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

PHP get_loggedin_user函数代码示例

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

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



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

示例1: get_gateway_variables

function get_gateway_variables()
{
    /*
     $user =  get_loggedin_user()->name ;
     $domain = $vars['entity']->cclite_payment_domain ;
     $protocol = $vars['entity']->cclite_transfer_protocol ;
     $apikey = $vars['entity']->cclite_api_key;
     $hashing = $vars['entity']->cclite_hashing_algorithm;
     $registry = $vars['entity']->cclite_registry;
     $limit = $vars['entity']->cclite_api_transaction_display_limit ;
    */
    $user = get_loggedin_user()->name;
    $domain = get_plugin_setting('cclite_payment_domain', 'cclite');
    $protocol = get_plugin_setting('cclite_protocol', 'cclite');
    $apikey = get_plugin_setting('cclite_api_key', 'cclite');
    $hashing = get_plugin_setting('cclite_hashing_algorithm', 'cclite');
    $registry = get_plugin_setting('cclite_registry', 'cclite');
    $limit = get_plugin_setting('cclite_api_transaction_display_limit', 'cclite');
    $values = array('user' => $user, 'limit' => $limit, 'domain' => $domain, 'protocol' => $protocol, 'apikey' => $apikey, 'hashing' => $hashing, 'registry' => $registry, 'verbose' => 0);
    /*
     $str = "getting variables " . $_SERVER['SERVER_ADDR'] . "<br/>" . "user is " .  $user . "<br/>" . "registry is " .   $registry ; 
     echo $str ;
    */
    return $values;
}
开发者ID:hbarnard,项目名称:cclite,代码行数:25,代码来源:cclite-common-simple.php


示例2: get_like_comment_string

function get_like_comment_string($annotation_guid)
{
    $results["unlikeid"] = "";
    $results["listusername"] = "";
    $loginuser = get_loggedin_user();
    if (!empty($annotation_guid)) {
        $like_object = get_likerating_byannotation($annotation_guid);
        if ($like_object && !empty($like_object)) {
            foreach ($like_object as $like) {
                if ($like->owner_guid == $loginuser->guid) {
                    $results["listusername"] = add_and_between_name($results["listusername"], "you");
                    $results["unlikeid"] = $like->guid;
                } else {
                    $user_entity = get_entity($like->owner_guid);
                    $results["listusername"] = add_and_between_name($results["listusername"], $user_entity->name);
                }
            }
        }
        if (!empty($results["listusername"])) {
            $results["listusername"] .= " " . elgg_echo("like:likethis");
        }
        if (!empty($results["listusername"])) {
            $results['listnumberusername'] = sizeof($like_object);
        }
    }
    return $results;
}
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:27,代码来源:start.php


示例3: file_init

/**
 * File plugin initialisation functions.
 */
