当前位置: 首页>>代码示例>>PHP>>正文


PHP get_loggedin_user函数代码示例

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


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


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