• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP notification函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中notification函数的典型用法代码示例。如果您正苦于以下问题:PHP notification函数的具体用法?PHP notification怎么用?PHP notification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了notification函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: file_manager_center_start

/**
 * file manager center start
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Modules
 * @author Henry Ruhs
 */
function file_manager_center_start()
{
    if (LOGGED_IN == TOKEN && FIRST_PARAMETER == 'admin' && SECOND_PARAMETER == 'file-manager') {
        if (THIRD_PARAMETER == 'upload') {
            file_manager_upload(FILE_MANAGER_DIRECTORY);
        } else {
            if (THIRD_PARAMETER == 'delete') {
                if (TOKEN_PARAMETER == '') {
                    $error = l('token_incorrect');
                } else {
                    /* file manager directory object */
                    $file_manager_directory = new Redaxscript\Directory(FILE_MANAGER_DIRECTORY);
                    $file_manager_directory_string = $file_manager_directory->get(ID_PARAMETER);
                    /* remove related children */
                    $file_manager_directory->remove($file_manager_directory_string);
                }
            }
        }
        /* handle error */
        if ($error) {
            notification(l('error_occurred'), $error, l('back'), 'admin/file-manager');
        } else {
            file_manager(FILE_MANAGER_DIRECTORY);
        }
    }
}
开发者ID:ITw3,项目名称:redaxscript,代码行数:36,代码来源:index.php


示例2: routing

/**
 * routing
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Center
 * @author Henry Ruhs
 */
function routing()
{
    /* check token */
    if ($_POST && $_POST['token'] != TOKEN) {
        notification(l('error_occurred'), l('token_incorrect'), l('home'), ROOT);
        return;
    }
    /* call default post */
    $post_list = array('comment', 'login', 'password_reset', 'registration', 'reminder', 'search');
    foreach ($post_list as $value) {
        if ($_POST[$value . '_post'] && function_exists($value . '_post')) {
            call_user_func($value . '_post');
            return;
        }
    }
    /* general routing */
    switch (FIRST_PARAMETER) {
        case 'admin':
            if (LOGGED_IN == TOKEN) {
                admin_routing();
            } else {
                notification(l('error_occurred'), l('access_no'), l('login'), 'login');
            }
            return;
        case 'login':
            login_form();
            return;
        case 'logout':
            if (LOGGED_IN == TOKEN) {
                logout();
            } else {
                notification(l('error_occurred'), l('access_no'), l('login'), 'login');
            }
            return;
        case 'password_reset':
            if (s('reminder') == 1 && FIRST_SUB_PARAMETER && THIRD_PARAMETER) {
                password_reset_form();
            } else {
                notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
            }
            return;
        case 'registration':
            if (s('registration')) {
                registration_form();
            } else {
                notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
            }
            return;
        case 'reminder':
            if (s('reminder') == 1) {
                reminder_form();
            } else {
                notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
            }
            return;
        default:
            contents();
            return;
    }
}
开发者ID:ITw3,项目名称:redaxscript,代码行数:70,代码来源:center.php


示例3: update_fail

function update_fail($update_id, $error_message)
{
    //send the administrators an e-mail
    $admin_mail_list = "'" . implode("','", array_map(dbesc, explode(",", str_replace(" ", "", $a->config['admin_email'])))) . "'";
    $adminlist = q("SELECT uid, language, email FROM user WHERE email IN (%s)", $admin_mail_list);
    // every admin could had different language
    foreach ($adminlist as $admin) {
        $lang = $admin['language'] ? $admin['language'] : 'en';
        push_lang($lang);
        $preamble = deindent(t("\n\t\t\tThe friendica developers released update %s recently,\n\t\t\tbut when I tried to install it, something went terribly wrong.\n\t\t\tThis needs to be fixed soon and I can't do it alone. Please contact a\n\t\t\tfriendica developer if you can not help me on your own. My database might be invalid."));
        $body = t("The error message is\n[pre]%s[/pre]");
        $preamble = sprintf($preamble, $update_id);
        $body = sprintf($body, $error_message);
        notification(array('type' => "SYSTEM_EMAIL", 'to_email' => $admin['email'], 'preamble' => $preamble, 'body' => $body, 'language' => $lang));
    }
    /*
    $email_tpl = get_intltext_template("update_fail_eml.tpl");
    $email_msg = replace_macros($email_tpl, array(
    	'$sitename' => $a->config['sitename'],
    	'$siteurl' =>  $a->get_baseurl(),
    	'$update' => DB_UPDATE_VERSION,
    	'$error' => sprintf(t('Update %s failed. See error logs.'), DB_UPDATE_VERSION)
    ));
    $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
    require_once('include/email.php');
    $subject = email_header_encode($subject,'UTF-8');
    mail($a->config['admin_email'], $subject, $email_msg,
    	'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME']."\n"
    	.'Content-type: text/plain; charset=UTF-8'."\n"
    	.'Content-transfer-encoding: 8bit');
    */
    //try the logger
    logger("CRITICAL: Database structure update failed: " . $retval);
    break;
}
开发者ID:strk,项目名称:friendica,代码行数:35,代码来源:dbstructure.php


