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


PHP AuthManager::getUserId方法代码示例

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


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

示例1: getUserPassedLessons

 public function getUserPassedLessons()
 {
     $result = array();
     if (AuthManager::isAuthorized()) {
         foreach (TRBean::inst()->getPassedLessons(AuthManager::getUserId()) as $id) {
             $result["tr{$id}"] = true;
         }
     }
     return $result;
 }
开发者ID:ilivanoff,项目名称:www,代码行数:10,代码来源:TrainManager.php

示例2: getPostsWithUncheckedCommentsHtml

 /**
  * Метод строит список постов, в которых появились новые комментарии, и показывает их администратору.
  * 
  * Выпуск №1 (3)
  * Архимед (7)
  */
 public function getPostsWithUncheckedCommentsHtml()
 {
     $adminId = AuthManager::getUserId();
     $result = array();
     /* @var $pp PostsProcessor */
     foreach (Handlers::getInstance()->getPostsProcessors() as $pp) {
         $bean = $pp->dbBean();
         $table = $bean->getPostsTable();
         $table_comments = $bean->getCommentsTable();
         $query = "SELECT p.id_post, (SELECT count(*)\n             FROM {$table_comments} c\n            WHERE     c.id_post = p.id_post\n                  AND c.b_deleted = 0\n                  AND c.b_confirmed = 0\n                  AND c.id_user <> ?) as comments_count\n  FROM v_{$table} p\n WHERE EXISTS\n          (SELECT *\n             FROM {$table_comments} c\n            WHERE     c.id_post = p.id_post\n                  AND c.b_deleted = 0\n                  AND c.b_confirmed = 0\n                  AND c.id_user <> ?)";
         $posts = $this->getArray($query, array($adminId, $adminId));
         foreach ($posts as $post) {
             $result[] = '<li>' . $pp->postHref($post['id_post'], null, 'comments') . ' (' . $post['comments_count'] . ')</li>';
         }
     }
     return '<ul>' . implode('', $result) . '</ul>';
 }
开发者ID:ilivanoff,项目名称:www,代码行数:23,代码来源:AdminManager.php

