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

PHP getLoggedInUser函数代码示例

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

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



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

示例1: __construct

 public function __construct()
 {
     gateKeeper();
     $guid = getInput("guid");
     $title = getInput("blog_title");
     $description = getInput("description");
     $access_id = getInput("access_id");
     $container_guid = getInput("container_guid");
     $owner_guid = getLoggedInUserGuid();
     if ($guid) {
         $blog = getEntity($guid);
     } else {
         $blog = new Blog();
     }
     $blog->title = $title;
     $blog->description = $description;
     $blog->access_id = $access_id;
     $blog->owner_guid = $owner_guid;
     $blog->status = "published";
     $blog->container_guid = $container_guid;
     $blog->save();
     new Activity(getLoggedInUserGuid(), "blog:add", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $blog->getURL(), $blog->title, truncate($blog->description)), "", $access_id);
     new SystemMessage("Your blog has been published");
     forward("blogs/all_blogs");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:AddBlogActionHandler.php


示例2: doAuth

function doAuth($info, $trusted = null, $fail_cancels = false)
{
    if (!$info) {
        // There is no authentication information, so bail
        return authCancel(null);
    }
    $req_url = $info->identity;
    $user = getLoggedInUser();
    setRequestInfo($info);
    if ($req_url != $user) {
        return login_render(array(), $req_url, $req_url);
    }
    $sites = getSessionSites();
    $trust_root = $info->trust_root;
    $fail_cancels = $fail_cancels || isset($sites[$trust_root]);
    $trusted = isset($trusted) ? $trusted : isTrusted($req_url, $trust_root);
    if ($trusted) {
        setRequestInfo();
        $server =& getServer();
        $response =& $info->answer(true);
        $webresponse =& $server->encodeResponse($response);
        $new_headers = array();
        foreach ($webresponse->headers as $k => $v) {
            $new_headers[] = $k . ": " . $v;
        }
        return array($new_headers, $webresponse->body);
    } elseif ($fail_cancels) {
        return authCancel($info);
    } else {
        return trust_render($info);
    }
}
开发者ID:honchoman,项目名称:singpolyma,代码行数:32,代码来源:common.php


示例3: __construct

 public function __construct()
 {
     gateKeeper();
     $user = getLoggedInUser();
     $user->createAvatar();
     if (isEnabledPlugin("photos")) {
         $album = getEntity(array("type" => "Photoalbum", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "Profile Avatars"))));
         $photo = new Photo();
         $photo->owner_guid = getLoggedInUserGuid();
         $photo_guid = $photo->save();
         Image::copyAvatar($user, $photo);
         $photo = getEntity($photo_guid);
         if (!$album) {
             $album = new Photoalbum();
             $album->owner_guid = getLoggedInUserGuid();
             $album->title = "Profile Avatars";
             $album_guid = $album->save();
             $album = getEntity($album_guid);
             Image::copyAvatar($photo, $album);
         }
         $photo->container_guid = $album->guid;
         $photo->save();
     }
     runHook("action:edit_avatar:after", array("user" => $user));
     new Activity(getLoggedInUserGuid(), "activity:avatar:updated", array($user->getURL(), $user->full_name));
     new SystemMessage("Your avatar has been uploaded.");
     forward("profile/" . $user->guid);
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:28,代码来源:EditAvatarActionHandler.php


