当前位置: 首页>>代码示例>>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;未经允许,请勿转载。