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


PHP OC_Preferences::deleteUser方法代码示例

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


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

示例1: tearDown

 public function tearDown()
 {
     $userId = OCA_mozilla_sync\User::userHashToId($this->userHash);
     if ($userId != false) {
         OCA_mozilla_sync\User::deleteUser($userId);
     }
     OC_Preferences::deleteUser($this->userName);
     OC_User::deleteUser($this->userName);
 }
开发者ID:netcon-source,项目名称:apps,代码行数:9,代码来源:userservice.php

示例2: tearDown

 public function tearDown()
 {
     $this->user = null;
     if ($this->storageMock) {
         $this->storageMock->getCache()->clear();
         $this->storageMock = null;
     }
     \OC\Files\Filesystem::tearDown();
     \OC_User::setUserId('');
     \OC_User::deleteUser($this->user);
     \OC_Preferences::deleteUser($this->user);
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:12,代码来源:helperstorage.php

示例3: testHomeStorageWrapperWithQuota

 /**
  * Tests that the home storage is not wrapped when no quota exists.
  */
 function testHomeStorageWrapperWithQuota()
 {
     $user1 = uniqid();
     \OC_User::createUser($user1, 'test');
     OC_Preferences::setValue($user1, 'files', 'quota', '1024');
     \OC_User::setUserId($user1);
     \OC_Util::setupFS($user1);
     $userMount = \OC\Files\Filesystem::getMountManager()->find('/' . $user1 . '/');
     $this->assertNotNull($userMount);
     $this->assertTrue($userMount->getStorage()->instanceOfStorage('\\OC\\Files\\Storage\\Wrapper\\Quota'));
     // ensure that root wasn't wrapped
     $rootMount = \OC\Files\Filesystem::getMountManager()->find('/');
     $this->assertNotNull($rootMount);
     $this->assertNotInstanceOf('\\OC\\Files\\Storage\\Wrapper\\Quota', $rootMount->getStorage());
     // clean up
     \OC_User::setUserId('');
     \OC_User::deleteUser($user1);
     OC_Preferences::deleteUser($user1);
     \OC_Util::tearDownFS();
 }
开发者ID:olucao,项目名称:owncloud-core,代码行数:23,代码来源:util.php

示例4: deleteUser

 /**
  * @brief delete a user
  * @param $uid The username of the user to delete
  * @returns true/false
  *
  * Deletes a user
  */
 public static function deleteUser($uid)
 {
     $run = true;
     OC_Hook::emit("OC_User", "pre_deleteUser", array("run" => &$run, "uid" => $uid));
     if ($run) {
         //delete the user from all backends
         foreach (self::$_usedBackends as $backend) {
             $backend->deleteUser($uid);
         }
         if (self::userExists($uid)) {
             return false;
         }
         // We have to delete the user from all groups
         foreach (OC_Group::getUserGroups($uid) as $i) {
             OC_Group::removeFromGroup($uid, $i);
         }
         // Delete the user's keys in preferences
         OC_Preferences::deleteUser($uid);
         // Delete user files in /data/
         OC_Helper::rmdirr(OC_Config::getValue("datadirectory", OC::$SERVERROOT . "/data") . '/' . $uid . '/');
         // Emit and exit
         OC_Hook::emit("OC_User", "post_deleteUser", array("uid" => $uid));
         return true;
     } else {
         return false;
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:34,代码来源:user.php

示例5: deleteUser

 /**
  * @brief delete a user
  * @param $uid The username of the user to delete
  * @returns true/false
  *
  * Deletes a user
  */
 public static function deleteUser($uid)
 {
     $run = true;
     OC_Hook::emit("OC_User", "pre_deleteUser", array("run" => &$run, "uid" => $uid));
     if ($run) {
         //delete the user from all backends
         foreach (self::$_usedBackends as $backend) {
             if ($backend->implementsActions(OC_USER_BACKEND_DELETE_USER)) {
                 $backend->deleteUser($uid);
             }
         }
         // We have to delete the user from all groups
         foreach (OC_Group::getUserGroups($uid) as $i) {
             OC_Group::removeFromGroup($uid, $i);
         }
         // Delete the user's keys in preferences
         OC_Preferences::deleteUser($uid);
         // Emit and exit
         OC_Hook::emit("OC_User", "post_deleteUser", array("uid" => $uid));
         return true;
     } else {
         return false;
     }
 }
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:user.php

示例6: testDeleteUser

 public function testDeleteUser()
 {
     $this->assertTrue(\OC_Preferences::deleteUser('Deleteuser'));
     $query = \OC_DB::prepare('SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ?');
     $result = $query->execute(array('Deleteuser'));
     $this->assertEquals(0, count($result->fetchAll()));
 }
开发者ID:Combustible,项目名称:core,代码行数:7,代码来源:preferences-singleton.php

示例7: deleteUser

 /**
  * @brief delete a user
  * @param string $uid The username of the user to delete
  * @return bool
  *
  * Deletes a user
  */
 public static function deleteUser($uid)
 {
     $user = self::getManager()->get($uid);
     if ($user) {
         $result = $user->delete();
         // if delete was successful we clean-up the rest
         if ($result) {
             // We have to delete the user from all groups
             foreach (OC_Group::getUserGroups($uid) as $i) {
                 OC_Group::removeFromGroup($uid, $i);
             }
             // Delete the user's keys in preferences
             OC_Preferences::deleteUser($uid);
             // Delete user files in /data/
             $home = \OC_User::getHome($uid);
             OC_Helper::rmdirr($home);
             // Delete the users entry in the storage table
             \OC\Files\Cache\Storage::remove('home::' . $uid);
             \OC\Files\Cache\Storage::remove('local::' . $home . '/');
             // Remove it from the Cache
             self::getManager()->delete($uid);
         }
         return true;
     } else {
         return false;
     }
 }
开发者ID:hjimmy,项目名称:owncloud,代码行数:34,代码来源:user.php


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