diff options
author | Sam Tuke <samtuke@owncloud.com> | 2012-10-17 16:35:19 +0100 |
---|---|---|
committer | Sam Tuke <samtuke@owncloud.com> | 2012-10-17 16:35:19 +0100 |
commit | 265f3654af3a8abb96a74214e63cd65a0a40f150 (patch) | |
tree | d7d811d0f6251f3ae90ef3d247001d0badd9afc7 /lib | |
parent | 8b01286a5d14bae90607d5192c89b5f9d72d8bc2 (diff) | |
download | nextcloud-server-265f3654af3a8abb96a74214e63cd65a0a40f150.tar.gz nextcloud-server-265f3654af3a8abb96a74214e63cd65a0a40f150.zip |
all unit files_encryption crypt unit tests now passing after merge
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 6 | ||||
-rw-r--r-- | lib/ocs.php | 32 |
2 files changed, 22 insertions, 16 deletions
diff --git a/lib/base.php b/lib/base.php index 803d3e8bde5..3cec1449474 100644 --- a/lib/base.php +++ b/lib/base.php @@ -71,6 +71,11 @@ class OC{ * SPL autoload */ public static function autoload($className) { + + //trigger_error('seth', E_ERROR); + + //debug_print_backtrace(); + if(array_key_exists($className, OC::$CLASSPATH)) { $path = OC::$CLASSPATH[$className]; /** @TODO: Remove this when necessary @@ -106,6 +111,7 @@ class OC{ } public static function initPaths() { + // calculate the root directories OC::$SERVERROOT=str_replace("\\", '/', substr(__DIR__, 0, -4)); OC::$SUBURI= str_replace("\\", "/", substr(realpath($_SERVER["SCRIPT_FILENAME"]), strlen(OC::$SERVERROOT))); diff --git a/lib/ocs.php b/lib/ocs.php index 19fbe26d903..d04959c715d 100644 --- a/lib/ocs.php +++ b/lib/ocs.php @@ -681,8 +681,8 @@ class OC_OCS { */ private static function publicKeyGet($format, $file) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($keys = OCA_Encryption\Keymanager::getPublicKeys($file))) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($keys = OCA\Encryption\Keymanager::getPublicKeys($file))) { $xml=$keys; $txt=OC_OCS::generatexml($format, 'ok', 100, '', $xml, 'cloud', '', 1, 0, 0); echo($txt); @@ -703,8 +703,8 @@ class OC_OCS { */ private static function publicKeySet($format, $key) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (OCA_Encryption\Keymanager::setPublicKey($key)) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (OCA\Encryption\Keymanager::setPublicKey($key)) { echo self::generateXml('', 'ok', 100, ''); } else { echo self::generateXml('', 'fail', 404, 'could not add your public key to the key storage'); @@ -721,8 +721,8 @@ class OC_OCS { */ private static function privateKeyGet($format) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($key = OCA_Encryption\Keymanager::getPrivateKey())) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($key = OCA\Encryption\Keymanager::getPrivateKey())) { $xml=array(); $xml['key']=$key; $txt=OC_OCS::generatexml($format, 'ok', 100, '', $xml, 'cloud', '', 1, 0, 0); @@ -743,8 +743,8 @@ class OC_OCS { */ private static function privateKeySet($format, $key) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($key = OCA_Encryption\Keymanager::setPrivateKey($key))) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($key = OCA\Encryption\Keymanager::setPrivateKey($key))) { echo self::generateXml('', 'ok', 100, ''); } else { echo self::generateXml('', 'fail', 404, 'could not add your private key to the key storage'); @@ -761,8 +761,8 @@ class OC_OCS { */ private static function userKeysGet($format) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - $keys = OCA_Encryption\Keymanager::getUserKeys(); + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + $keys = OCA\Encryption\Keymanager::getUserKeys(); if ($keys['privatekey'] && $keys['publickey']) { $xml=array(); $xml['privatekey']=$keys['privatekey']; @@ -786,8 +786,8 @@ class OC_OCS { */ private static function userKeysSet($format, $privatekey, $publickey) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($key = OCA_Encryption\Keymanager::setUserKeys($privatekey, $publickey))) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($key = OCA\Encryption\Keymanager::setUserKeys($privatekey, $publickey))) { echo self::generateXml('', 'ok', 100, ''); } else { echo self::generateXml('', 'fail', 404, 'could not add your keys to the key storage'); @@ -805,8 +805,8 @@ class OC_OCS { */ private static function fileKeyGet($format, $file) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($key = OCA_Encryption\Keymanager::getFileKey($file))) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($key = OCA\Encryption\Keymanager::getFileKey($file))) { $xml=array(); $xml['key']=$key; $txt=OC_OCS::generatexml($format, 'ok', 100, '', $xml, 'cloud', '', 1, 0, 0); @@ -828,8 +828,8 @@ class OC_OCS { */ private static function fileKeySet($format, $file, $key) { $login=OC_OCS::checkpassword(); - if(OC_App::isEnabled('files_encryption') && OCA_Encryption\Crypt::mode() === 'client') { - if (($key = OCA_Encryption\Keymanager::setFileKey($file, $key))) { + if(OC_App::isEnabled('files_encryption') && OCA\Encryption\Crypt::mode() === 'client') { + if (($key = OCA\Encryption\Keymanager::setFileKey($file, $key))) { echo self::generateXml('', 'ok', 100, ''); } else { echo self::generateXml('', 'fail', 404, 'could not write key file'); |