當前位置: 首頁>>代碼示例>>PHP>>正文


PHP UserAccountModel::getIsSystemAdmin方法代碼示例

本文整理匯總了PHP中models\UserAccountModel::getIsSystemAdmin方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserAccountModel::getIsSystemAdmin方法的具體用法?PHP UserAccountModel::getIsSystemAdmin怎麽用?PHP UserAccountModel::getIsSystemAdmin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在models\UserAccountModel的用法示例。


在下文中一共展示了UserAccountModel::getIsSystemAdmin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: checkUserInTest1

 protected function checkUserInTest1(UserAccountModel $user)
 {
     $this->assertEquals("test", $user->getUsername());
     $this->assertEquals("test@jarofgreen.co.uk", $user->getEmail());
     $this->assertEquals(false, $user->checkPassword("1234"));
     $this->assertEquals(true, $user->checkPassword("password"));
     $this->assertEquals(false, $user->getIsEmailVerified());
     $this->assertEquals(false, $user->getIsSystemAdmin());
     $this->assertEquals(true, $user->getIsEditor());
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:10,代碼來源:UserCreateTest.php

示例2: array

 function __construct(ExtensionManager $extensionManager, $permissions, \models\UserAccountModel $userAccountModel = null, $removeEditorPermissions = false, $includeChildrenPermissions = false)
 {
     if ($userAccountModel) {
         $this->has_user = true;
         $this->has_user_editor = $userAccountModel->getIsEditor();
         $this->has_user_verified = $userAccountModel->getIsEmailVerified();
         $this->has_user_system_administrator = $userAccountModel->getIsSystemAdmin();
     }
     $this->removeEditorPermissions = $removeEditorPermissions;
     $this->permissions = array();
     // Add direct permissions, checking user stats as we do so.
     foreach ($permissions as $permission) {
         $this->addPermission($permission);
     }
     // now add children
     if ($includeChildrenPermissions) {
         $loopCount = 0;
         do {
             $loopCount++;
             $addedAny = false;
             foreach ($extensionManager->getExtensionsIncludingCore() as $extension) {
                 foreach ($extension->getUserPermissions() as $possibleChildID) {
                     $possibleChildPermission = $extension->getUserPermission($possibleChildID);
                     if (!$this->hasPermission($extension->getId(), $possibleChildID)) {
                         $addThisOne = false;
                         foreach ($possibleChildPermission->getParentPermissionsIDs() as $parentData) {
                             if (!$addThisOne && $this->hasPermission($parentData[0], $parentData[1])) {
                                 $addThisOne = true;
                             }
                         }
                         if ($addThisOne) {
                             $this->addPermission($possibleChildPermission);
                             $addedAny = true;
                         }
                     }
                 }
             }
         } while ($addedAny && $loopCount < 100);
     }
 }
開發者ID:radical-assembly,項目名稱:OpenACalendar-Web-Core,代碼行數:40,代碼來源:UserPermissionsList.php

示例3: edit

 public function edit(UserAccountModel $user)
 {
     global $DB;
     $stat = $DB->prepare("UPDATE user_account_information SET  is_editor=:is_editor, is_system_admin=:is_system_admin WHERE id =:id");
     $stat->execute(array('id' => $user->getId(), 'is_editor' => $user->getIsEditor() ? 1 : 0, 'is_system_admin' => $user->getIsSystemAdmin() ? 1 : 0));
 }
開發者ID:schlos,項目名稱:MeetYourNextMP-Web-Core,代碼行數:6,代碼來源:UserAccountRepository.php


注:本文中的models\UserAccountModel::getIsSystemAdmin方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。