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


PHP S::user方法代码示例

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


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

示例1: smarty_block_canEdit

function smarty_block_canEdit($params, $content, &$smarty, &$repeat)
{
    $group = $params['target']->group();
    if (S::user()->hasRights($group, Rights::admin()) || S::user()->isWeb()) {
        return $content;
    }
}
开发者ID:netixx,项目名称:frankiz,代码行数:7,代码来源:block.canEdit.php

示例2: smarty_function_grpvisibility

function smarty_function_grpvisibility($params, &$smarty)
{
    $user = $params['user'];
    $group = $params['group'];
    $grpcoll = $user->groupVisibility($group);
    $visigroup = $grpcoll->count() == 1 ? $grpcoll->first() : null;
    // if $user is session user, see which visibility option is enabled
    $flagselect = '';
    if (S::user()->isMe($user)) {
        $possib = $user->getAvailVisibilities($group);
        $flagoptions = array();
        foreach ($possib as $gid => $title) {
            $flagoption = '<option value="' . $gid . '"';
            if ($visigroup != null && $visigroup->id() == $gid) {
                $flagoption .= ' selected';
            }
            $flagoption .= '>visible par ' . $title . '</option>';
            $flagoptions[] = $flagoption;
        }
        $flagselect = '<select class="visiselect" name="visibility-' . $user->id() . '-' . $group->id() . '">' . implode($flagoptions) . '</select>';
    }
    // Get color & title
    list($color, $title) = User::visibilitiesColInfo($grpcoll);
    return '<form class="visicontainer" id="visiflag-' . $user->id() . '-' . $group->id() . '">' . '<div class="visiflag ' . $color . ' click" title="' . $title . '"></div>' . $flagselect . '</form>';
}
开发者ID:netixx,项目名称:frankiz,代码行数:25,代码来源:function.grpvisibility.php

示例3: __construct

 public function __construct($question, $answer1, $answer2)
 {
     $this->question = $question;
     $this->answer1 = $answer1;
     $this->answer2 = $answer2;
     $this->writer = S::user();
 }
开发者ID:netixx,项目名称:frankiz,代码行数:7,代码来源:qdjvalidate.php

