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


PHP PFUser::getStatus方法代码示例

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


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

示例1: processReminder

 /**
  * Process admin notification while traversing the list of project the suspended user belong to.
  *
  * @param PFUser $user Suspended user after LDAP daily synchro.
  *
  * @return void
  */
 public function processReminder(PFUser $user)
 {
     $to = '';
     if ($user->getStatus() == 'S') {
         $adminsEmails = $this->ldapSyncMail->getNotificationRecipients($user);
         foreach ($adminsEmails as $projectName => $emailList) {
             $subject = $this->getSubject($projectName, $user);
             $body = $this->getBody($projectName, $user);
             $to = implode(";", $emailList);
             $this->ldapSyncMail->notifyProjectsAdmins($to, $projectName, $user, $subject, $body);
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:20,代码来源:LDAP_SyncReminderNotificationManager.class.php

示例2: isFinalStatus

 /**
  * Check user status validity
  *
  * @param PFUser $user
  * @param Boolean $allowpending
  * @return Boolean
  * @throws User_StatusDeletedException
  * @throws User_StatusSuspendedException
  */
 private function isFinalStatus(PFUser $user)
 {
     $status = $user->getStatus();
     switch ($status) {
         case PFUser::STATUS_ACTIVE:
         case PFUser::STATUS_RESTRICTED:
             return true;
             break;
         case PFUser::STATUS_DELETED:
             throw new User_StatusDeletedException();
         case PFUser::STATUS_SUSPENDED:
             throw new User_StatusSuspendedException();
         default:
             return false;
     }
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:25,代码来源:UserStatusManager.class.php

示例3: deleteSuspendedUser

 /**
  * Delete suspended user
  *
  * @param PFUser user
  *
  */
 private function deleteSuspendedUser(PFUser $user)
 {
     if ($user->getStatus() == 'S') {
         $user->setStatus('D');
         $deletionResult = $this->getUserManager()->updateDb($user);
         if (!$deletionResult) {
             $this->getBackendLogger()->error("[LDAP Clean Up] Error when deleting user " . $user->getUserName());
         } else {
             $directoryCleanUpDao = $this->getLDAPDirectoryCleanUpDao();
             $resetResult = $directoryCleanUpDao->resetForecastDeletionDate($user->getId());
             if (!$resetResult) {
                 $this->getBackendLogger()->warn("[LDAP Clean Up] Unable to reset forecast deletion date for user " . $user->getUserName());
             }
             $this->removeUserFromProjects($user);
             $this->getBackendLogger()->info("[LDAP Clean Up] user " . $user->getUserName() . "  have been deleted");
         }
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:24,代码来源:LDAP_CleanUpManager.class.php

示例4: hasAllowedStatus

 private function hasAllowedStatus(PFUser $user)
 {
     return in_array($user->getStatus(), $this->allowed_status);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:RecipientListBuilder.php

示例5: ldap_daily_synchro_update_user

 /**
  * @param PFUser user
  */
 public function ldap_daily_synchro_update_user(PFUser $user)
 {
     if ($user->getStatus() == PFUser::STATUS_SUSPENDED) {
         $factory = $this->getGerritServerFactory();
         $gerrit_servers = $factory->getServers();
         $gerritDriverFactory = new Git_Driver_Gerrit_GerritDriverFactory($this->getLogger());
         foreach ($gerrit_servers as $server) {
             $gerritDriver = $gerritDriverFactory->getDriver($server);
             $gerritDriver->setUserAccountInactive($server, $user);
         }
     }
 }
开发者ID:LouisRenWeiWei,项目名称:tuleap,代码行数:15,代码来源:gitPlugin.class.php

示例6: createAccount

 /**
  * Create new account
  *
  * @param PFUser $user
  *
  * @return PFUser
  */
 function createAccount($user)
 {
     $dao = $this->getDao();
     $user_id = $dao->create($user->getUserName(), $user->getEmail(), $user->getPassword(), $user->getRealName(), $user->getRegisterPurpose(), $user->getStatus(), $user->getShell(), $user->getUnixStatus(), $user->getUnixUid(), $user->getUnixBox(), $user->getLdapId(), $_SERVER['REQUEST_TIME'], $user->getConfirmHash(), $user->getMailSiteUpdates(), $user->getMailVA(), $user->getStickyLogin(), $user->getAuthorizedKeys(), $user->getNewMail(), $user->getTimeZone(), $user->getTheme(), $user->getLanguageID(), $user->getExpiryDate(), $_SERVER['REQUEST_TIME']);
     if (!$user_id) {
         $GLOBALS['Response']->addFeedback('error', $GLOBALS['Language']->getText('include_exit', 'error'));
         return 0;
     } else {
         $user->setId($user_id);
         $this->assignNextUnixUid($user);
         $em = $this->_getEventManager();
         $em->processEvent(Event::USER_MANAGER_CREATE_ACCOUNT, array('user' => $user));
         // Create the first layout for the user and add some initial widgets
         $lm = $this->_getWidgetLayoutManager();
         $lm->createDefaultLayoutForUser($user_id);
         switch ($user->getStatus()) {
             case PFUser::STATUS_PENDING:
                 if (ForgeConfig::get('sys_user_approval')) {
                     $this->pending_user_notifier->notifyAdministrator($user);
                 }
                 break;
             case PFUser::STATUS_ACTIVE:
             case PFUser::STATUS_RESTRICTED:
                 $em->processEvent('project_admin_activate_user', array('user_id' => $user_id));
                 break;
         }
         return $user;
     }
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:36,代码来源:UserManager.class.php

示例7: isValidUser

 /**
  * @return bool true if the user is considered valid (active or restricted)
  */
 private function isValidUser(PFUser $user)
 {
     return isset(self::$user_status[$user->getStatus()]);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:UGroupLiteralizer.class.php


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