本文整理汇总了PHP中PhabricatorUser::isUserActivated方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorUser::isUserActivated方法的具体用法?PHP PhabricatorUser::isUserActivated怎么用?PHP PhabricatorUser::isUserActivated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorUser
的用法示例。
在下文中一共展示了PhabricatorUser::isUserActivated方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildMainMenuItems
public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
{
$items = array();
if ($user->isLoggedIn() && $user->isUserActivated()) {
$selected = $controller instanceof PhabricatorSettingsMainController;
$item = id(new PHUIListItemView())->setName(pht('Settings'))->setIcon('settings-sm')->addClass('core-menu-item')->setSelected($selected)->setHref('/settings/')->setAural(pht('Settings'))->setOrder(400);
$items[] = $item;
}
return $items;
}
示例2: buildMainMenuItems
public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
{
$items = array();
if ($user->isLoggedIn() && $user->isUserActivated()) {
$create_id = celerity_generate_unique_node_id();
Javelin::initBehavior('aphlict-dropdown', array('bubbleID' => $create_id, 'dropdownID' => 'phabricator-quick-create-menu', 'local' => true, 'desktop' => true, 'right' => true));
$item = id(new PHUIListItemView())->setName(pht('Create New...'))->setIcon('new-sm')->addClass('core-menu-item')->setHref('/home/create/')->addSigil('quick-create-menu')->setID($create_id)->setAural(pht('Quick Create'))->setOrder(300);
$items[] = $item;
}
return $items;
}
示例3: buildMainMenuItems
public function buildMainMenuItems(PhabricatorUser $user, PhabricatorController $controller = null)
{
$items = array();
if ($user->isLoggedIn() && $user->isUserActivated()) {
$image = $user->loadProfileImageURI();
$item = id(new PHUIListItemView())->setName($user->getUsername())->setHref('/p/' . $user->getUsername() . '/')->addClass('core-menu-item')->setAural(pht('Profile'))->setOrder(100);
$classes = array('phabricator-core-menu-icon', 'phabricator-core-menu-profile-image');
$item->appendChild(phutil_tag('span', array('class' => implode(' ', $classes), 'style' => 'background-image: url(' . $image . ')'), ''));
$items[] = $item;
}
return $items;
}
示例4: buildUserInformationDictionary
protected function buildUserInformationDictionary(PhabricatorUser $user, $with_email = false, $with_availability = false)
{
$roles = array();
if ($user->getIsDisabled()) {
$roles[] = 'disabled';
}
if ($user->getIsSystemAgent()) {
$roles[] = 'agent';
}
if ($user->getIsMailingList()) {
$roles[] = 'list';
}
if ($user->getIsAdmin()) {
$roles[] = 'admin';
}
$primary = $user->loadPrimaryEmail();
if ($primary && $primary->getIsVerified()) {
$email = $primary->getAddress();
$roles[] = 'verified';
} else {
$email = null;
$roles[] = 'unverified';
}
if ($user->getIsApproved()) {
$roles[] = 'approved';
}
if ($user->isUserActivated()) {
$roles[] = 'activated';
}
$return = array('phid' => $user->getPHID(), 'userName' => $user->getUserName(), 'realName' => $user->getRealName(), 'image' => $user->getProfileImageURI(), 'uri' => PhabricatorEnv::getURI('/p/' . $user->getUsername() . '/'), 'roles' => $roles);
if ($with_email) {
$return['primaryEmail'] = $email;
}
if ($with_availability) {
// TODO: Modernize this once we have a more long-term view of what the
// data looks like.
$until = $user->getAwayUntil();
if ($until) {
$return['currentStatus'] = 'away';
$return['currentStatusUntil'] = $until;
}
}
return $return;
}
示例5: isExtensionEnabledForViewer
public function isExtensionEnabledForViewer(PhabricatorUser $viewer)
{
if (!$viewer->isLoggedIn()) {
return false;
}
if (!$viewer->isUserActivated()) {
return false;
}
// Don't show menus for users with partial sessions. This usually means
// they have logged in but have not made it through MFA, so we don't want
// to show notification counts, saved queries, etc.
if (!$viewer->hasSession()) {
return false;
}
if ($viewer->getSession()->getIsPartial()) {
return false;
}
return true;
}
示例6: validateAuthenticatedUser
private function validateAuthenticatedUser(ConduitAPIRequest $request, PhabricatorUser $user)
{
if (!$user->isUserActivated()) {
return array('ERR-USER-DISABLED', pht('User account is not activated.'));
}
$request->setUser($user);
return null;
}