示例4: assign_json_to_map

 public static function assign_json_to_map(PlPage $page, $pids = null)
 {
     if (!is_null($pids)) {
         $where = XDB::format(' AND pa.pid IN {?}', $pids);
     } else {
         $where = '';
     }
     if (!S::logged() || !S::user()->checkPerms('directory_ax')) {
         $where .= " AND pa.pub = 'public'";
         $name_publicity = 'public';
     } else {
         if (!S::user()->checkPerms('directory_private')) {
             $where .= " AND pa.pub = 'ax'";
             $name_publicity = 'public';
         } else {
             $name_publicity = 'private';
         }
     }
     $data = XDB::rawFetchAllAssoc('SELECT  pa.latitude, pa.longitude, GROUP_CONCAT(DISTINCT p.hrpid SEPARATOR \',\') AS hrpid,
                                            GROUP_CONCAT(pd.promo SEPARATOR \',\') AS promo,
                                            GROUP_CONCAT(DISTINCT pd.' . $name_publicity . '_name, \' (\', pd.promo, \')\' SEPARATOR \', \') AS name,
                                            GROUP_CONCAT(DISTINCT pa.pid SEPARATOR \',\') AS pid
                                      FROM  profile_addresses AS pa
                                INNER JOIN  profiles          AS p  ON (pa.pid = p.pid)
                                INNER JOIN  profile_display   AS pd ON (pd.pid = pa.pid)
                                     WHERE  pa.type = \'home\' AND p.deathdate IS NULL AND pa.latitude IS NOT NULL AND pa.longitude IS NOT NULL' . $where . '
                                  GROUP BY  pa.latitude, pa.longitude');
     $page->jsonAssign('data', $data);
 }
开发者ID:Ekleog,项目名称:platal,代码行数:29,代码来源:geoloc.php

示例5: __construct

 public function __construct()
 {
     global $globals;
     parent::__construct();
     // Set the default page
     $this->changeTpl('platal/index.tpl');
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
         $this->addJsLink('json2.js');
     }
     $this->addJsLink('jquery.xorg.js');
     $this->addJsLink('overlib.js');
     $this->addJsLink('core.js');
     $this->addJsLink('xorg.js');
     if ($globals->core->sentry_js_dsn) {
         $this->addJsLink('raven.min.js');
     }
     $this->setTitle('le site des élèves et anciens élèves de l\'École polytechnique');
     if (S::logged() && S::user()->checkPerms('admin')) {
         $types = array(S::user()->type);
         $perms = DirEnum::getOptions(DirEnum::ACCOUNTTYPES);
         ksort($perms);
         foreach ($perms as $type => $perm) {
             if (!empty($perm) && $type != $types[0]) {
                 $types[] = $type;
             }
         }
         $this->assign('account_types_list', $types);
         $skins = DirEnum::getOptions(DirEnum::SKINS);
         asort($skins);
         $this->assign('skin_list', $skins);
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:32,代码来源:xorgpage.php

示例6: run

 public function run()
 {
     $res = XDB::query('SELECT todo_id, sent, checked, tobedone
                        FROM todo
                       WHERE uid = {?}
                       ORDER BY sent DESC', S::user()->id());
     $array_todo = $res->fetchAllAssoc();
     $this->assign('list', $array_todo);
 }
开发者ID:netixx,项目名称:frankiz,代码行数:9,代码来源:todo.php

示例7: run

 public function run()
 {
     $binets = S::user()->castes()->groups()->filter('ns', Group::NS_BINET);
     $frees = S::user()->castes()->groups()->filter('ns', Group::NS_FREE);
     $binets->select(GroupSelect::premises());
     $binets->select(GroupSelect::nb_news());
     $this->assign('binets', $binets);
     $this->assign('frees', $frees);
     $this->assign('user', S::user());
 }
开发者ID:netixx,项目名称:frankiz,代码行数:10,代码来源:groups.php

示例8: __construct

 public function __construct($mbox, $domain, $user = null)
 {
     $this->mbox = $mbox;
     $this->domain = $domain;
     $this->address = "{$mbox}@{$domain}";
     if (is_null($user)) {
         $user = S::user();
     }
     $this->mmclient = new MMList($user, $this->domain);
 }
开发者ID:Ekleog,项目名称:platal,代码行数:10,代码来源:mailinglist.inc.php

示例9: handler_ajax_todo_clear

 function handler_ajax_todo_clear($page)
 {
     S::assert_xsrf_token();
     XDB::execute('DELETE FROM  todo
                         WHERE  uid = {?} AND checked = 1', S::user()->id());
     if (XDB::affectedRows() != 1) {
         $page->jsonAssign('error', "Impossible de nettoyer la liste des tâches");
     }
     return PL_JSON;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:10,代码来源:todo.php

示例10: save

 public function save(ProfilePage $page, $field, $value)
 {
     $deletePrivate = S::user()->isMe($page->owner) || S::admin();
     Phone::deletePhones($page->pid(), Phone::LINK_ADDRESS, null, $deletePrivate);
     Address::deleteAddresses($page->pid(), Address::LINK_PROFILE, null, null, $deletePrivate);
     AddressReq::purge_requests($page->pid(), 0, 0, Address::LINK_PROFILE);
     Address::saveFromArray($value, $page->pid(), Address::LINK_PROFILE, null, $deletePrivate);
     if (S::user()->isMe($page->owner) && count($value) > 1) {
         Platal::page()->trigWarning('Attention, tu as plusieurs adresses sur ton profil. Pense à supprimer celles qui sont obsolètes.');
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:addresses.inc.php

示例11: handler_chat

 function handler_chat($page, $group = 'platal')
 {
     $page->assign('jabber_hruid', S::user()->login());
     $page->assign('jabber_nick', S::user()->displayName());
     $page->assign('jabber_cookie', $_SERVER['HTTP_COOKIE']);
     if ($group) {
         $page->assign('jabber_room', $group);
     } else {
         $page->assign('jabber_room', 'br');
     }
     $page->changeTpl('chat/chat.tpl');
 }
开发者ID:netixx,项目名称:frankiz,代码行数:12,代码来源:chat.php

示例12: defaultForEdit

 public static function defaultForEdit($max_level = null)
 {
     if (!S::logged()) {
         $vis = self::get(self::VIEW_NONE);
     } else {
         $vis = S::user()->editVisibility();
     }
     if ($max_level != null) {
         return $vis->restrict($max_level);
     } else {
         return $vis;
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:13,代码来源:visibility.php

示例13: handle_editor

 protected function handle_editor()
 {
     if (isset($_FILES['userfile'])) {
         $upload =& PlUpload::get($_FILES['userfile'], S::user()->login(), 'photo');
         if (!$upload) {
             $this->trigError('Une erreur est survenue lors du téléchargement du fichier.');
             return false;
         }
         $this->read($upload);
         return $this->valid;
     }
     return false;
 }
开发者ID:Ekleog,项目名称:platal,代码行数:13,代码来源:photos.inc.php

示例14: run

 public function run()
 {
     $date = new FrankizDateTime();
     $date->setTime(0, 0);
     $date_n = new FrankizDateTime();
     date_add($date_n, date_interval_create_from_date_string('1 day'));
     $date_n->setTime(0, 0);
     $activities = new ActivityInstanceFilter(new PFC_AND(new PFC_Or(new AIFC_User(S::user(), 'restricted'), new AIFC_User(S::user(), 'everybody')), new AIFC_Period($date, $date_n)));
     $c = $activities->get();
     $c->select(ActivityInstanceSelect::all());
     $c->order('hour_begin', false);
     $this->assign('day', new FrankizDateTime());
     $this->assign('date', date("Y-m-d"));
     $this->assign('activities', $c);
 }
开发者ID:netixx,项目名称:frankiz,代码行数:15,代码来源:activity.php

示例15: smarty_function_origin_picker

function smarty_function_origin_picker($params, &$smarty)
{
    $gf = new GroupFilter(new PFC_And(new PFC_Not(new GFC_Namespace(Group::NS_USER)), new GFC_User(S::user(), Rights::admin())), new GFO_Score());
    $gs = $gf->get();
    if ($params['not_only_admin']) {
        $gfo = new GroupFilter(new PFC_And(new GFC_Namespace(array(Group::NS_BINET, Group::NS_FREE)), new GFC_User(S::user(), Rights::restricted())), new GFO_Score());
        $gso = $gfo->get()->diff($gs);
        $temp = new Collection();
        $temp->merge($gs)->merge($gso);
        $temp->select(GroupSelect::base());
        $smarty->assign('not_admin', $gso);
    } else {
        $gs = $gf->get()->select(GroupSelect::base());
    }
    $smarty->assign($params['out'], $gs);
}
开发者ID:netixx,项目名称:frankiz,代码行数:16,代码来源:function.origin_picker.php


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