get encryption mode from the settings

This commit is contained in:
Bjoern Schiessle 2012-07-31 16:52:21 +02:00
parent e4e6574e42
commit f6863f9e51
1 changed files with 11 additions and 5 deletions

View File

@ -32,13 +32,19 @@ class Crypt {
/**
* @brief return encryption mode client or server side encryption
* @param string user name
* @param string user name (use system wide setting if name=null)
* @return string 'client' or 'server'
*/
public static function mode($user) {
//TODO: allow user to set encryption mode and check the selection of the user
// for the moment I just return 'client' for test purposes
return 'client';
public static function mode($user=null) {
$mode = \OC_Appconfig::getValue('files_encryption', 'mode', 'unknown');
if ($mode == 'unknown') {
error_log('no encryption mode configured');
return false;
}
return $mode;
}
/**