diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-23 16:16:46 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-23 16:16:46 +0200 |
commit | 7424f3aef6ecdb1b62f4ab4ff0d23ade9011ad77 (patch) | |
tree | e9cf72f3d6813d564baa9c286d0461afd0a27b34 /lib | |
parent | 707bd68bb4e77b4184b578699d508750653e2d42 (diff) | |
parent | ab944094e2c0c9d063cc363a81dbe517c259a466 (diff) | |
download | nextcloud-server-7424f3aef6ecdb1b62f4ab4ff0d23ade9011ad77.tar.gz nextcloud-server-7424f3aef6ecdb1b62f4ab4ff0d23ade9011ad77.zip |
merge master into filesystem
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connector/sabre/auth.php | 2 | ||||
-rw-r--r-- | lib/fileproxy/quota.php | 54 | ||||
-rw-r--r-- | lib/files/storage/common.php | 48 | ||||
-rw-r--r-- | lib/files/storage/storage.php | 2 | ||||
-rw-r--r-- | lib/helper.php | 4 | ||||
-rw-r--r-- | lib/installer.php | 4 | ||||
-rw-r--r-- | lib/json.php | 2 | ||||
-rw-r--r-- | lib/l10n.php | 15 | ||||
-rw-r--r-- | lib/l10n/id.php | 28 | ||||
-rw-r--r-- | lib/l10n/ka_GE.php | 13 | ||||
-rw-r--r-- | lib/l10n/lt_LT.php | 9 | ||||
-rw-r--r-- | lib/l10n/si_LK.php | 28 | ||||
-rw-r--r-- | lib/l10n/sl.php | 18 | ||||
-rw-r--r-- | lib/migrate.php | 2 | ||||
-rw-r--r-- | lib/search/provider/file.php | 11 | ||||
-rw-r--r-- | lib/template.php | 4 | ||||
-rwxr-xr-x | lib/util.php | 14 |
17 files changed, 180 insertions, 78 deletions
diff --git a/lib/connector/sabre/auth.php b/lib/connector/sabre/auth.php index 0c34c7ea29f..db8f005745a 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/connector/sabre/auth.php @@ -37,7 +37,7 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { } else { OC_Util::setUpFS();//login hooks may need early access to the filesystem if(OC_User::login($username, $password)) { - OC_Util::setUpFS($username); + OC_Util::setUpFS(OC_User::getUser()); return true; } else{ diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php index bc5ef9c8df4..d120f309998 100644 --- a/lib/fileproxy/quota.php +++ b/lib/fileproxy/quota.php @@ -27,52 +27,58 @@ class OC_FileProxy_Quota extends OC_FileProxy{ static $rootView; - private $userQuota=-1; + private $userQuota=array(); /** - * get the quota for the current user + * get the quota for the user + * @param user * @return int */ - private function getQuota() { - if($this->userQuota!=-1) { - return $this->userQuota; + private function getQuota($user) { + if(in_array($user, $this->userQuota)) { + return $this->userQuota[$user]; } - $userQuota=OC_Preferences::getValue(OC_User::getUser(),'files','quota','default'); + $userQuota=OC_Preferences::getValue($user,'files','quota','default'); if($userQuota=='default') { $userQuota=OC_AppConfig::getValue('files','default_quota','none'); } if($userQuota=='none') { - $this->userQuota=0; + $this->userQuota[$user]=0; }else{ - $this->userQuota=OC_Helper::computerFileSize($userQuota); + $this->userQuota[$user]=OC_Helper::computerFileSize($userQuota); } - return $this->userQuota; + return $this->userQuota[$user]; } /** - * get the free space in the users home folder + * get the free space in the path's owner home folder + * @param path * @return int */ - private function getFreeSpace() { - $rootInfo=OC_FileCache_Cached::get(''); + private function getFreeSpace($path) { + $storage=OC_Filesystem::getStorage($path); + $owner=$storage->getOwner($path); + + $totalSpace=$this->getQuota($owner); + if($totalSpace==0) { + return 0; + } + + $rootInfo=OC_FileCache::get('', "/".$owner."/files"); // TODO Remove after merge of share_api - if (OC_FileCache::inCache('/Shared')) { - $sharedInfo=OC_FileCache_Cached::get('/Shared'); + if (OC_FileCache::inCache('/Shared', "/".$owner."/files")) { + $sharedInfo=OC_FileCache::get('/Shared', "/".$owner."/files"); } else { $sharedInfo = null; } $usedSpace=isset($rootInfo['size'])?$rootInfo['size']:0; $usedSpace=isset($sharedInfo['size'])?$usedSpace-$sharedInfo['size']:$usedSpace; - $totalSpace=$this->getQuota(); - if($totalSpace==0) { - return 0; - } return $totalSpace-$usedSpace; } - + public function postFree_space($path,$space) { - $free=$this->getFreeSpace(); + $free=$this->getFreeSpace($path); if($free==0) { return $space; } @@ -83,21 +89,21 @@ class OC_FileProxy_Quota extends OC_FileProxy{ if (is_resource($data)) { $data = '';//TODO: find a way to get the length of the stream without emptying it } - return (strlen($data)<$this->getFreeSpace() or $this->getFreeSpace()==0); + return (strlen($data)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } public function preCopy($path1,$path2) { if(!self::$rootView){ self::$rootView = new \OC\Files\View(''); } - return (self::$rootView->filesize($path1)<$this->getFreeSpace() or $this->getFreeSpace()==0); + return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==0); } public function preFromTmpFile($tmpfile,$path) { - return (filesize($tmpfile)<$this->getFreeSpace() or $this->getFreeSpace()==0); + return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } public function preFromUploadedFile($tmpfile,$path) { - return (filesize($tmpfile)<$this->getFreeSpace() or $this->getFreeSpace()==0); + return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0); } } diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index de02c0d5d81..1694563d49e 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -23,18 +23,18 @@ namespace OC\Files\Storage; abstract class Common implements \OC\Files\Storage\Storage { public function __construct($parameters) {} -// abstract public function getId(); -// abstract public function mkdir($path); -// abstract public function rmdir($path); -// abstract public function opendir($path); + abstract public function getId(); + abstract public function mkdir($path); + abstract public function rmdir($path); + abstract public function opendir($path); public function is_dir($path) { return $this->filetype($path)=='dir'; } public function is_file($path) { return $this->filetype($path)=='file'; } -// abstract public function stat($path); -// abstract public function filetype($path); + abstract public function stat($path); + abstract public function filetype($path); public function filesize($path) { if($this->is_dir($path)) { return 0;//by definition @@ -46,8 +46,8 @@ abstract class Common implements \OC\Files\Storage\Storage { public function isCreatable($path) { return $this->isUpdatable($path); } -// abstract public function isReadable($path); -// abstract public function isUpdatable($path); + abstract public function isReadable($path); + abstract public function isUpdatable($path); public function isDeletable($path) { return $this->isUpdatable($path); } @@ -73,7 +73,7 @@ abstract class Common implements \OC\Files\Storage\Storage { } return $permissions; } -// abstract public function file_exists($path); + abstract public function file_exists($path); public function filemtime($path) { $stat = $this->stat($path); return $stat['mtime']; @@ -97,7 +97,7 @@ abstract class Common implements \OC\Files\Storage\Storage { $handle = $this->fopen($path, "w"); return fwrite($handle, $data); } -// abstract public function unlink($path); + abstract public function unlink($path); public function rename($path1,$path2) { if($this->copy($path1,$path2)) { return $this->unlink($path1); @@ -111,13 +111,13 @@ abstract class Common implements \OC\Files\Storage\Storage { $count=\OC_Helper::streamCopy($source,$target); return $count>0; } -// abstract public function fopen($path,$mode); + abstract public function fopen($path,$mode); /** * @brief Deletes all files and folders recursively within a directory - * @param $directory The directory whose contents will be deleted - * @param $empty Flag indicating whether directory will be emptied - * @returns true/false + * @param string $directory The directory whose contents will be deleted + * @param bool $empty Flag indicating whether directory will be emptied + * @returns bool * * @note By default the directory specified by $directory will be * deleted together with its contents. To avoid this set $empty to true @@ -127,7 +127,7 @@ abstract class Common implements \OC\Files\Storage\Storage { if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) { return false; - } elseif( !$this->is_readable( \OCP\USER::getUser() . '/' . $directory ) ) { + } elseif( !$this->isReadable( \OCP\USER::getUser() . '/' . $directory ) ) { return false; } else { $directoryHandle = $this->opendir( \OCP\USER::getUser() . '/' . $directory ); @@ -135,7 +135,7 @@ abstract class Common implements \OC\Files\Storage\Storage { if ( $contents != '.' && $contents != '..') { $path = $directory . "/" . $contents; if ( $this->is_dir( $path ) ) { - deleteAll( $path ); + $this->deleteAll( $path ); } else { $this->unlink( \OCP\USER::getUser() .'/' . $path ); // TODO: make unlink use same system path as is_dir } @@ -180,14 +180,14 @@ abstract class Common implements \OC\Files\Storage\Storage { unlink($tmpFile); return $hash; } -// abstract public function free_space($path); + abstract public function free_space($path); public function search($query) { return $this->searchInDir($query); } public function getLocalFile($path) { return $this->toTmpFile($path); } - private function toTmpFile($path) {//no longer in the storage api, still usefull here + private function toTmpFile($path) {//no longer in the storage api, still useful here $source=$this->fopen($path,'r'); if(!$source) { return false; @@ -222,7 +222,7 @@ abstract class Common implements \OC\Files\Storage\Storage { } } } -// abstract public function touch($path, $mtime=null); + abstract public function touch($path, $mtime=null); protected function searchInDir($query,$dir='') { $files=array(); @@ -243,6 +243,7 @@ abstract class Common implements \OC\Files\Storage\Storage { /** * check if a file or folder has been updated since $time + * @param string $path * @param int $time * @return bool */ @@ -257,4 +258,13 @@ abstract class Common implements \OC\Files\Storage\Storage { public function getScanner(){ return new \OC\Files\Cache\Scanner($this); } + + /** + * get the owner of a path + * @param string $path The path to get the owner + * @return string uid or false + */ + public function getOwner($path) { + return \OC_User::getUser(); + } } diff --git a/lib/files/storage/storage.php b/lib/files/storage/storage.php index 853e8ba5198..1f5c9356294 100644 --- a/lib/files/storage/storage.php +++ b/lib/files/storage/storage.php @@ -61,4 +61,6 @@ interface Storage{ * @return \OC\Files\Cache\Scanner */ public function getScanner(); + + public function getOwner($path); } diff --git a/lib/helper.php b/lib/helper.php index 55db1c73e1c..1951a742a21 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -350,8 +350,8 @@ class OC_Helper { if(strpos($path,'.')) { //try to guess the type by the file extension - if(!self::$mimetypes || self::$mimetypes != include('mimetypes.list.php')) { - self::$mimetypes=include('mimetypes.list.php'); + if(!self::$mimetypes || self::$mimetypes != include 'mimetypes.list.php') { + self::$mimetypes=include 'mimetypes.list.php'; } $extension=strtolower(strrchr(basename($path), ".")); $extension=substr($extension,1);//remove leading . diff --git a/lib/installer.php b/lib/installer.php index 9135c60fc05..56e474bb3b3 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -187,7 +187,7 @@ class OC_Installer{ //run appinfo/install.php if((!isset($data['noinstall']) or $data['noinstall']==false) and file_exists($basedir.'/appinfo/install.php')) { - include($basedir.'/appinfo/install.php'); + include $basedir.'/appinfo/install.php'; } //set the installed version @@ -320,7 +320,7 @@ class OC_Installer{ //run appinfo/install.php if(is_file(OC_App::getAppPath($app)."/appinfo/install.php")) { - include(OC_App::getAppPath($app)."/appinfo/install.php"); + include OC_App::getAppPath($app)."/appinfo/install.php"; } $info=OC_App::getAppInfo($app); OC_Appconfig::setValue($app,'installed_version',OC_App::getAppVersion($app)); diff --git a/lib/json.php b/lib/json.php index cc504907261..cc6cee6caff 100644 --- a/lib/json.php +++ b/lib/json.php @@ -83,7 +83,7 @@ class OC_JSON{ * Check if the user verified the login with his password */ public static function verifyUser() { - if(OC_Config::getValue('enhancedauth', true) === true) { + if(OC_Config::getValue('enhancedauth', false) === true) { if(!isset($_SESSION['verifiedLogin']) OR $_SESSION['verifiedLogin'] < time()) { $l = OC_L10N::get('lib'); self::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); diff --git a/lib/l10n.php b/lib/l10n.php index 26611537175..41c89a7d4b5 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -58,9 +58,11 @@ class OC_L10N{ * Localization */ private $localizations = array( + 'jsdate' => 'dd.mm.yy', 'date' => '%d.%m.%Y', 'datetime' => '%d.%m.%Y %H:%M:%S', - 'time' => '%H:%M:%S'); + 'time' => '%H:%M:%S', + 'firstday' => 0); /** * get an L10N instance @@ -118,7 +120,7 @@ class OC_L10N{ OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/lib/l10n/') || OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/settings')) && file_exists($i18ndir.$lang.'.php')) { // Include the file, save the data from $CONFIG - include(strip_tags($i18ndir).strip_tags($lang).'.php'); + include strip_tags($i18ndir).strip_tags($lang).'.php'; if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)) { $this->translations = $TRANSLATIONS; } @@ -126,7 +128,7 @@ class OC_L10N{ if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')) { // Include the file, save the data from $CONFIG - include(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php'); + include OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php'; if(isset($LOCALIZATIONS) && is_array($LOCALIZATIONS)) { $this->localizations = array_merge($this->localizations, $LOCALIZATIONS); } @@ -217,10 +219,15 @@ class OC_L10N{ if($data instanceof DateTime) return $data->format($this->localizations[$type]); elseif(is_string($data)) $data = strtotime($data); $locales = array(self::findLanguage()); - if (strlen($locales[0]) == 2) $locales[] = $language.'_'.strtoupper($language); + if (strlen($locales[0]) == 2) { + $locales[] = $locales[0].'_'.strtoupper($locales[0]); + } setlocale(LC_TIME, $locales); return strftime($this->localizations[$type], $data); break; + case 'firstday': + case 'jsdate': + return $this->localizations[$type]; default: return false; } diff --git a/lib/l10n/id.php b/lib/l10n/id.php new file mode 100644 index 00000000000..3f9bc4ee6ba --- /dev/null +++ b/lib/l10n/id.php @@ -0,0 +1,28 @@ +<?php $TRANSLATIONS = array( +"Help" => "bantu", +"Personal" => "perseorangan", +"Settings" => "pengaturan", +"Users" => "pengguna", +"Apps" => "aplikasi", +"Admin" => "admin", +"ZIP download is turned off." => "download ZIP sedang dimatikan", +"Files need to be downloaded one by one." => "file harus di unduh satu persatu", +"Back to Files" => "kembali ke daftar file", +"Selected files too large to generate zip file." => "file yang dipilih terlalu besar untuk membuat file zip", +"Application is not enabled" => "aplikasi tidak diaktifkan", +"Authentication error" => "autentikasi bermasalah", +"Token expired. Please reload page." => "token kadaluarsa.mohon perbaharui laman.", +"seconds ago" => "beberapa detik yang lalu", +"1 minute ago" => "1 menit lalu", +"%d minutes ago" => "%d menit lalu", +"today" => "hari ini", +"yesterday" => "kemarin", +"%d days ago" => "%d hari lalu", +"last month" => "bulan kemarin", +"months ago" => "beberapa bulan lalu", +"last year" => "tahun kemarin", +"years ago" => "beberapa tahun lalu", +"%s is available. Get <a href=\"%s\">more information</a>" => "%s tersedia. dapatkan <a href=\"%s\"> info lebih lanjut</a>", +"up to date" => "terbaru", +"updates check is disabled" => "pengecekan pembaharuan sedang non-aktifkan" +); diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php new file mode 100644 index 00000000000..9820ce68599 --- /dev/null +++ b/lib/l10n/ka_GE.php @@ -0,0 +1,13 @@ +<?php $TRANSLATIONS = array( +"Help" => "დახმარება", +"Personal" => "პირადი", +"Settings" => "პარამეტრები", +"Users" => "მომხმარებელი", +"Apps" => "აპლიკაციები", +"Admin" => "ადმინისტრატორი", +"months ago" => "თვის წინ", +"last year" => "ბოლო წელს", +"years ago" => "წლის წინ", +"up to date" => "განახლებულია", +"updates check is disabled" => "განახლების ძებნა გათიშულია" +); diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php index c6702a62287..a20daf4cb5b 100644 --- a/lib/l10n/lt_LT.php +++ b/lib/l10n/lt_LT.php @@ -11,11 +11,18 @@ "Selected files too large to generate zip file." => "Pasirinkti failai per dideli archyvavimui į ZIP.", "Application is not enabled" => "Programa neįjungta", "Authentication error" => "Autentikacijos klaida", +"Token expired. Please reload page." => "Sesija baigėsi. Prašome perkrauti puslapį.", +"seconds ago" => "prieš kelias sekundes", "1 minute ago" => "prieš 1 minutę", "%d minutes ago" => "prieš %d minučių", "today" => "šiandien", "yesterday" => "vakar", "%d days ago" => "prieš %d dienų", "last month" => "praėjusį mėnesį", -"last year" => "pereitais metais" +"months ago" => "prieš mėnesį", +"last year" => "pereitais metais", +"years ago" => "prieš metus", +"%s is available. Get <a href=\"%s\">more information</a>" => "%s yra galimas. Platesnė <a href=\"%s\">informacija čia</a>", +"up to date" => "pilnai atnaujinta", +"updates check is disabled" => "atnaujinimų tikrinimas išjungtas" ); diff --git a/lib/l10n/si_LK.php b/lib/l10n/si_LK.php new file mode 100644 index 00000000000..e5728050ce1 --- /dev/null +++ b/lib/l10n/si_LK.php @@ -0,0 +1,28 @@ +<?php $TRANSLATIONS = array( +"Help" => "උදව්", +"Personal" => "පෞද්ගලික", +"Settings" => "සිටුවම්", +"Users" => "පරිශීලකයන්", +"Apps" => "යෙදුම්", +"Admin" => "පරිපාලක", +"ZIP download is turned off." => "ZIP භාගත කිරීම් අක්රියයි", +"Files need to be downloaded one by one." => "ගොනු එකින් එක භාගත යුතුයි", +"Back to Files" => "ගොනු වෙතට නැවත යන්න", +"Selected files too large to generate zip file." => "තෝරාගත් ගොනු ZIP ගොනුවක් තැනීමට විශාල වැඩිය.", +"Application is not enabled" => "යෙදුම සක්රිය කර නොමැත", +"Authentication error" => "සත්යාපනය කිරීමේ දෝශයක්", +"Token expired. Please reload page." => "ටෝකනය කල් ඉකුත් වී ඇත. පිටුව නැවුම් කරන්න", +"seconds ago" => "තත්පරයන්ට පෙර", +"1 minute ago" => "1 මිනිත්තුවකට පෙර", +"%d minutes ago" => "%d මිනිත්තුවන්ට පෙර", +"today" => "අද", +"yesterday" => "ඊයේ", +"%d days ago" => "%d දිනකට පෙර", +"last month" => "පෙර මාසයේ", +"months ago" => "මාස කීපයකට පෙර", +"last year" => "පෙර අවුරුද්දේ", +"years ago" => "අවුරුදු කීපයකට පෙර", +"%s is available. Get <a href=\"%s\">more information</a>" => "%s යොදාගත හැක. <a href=\"%s\">තව විස්තර</a> ලබාගන්න", +"up to date" => "යාවත්කාලීනයි", +"updates check is disabled" => "යාවත්කාලීන බව පරීක්ෂණය අක්රියයි" +); diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php index eac839e78f3..87fd0fb027d 100644 --- a/lib/l10n/sl.php +++ b/lib/l10n/sl.php @@ -3,15 +3,15 @@ "Personal" => "Osebno", "Settings" => "Nastavitve", "Users" => "Uporabniki", -"Apps" => "Aplikacije", -"Admin" => "Skrbnik", -"ZIP download is turned off." => "ZIP prenos je onemogočen.", -"Files need to be downloaded one by one." => "Datoteke morajo biti prenešene posamezno.", +"Apps" => "Programi", +"Admin" => "Skrbništvo", +"ZIP download is turned off." => "Prejem datotek ZIP je onemogočen.", +"Files need to be downloaded one by one." => "Datoteke je mogoče prejeti le posamič.", "Back to Files" => "Nazaj na datoteke", -"Selected files too large to generate zip file." => "Izbrane datoteke so prevelike, da bi lahko ustvarili zip datoteko.", -"Application is not enabled" => "Aplikacija ni omogočena", +"Selected files too large to generate zip file." => "Izbrane datoteke so prevelike za ustvarjanje datoteke arhiva zip.", +"Application is not enabled" => "Program ni omogočen", "Authentication error" => "Napaka overitve", -"Token expired. Please reload page." => "Žeton je potekel. Prosimo, če spletno stran znova naložite.", +"Token expired. Please reload page." => "Žeton je potekel. Spletišče je traba znova naložiti.", "seconds ago" => "pred nekaj sekundami", "1 minute ago" => "pred minuto", "%d minutes ago" => "pred %d minutami", @@ -22,7 +22,7 @@ "months ago" => "pred nekaj meseci", "last year" => "lani", "years ago" => "pred nekaj leti", -"%s is available. Get <a href=\"%s\">more information</a>" => "%s je na voljo. <a href=\"%s\">Več informacij.</a>", -"up to date" => "ažuren", +"%s is available. Get <a href=\"%s\">more information</a>" => "%s je na voljo. <a href=\"%s\">Več podrobnosti.</a>", +"up to date" => "posodobljeno", "updates check is disabled" => "preverjanje za posodobitve je onemogočeno" ); diff --git a/lib/migrate.php b/lib/migrate.php index 611a935ee5d..3694ea877a0 100644 --- a/lib/migrate.php +++ b/lib/migrate.php @@ -66,7 +66,7 @@ class OC_Migrate{ foreach($apps as $app) { $path = OC_App::getAppPath($app) . '/appinfo/migrate.php'; if( file_exists( $path ) ) { - include( $path ); + include $path; } } } diff --git a/lib/search/provider/file.php b/lib/search/provider/file.php index 24832296c59..8d0843ce2d2 100644 --- a/lib/search/provider/file.php +++ b/lib/search/provider/file.php @@ -4,6 +4,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ function search($query) { $files=OC_FileCache::search($query,true); $results=array(); + $l=OC_L10N::get('lib'); foreach($files as $fileData) { $path = $fileData['path']; $mime = $fileData['mimetype']; @@ -13,7 +14,7 @@ class OC_Search_Provider_File extends OC_Search_Provider{ $skip = false; if($mime=='httpd/unix-directory') { $link = OC_Helper::linkTo( 'files', 'index.php', array('dir' => $path)); - $type = 'Files'; + $type = (string)$l->t('Files'); }else{ $link = OC_Helper::linkTo( 'files', 'download.php', array('file' => $path)); $mimeBase = $fileData['mimepart']; @@ -22,16 +23,16 @@ class OC_Search_Provider_File extends OC_Search_Provider{ $skip = true; break; case 'text': - $type = 'Text'; + $type = (string)$l->t('Text'); break; case 'image': - $type = 'Images'; + $type = (string)$l->t('Images'); break; default: if($mime=='application/xml') { - $type = 'Text'; + $type = (string)$l->t('Text'); }else{ - $type = 'Files'; + $type = (string)$l->t('Files'); } } } diff --git a/lib/template.php b/lib/template.php index 1c529932a30..972d75807c7 100644 --- a/lib/template.php +++ b/lib/template.php @@ -405,7 +405,7 @@ class OC_Template{ // Execute the template ob_start(); - include( $this->template ); // <-- we have to use include because we pass $_! + include $this->template; // <-- we have to use include because we pass $_! $data = ob_get_contents(); @ob_end_clean(); @@ -430,7 +430,7 @@ class OC_Template{ // Include ob_start(); - include( $this->path.$file.'.php' ); + include $this->path.$file.'.php'; $data = ob_get_contents(); @ob_end_clean(); diff --git a/lib/util.php b/lib/util.php index 5335efb11c7..100a1a447c2 100755 --- a/lib/util.php +++ b/lib/util.php @@ -47,7 +47,8 @@ class OC_Util { } //jail the user into his "home" directory \OC\Files\Filesystem::mount('\OC\Files\Storage\Local', array('datadir' => $user_root), $user); - \OC\Files\Filesystem::init($user_dir); + \OC\Files\Filesystem::init($user_dir, $user); + $quotaProxy=new OC_FileProxy_Quota(); $fileOperationProxy = new OC_FileProxy_FileOperations(); OC_FileProxy::register($quotaProxy); @@ -69,17 +70,16 @@ class OC_Util { $user_root = OC_User::getHome($user); $userdirectory = $user_root . '/files'; if (is_file($user_root.'/mount.php')) { - $mountConfig = include($user_root.'/mount.php'); + $mountConfig = include $user_root.'/mount.php'; if (isset($mountConfig['user'][$user])) { foreach ($mountConfig['user'][$user] as $mountPoint => $options) { - OC_Filesystem::mount($options['class'], $options['options'], $mountPoint); + \OC\Files\Filesystem::mount($options['class'], $options['options'], $mountPoint); } } $mtime=filemtime($user_root.'/mount.php'); $previousMTime=OC_Preferences::getValue($user,'files','mountconfigmtime',0); if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated - OC_FileCache::triggerUpdate($user); OC_Preferences::setValue($user,'files','mountconfigmtime',$mtime); } } @@ -399,7 +399,7 @@ class OC_Util { * If not, the user will be shown a password verification page */ public static function verifyUser() { - if(OC_Config::getValue('enhancedauth', true) === true) { + if(OC_Config::getValue('enhancedauth', false) === true) { // Check password to set session if(isset($_POST['password'])) { if (OC_User::login(OC_User::getUser(), $_POST["password"] ) === true) { @@ -420,12 +420,12 @@ class OC_Util { * @return bool */ public static function isUserVerified() { - if(OC_Config::getValue('enhancedauth', true) === true) { + if(OC_Config::getValue('enhancedauth', false) === true) { if(!isset($_SESSION['verifiedLogin']) OR $_SESSION['verifiedLogin'] < time()) { return false; } - return true; } + return true; } /** |