Fix ```createCertificateBundle``` and ```getCertificates``` methods

from ```OC_Mount_config``` to use ```OC_User::getHome``` to get the
path
This commit is contained in:
Carlos Cerrillo 2013-12-17 10:13:14 +01:00
parent b245e2e3d8
commit c06844c374
1 changed files with 2 additions and 4 deletions

View File

@ -382,8 +382,7 @@ class OC_Mount_Config {
* @return array * @return array
*/ */
public static function getCertificates() { public static function getCertificates() {
$view = \OCP\Files::getStorage('files_external'); $path=OC_User::getHome(OC_User::getUser()) . '/files_external/uploads/';
$path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/';
\OCP\Util::writeLog('files_external', 'checking path '.$path, \OCP\Util::INFO); \OCP\Util::writeLog('files_external', 'checking path '.$path, \OCP\Util::INFO);
if ( ! is_dir($path)) { if ( ! is_dir($path)) {
//path might not exist (e.g. non-standard OC_User::getHome() value) //path might not exist (e.g. non-standard OC_User::getHome() value)
@ -405,8 +404,7 @@ class OC_Mount_Config {
* creates certificate bundle * creates certificate bundle
*/ */
public static function createCertificateBundle() { public static function createCertificateBundle() {
$view = \OCP\Files::getStorage("files_external"); $path=OC_User::getHome(OC_User::getUser()) . '/files_external';
$path = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("");
$certs = OC_Mount_Config::getCertificates(); $certs = OC_Mount_Config::getCertificates();
$fh_certs = fopen($path."/rootcerts.crt", 'w'); $fh_certs = fopen($path."/rootcerts.crt", 'w');