本文整理汇总了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;
}
}
示例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()));
}