示例4: testdrive_cron

function testdrive_cron($a, $b)
{
    require_once 'include/enotify.php';
    $r = q("select * from account where account_expires_on < %s + INTERVAL %s and\n\t\taccount_expire_notified = '%s' ", db_utcnow(), db_quoteinterval('5 DAY'), dbesc(NULL_DATE));
    if ($r) {
        foreach ($r as $rr) {
            $uid = $rr['account_default_channel'];
            if (!$uid) {
                continue;
            }
            $x = q("select * from channel where channel_id = %d limit 1", intval($uid));
            if (!$x) {
                continue;
            }
            notification(array('type' => NOTIFY_SYSTEM, 'system_type' => 'testdrive_expire', 'from_xchan' => $x[0]['channel_hash'], 'to_xchan' => $x[0]['channel_hash']));
            q("update account set account_expire_notified = '%s' where account_id = %d", dbesc(datetime_convert()), intval($rr['account_id']));
        }
    }
    // give them a 5 day grace period. Then nuke the account.
    $r = q("select * from account where account_expired = 1 and account_expires < %s - INTERVAL %s", db_utcnow(), db_quoteinterval('5 DAY'));
    if ($r) {
        require_once 'include/Contact.php';
        foreach ($r as $rr) {
            account_remove($rr['account_id']);
        }
    }
}
开发者ID:royalterra,项目名称:hubzilla-addons,代码行数:27,代码来源:testdrive.php


示例5: redirect

function redirect($uri = '', $msg = '', $method = '', $http_response_code = 302)
{
    if ($uri == 'referer' && !isset($_POST['ajx'])) {
        $method = 'referer';
    }
    if (!preg_match('#^https?://#i', $uri)) {
        $uri = site_url . str_replace("//", '/', '/' . $uri . '/');
    }
    if (isset($_POST['ajx']) && $method == '') {
        $method = $_POST['ajx'];
    }
    getNotification($msg);
    $_SESSION['not'] = empty($_POST['notification']) ? '' : $_POST['notification'];
    // particualr forum echo
    switch ($method) {
        case 'ajx':
            notification($_SESSION['not']);
            break;
        case 'refresh':
            header("Refresh:0;url=" . $uri);
            break;
        case 'javascript':
            echo "<script>window.location='" . $uri . "'</script>";
            break;
        case 'referer':
            echo "<script>window.location='{$_SERVER['HTTP_REFERER']}'</script>";
            break;
        default:
            header("Location: " . $uri, TRUE, $http_response_code);
            break;
    }
    exit;
}
开发者ID:arunabh1911,项目名称:ecom,代码行数:33,代码来源:config.php


示例6: public_server_cron

