本文整理汇总了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;
}
示例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>';
}
示例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;
//.........这里部分代码省略.........
示例4: processRequest
protected function processRequest(ArrayAdapter $params)
{
$smarty['discussion'] = FeedbackManager::inst()->buildDiscussion(false, AuthManager::getUserId(), true);
return new IdentPageFilling($smarty);
}
示例5: delUserAnswer
public function delUserAnswer($ansId)
{
$this->BEAN->delImgAnswer($ansId, $this->id, AuthManager::getUserId());
}
示例6: processRequest
public function processRequest(ArrayAdapter $params)
{
$trees = CommentsNotifyManager::getInstance()->getUserPostCommentsInfo(AuthManager::getUserId());
return new IdentPageFilling(array('trees' => $trees));
}
示例7: getUserUnreadedFeedbacksCount
/**
* Получает количество новых ответов на сообщения пользователя в рамках обратной связи
*/
public function getUserUnreadedFeedbacksCount()
{
return $this->getUserUnknownMsgsCnt(AuthManager::getUserId(), AuthManager::getUserId());
}
示例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);
}
示例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));
}
示例10: dropTestingResults
public function dropTestingResults($idTestingRes)
{
TestingBean::inst()->dropTestingResults($idTestingRes, AuthManager::getUserId());
}