示例3: buildLeaf

 /**
  * Метод строит html листочка на дереве дискуссии:
  * 
  * <li>
  * ....
  *    <ul>
  *       <li>
  *       ....
  *       </li>
  *    </ul>
  * </li>
  * 
  * @param DiscussionMsg $msg
  */
 public final function buildLeaf(DiscussionMsg $msg, $simple = false)
 {
     $msgId = $msg->getId();
     $author = $msg->getUser();
     $isDeleted = $msg->isDeleted();
     $isUserComment = $author->isAuthorised();
     $isCanConfirm = !$isUserComment && !$msg->isConfirmed() && !$isDeleted && AuthManager::isAuthorizedAsAdmin();
     $notKnown = !$msg->isKnown() && $msg->getUserTo() && $msg->getUserTo()->isIt(PsUser::instOrNull());
     $msgUnique = $msg->getUnique();
     $threadUnique = $this->SETTINGS->getThreadUnique($msg->getThreadId());
     //Мы открываем страницу для показа этого комментария
     $liId = RequestArrayAdapter::inst()->str(GET_PARAM_GOTO_MSG) === $msgUnique ? " id=\"{$msgUnique}\"" : '';
     //Классы li
     $liClasses = array('msg');
     if ($isDeleted) {
         $liClasses[] = 'deleted';
     }
     //Классы Comment
     $divClasses = array('comment', $msgUnique);
     if ($isUserComment) {
         $divClasses[] = 'user_comment';
     }
     if ($isCanConfirm) {
         $divClasses[] = 'not_confirmed';
     }
     //Данные для Comment
     $divData['unique'] = $msgUnique;
     //Имя пользователя
     $userName = $author->getName() . ($isUserComment ? ' (вы)' : '');
     //КНОПКИ УПРАВЛЕНИЯ СВЕРХУ
     $controlsTop = array();
     if (!$simple) {
         //Кнопки управления сверху
         $controlsTop[] = PsHtml::a(array('href' => '#'), '#');
         if (!$msg->isRoot()) {
             $controlsTop[] = PsHtml::a(array('href' => '#', 'class' => 'parent'), '↑');
         }
     }
     //Кнопки голосования
     if ($this->SETTINGS->isVotable()) {
         $userCanVote = AuthManager::isAuthorized() && !$isUserComment;
         $votes = VotesManager::inst()->getVotesCount($threadUnique, $msgId);
         $likeCtrl = array();
         if ($userCanVote) {
             $vote = VotesManager::inst()->getUserVotes($threadUnique, $msgId, AuthManager::getUserId());
             $likeCtrl[] = PsHtml::a(array('class' => 'like ' . ($vote > 0 ? 'active' : 'clickable')), '+1');
             $likeCtrl[] = PsHtml::a(array('class' => 'votes' . ($vote == 0 ? '' : ' clickable') . ($votes == 0 ? '' : ($votes > 0 ? ' green' : ' red'))), abs($votes));
             $likeCtrl[] = PsHtml::a(array('class' => 'dislike ' . ($vote < 0 ? 'active' : 'clickable')), '−1');
         } else {
             $likeCtrl[] = PsHtml::a(array('class' => 'votes' . ($votes == 0 ? '' : ($votes > 0 ? ' green' : ' red'))), abs($votes));
         }
         $controlsTop[] = PsHtml::span(array('class' => 'vote'), implode('', $likeCtrl));
     }
     $controlsTop = implode('', $controlsTop);
     //КНОПКИ УПРАВЛЕНИЯ СНИЗУ
     $controlsBottom = '';
     if (!$simple && !$isDeleted) {
         $controlsBottom = array();
         $controlsBottom['id'] = $msgId;
         if ($isCanConfirm) {
             $controlsBottom[SmartyFunctions::ACTION_CONFIRM] = 'Принять';
         }
         if (!$msg->isMaxDeepLevel()) {
             $controlsBottom[SmartyFunctions::ACTION_REPLY] = 'Ответить';
         }
         if ($isUserComment) {
             $controlsBottom[SmartyFunctions::ACTION_DELETE] = 'Удалить';
         } elseif (AuthManager::isAuthorizedAsAdmin()) {
             $controlsBottom[SmartyFunctions::ACTION_DELETE] = 'Удалить (админ)';
         }
         $controlsBottom = SmartyFunctions::psctrl($controlsBottom);
     }
     //Собираем параметры в кучу
     $params['msg'] = $msg;
     $params['new'] = $notKnown;
     $params['builder'] = $this;
     $params['liId'] = $liId;
     $params['liClasses'] = implode(' ', $liClasses);
     $params['divClasses'] = implode(' ', $divClasses);
     $params['divData'] = PsHtml::data2string($divData);
     $params['msgId'] = $msgId;
     $params['simple'] = $simple;
     $params['avatar'] = $author->getAvatarImg('42x', array('class' => 'small'));
     $params['userName'] = $userName;
     $params['controlsTop'] = $controlsTop;
     $params['controlsBottom'] = $controlsBottom;
//.........这里部分代码省略.........
开发者ID:ilivanoff,项目名称:www,代码行数:101,代码来源:DiscussionController.php

示例4: processRequest

 protected function processRequest(ArrayAdapter $params)
 {
     $smarty['discussion'] = FeedbackManager::inst()->buildDiscussion(false, AuthManager::getUserId(), true);
     return new IdentPageFilling($smarty);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:5,代码来源:userfeedback.php

示例5: delUserAnswer

 public function delUserAnswer($ansId)
 {
     $this->BEAN->delImgAnswer($ansId, $this->id, AuthManager::getUserId());
 }
开发者ID:ilivanoff,项目名称:www,代码行数:4,代码来源:MosaicImage.php

示例6: processRequest

 public function processRequest(ArrayAdapter $params)
 {
     $trees = CommentsNotifyManager::getInstance()->getUserPostCommentsInfo(AuthManager::getUserId());
     return new IdentPageFilling(array('trees' => $trees));
 }
开发者ID:ilivanoff,项目名称:www,代码行数:5,代码来源:usercomments.php

示例7: getUserUnreadedFeedbacksCount

 /**
  * Получает количество новых ответов на сообщения пользователя в рамках обратной связи
  */
 public function getUserUnreadedFeedbacksCount()
 {
     return $this->getUserUnknownMsgsCnt(AuthManager::getUserId(), AuthManager::getUserId());
 }
开发者ID:ilivanoff,项目名称:www,代码行数:7,代码来源:FeedbackManager.php

示例8: toggleUserPopup

 /**
  * Привязка popup-страницы к пользователю.
  * Метод должен работать максимально быстро - не будем проверять видимость страницы, просто проверим,
  * существует ли она.
  */
 public function toggleUserPopup($isAdd, $type, $ident)
 {
     $canBeVis = PopupVis::isCanBeVisible($this->getPagePopupVisibility($type, $ident));
     check_condition($canBeVis, "Незарегистрированный плагин с типом [{$type}] и идентификатором [{$ident}]");
     PopupBean::inst()->toggleUserPopup(AuthManager::getUserId(), $isAdd, $type, $ident);
 }
开发者ID:ilivanoff,项目名称:www,代码行数:11,代码来源:PopupPagesManager.php

示例9: backupMsg

 /**
  * Метод переносит содержимое сообщения в таблицу ps_discussion_backup перед его удалением.
  */
 private function backupMsg($msgId)
 {
     $themeCol = $this->themeColumn ? $this->themeColumn : 'null';
     $threadCol = $this->threadIdColumn ? $this->threadIdColumn : 'null';
     $this->update("INSERT INTO ps_discussion_backup\n(v_table, id_msg, id_parent, id_root, id_thread, id_user, id_user_to, id_user_delete, dt_event, dt_event_delete, n_deep, theme, content)\nSELECT ?, {$this->idColumn}, id_parent, id_root, {$threadCol}, id_user, id_user_to, ?, dt_event, unix_timestamp(), n_deep, {$themeCol}, content\n  FROM   {$this->table} WHERE  {$this->idColumn} = ?", array($this->table, AuthManager::getUserId(), $msgId));
 }
开发者ID:ilivanoff,项目名称:www,代码行数:9,代码来源:DiscussionBean.php

示例10: dropTestingResults

 public function dropTestingResults($idTestingRes)
 {
     TestingBean::inst()->dropTestingResults($idTestingRes, AuthManager::getUserId());
 }
开发者ID:ilivanoff,项目名称:www,代码行数:4,代码来源:TestingManager.php


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