function public_server_cron($a, $b)
{
    logger("public_server: cron start");
    require_once 'include/enotify.php';
    $r = q("select * from user where account_expires_on < UTC_TIMESTAMP() + INTERVAL 5 DAY and account_expires_on > '0000-00-00 00:00:00' and\n\t\texpire_notification_sent = '0000-00-00 00:00:00' ");
    if (count($r)) {
        foreach ($r as $rr) {
            notification(array('uid' => $rr['uid'], 'type' => NOTIFY_SYSTEM, 'system_type' => 'public_server_expire', 'language' => $rr['language'], 'to_name' => $rr['username'], 'to_email' => $rr['email'], 'source_name' => t('Administrator'), 'source_link' => $a->get_baseurl(), 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg'));
            q("update user set expire_notification_sent = '%s' where uid = %d", dbesc(datetime_convert()), intval($rr['uid']));
        }
    }
    $r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY and account_expires_on > '0000-00-00 00:00:00'");
    if (count($r)) {
        require_once 'include/Contact.php';
        foreach ($r as $rr) {
            user_remove($rr['uid']);
        }
    }
    $nologin = get_config('public_server', 'nologin');
    if ($nologin) {
        $r = q("select uid from user where account_expired = 0 and login_date = '0000-00-00 00:00:00' and register_date <  UTC_TIMESTAMP() - INTERVAL %d DAY and account_expires_on = '0000-00-00 00:00:00'", intval($nologin));
        if (count($r)) {
            foreach ($r as $rr) {
                q("update user set account_expires_on = '%s' where uid = %d", dbesc(datetime_convert('UTC', 'UTC', 'now +' . '6 days')), intval($rr['uid']));
            }
        }
    }
    $flagusers = get_config('public_server', 'flagusers');
    if ($flagusers) {
        $r = q("select uid from user where account_expired = 0 and login_date < UTC_TIMESTAMP() - INTERVAL %d DAY and account_expires_on = '0000-00-00 00:00:00' and `page-flags` = 0", intval($flagusers));
        if (count($r)) {
            foreach ($r as $rr) {
                q("update user set account_expires_on = '%s' where uid = %d", dbesc(datetime_convert('UTC', 'UTC', 'now +' . '6 days')), intval($rr['uid']));
            }
        }
    }
    $flagposts = get_config('public_server', 'flagposts');
    $flagpostsexpire = get_config('public_server', 'flagpostsexpire');
    if ($flagposts && $flagpostsexpire) {
        $r = q("select uid from user where account_expired = 0 and login_date < UTC_TIMESTAMP() - INTERVAL %d DAY and account_expires_on = '0000-00-00 00:00:00' and expire = 0 and `page-flags` = 0", intval($flagposts));
        if (count($r)) {
            foreach ($r as $rr) {
                q("update user set expire = %d where uid = %d", intval($flagpostsexpire), intval($rr['uid']));
            }
        }
    }
    logger("public_server: cron end");
}
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:48,代码来源:public_server.php


示例7: query

 function query($query)
 {
     require_once ABSOLUTE_BASEPATH . '/languages/' . BOARD_LANGUAGE . '.lang';
     $dbquery = $this->dbtype . '_query';
     $dbfetch = $this->dbtype . '_fetch_array';
     if (!($this->res = @$dbquery($query))) {
         require_once ABSOLUTE_BASEPATH . '/header.' . PHPEXT;
         notification($this->_LANG['query_error'] . '<br><br>' . $query . '<br><br>' . mysql_error(), '', 60);
         die;
     }
     $dbres = array();
     while ($row = @$dbfetch($this->res, MYSQL_ASSOC)) {
         array_push($dbres, $row);
     }
     return $dbres;
 }
开发者ID:BlackLight,项目名称:nullBB,代码行数:16,代码来源:db.php


示例8: testdrive_cron

function testdrive_cron($a, $b)
{
    require_once 'include/enotify.php';
    $r = q("select * from user where account_expires_on < UTC_TIMESTAMP() + INTERVAL 5 DAY and\n\t\texpire_notification_sent = '0000-00-00 00:00:00' ");
    if (count($r)) {
        foreach ($r as $rr) {
            notification(array('uid' => $rr['uid'], 'type' => NOTIFY_SYSTEM, 'system_type' => 'testdrive_expire', 'language' => $rr['language'], 'to_name' => $rr['username'], 'to_email' => $rr['email'], 'source_name' => t('Administrator'), 'source_link' => $a->get_baseurl(), 'source_photo' => $a->get_baseurl() . '/images/person-80.jpg'));
            q("update user set expire_notification_sent = '%s' where uid = %d", dbesc(datetime_convert()), intval($rr['uid']));
        }
    }
    $r = q("select * from user where account_expired = 1 and account_expires_on < UTC_TIMESTAMP() - INTERVAL 5 DAY ");
    if (count($r)) {
        require_once 'include/Contact.php';
        foreach ($r as $rr) {
            user_remove($rr['uid']);
        }
    }
}
开发者ID:swathe,项目名称:friendica-addons,代码行数:18,代码来源:testdrive.php


示例9: _login

 /**
  * login
  *
  * @since 2.2.0
  */
 protected static function _login()
 {
     $root = Registry::get('root');
     $token = Registry::get('token');
     /* session values */
     Request::setSession($root . '/logged_in', $token);
     Request::setSession($root . '/my_name', 'Anonymous');
     Request::setSession($root . '/my_user', 'demo');
     Request::setSession($root . '/my_email', '[email protected]');
     Request::setSession($root . '/categories_new', 1);
     Request::setSession($root . '/categories_edit', 1);
     Request::setSession($root . '/articles_new', 1);
     Request::setSession($root . '/articles_edit', 1);
     Request::setSession($root . '/comments_new', 1);
     Request::setSession($root . '/comments_edit', 1);
     Request::setSession($root . '/settings_edit', 1);
     Request::setSession($root . '/filter', 1);
     /* notification */
     notification(l('welcome'), l('logged_in'), l('continue'), 'admin');
 }
开发者ID:ITw3,项目名称:redaxscript,代码行数:25,代码来源:index.php


示例10: _login

 /**
  * login
  *
  * @since 2.4.0
  */
 protected static function _login()
 {
     $root = Registry::get('root');
     $token = Registry::get('token');
     $tableArray = array('categories', 'articles', 'extras', 'comments', 'groups', 'users');
     /* session values */
     Request::setSession($root . '/logged_in', $token);
     Request::setSession($root . '/my_name', 'Demo');
     Request::setSession($root . '/my_user', 'demo');
     Request::setSession($root . '/my_email', 'demo@localhost');
     foreach ($tableArray as $value) {
         Request::setSession($root . '/' . $value . '_new', 1);
         Request::setSession($root . '/' . $value . '_edit', 1);
         Request::setSession($root . '/' . $value . '_delete', 1);
     }
     Request::setSession($root . '/modules_install', 0);
     Request::setSession($root . '/modules_edit', 0);
     Request::setSession($root . '/modules_uninstall', 0);
     Request::setSession($root . '/settings_edit', 1);
     Request::setSession($root . '/filter', 1);
     /* notification */
     notification(Language::get('welcome'), Language::get('logged_in'), Language::get('continue'), 'admin');
 }
开发者ID:amanpreetsinghmalhotra,项目名称:redaxscript,代码行数:28,代码来源:Demo.php


示例11: search_post

/**
 * search post
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Search
 * @author Henry Ruhs
 */
function search_post()
{
    /* clean post */
    if (ATTACK_BLOCKED < 10) {
        $search_terms = clean($_POST['search_terms'], 1);
    }
    /* validate post */
    if (strlen($search_terms) < 3 || $search_terms == l('search_terms')) {
        $error = l('input_incorrect');
    } else {
        $search = array_filter(explode(' ', $search_terms));
        $search_keys = array_keys($search);
        $last = end($search_keys);
        /* query search */
        $query = 'SELECT id, title, alias, description, date, category, access FROM ' . PREFIX . 'articles WHERE (language = \'' . LANGUAGE . '\' || language = \'\') && status = 1';
        if ($search) {
            $query .= ' && (';
            foreach ($search as $key => $value) {
                $query .= 'title LIKE \'%' . $value . '%\' || description LIKE \'%' . $value . '%\' || keywords LIKE \'%' . $value . '%\' || text LIKE \'%' . $value . '%\'';
                if ($last != $key) {
                    $query .= ' || ';
                }
            }
            $query .= ')';
        }
        $query .= ' ORDER BY date DESC LIMIT 50';
        $result = mysql_query($query);
        $num_rows = mysql_num_rows($result);
        if ($result == '' || $num_rows == '') {
            $error = l('search_no');
        } else {
            if ($result) {
                $accessValidator = new Redaxscript\Validator\Access();
                $output = '<h2 class="title_content title_search_result">' . l('search') . '</h2>';
                $output .= form_element('fieldset', '', 'set_search_result', '', '', '<span class="title_content_sub title_search_result_sub">' . l('articles') . '</span>') . '<ol class="list_search_result">';
                while ($r = mysql_fetch_assoc($result)) {
                    $access = $r['access'];
                    $check_access = $accessValidator->validate($access, MY_GROUPS);
                    /* if access granted */
                    if ($check_access == 1) {
                        if ($r) {
                            foreach ($r as $key => $value) {
                                ${$key} = stripslashes($value);
                            }
                        }
                        /* prepare metadata */
                        if ($description == '') {
                            $description = $title;
                        }
                        $date = date(s('date'), strtotime($date));
                        /* build route */
                        if ($category == 0) {
                            $route = $alias;
                        } else {
                            $route = build_route('articles', $id);
                        }
                        /* collect item output */
                        $output .= '<li class="item_search_result">' . anchor_element('internal', '', 'link_search_result', $title, $route, $description) . '<span class="date_search_result">' . $date . '</span></li>';
                    } else {
                        $counter++;
                    }
                }
                $output .= '</ol></fieldset>';
                /* handle access */
                if ($num_rows == $counter) {
                    $error = l('access_no');
                }
            }
        }
    }
    /* handle error */
    if ($error) {
        notification(l('something_wrong'), $error);
    } else {
        echo $output;
    }
}
开发者ID:ITw3,项目名称:redaxscript,代码行数:87,代码来源:search.php


示例12: admin_page_users_post

/**
 * Users admin page
 *
 * @param App $a
 */
function admin_page_users_post(&$a)
{
    $pending = x($_POST, 'pending') ? $_POST['pending'] : array();
    $users = x($_POST, 'user') ? $_POST['user'] : array();
    $nu_name = x($_POST, 'new_user_name') ? $_POST['new_user_name'] : '';
    $nu_nickname = x($_POST, 'new_user_nickname') ? $_POST['new_user_nickname'] : '';
    $nu_email = x($_POST, 'new_user_email') ? $_POST['new_user_email'] : '';
    check_form_security_token_redirectOnErr('/admin/users', 'admin_users');
    if (!($nu_name === "") && !($nu_email === "") && !($nu_nickname === "")) {
        require_once 'include/user.php';
        $result = create_user(array('username' => $nu_name, 'email' => $nu_email, 'nickname' => $nu_nickname, 'verified' => 1));
        if (!$result['success']) {
            notice($result['message']);
            return;
        }
        $nu = $result['user'];
        $preamble = deindent(t('
			Dear %1$s,
				the administrator of %2$s has set up an account for you.'));
        $body = deindent(t('
			The login details are as follows:

			Site Location:	%1$s
			Login Name:		%2$s
			Password:		%3$s

			You may change your password from your account "Settings" page after logging
			in.

			Please take a few moments to review the other account settings on that page.

			You may also wish to add some basic information to your default profile
			(on the "Profiles" page) so that other people can easily find you.

			We recommend setting your full name, adding a profile photo,
			adding some profile "keywords" (very useful in making new friends) - and
			perhaps what country you live in; if you do not wish to be more specific
			than that.

			We fully respect your right to privacy, and none of these items are necessary.
			If you are new and do not know anybody here, they may help
			you to make some new and interesting friends.

			Thank you and welcome to %4$s.'));
        $preamble = sprintf($preamble, $nu['username'], $a->config['sitename']);
        $body = sprintf($body, $a->get_baseurl(), $nu['email'], $result['password'], $a->config['sitename']);
        notification(array('type' => "SYSTEM_EMAIL", 'to_email' => $nu['email'], 'subject' => sprintf(t('Registration details for %s'), $a->config['sitename']), 'preamble' => $preamble, 'body' => $body));
    }
    if (x($_POST, 'page_users_block')) {
        foreach ($users as $uid) {
            q("UPDATE `user` SET `blocked`=1-`blocked` WHERE `uid`=%s", intval($uid));
        }
        notice(sprintf(tt("%s user blocked/unblocked", "%s users blocked/unblocked", count($users)), count($users)));
    }
    if (x($_POST, 'page_users_delete')) {
        require_once "include/Contact.php";
        foreach ($users as $uid) {
            user_remove($uid);
        }
        notice(sprintf(tt("%s user deleted", "%s users deleted", count($users)), count($users)));
    }
    if (x($_POST, 'page_users_approve')) {
        require_once "mod/regmod.php";
        foreach ($pending as $hash) {
            user_allow($hash);
        }
    }
    if (x($_POST, 'page_users_deny')) {
        require_once "mod/regmod.php";
        foreach ($pending as $hash) {
            user_deny($hash);
        }
    }
    goaway($a->get_baseurl(true) . '/admin/users');
    return;
    // NOTREACHED
}
开发者ID:strk,项目名称:friendica,代码行数:82,代码来源:admin.php


示例13: logout

/**
 * logout
 *
 * @since 1.2.1
 * @deprecated 2.0.0
 *
 * @package Redaxscript
 * @category Login
 * @author Henry Ruhs
 */
function logout()
{
    session_destroy();
    notification(l('goodbye'), l('logged_out'), l('continue'), 'login');
}
开发者ID:amanpreetsinghmalhotra,项目名称:redaxscript,代码行数:15,代码来源:login.php


示例14: diaspora_request

function diaspora_request($importer, $xml)
{
    $a = get_app();
    $sender_handle = unxmlify($xml->sender_handle);
    $recipient_handle = unxmlify($xml->recipient_handle);
    if (!$sender_handle || !$recipient_handle) {
        return;
    }
    // Do we already have an abook record?
    $contact = diaspora_get_contact_by_handle($importer['channel_id'], $sender_handle);
    if ($contact && $contact['abook_id']) {
        // perhaps we were already sharing with this person. Now they're sharing with us.
        // That makes us friends. Maybe.
        // Please note some of these permissions such as PERMS_R_PAGES are impossible for Disapora.
        // They cannot authenticate to our system.
        $newperms = PERMS_R_STREAM | PERMS_R_PROFILE | PERMS_R_PHOTOS | PERMS_R_ABOOK | PERMS_W_STREAM | PERMS_W_COMMENT | PERMS_W_MAIL | PERMS_W_CHAT | PERMS_R_STORAGE | PERMS_R_PAGES;
        $r = q("update abook set abook_their_perms = %d where abook_id = %d and abook_channel = %d limit 1", intval($newperms), intval($contact['abook_id']), intval($importer['channel_id']));
        return;
    }
    $ret = find_diaspora_person_by_handle($sender_handle);
    if (!$ret || !strstr($ret['xchan_network'], 'diaspora')) {
        logger('diaspora_request: Cannot resolve diaspora handle ' . $sender_handle . ' for ' . $recipient_handle);
        return;
    }
    $default_perms = 0;
    // look for default permissions to apply in return - e.g. auto-friend
    $z = q("select * from abook where abook_channel = %d and (abook_flags & %d) limit 1", intval($importer['channel_id']), intval(ABOOK_FLAG_SELF));
    if ($z) {
        $default_perms = intval($z[0]['abook_my_perms']);
    }
    $their_perms = PERMS_R_STREAM | PERMS_R_PROFILE | PERMS_R_PHOTOS | PERMS_R_ABOOK | PERMS_W_STREAM | PERMS_W_COMMENT | PERMS_W_MAIL | PERMS_W_CHAT | PERMS_R_STORAGE | PERMS_R_PAGES;
    $r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_my_perms, abook_their_perms, abook_closeness, abook_rating, abook_created, abook_updated, abook_connected, abook_dob, abook_flags) values ( %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d )", intval($importer['channel_account_id']), intval($importer['channel_id']), dbesc($ret['xchan_hash']), intval($default_perms), intval($their_perms), intval(99), intval(0), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc(datetime_convert()), dbesc(NULL_DATE), intval($default_perms ? 0 : ABOOK_FLAG_PENDING));
    if ($r) {
        logger("New Diaspora introduction received for {$importer['channel_name']}");
        $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash left join hubloc on hubloc_hash = xchan_hash where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1", intval($importer['channel_id']), dbesc($ret['xchan_hash']));
        if ($new_connection) {
            require_once 'include/enotify.php';
            notification(array('type' => NOTIFY_INTRO, 'from_xchan' => $ret['xchan_hash'], 'to_xchan' => $importer['channel_hash'], 'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id']));
            if ($default_perms) {
                // Send back a sharing notification to them
                diaspora_share($importer, $new_connection[0]);
            }
        }
    }
    // find the abook record we just created
    $contact_record = diaspora_get_contact_by_handle($importer['channel_id'], $sender_handle);
    if (!$contact_record) {
        logger('diaspora_request: unable to locate newly created contact record.');
        return;
    }
    /** If there is a default group for this channel, add this member to it */
    if ($importer['channel_default_group']) {
        require_once 'include/group.php';
        $g = group_rec_byhash($importer['channel_id'], $importer['channel_default_group']);
        if ($g) {
            group_add_member($importer['channel_id'], '', $contact_record['xchan_hash'], $g['id']);
        }
    }
    return;
}
开发者ID:Mauru,项目名称:red,代码行数:60,代码来源:diaspora.php


示例15: repwd

 /**
  * 重置密码
  */
 public function repwd()
 {
     $user_id = I('uid');
     if (empty($user_id)) {
         $this->ajaxReturn(array('status' => 0, 'message' => '无法获取该行'));
     }
     $where['user_id'] = array('eq', $user_id);
     $info = M('User')->where($where)->find();
     /* if(empty($info['identity_card_no'])){
            $this->ajaxReturn(array('status'=>0,'message'=>'没有进行身份认证'));
        }*/
     /*if(md5($info['mobile'] == $info['password'])){
           $this->ajaxReturn(array('status'=>1,'message'=>'重置密码成功'));
       }*/
     $update = M('User')->where($where)->save(array('password' => md5($info['mobile'])));
     //($pwd);exit;
     if ($update !== false) {
         notification('userInfoChange', array('userId' => $user_id));
         $this->ajaxReturn(array('status' => 1, 'message' => '重置密码成功'));
     } else {
         $this->ajaxReturn(array('status' => 0, 'message' => '重置密码失败'));
     }
 }
开发者ID:tearys,项目名称:php1,代码行数:26,代码来源:OperatorsController.class.php


示例16: add_escape_custom

     $strQuery = "UPDATE `prescriptions` set\n                                        provider_id = " . add_escape_custom($provider_id) . ", \n                                        start_date = '" . add_escape_custom($startDate) . "',\n                                        form = '" . add_escape_custom($drug_form) . "',\n                                        drug = '" . add_escape_custom($drug) . "', \n                                        dosage = '" . add_escape_custom($dosage) . "', \n                                        unit = '" . add_escape_custom($drug_units) . "', \n                                        route = '" . add_escape_custom($drug_route) . "', \n                                        `interval` = '" . add_escape_custom($drug_interval) . "', \n                                        substitute = '" . add_escape_custom($substitute) . "',\n                                        quantity = '" . add_escape_custom($quantity) . "',  \n                                        refills = '" . add_escape_custom($per_refill) . "', \n                                        medication = '" . add_escape_custom($medication) . "',\n                                        date_modified = '" . date('Y-m-d') . "',\n                                        size = '" . add_escape_custom($size) . "', \n                                        per_refill = '" . add_escape_custom($p_refill) . "',\n                                        note = '" . add_escape_custom($note) . "'\n                             WHERE id = ?";
     $result = sqlStatement($strQuery, array($id));
     $list_result = 1;
     if ($medication) {
         $select_medication = "SELECT * FROM  `lists` \n                                    WHERE  `type` LIKE  'medication'\n                                            AND  `title` LIKE  ? \n                                            AND  `pid` = ?";
         $result1 = sqlQuery($select_medication, array($drug, $patient_id));
         if (!$result1) {
             $list_query = "insert into lists(date,begdate,type,activity,pid,user,groupname,title) \n                            values (now(),cast(now() as date),'medication',1," . add_escape_custom($patientId) . ",'" . add_escape_custom($user) . "','','" . add_escape_custom($drug) . "')";
             $list_result = sqlStatement($list_query);
         }
     }
     $device_token_badge = getDeviceTokenBadge($provider_username, 'prescription');
     $badge = $device_token_badge['badge'];
     $deviceToken = $device_token_badge['device_token'];
     if ($deviceToken) {
         $notification_res = notification($deviceToken, $badge, $msg_count = 0, $apt_count = 0, $message = 'Update Prescription Notification!');
     }
     if ($result !== FALSE && $list_result !== FALSE) {
         $xml_string .= "<status>0</status>";
         $xml_string .= "<reason>The Patient prescription has been updated</reason>";
         if ($notification_res) {
             $xml_array['notification'] = 'Update Appointment Notification(' . $notification_res . ')';
         } else {
             $xml_array['notification'] = 'Notificaiotn Failed.';
         }
     } else {
         $xml_string .= "<status>-1</status>";
         $xml_string .= "<reason>ERROR: Sorry, there was an error processing your data. Please re-submit the information again.</reason>";
     }
 } else {
     $xml_string .= "<status>-2</status>\n";
开发者ID:bharathi26,项目名称:openemr,代码行数:31,代码来源:updateprescription.php


示例17: item_post


//.........这里部分代码省略.........
        echo json_encode($json);
        killme();
    }
    if (mb_strlen($datarray['title']) > 255) {
        $datarray['title'] = mb_substr($datarray['title'], 0, 255);
    }
    if (array_key_exists('item_private', $datarray) && $datarray['item_private']) {
        $datarray['body'] = trim(z_input_filter($datarray['uid'], $datarray['body'], $datarray['mimetype']));
        if ($uid) {
            if ($channel['channel_hash'] === $datarray['author_xchan']) {
                $datarray['sig'] = base64url_encode(rsa_sign($datarray['body'], $channel['channel_prvkey']));
                $datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
            }
        }
        logger('Encrypting local storage');
        $key = get_config('system', 'pubkey');
        $datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED;
        if ($datarray['title']) {
            $datarray['title'] = json_encode(crypto_encapsulate($datarray['title'], $key));
        }
        if ($datarray['body']) {
            $datarray['body'] = json_encode(crypto_encapsulate($datarray['body'], $key));
        }
    }
    if ($orig_post) {
        $datarray['id'] = $post_id;
        item_store_update($datarray, $execflag);
        update_remote_id($channel, $post_id, $webpage, $pagetitle, $namespace, $remote_id, $mid);
        if (!$nopush) {
            proc_run('php', "include/notifier.php", 'edit_post', $post_id);
        }
        if (x($_REQUEST, 'return') && strlen($return_path)) {
            logger('return: ' . $return_path);
            goaway($a->get_baseurl() . "/" . $return_path);
        }
        killme();
    } else {
        $post_id = 0;
    }
    $post = item_store($datarray, $execflag);
    $post_id = $post['item_id'];
    if ($post_id) {
        logger('mod_item: saved item ' . $post_id);
        if ($parent) {
            // only send comment notification if this is a wall-to-wall comment,
            // otherwise it will happen during delivery
            if ($datarray['owner_xchan'] != $datarray['author_xchan'] && $parent_item['item_flags'] & ITEM_WALL) {
                notification(array('type' => NOTIFY_COMMENT, 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $datarray['mid'], 'verb' => ACTIVITY_POST, 'otype' => 'item', 'parent' => $parent, 'parent_mid' => $parent_item['mid']));
            }
        } else {
            $parent = $post_id;
            if ($datarray['owner_xchan'] != $datarray['author_xchan']) {
                notification(array('type' => NOTIFY_WALL, 'from_xchan' => $datarray['author_xchan'], 'to_xchan' => $datarray['owner_xchan'], 'item' => $datarray, 'link' => $a->get_baseurl() . '/display/' . $datarray['mid'], 'verb' => ACTIVITY_POST, 'otype' => 'item'));
            }
            if ($uid && $uid == $profile_uid && !$datarray['item_restrict']) {
                q("update channel set channel_lastpost = '%s' where channel_id = %d", dbesc(datetime_convert()), intval($uid));
            }
        }
        // photo comments turn the corresponding item visible to the profile wall
        // This way we don't see every picture in your new photo album posted to your wall at once.
        // They will show up as people comment on them.
        if ($parent_item['item_restrict'] & ITEM_HIDDEN) {
            $r = q("UPDATE `item` SET `item_restrict` = %d WHERE `id` = %d", intval($parent_item['item_restrict'] - ITEM_HIDDEN), intval($parent_item['id']));
        }
    } else {
        logger('mod_item: unable to retrieve post that was just stored.');
        notice(t('System error. Post not saved.') . EOL);
        goaway($a->get_baseurl() . "/" . $return_path);
        // NOTREACHED
    }
    if ($parent) {
        // Store the comment signature information in case we need to relay to Diaspora
        $ditem = $datarray;
        $ditem['author'] = $observer;
        store_diaspora_comment_sig($ditem, $channel, $parent_item, $post_id, $walltowall_comment ? 1 : 0);
    }
    update_remote_id($channel, $post_id, $webpage, $pagetitle, $namespace, $remote_id, $mid);
    $datarray['id'] = $post_id;
    $datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id;
    call_hooks('post_local_end', $datarray);
    if (!$nopush) {
        proc_run('php', 'include/notifier.php', $notify_type, $post_id);
    }
    logger('post_complete');
    // figure out how to return, depending on from whence we came
    if ($api_source) {
        return $post;
    }
    if ($return_path) {
        goaway($a->get_baseurl() . "/" . $return_path);
    }
    $json = array('success' => 1);
    if (x($_REQUEST, 'jsreload') && strlen($_REQUEST['jsreload'])) {
        $json['reload'] = $a->get_baseurl() . '/' . $_REQUEST['jsreload'];
    }
    logger('post_json: ' . print_r($json, true), LOGGER_DEBUG);
    echo json_encode($json);
    killme();
    // NOTREACHED
}
开发者ID:einervonvielen,项目名称:redmatrix,代码行数:101,代码来源:item.php


示例18: new_follower

function new_follower($importer, $contact, $datarray, $item, $sharing = false)
{
    $url = notags(trim($datarray['author-link']));
    $name = notags(trim($datarray['author-name']));
    $photo = notags(trim($datarray['author-avatar']));
    if (is_object($item)) {
        $rawtag = $item->get_item_tags(NAMESPACE_ACTIVITY, 'actor');
        if ($rawtag && $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data']) {
            $nick = $rawtag[0]['child'][NAMESPACE_POCO]['preferredUsername'][0]['data'];
        }
    } else {
        $nick = $item;
    }
    if (is_array($contact)) {
        if ($contact['network'] == NETWORK_OSTATUS && $contact['rel'] == CONTACT_IS_SHARING || $sharing && $contact['rel'] == CONTACT_IS_FOLLOWER) {
            $r = q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d", intval(CONTACT_IS_FRIEND), intval($contact['id']), intval($importer['uid']));
        }
        // send email notification to owner?
    } else {
        // create contact record
        $r = q("INSERT INTO `contact` (`uid`, `created`, `url`, `nurl`, `name`, `nick`, `photo`, `network`, `rel`,\n\t\t\t`blocked`, `readonly`, `pending`, `writable`)\n\t\t\tVALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, 0, 0, 1, 1)", intval($importer['uid']), dbesc(datetime_convert()), dbesc($url), dbesc(normalise_link($url)), dbesc($name), dbesc($nick), dbesc($photo), dbesc($sharing ? NETWORK_ZOT : NETWORK_OSTATUS), intval($sharing ? CONTACT_IS_SHARING : CONTACT_IS_FOLLOWER));
        $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `pending` = 1 LIMIT 1", intval($importer['uid']), dbesc($url));
        if (count($r)) {
            $contact_record = $r[0];
            $photos = import_profile_photo($photo, $importer["uid"], $contact_record["id"]);
            q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s' WHERE `id` = %d", dbesc($photos[0]), dbesc($photos[1]), dbesc($photos[2]), intval($contact_record["id"]));
        }
        $r = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval($importer['uid']));
        $a = get_app();
        if (count($r) and !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
            // create notification
            $hash = random_string();
            if (is_array($contact_record)) {
                $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `hash`, `datetime`)\n\t\t\t\t\tVALUES ( %d, %d, 0, 0, '%s', '%s' )", intval($importer['uid']), intval($contact_record['id']), dbesc($hash), dbesc(datetime_convert()));
            }
            if (intval($r[0]['def_gid'])) {
                require_once 'include/group.php';
                group_add_member($r[0]['uid'], '', $contact_record['id'], $r[0]['def_gid']);
            }
            if ($r[0]['notify-flags'] & NOTIFY_INTRO && in_array($r[0]['page-flags'], array(PAGE_NORMAL))) {
                notification(array('type' => NOTIFY_ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP notificationCategoryInfo函数代码示例发布时间:2022-05-15
下一篇:
PHP notificar函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap