diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-28 09:57:24 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-28 09:57:24 +0100 |
commit | 1d44a99ebb5f00b3b9550f4c281db7519cec3c75 (patch) | |
tree | 43a6ab3a67421bbf6589f757a97088eb16dff08b /lib | |
parent | dbc13cf6ee775745c86f92d97d636f9ed3cf5432 (diff) | |
parent | 31d83fddc482959d7fb4f7377cc7020c59c30951 (diff) | |
download | nextcloud-server-1d44a99ebb5f00b3b9550f4c281db7519cec3c75.tar.gz nextcloud-server-1d44a99ebb5f00b3b9550f4c281db7519cec3c75.zip |
Merge branch 'master' into updater-CSP
Conflicts:
core/templates/update.php
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 9 | ||||
-rw-r--r-- | lib/helper.php | 19 | ||||
-rw-r--r-- | lib/l10n/fa.php | 1 | ||||
-rw-r--r-- | lib/l10n/hu_HU.php | 4 | ||||
-rw-r--r-- | lib/l10n/lb.php | 6 | ||||
-rw-r--r-- | lib/l10n/ro.php | 1 | ||||
-rw-r--r-- | lib/template.php | 1 | ||||
-rw-r--r-- | lib/templatelayout.php | 5 |
8 files changed, 36 insertions, 10 deletions
diff --git a/lib/base.php b/lib/base.php index 402a8af4211..f9818d3514e 100644 --- a/lib/base.php +++ b/lib/base.php @@ -96,7 +96,14 @@ class OC } elseif (strpos($className, 'OCP\\') === 0) { $path = 'public/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); } elseif (strpos($className, 'OCA\\') === 0) { - $path = 'apps/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); + foreach(self::$APPSROOTS as $appDir) { + $path = $appDir['path'] . '/' . strtolower(str_replace('\\', '/', substr($className, 3)) . '.php'); + $fullPath = stream_resolve_include_path($path); + if (file_exists($fullPath)) { + require_once $fullPath; + return false; + } + } } elseif (strpos($className, 'Sabre_') === 0) { $path = str_replace('_', '/', $className) . '.php'; } elseif (strpos($className, 'Symfony\\Component\\Routing\\') === 0) { diff --git a/lib/helper.php b/lib/helper.php index a7b2a429952..d2c6b1695bd 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -785,4 +785,23 @@ class OC_Helper { } return true; } + + /** + * Calculate the disc space + */ + public static function getStorageInfo() { + $rootInfo = OC_FileCache::get(''); + $used = $rootInfo['size']; + if ($used < 0) { + $used = 0; + } + $free = OC_Filesystem::free_space(); + $total = $free + $used; + if ($total == 0) { + $total = 1; // prevent division by zero + } + $relative = round(($used / $total) * 10000) / 100; + + return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative); + } } diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php index ce7c7c6e970..8cbdcb03b3b 100644 --- a/lib/l10n/fa.php +++ b/lib/l10n/fa.php @@ -10,6 +10,7 @@ "seconds ago" => "ثانیهها پیش", "1 minute ago" => "1 دقیقه پیش", "%d minutes ago" => "%d دقیقه پیش", +"1 hour ago" => "1 ساعت پیش", "today" => "امروز", "yesterday" => "دیروز", "last month" => "ماه قبل", diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php index c95358011f0..e25de3e1ed6 100644 --- a/lib/l10n/hu_HU.php +++ b/lib/l10n/hu_HU.php @@ -5,11 +5,11 @@ "Users" => "Felhasználók", "Apps" => "Alkalmazások", "Admin" => "Admin", -"ZIP download is turned off." => "A ZIP-letöltés nem engedélyezett.", +"ZIP download is turned off." => "A ZIP-letöltés nincs engedélyezve.", "Files need to be downloaded one by one." => "A fájlokat egyenként kell letölteni", "Back to Files" => "Vissza a Fájlokhoz", "Selected files too large to generate zip file." => "A kiválasztott fájlok túl nagyok a zip tömörítéshez.", -"couldn't be determined" => "nem sikerült azonosítani", +"couldn't be determined" => "nem határozható meg", "Application is not enabled" => "Az alkalmazás nincs engedélyezve", "Authentication error" => "Hitelesítési hiba", "Token expired. Please reload page." => "A token lejárt. Frissítse az oldalt.", diff --git a/lib/l10n/lb.php b/lib/l10n/lb.php index a5a9adca187..06e8b2ca094 100644 --- a/lib/l10n/lb.php +++ b/lib/l10n/lb.php @@ -4,5 +4,9 @@ "Settings" => "Astellungen", "Authentication error" => "Authentifikatioun's Fehler", "Files" => "Dateien", -"Text" => "SMS" +"Text" => "SMS", +"1 hour ago" => "vrun 1 Stonn", +"last month" => "Läschte Mount", +"last year" => "Läscht Joer", +"years ago" => "Joren hier" ); diff --git a/lib/l10n/ro.php b/lib/l10n/ro.php index d3ce066c8c1..3f8e59cdac2 100644 --- a/lib/l10n/ro.php +++ b/lib/l10n/ro.php @@ -9,6 +9,7 @@ "Files need to be downloaded one by one." => "Fișierele trebuie descărcate unul câte unul.", "Back to Files" => "Înapoi la fișiere", "Selected files too large to generate zip file." => "Fișierele selectate sunt prea mari pentru a genera un fișier zip.", +"couldn't be determined" => "nu poate fi determinat", "Application is not enabled" => "Aplicația nu este activată", "Authentication error" => "Eroare la autentificare", "Token expired. Please reload page." => "Token expirat. Te rugăm să reîncarci pagina.", diff --git a/lib/template.php b/lib/template.php index da757a08662..238d8a8ad0f 100644 --- a/lib/template.php +++ b/lib/template.php @@ -195,7 +195,6 @@ class OC_Template{ $policy = OC_Config::getValue('custom_csp_policy', 'default-src \'self\'; script-src \'self\' \'unsafe-eval\'; style-src \'self\' \'unsafe-inline\'; frame-src *; img-src *'); header('Content-Security-Policy:'.$policy); // Standard header('X-WebKit-CSP:'.$policy); // Older webkit browsers - header('X-Content-Security-Policy:'.$policy); // Mozilla + Internet Explorer $this->findTemplate($name); } diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 83d36199986..37ece91047f 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -28,11 +28,6 @@ class OC_TemplateLayout extends OC_Template { break; } } - $apps_paths = array(); - foreach(OC_App::getEnabledApps() as $app) { - $apps_paths[$app] = OC_App::getAppWebPath($app); - } - $this->assign( 'apps_paths', str_replace('\\/', '/', json_encode($apps_paths)), false ); // Ugly unescape slashes waiting for better solution } else if ($renderas == 'guest') { parent::__construct('core', 'layout.guest'); } else { |