function file_init()
{
    global $CONFIG;
    // Set up menu (tools dropdown or other uses as defined by theme)
    if (isloggedin()) {
        add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/" . get_loggedin_user()->username);
    } else {
        add_menu(elgg_echo('file'), $CONFIG->wwwroot . "pg/file/world/world/");
    }
    // Extend CSS
    elgg_extend_view('css', 'file/css');
    // Extend hover-over and profile menu
    elgg_extend_view('profile/menu/links', 'file/menu');
    // extend group main page
    elgg_extend_view('groups/left_column', 'file/groupprofile_files');
    // Register a page handler, so we can have nice URLs
    register_page_handler('file', 'file_page_handler');
    // Add a new file widget
    add_widget_type('filerepo', elgg_echo("file:widget"), elgg_echo("file:widget:description"));
    // Register a URL handler for files
    register_entity_url_handler('file_url', 'object', 'file');
    // Register granular notification for this object type
    if (is_callable('register_notification_object')) {
        register_notification_object('object', 'file', elgg_echo('file:newupload'));
    }
    // Listen to notification events and supply a more useful message
    register_plugin_hook('notify:entity:message', 'object', 'file_notify_message');
    // add the group files tool option
    add_group_tool_option('files', elgg_echo('groups:enablefiles'), true);
    // Register entity type
    register_entity_type('object', 'file');
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:35,代码来源:start.php


示例4: invoke_get_send_messages

 public function invoke_get_send_messages()
 {
     $user = get_loggedin_user();
     $uid = $uer->uid;
     $this->page["messages"] = $this->message_model->get_send_messages($uid);
     include "view/send_messages_part.php";
 }
开发者ID:shawn712,项目名称:csc309-pug,代码行数:7,代码来源:message.php


示例5: invoke_give_rating_organizer

 public function invoke_give_rating_organizer()
 {
     if (isset($_POST["ratee"]) && isset($_POST["value"])) {
         // user submitted login information
         $ratee = htmlspecialchars($_POST["ratee"]);
         // we must check the value is 1.int 2.0-10 both on client side using js and server side
         // js will play the main role, php as the second prevent
         $value = intval(htmlspecialchars($_POST["value"]));
         $comment = "";
         // set comment to be empty as default, will implement later
         $rater = get_loggedin_user();
         // how to determine value is int?
         if (!is_int($value) || $value > 5 || $value < 0) {
             $this->page["page"] = "";
             $this->page["title"] = "";
             $this->page["err"] = "the value should be an int between 0 and 5";
             include "view/template.php";
         } elseif (strlen($comment) > 1024) {
             $this->page["page"] = "";
             $this->page["title"] = "";
             $this->page["err"] = "the comment should less than 1024 characters.";
         } else {
             //set the id to be 0 as default, and the type to be organizer
             //the truly id will be associated to rating object after persist_rating is called
             $rating = $this->rating_model->create_rating(0, $rater->uid, $ratee, $value, $comment, 0);
             $rating = $this->rating_model->persist_rating($rating);
             header("Location: profile.php?uid=" . $ratee);
         }
     } else {
         // user hasn't submit any login information
         $this->page["page"] = "view/login_page.php";
         $this->page["title"] = "Login";
         include "view/template.php";
     }
 }
开发者ID:shawn712,项目名称:csc309-pug,代码行数:35,代码来源:rating.php


示例6: set_user_redirect

function set_user_redirect()
{
    global $CONFIG;
    $username = get_loggedin_user()->username;
    $custom = get_plugin_setting("custom_redirect", "first_login_redirector");
    if (!empty($custom)) {
        $custom = str_replace("[wwwroot]", $CONFIG->wwwroot, $custom);
        $custom = str_replace("[username]", $username, $custom);
        $_SESSION['last_forward_from'] = $custom;
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:11,代码来源:start.php


示例7: beechat_pagesetup

function beechat_pagesetup()
{
    global $CONFIG;
    if (get_context() == 'settings' && isloggedin()) {
        if (get_loggedin_user()->chatenabled) {
            add_submenu_item(elgg_echo('beechat:disablechat'), $CONFIG->wwwroot . "mod/beechat/disablechat.php");
        } else {
            add_submenu_item(elgg_echo('beechat:enablechat'), $CONFIG->wwwroot . "mod/beechat/enablechat.php");
        }
    }
}
开发者ID:beechannels,项目名称:beechat,代码行数:11,代码来源:start.php


示例8: usersettings_pagesetup

function usersettings_pagesetup()
{
    // Get config
    global $CONFIG;
    // Menu options
    if (get_context() == "settings") {
        $user = get_loggedin_user();
        add_submenu_item(elgg_echo('usersettings:user:opt:linktext'), $CONFIG->wwwroot . "pg/settings/user/{$user->username}/");
        add_submenu_item(elgg_echo('usersettings:plugins:opt:linktext'), $CONFIG->wwwroot . "pg/settings/plugins/{$user->username}/");
        add_submenu_item(elgg_echo('usersettings:statistics:opt:linktext'), $CONFIG->wwwroot . "pg/settings/statistics/{$user->username}/");
    }
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:12,代码来源:usersettings.php


示例9: perform_redirect

function perform_redirect()
{
    global $CONFIG;
    $username = get_loggedin_user()->username;
    $custom = get_plugin_setting("custom_redirect", "new_profile_redirector");
    if (!get_loggedin_user()->profile_updated && !empty($custom)) {
        $custom = str_replace("[wwwroot]", $CONFIG->wwwroot, $custom);
        $custom = str_replace("[username]", $username, $custom);
        get_loggedin_user()->profile_updated = 1;
        trigger_elgg_event('firstprofileupdate', 'user', $user);
        forward($custom);
    }
}
开发者ID:eokyere,项目名称:elgg,代码行数:13,代码来源:start.php


示例10: issuperadminloggedin

function issuperadminloggedin()
{
    $result = false;
    if (isadminloggedin()) {
        $user = get_loggedin_user();
        if ($user->superadmin == "yes") {
            $result = true;
        } elseif ($user->admin == 1) {
            $result = true;
        }
    }
    return $result;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:13,代码来源:start.php


示例11: get_language

/**
 * Gets the current language in use by the system or user.
 * 
 * [Marcus Povey 20090216: Not sure why this func is necessary.]
 *
 * @return string The language code (eg "en")
 */
function get_language()
{
    global $CONFIG;
    $user = get_loggedin_user();
    $language = false;
    if ($user && $user->language) {
        $language = $user->language;
    }
    if (!$language && isset($CONFIG->language) && $CONFIG->language) {
        $language = $CONFIG->language;
    }
    if ($language) {
        return $language;
    }
    return false;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:23,代码来源:languages.php


示例12: get_gateway_variables

function get_gateway_variables()
{
    $user = get_loggedin_user()->name;
    // hack for the moment
    $domain = get_plugin_setting('cclite_payment_domain', 'cclite');
    $protocol = get_plugin_setting('cclite_protocol', 'cclite');
    $apikey = get_plugin_setting('cclite_api_key', 'cclite');
    $hashing = get_plugin_setting('cclite_hashing_algorithm', 'cclite');
    $registry = get_plugin_setting('cclite_registry', 'cclite');
    $values = array('user' => $user, 'domain' => $domain, 'protocol' => $protocol, 'apikey' => $apikey, 'hashing' => $hashing, 'registry' => $registry);
    /*
     $str = "getting variables " . $_SERVER['SERVER_ADDR'] . "<br/>" . "user is " .  $user . "<br/>" . "registry is " .   $registry ; 
     echo $str ;
    */
    return $values;
}
开发者ID:hbarnard,项目名称:cclite,代码行数:16,代码来源:cclite-common.php


示例13: file_get_files

/**
 * Web service to get file list by all users
 *
 * @param string $context eg. all, friends, mine, groups
 * @param int $limit  (optional) default 10
 * @param int $offset (optional) default 0
 * @param int $group_guid (optional)  the guid of a group, $context must be set to 'group'
 * @param string $username (optional) the username of the user default loggedin user
 *
 * @return array $file Array of files uploaded
 */
function file_get_files($context, $limit = 10, $offset = 0, $group_guid, $username)
{
    if (!$username) {
        $user = get_loggedin_user();
    } else {
        $user = get_user_by_username($username);
        if (!$user) {
            throw new InvalidParameterException('registration:usernamenotvalid');
        }
    }
    if ($context == "all") {
        $params = array('types' => 'object', 'subtypes' => 'file', 'limit' => $limit, 'full_view' => FALSE);
    }
    if ($context == "mine" || $context == "user") {
        $params = array('types' => 'object', 'subtypes' => 'file', 'owner_guid' => $user->guid, 'limit' => $limit, 'full_view' => FALSE);
    }
    if ($context == "group") {
        $params = array('types' => 'object', 'subtypes' => 'file', 'container_guid' => $group_guid, 'limit' => $limit, 'full_view' => FALSE);
    }
    $latest_file = elgg_get_entities($params);
    if ($context == "friends") {
        $latest_file = get_user_friends_objects($user->guid, 'file', $limit, $offset);
    }
    if ($latest_file) {
        foreach ($latest_file as $single) {
            $file['guid'] = $single->guid;
            $file['title'] = $single->title;
            $owner = get_entity($single->owner_guid);
            $file['owner']['guid'] = $owner->guid;
            $file['owner']['name'] = $owner->name;
            $file['owner']['avatar_url'] = get_entity_icon_url($owner, 'small');
            $file['container_guid'] = $single->container_guid;
            $file['access_id'] = $single->access_id;
            $file['time_created'] = (int) $single->time_created;
            $file['time_updated'] = (int) $single->time_updated;
            $file['last_action'] = (int) $single->last_action;
            $file['MIMEType'] = $single->mimetype;
            $file['file_icon'] = get_entity_icon_url($single, 'small');
            $return[] = $file;
        }
    } else {
        $msg = elgg_echo('file:none');
        throw new InvalidParameterException($msg);
    }
    return $return;
}
开发者ID:manumatrix,项目名称:elgg-web-services,代码行数:57,代码来源:file.php


示例14: bookmarks_pagesetup

/**
 * Sidebar menu for bookmarks
 *
 */
function bookmarks_pagesetup()
{
    global $CONFIG;
    $page_owner = page_owner_entity();
    //add submenu options
    if (get_context() == "bookmarks") {
        if (isloggedin()) {
            // link to add bookmark form
            if ($page_owner instanceof ElggGroup) {
                if ($page_owner->isMember(get_loggedin_user())) {
                    add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . "/add");
                }
            } else {
                add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/add");
                add_submenu_item(elgg_echo('bookmarks:inbox'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/inbox");
            }
            if (page_owner()) {
                add_submenu_item(sprintf(elgg_echo('bookmarks:read'), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . "/items");
            }
            if (!$page_owner instanceof ElggGroup) {
                add_submenu_item(elgg_echo('bookmarks:friends'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . "/friends");
            }
        }
        if (!$page_owner instanceof ElggGroup) {
            add_submenu_item(elgg_echo('bookmarks:everyone'), $CONFIG->wwwroot . "mod/bookmarks/everyone.php");
        }
        // Bookmarklet
        if (isloggedin() && page_owner() && can_write_to_container(0, page_owner())) {
            $bmtext = elgg_echo('bookmarks:bookmarklet');
            if ($page_owner instanceof ElggGroup) {
                $bmtext = elgg_echo('bookmarks:bookmarklet:group');
            }
            add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet");
        }
    }
    if ($page_owner instanceof ElggGroup && get_context() == 'groups') {
        if ($page_owner->bookmarks_enable != "no") {
            add_submenu_item(sprintf(elgg_echo("bookmarks:group"), $page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items');
        }
    }
}
开发者ID:ashwiniravi,项目名称:Elgg-Social-Network-Single-Sign-on-and-Web-Statistics,代码行数:45,代码来源:start.php


示例15: wire_get_posts

/**
 * Web service for read latest wire post of user
 *
 * @param string $context all/mine/friends
 * @param string $username username of author
 *
 * @return bool
 */
function wire_get_posts($context, $limit = 10, $offset = 0, $username)
{
    if (!$username) {
        $user = get_loggedin_user();
    } else {
        $user = get_user_by_username($username);
        if (!$user) {
            throw new InvalidParameterException('registration:usernamenotvalid');
        }
    }
    if ($context == "all") {
        $params = array('types' => 'object', 'subtypes' => 'thewire', 'limit' => $limit, 'full_view' => FALSE);
    }
    if ($context == "mine" || $context == "user") {
        $params = array('types' => 'object', 'subtypes' => 'thewire', 'owner_guid' => $user->guid, 'limit' => $limit, 'full_view' => FALSE);
    }
    $latest_wire = elgg_get_entities($params);
    if ($context == "friends") {
        $latest_wire = get_user_friends_objects($user->guid, 'thewire', $limit, $offset);
    }
    if ($latest_wire) {
        foreach ($latest_wire as $single) {
            $wire['guid'] = $single->guid;
            $owner = get_entity($single->owner_guid);
            $wire['owner']['guid'] = $owner->guid;
            $wire['owner']['name'] = $owner->name;
            $wire['owner']['avatar_url'] = get_entity_icon_url($owner, 'small');
            $wire['time_created'] = (int) $single->time_created;
            $wire['description'] = $single->description;
            $return[] = $wire;
        }
    } else {
        $msg = elgg_echo('thewire:noposts');
        throw new InvalidParameterException($msg);
    }
    return $return;
}
开发者ID:manumatrix,项目名称:elgg-web-services,代码行数:45,代码来源:wire.php


示例16: blog_save

/**
 * Web service for making a blog post
 *
 * @param string $username username of author
 * @param string $title    the title of blog
 * @param string $excerpt  the excerpt of blog
 * @param string $text     the content of blog
 * @param string $tags     tags for blog
 * @param string $access   Access level of blog
 *
 * @return bool
 */
function blog_save($title, $text, $excerpt, $tags, $access, $container_guid)
{
    $user = get_loggedin_user();
    if (!$user) {
        throw new InvalidParameterException('registration:usernamenotvalid');
    }
    $obj = new ElggObject();
    $obj->subtype = "blog";
    $obj->owner_guid = $user->guid;
    $obj->container_guid = $container_guid;
    $obj->access_id = strip_tags($access);
    $obj->method = "api";
    $obj->description = strip_tags($text);
    $obj->title = elgg_substr(strip_tags($title), 0, 140);
    $obj->status = 'published';
    $obj->comments_on = 'On';
    $obj->excerpt = strip_tags($excerpt);
    $obj->tags = strip_tags($tags);
    $guid = $obj->save();
    add_to_river('river/object/blog/create', 'create', $user->guid, $obj->guid);
    $return['success'] = true;
    $return['message'] = elgg_echo('blog:message:saved');
    return $return;
}
开发者ID:manumatrix,项目名称:elgg-web-services,代码行数:36,代码来源:blog.php


示例17: preg_replace

<?php

/**
 * @package Elgg
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
 * @author Roger Curry, Grid Research Centre [[email protected]]
 * @author Tingxi Tan, Grid Research Centre [[email protected]]
 * @link http://grc.ucalgary.ca/
 */
global $CONFIG;
$exauthor = $vars['exauthor'];
$formatauthor = preg_replace('/ /', '_', $exauthor);
$publication_guid = $vars['publication_guid'];
$publication = get_entity($publication_guid);
$publication_title = $publication->title;
$invitee = get_loggedin_user();
$invitee_name = $invitee->name;
$canedit = $vars['canedit'];
$content = '<p>' . sprintf(elgg_echo("publication:inviteinfomsg"), $exauthor, $exauthor) . '</p>';
$content .= "<p><label>Enter email address</label>";
$content .= elgg_view('input/email', array('internalname' => 'emails', 'internalid' => 'emails'));
$content .= "</p><p><label>Message</label>";
$content .= "<textarea class='input-textarea' name='emailmessage'>" . sprintf(elgg_echo('publication:invitemsg'), $exauthor, $publication_title, $invitee_name) . elgg_echo('publication:additionalmsg') . "</textarea></p>";
$content .= "<input type='hidden' name='author' value=''/>";
$content .= "<input type='hidden' name='publication' value='{$publication_guid}' />";
$content .= "<input type='submit' value='invite'/>&nbsp<input type='button' value='cancel' onclick=\"hide_dialog('{$formatauthor}')\"/>";
$form = elgg_view('input/form', array('action' => "{$CONFIG->wwwroot}/action/publication/invite", 'body' => $content));
$dialog = "<div style='display:none' id='invite_dialog_{$formatauthor}' class='publication_dialog'>{$form}</div>";
$userinfo = <<<EOT
\t<div class='search_listing'>
\t\t<div class='search_listing_icon'>
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:31,代码来源:authorinvite.php


示例18: messages_send

/**
 * Send an internal message
 *
 * @param string $subject The subject line of the message
 * @param string $body The body of the mesage
 * @param int $send_to The GUID of the user to send to
 * @param int $from Optionally, the GUID of the user to send from
 * @param int $reply The GUID of the message to reply from (default: none)
 * @param true|false $notify Send a notification (default: true)
 * @param true|false $add_to_sent If true (default), will add a message to the sender's 'sent' tray
 * @return true|false Depending on success
 */
function messages_send($subject, $body, $send_to, $from = 0, $reply = 0, $notify = true, $add_to_sent = true)
{
    global $messagesendflag;
    $messagesendflag = 1;
    global $messages_pm;
    if ($notify) {
        $messages_pm = 1;
    } else {
        $messages_pm = 0;
    }
    // If $from == 0, set to current user
    if ($from == 0) {
        $from = (int) get_loggedin_user()->guid;
    }
    // Initialise a new ElggObject
    $message_to = new ElggObject();
    $message_sent = new ElggObject();
    // Tell the system it's a message
    $message_to->subtype = "messages";
    $message_sent->subtype = "messages";
    // Set its owner to the current user
    // $message_to->owner_guid = $_SESSION['user']->getGUID();
    $message_to->owner_guid = $send_to;
    $message_to->container_guid = $send_to;
    $message_sent->owner_guid = $from;
    $message_sent->container_guid = $from;
    // For now, set its access to public (we'll add an access dropdown shortly)
    $message_to->access_id = ACCESS_PUBLIC;
    $message_sent->access_id = ACCESS_PUBLIC;
    // Set its description appropriately
    $message_to->title = $subject;
    $message_to->description = $body;
    $message_sent->title = $subject;
    $message_sent->description = $body;
    // set the metadata
    $message_to->toId = $send_to;
    // the user receiving the message
    $message_to->fromId = $from;
    // the user receiving the message
    $message_to->readYet = 0;
    // this is a toggle between 0 / 1 (1 = read)
    $message_to->hiddenFrom = 0;
    // this is used when a user deletes a message in their sentbox, it is a flag
    $message_to->hiddenTo = 0;
    // this is used when a user deletes a message in their inbox
    $message_sent->toId = $send_to;
    // the user receiving the message
    $message_sent->fromId = $from;
    // the user receiving the message
    $message_sent->readYet = 0;
    // this is a toggle between 0 / 1 (1 = read)
    $message_sent->hiddenFrom = 0;
    // this is used when a user deletes a message in their sentbox, it is a flag
    $message_sent->hiddenTo = 0;
    // this is used when a user deletes a message in their inbox
    $message_to->msg = 1;
    $message_sent->msg = 1;
    // Save the copy of the message that goes to the recipient
    $success = $message_to->save();
    // Save the copy of the message that goes to the sender
    if ($add_to_sent) {
        $success2 = $message_sent->save();
    }
    $message_to->access_id = ACCESS_PRIVATE;
    $message_to->save();
    if ($add_to_sent) {
        $message_sent->access_id = ACCESS_PRIVATE;
        $message_sent->save();
    }
    // if the new message is a reply then create a relationship link between the new message
    // and the message it is in reply to
    if ($reply && $success) {
        $create_relationship = add_entity_relationship($message_sent->guid, "reply", $reply);
    }
    global $CONFIG;
    $message_contents = strip_tags($body);
    if ($send_to != get_loggedin_user() && $notify) {
        notify_user($send_to, get_loggedin_user()->guid, elgg_echo('messages:email:subject'), sprintf(elgg_echo('messages:email:body'), get_loggedin_user()->name, $message_contents, $CONFIG->wwwroot . "pg/messages/" . $user->username, get_loggedin_user()->name, $CONFIG->wwwroot . "mod/messages/send.php?send_to=" . get_loggedin_user()->guid));
    }
    $messagesendflag = 0;
    return $success;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:94,代码来源:start.php


示例19: gatekeeper

<?php

// must be logged in
gatekeeper();
global $CONFIG, $SESSION;
// Get the logged in user
$user = get_loggedin_user();
$consumer_key = get_input('consumer_key');
$return_to = html_entity_decode(get_input('return_to'));
$user_auth = html_entity_decode(get_input('user_auth'));
$request_url = html_entity_decode(get_input('request_url'));
$access_url = html_entity_decode(get_input('access_url'));
// make our consumer object
$consumEnt = oauth_lookup_consumer_entity($consumer_key);
$consumer = oauth_consumer_from_entity($consumEnt);
// get a new request token
if ($consumEnt->revA) {
    $token = oauth_get_new_request_token($consumer, $request_url, $consumEnt->callbackUrl);
} else {
    $token = oauth_get_new_request_token($consumer, $request_url);
}
if ($token != null) {
    // save our token
    if ($consumEnt->revA) {
        $tokEnt = oauth_save_request_token($token, $consumer, $user, $consumEnt->callbackUrl);
    } else {
        $tokEnt = oauth_save_request_token($token, $consumer, $user);
    }
    // save our information to the session and send the user off to get the token validated
    $SESSION['oauth_return_to'] = $return_to;
    $SESSION['oauth_token'] = $tokEnt->getGUID();
开发者ID:lorea,项目名称:Hydra-dev,代码行数:31,代码来源:gettoken.php


示例20: group_forum_delete_reply

/**
 * Web service delete a reply
 *
 * @param string $username username
 * @param string $id       Annotation ID of reply
 *
 * @return bool
 */
function group_forum_delete_reply($id, $username)
{
    $reply = elgg_get_annotation_from_id($id);
    if (!$reply || $reply->name != 'group_topic_post') {
        $msg = elgg_echo('discussion:reply:error:notdeleted');
        throw new InvalidParameterException($msg);
    }
    if (!$username) {
        $user = get_loggedin_user();
    } else {
        $user = get_user_by_username($username);
        if (!$user) {
            throw new InvalidParameterException('registration:usernamenotvalid');
        }
    }
    if (!$reply->canEdit($user->guid)) {
        $msg = elgg_echo('discussion:error:permissions');
        throw new InvalidParameterException($msg);
    }
    $result = $reply->delete();
    if ($result) {
        $return['success'] = true;
        $return['message'] = elgg_echo('discussion:reply:deleted');
    } else {
        $msg = elgg_echo('discussion:reply:error:notdeleted');
        throw new InvalidParameterException($msg);
    }
    return $return;
}
开发者ID:manumatrix,项目名称:elgg-web-services,代码行数:37,代码来源:group.php



注:本文中的get_loggedin_user函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_loggedin_userid函数代码示例发布时间:2022-05-15
下一篇:
PHP get_logged_user函数代码示例发布时间: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