示例4: init

 public function init($file)
 {
     if (!loggedIn()) {
         return false;
     }
     if (!is_a($file, "SocialApparatus\\File")) {
         return false;
     }
     $product = getEntity($file->container_guid);
     if (!is_a($product, "SocialApparatus\\Product")) {
         return false;
     }
     $user = getLoggedInUser();
     if ($user->stripe_cust) {
         \Stripe\Stripe::setApiKey(EcommercePlugin::secretKey());
         $orders = \Stripe\Order::all(array("limit" => 300, "customer" => $user->stripe_cust));
         foreach ($orders['data'] as $order) {
             foreach ($order->items as $item) {
                 if ($item->description != "Taxes (included)" && $item->description != "Free shipping") {
                     $sku = $item->parent;
                     if ($sku == $product->stripe_sku) {
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:29,代码来源:ProductAccessHandler.php


示例5: __construct

 public function __construct()
 {
     gateKeeper();
     $message = NULL;
     $user = getLoggedInUser();
     $user->profile_complete = true;
     $profile_type = $user->profile_type;
     $fields = ProfileField::get($profile_type);
     foreach ($fields as $key => $field) {
         if ($field['required'] == "true" && !getInput($key)) {
             $message .= "{$field['label']} cannot be empty.";
         }
     }
     if ($message) {
         new SystemMessage($message);
         forward("editProfile");
     }
     foreach ($fields as $key => $field) {
         $user->{$key} = getInput($key);
     }
     $user->save();
     new Activity($user->guid, "activity:profile:updated", array($user->getURL(), $user->full_name));
     new SystemMessage("Your profile has been updated.");
     forward("profile/{$user->guid}");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:EditProfileActionHandler.php


示例6: __construct

 public function __construct()
 {
     $editor = getInput("editor_id");
     if (file_exists($_FILES['avatar']['tmp_name'])) {
         // Check if General album exists
         $album = getEntity(array("type" => "Photoalbum", "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "General"))));
         $photo = new Photo();
         $photo->owner_guid = getLoggedInUserGuid();
         $photo->save();
         $photo->createAvatar();
         if (!$album) {
             $album = new Photoalbum();
             $album->title = "General";
             $album->owner_guid = getLoggedInUserGuid();
             $album->access_id = "public";
             Image::copyAvatar($photo, $album);
             $album->save();
         }
         $photo->container_guid = $album->guid;
         if (!$album->title != "Profile Avatars" && $album->title != "General") {
             new Activity(getLoggedInUserGuid(), "activity:add:photo", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $album->getURL(), $album->title, "<a href='" . $album->getURL() . "'>" . $photo->icon(EXTRALARGE, "img-responsive") . "</a>"), $album->access_id);
         }
         $photo->save();
         forward(false, array("insertphoto" => $photo->guid, "editor" => $editor));
     } else {
         forward();
     }
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:28,代码来源:UploadPhotoActionHandler.php


示例7: __construct

 public function __construct()
 {
     gateKeeper();
     $title = getInput("title");
     $description = getInput("description");
     $access_id = getInput("access_id");
     $membership = getInput("membership");
     $group = new Group();
     $group->title = $title;
     $group->description = $description;
     $group->access_id = $access_id;
     $group->membership = $membership;
     $group->owner_guid = getLoggedInUserGuid();
     $group->save();
     $group->createAvatar();
     $test = getEntity(array("type" => "Groupmembership", "metadata_name_value_pairs" => array(array("name" => "group", "value" => $group->guid), array("name" => "member_guid", "value" => getLoggedInUserGuid()))));
     if (!$test) {
         $group_membership = new Groupmembership();
         $group_membership->group = $group->guid;
         $group_membership->member_guid = getLoggedInUserGuid();
         $group_membership->access_id = "system";
         $group_membership->save();
     }
     new Activity(getLoggedInUserGuid(), "group:created", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $group->getURL(), $group->title), $group->guid);
     new SystemMessage("Your group has been created.");
     forward("groups");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:27,代码来源:CreateGroupActionHandler.php


示例8: __construct

 function __construct()
 {
     $guid = getInput("guid");
     $reply = getInput("reply");
     if (!$reply) {
         new SystemMessage("Message body cannot be left empty.");
         forward();
     }
     $message = getEntity($guid);
     $to = getLoggedInUserGuid() == $message->to ? $message->from : $message->to;
     $from = getLoggedInUserGuid();
     $to_user = getEntity($to);
     $from_user = getEntity($from);
     $message_element = new Messageelement();
     $message_element->message = $reply;
     $message_element->to = $to;
     $message_element->from = $from;
     $message_element->container_guid = $guid;
     $message_element->save();
     $link = getSiteURL() . "messages";
     notifyUser("message", $to, getLoggedInUserGuid(), $to);
     sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true));
     new SystemMessage("Your message has been sent.");
     forward("messages/" . $message->guid);
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:MessageReplyActionHandler.php


示例9: __construct

 function __construct()
 {
     \Stripe\Stripe::setApiKey(EcommercePlugin::secretKey());
     $order_items = array();
     $user = getLoggedInUser();
     $stripe_cust = $user->stripe_cust;
     $cart = Cache::get("cart", "session");
     if (!$stripe_cust) {
         try {
             $cu = \Stripe\Customer::create(array("description" => $user->email, "source" => getInput("stripeToken")));
         } catch (Exception $e) {
             new SystemMessage("There has been an error.  Please contact us.");
             forward("home");
         }
         $user->stripe_cust = $cu->id;
         $user->save();
     } else {
         $cu = \Stripe\Customer::retrieve($stripe_cust);
         try {
             $cu->source = getInput("stripeToken");
         } catch (Exception $e) {
             new SystemMessage("There has been an error.  Please contact us.");
             forward("home");
         }
         $cu->save();
     }
     foreach ($cart as $guid => $details) {
         $product = getEntity($guid);
         if ($product->interval == "one_time") {
             $order_item = array("type" => "sku", "parent" => $product->stripe_sku, "description" => $product->description . $details);
             $order_items[] = $order_item;
         } else {
             try {
                 $cu->subscriptions->create(array("plan" => $guid));
             } catch (Exception $e) {
                 new SystemMessage("There has been an error.  Please contact us.");
                 forward("home");
             }
         }
     }
     if (!empty($order_items)) {
         try {
             $order = \Stripe\Order::create(array("items" => $order_items, "currency" => "usd", "customer" => $cu->id));
             $order->pay(array("customer" => $cu->id, "email" => $user->email));
         } catch (Exception $e) {
             new SystemMessage("There has been an error.  Please contact us.");
             forward("home");
         }
     }
     $invoice = new Invoice();
     $invoice->items = $cart;
     $invoice->status = "paid";
     $invoice->owner_guid = getLoggedInUserGuid();
     $invoice->stripe_order = $order->id;
     $invoice->save();
     Cache::delete("cart", "session");
     new SystemMessage("Your purchase is complete.");
     forward("billing");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:59,代码来源:ChargeCardActionHandler.php


示例10: trust_render

function trust_render($info)
{
    $current_user = getLoggedInUser();
    $lnk = link_render($current_user);
    $trust_root = htmlspecialchars($info->trust_root);
    $trust_url = buildURL('trust', true);
    $form = sprintf(trust_form_pat, $lnk, $trust_root, $trust_url);
    return page_render($form, $current_user, 'Trust This Site');
}
开发者ID:honchoman,项目名称:singpolyma,代码行数:9,代码来源:trust.php


示例11: __construct

 public function __construct()
 {
     runHook("action:logout:before");
     $user = getLoggedInUser();
     if ($user) {
         $user->logout();
     }
     runHook("action:logout:after");
     new SystemMessage(translate("system_message:logged_out"));
     forward("home");
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:LogoutActionHandler.php


示例12: sites_render

function sites_render($sites)
{
    if ($sites) {
        $rows = siteList_render($sites);
        $form = sprintf(sites_form, buildURL('sites'), $rows);
        $body = $pre . $form;
    } else {
        $body = sprintf(sites_empty_message, link_render(buildURL(''), 'Return home'));
    }
    return page_render($body, getLoggedInUser(), 'Remembered Sites');
}
开发者ID:honchoman,项目名称:singpolyma,代码行数:11,代码来源:sites.php


示例13: action_default

/**
 * Handle a standard OpenID server request
 */
function action_default()
{
    header('X-XRDS-Location: ' . buildURL('idpXrds'));
    $server = getServer();
    $method = $_SERVER['REQUEST_METHOD'];
    $request = null;
    if ($method == 'GET') {
        $request = $_GET;
    } else {
        $request = $_POST;
    }
    $request = $server->decodeRequest();
    if (!$request) {
        return about_render();
    }
    setRequestInfo($request);
    if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
        if ($request->idSelect()) {
            // Perform IDP-driven identifier selection
            if ($request->mode == 'checkid_immediate') {
                $response = $request->answer(false);
            } else {
                return trust_render($request);
            }
        } else {
            if (!$request->identity && !$request->idSelect()) {
                // No identifier used or desired; display a page saying
                // so.
                return noIdentifier_render();
            } else {
                if ($request->immediate) {
                    $response = $request->answer(false, buildURL());
                } else {
                    if (!getLoggedInUser()) {
                        return login_render();
                    }
                    return trust_render($request);
                }
            }
        }
    } else {
        $response = $server->handleRequest($request);
    }
    $webresponse = $server->encodeResponse($response);
    if ($webresponse->code != AUTH_OPENID_HTTP_OK) {
        header(sprintf("HTTP/1.1 %d ", $webresponse->code), true, $webresponse->code);
    }
    foreach ($webresponse->headers as $k => $v) {
        header("{$k}: {$v}");
    }
    header(header_connection_close);
    print $webresponse->body;
    exit(0);
}
开发者ID:marcioyonamine,项目名称:php-openid,代码行数:57,代码来源:actions.php


示例14: about_render

/**
 * Render the about page, potentially with an error message
 */
function about_render($error = false, $internal = true)
{
    $headers = array();
    $body = sprintf(about_body, buildURL());
    if ($error) {
        $headers[] = $internal ? http_internal_error : http_bad_request;
        $body .= sprintf(about_error_template, htmlspecialchars($error));
    }
    $current_user = getLoggedInUser();
    return page_render($body, $current_user, 'OpenID Server Endpoint');
}
开发者ID:matheuscsc,项目名称:finalproject,代码行数:14,代码来源:about.php


示例15: __construct

 public function __construct()
 {
     gateKeeper();
     $topic = new Forumtopic();
     $topic->title = getInput("title");
     $topic->description = getInput("description");
     $topic->container_guid = getInput("container_guid");
     $topic->save();
     new SystemMessage("Your topic has been posted.");
     new Activity(getLoggedInUserGuid(), "forum:topic:posted", $params = array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $topic->getURL(), $topic->title, getEntity($topic->container_guid)->getURL(), getEntity($topic->container_guid)->title), getInput("container_guid"));
     forward("forum/category/" . getInput("container_guid"));
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:12,代码来源:AddTopicActionHandler.php


示例16: __construct

 public function __construct()
 {
     gateKeeper();
     $email_users = array();
     $container_guid = getInput("container_guid");
     $topic = getEntity($container_guid);
     $category_guid = $topic->container_guid;
     $category = getEntity($category_guid);
     $description = getInput("comment");
     $comment = new Forumcomment();
     $comment->description = $description;
     $comment->container_guid = $container_guid;
     $comment->category_guid = $category_guid;
     $comment->owner_guid = getLoggedInUserGuid();
     $comment->save();
     new SystemMessage("Your comment has been posted.");
     new Activity(getLoggedInUserGuid(), "forum:comment:posted", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $topic->getURL(), $topic->title, truncate($comment->description)), $container_guid, $category->access_id);
     $all_comments = getEntities(array("type" => "Forumcomment", "metadata_name" => "container_guid", "metadata_value" => $container_guid));
     $notify_users = array($topic->owner_guid);
     $container_owner_guid = $topic->owner_guid;
     $container_owner = getEntity($container_owner_guid);
     if ($container_owner->notify_when_forum_comment_topic_i_own == "email" || $container_owner->notify_when_forum_comment_topic_i_own == "both") {
         $email_users[] = $container_guid;
     }
     foreach ($all_comments as $comment) {
         $user_guid = $comment->owner_guid;
         $user = getEntity($user_guid);
         switch ($user->notify_when_forum_comment_topic_i_own) {
             case "both":
                 $notify_users[] = $comment->owner_guid;
                 $email_users[] = $comment->owner_guid;
                 break;
             case "email":
                 $email_users[] = $comment->owner_guid;
                 break;
             case "site":
                 $notify_users[] = $comment->owner_guid;
                 break;
             case "none":
                 break;
         }
     }
     $notify_users = array_unique($notify_users);
     foreach ($notify_users as $user_guid) {
         notifyUser("forumcomment", $container_guid, getLoggedInUserGuid(), $user_guid);
     }
     foreach ($email_users as $user) {
         $params = array("to" => array($user->full_name, $user->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment.  Click <a href='{$url}'>Here</a> to view it.", "html" => true);
         sendEmail($params);
     }
     forward();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:52,代码来源:AddForumCommentActionHandler.php


示例17: __construct

 public function __construct($data = NULL)
 {
     gateKeeper();
     $logged_in_user = getLoggedInUser();
     if (!$data) {
         // Get the comment body
         $comment_body = getInput("comment");
         // Get container url
         $container_guid = getInput("guid");
     } else {
         $comment_body = $data['comment_body'];
         $container_guid = $data['container_guid'];
     }
     $container = getEntity($container_guid);
     $container_owner_guid = $container->owner_guid;
     if ($container_owner_guid) {
         $container_owner = getEntity($container_owner_guid);
     }
     $url = $container->getURL();
     if (!$url) {
         $url = getSiteURL();
     }
     // Create the comment
     CommentsPlugin::createComment($container_guid, $comment_body);
     if ($container_owner_guid) {
         if ($container_owner_guid != getLoggedInUserGuid()) {
             $params = array("to" => array($container_owner->full_name, $container_owner->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment.  Click <a href='{$url}'>Here</a> to view it.", "html" => true);
             switch ($logged_in_user->getSetting("notify_when_comment")) {
                 case "email":
                     sendEmail($params);
                     break;
                 case "none":
                     break;
                 case "site":
                     notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid);
                     break;
                 case "both":
                     sendEmail($params);
                     notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid);
                     break;
             }
         }
     }
     runHook("add:comment:after");
     if (getLoggedInUserGuid() != $container_owner_guid && $container_owner_guid) {
         new Activity(getLoggedInUserGuid(), "activity:comment", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container_owner->getURL(), $container_owner->full_name, $container->getURL(), translate($container->type), truncate($comment_body)));
     } elseif (!$container_owner_guid) {
         new Activity(getLoggedInUserGuid(), "activity:comment:own", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container->getURL(), $container->title, translate($container->type), truncate($comment_body)));
     }
     // Return to container page.
     forward();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:52,代码来源:AddCommentActionHandler.php


示例18: __construct

 function __construct()
 {
     gateKeeper();
     $user = getLoggedInUser();
     $subscription = pageArray(2);
     if ($subscription && $user->stripe_cust) {
         \Stripe\Stripe::setApiKey(EcommercePlugin::secretKey());
         $cu = \Stripe\Customer::retrieve($user->stripe_cust);
         $cu->subscriptions->retrieve($subscription)->cancel();
         new SystemMessage("Your subscription has been canceled.");
     }
     forward();
 }
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:13,代码来源:CancelSubscriptionActionHandler.php


示例19: isTrusted

/**
 * Return whether the trust root is currently trusted
 *
 */
function isTrusted($identity_url, $trust_root, $return_to)
{
    global $store;
    if ($identity_url != getLoggedInUser()) {
        return false;
    }
    $sites = $store->getTrustedSites($identity_url);
    if (empty($sites)) {
        return false;
    } else {
        return in_array($trust_root, $sites) && fnmatch($trust_root . '*', $return_to);
    }
}
开发者ID:lorea,项目名称:Hydra-dev,代码行数:17,代码来源:session.php


示例20: trust_render

function trust_render($info)
{
    $current_user = getLoggedInUser();
    $lnk = link_render(idURL($current_user));
    $trust_root = htmlspecialchars($info->trust_root);
    $trust_url = buildURL('trust', true);
    if ($info->idSelect()) {
        $prompt = id_select_pat;
    } else {
        $prompt = sprintf(normal_pat, $lnk, $trust_root);
    }
    $form = sprintf(trust_form_pat, $trust_url, $prompt);
    return page_render($form, $current_user, 'Trust This Site');
}
开发者ID:Somniloquist,项目名称:cs50,代码行数:14,代码来源:trust.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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