public function testDeleteAppFromAllUsers() { $this->assertTrue(\OC_Preferences::deleteAppFromAllUsers('someapp')); $query = \OC_DB::prepare('SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `appid` = ?'); $result = $query->execute(array('someapp')); $this->assertEquals(0, count($result->fetchAll())); }
/** * set migration status and the init status back to '0' so that all new files get encrypted * if the app gets enabled again * @param array $params contains the app ID */ public static function preDisable($params) { if ($params['app'] === 'files_encryption') { \OC_Preferences::deleteAppFromAllUsers('files_encryption'); $session = new \OCA\Encryption\Session(new \OC\Files\View('/')); $session->setInitialized(\OCA\Encryption\Session::NOT_INITIALIZED); } }