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


PHP OC_Preferences::deleteApp方法代码示例

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


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

示例1: setPassword

 /**
  * @brief Set password
  * @param $uid The username
  * @param $password The new password
  * @param $recoveryPassword for the encryption app to reset encryption keys
  * @returns true/false
  *
  * Change the password of a user
  */
 public static function setPassword($uid, $password, $recoveryPassword = null)
 {
     $run = true;
     OC_Hook::emit("OC_User", "pre_setPassword", array("run" => &$run, "uid" => $uid, "password" => $password, "recoveryPassword" => $recoveryPassword));
     if ($run) {
         $success = false;
         foreach (self::$_usedBackends as $backend) {
             if ($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)) {
                 if ($backend->userExists($uid)) {
                     $success |= $backend->setPassword($uid, $password);
                 }
             }
         }
         // invalidate all login cookies
         OC_Preferences::deleteApp($uid, 'login_token');
         OC_Hook::emit("OC_User", "post_setPassword", array("uid" => $uid, "password" => $password, "recoveryPassword" => $recoveryPassword));
         return $success;
     } else {
         return false;
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:30,代码来源:user.php

示例2: testDeleteApp

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


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