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


PHP Authentication::current_user方法代码示例

本文整理汇总了PHP中Authentication::current_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Authentication::current_user方法的具体用法?PHP Authentication::current_user怎么用?PHP Authentication::current_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Authentication的用法示例。


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

示例1: get_nav_children

 function get_nav_children($e)
 {
     $result = array();
     foreach ($e->children() as $e) {
         if (!$e->visible()) {
             continue;
         }
         $class = '';
         if ($e == $this->entity) {
             $class .= 'current ';
             if ($e->has_visible_children()) {
                 $class .= 'ancestor ';
             }
         } else {
             if ($e->is_ancestor_of($this->entity)) {
                 $class .= 'ancestor ';
             }
         }
         if ($e->submitable()) {
             $subm = Authentication::current_user()->status_of_last_submission_to($e);
             $class .= Status::to_css_class($subm) . ' ';
         }
         if (!$e->active()) {
             $class .= 'inactive ';
         }
         $result[] = array('title' => $e->title(), 'url' => $this->nav_script($e) . $e->path(), 'class' => $class);
     }
     return $result;
 }
开发者ID:jlsa,项目名称:justitia,代码行数:29,代码来源:PageWithEntity.php

示例2: init

 private static function init()
 {
     // current user is always in group
     $user = Authentication::current_user();
     if (!$user) {
         UserGroup::$current = array();
     } else {
         UserGroup::$current = array($user);
     }
     // get from session
     UserGroup::start_session();
     foreach ($_SESSION['usergroup'] as $extra_userid) {
         UserGroup::$current[] = User::by_id($extra_userid);
     }
 }
开发者ID:jlsa,项目名称:justitia,代码行数:15,代码来源:UserGroup.php

示例3: app_name

 function app_name()
 {
     static $app_name;
     if (!$app_name) {
         $user = Authentication::current_user();
         if ($user && $user->login[0] != 's' && time() / 1000 % 10 == 0) {
             // just for fun
             $app_name = "Twanthena";
         } else {
             $app_name = "Justitia";
         }
     }
     return $app_name;
 }
开发者ID:jlsa,项目名称:justitia,代码行数:14,代码来源:Template.php

示例4: array

<?php

require_once '../lib/bootstrap.inc';
// -----------------------------------------------------------------------------
// Ajax utility: return newest submissions
// -----------------------------------------------------------------------------
if (Authentication::current_user() == false) {
    echo '{"logout":"true"}';
} else {
    if (Authentication::is_admin() and isset($_GET['entity']) and isset($_GET['submissionid'])) {
        try {
            // get entity
            $entity = Entity::get($_GET['entity'], false, true);
            $submissions = $entity->submissions_after($_GET['submissionid']);
            $arr = array();
            foreach ($submissions as $s) {
                $arr[] = $s->submissionid;
            }
            echo '{"new_ids":' . json_encode($arr) . '}';
        } catch (NotFoundException $e) {
            exit;
        }
    } else {
        die("You have no rights to view this submission");
    }
}
开发者ID:jlsa,项目名称:justitia,代码行数:26,代码来源:ajax_latestsubmissions.php

示例5: write_overview_item

 function write_overview_item($e)
 {
     if (!$e->visible()) {
         return;
     }
     $class = '';
     if ($e->submitable()) {
         $subm = Authentication::current_user()->status_of_last_submission_to($e);
         $class .= Status::to_css_class($subm) . ' ';
     }
     if (!$e->active()) {
         $class .= 'inactive ';
     }
     $this->write_block_begin($e->title(), 'collapsed linky block ' . $class, 'index.php' . $e->path());
     $this->write_block_end();
 }
开发者ID:jlsa,项目名称:justitia,代码行数:16,代码来源:index.php

示例6: is_admin

 static function is_admin()
 {
     $user = Authentication::current_user();
     return $user && $user->is_admin;
 }
开发者ID:jlsa,项目名称:justitia,代码行数:5,代码来源:Authentication.php


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