aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/admin.php2
-rw-r--r--apps/files/ajax/autocomplete.php2
-rw-r--r--apps/files/ajax/move.php4
-rw-r--r--apps/files/ajax/upload.php4
-rw-r--r--apps/files/appinfo/filesync.php6
-rw-r--r--apps/files/appinfo/remote.php6
-rw-r--r--apps/files/appinfo/update.php8
-rw-r--r--apps/files/download.php2
-rw-r--r--apps/files/index.php6
-rw-r--r--apps/files/js/fileactions.js26
-rw-r--r--apps/files/l10n/ar.php2
-rw-r--r--apps/files/l10n/bg_BG.php2
-rw-r--r--apps/files/l10n/ca.php2
-rw-r--r--apps/files/l10n/cs_CZ.php2
-rw-r--r--apps/files/l10n/da.php1
-rw-r--r--apps/files/l10n/de.php2
-rw-r--r--apps/files/l10n/de_DE.php2
-rw-r--r--apps/files/l10n/el.php1
-rw-r--r--apps/files/l10n/eo.php2
-rw-r--r--apps/files/l10n/es.php2
-rw-r--r--apps/files/l10n/es_AR.php1
-rw-r--r--apps/files/l10n/et_EE.php1
-rw-r--r--apps/files/l10n/eu.php2
-rw-r--r--apps/files/l10n/fa.php11
-rw-r--r--apps/files/l10n/fi_FI.php2
-rw-r--r--apps/files/l10n/fr.php2
-rw-r--r--apps/files/l10n/gl.php9
-rw-r--r--apps/files/l10n/he.php11
-rw-r--r--apps/files/l10n/hr.php1
-rw-r--r--apps/files/l10n/hu_HU.php11
-rw-r--r--apps/files/l10n/ia.php3
-rw-r--r--apps/files/l10n/id.php11
-rw-r--r--apps/files/l10n/it.php2
-rw-r--r--apps/files/l10n/ja_JP.php1
-rw-r--r--apps/files/l10n/ka_GE.php1
-rw-r--r--apps/files/l10n/ko.php2
-rw-r--r--apps/files/l10n/ku_IQ.php7
-rw-r--r--apps/files/l10n/lb.php2
-rw-r--r--apps/files/l10n/lt_LT.php1
-rw-r--r--apps/files/l10n/lv.php2
-rw-r--r--apps/files/l10n/mk.php2
-rw-r--r--apps/files/l10n/ms_MY.php2
-rw-r--r--apps/files/l10n/nb_NO.php14
-rw-r--r--apps/files/l10n/nl.php1
-rw-r--r--apps/files/l10n/nn_NO.php1
-rw-r--r--apps/files/l10n/oc.php2
-rw-r--r--apps/files/l10n/pl.php1
-rw-r--r--apps/files/l10n/pl_PL.php3
-rw-r--r--apps/files/l10n/pt_BR.php16
-rw-r--r--apps/files/l10n/pt_PT.php2
-rw-r--r--apps/files/l10n/ro.php2
-rw-r--r--apps/files/l10n/ru.php1
-rw-r--r--apps/files/l10n/ru_RU.php2
-rw-r--r--apps/files/l10n/si_LK.php15
-rw-r--r--apps/files/l10n/sk_SK.php2
-rw-r--r--apps/files/l10n/sl.php1
-rw-r--r--apps/files/l10n/sr.php1
-rw-r--r--apps/files/l10n/sr@latin.php1
-rw-r--r--apps/files/l10n/sv.php2
-rw-r--r--apps/files/l10n/ta_LK.php2
-rw-r--r--apps/files/l10n/th_TH.php1
-rw-r--r--apps/files/l10n/tr.php4
-rw-r--r--apps/files/l10n/uk.php11
-rw-r--r--apps/files/l10n/vi.php1
-rw-r--r--apps/files/l10n/zh_CN.GB2312.php2
-rw-r--r--apps/files/l10n/zh_CN.php1
-rw-r--r--apps/files/l10n/zh_TW.php12
-rw-r--r--apps/files/templates/admin.php3
-rw-r--r--apps/files/templates/index.php4
-rw-r--r--apps/files/templates/part.breadcrumb.php2
-rw-r--r--apps/files/templates/part.list.php8
-rw-r--r--apps/files_encryption/appinfo/app.php4
-rw-r--r--apps/files_encryption/lib/crypt.php26
-rw-r--r--apps/files_encryption/lib/cryptstream.php50
-rw-r--r--apps/files_encryption/lib/proxy.php34
-rw-r--r--apps/files_encryption/settings.php10
-rw-r--r--apps/files_encryption/tests/encryption.php60
-rw-r--r--apps/files_encryption/tests/proxy.php32
-rw-r--r--apps/files_encryption/tests/stream.php44
-rw-r--r--apps/files_external/l10n/cs_CZ.php2
-rw-r--r--apps/files_external/l10n/lt_LT.php2
-rwxr-xr-xapps/files_external/lib/config.php9
-rw-r--r--apps/files_external/lib/ftp.php24
-rw-r--r--apps/files_external/lib/google.php4
-rw-r--r--apps/files_external/lib/smb.php12
-rw-r--r--apps/files_external/lib/streamwrapper.php22
-rw-r--r--apps/files_external/lib/swift.php54
-rw-r--r--apps/files_external/lib/webdav.php68
-rw-r--r--apps/files_external/tests/ftp.php18
-rw-r--r--apps/files_sharing/l10n/et_EE.php2
-rw-r--r--apps/files_sharing/l10n/nb_NO.php11
-rw-r--r--apps/files_sharing/lib/sharedstorage.php2
-rw-r--r--apps/files_sharing/public.php446
-rw-r--r--apps/files_versions/appinfo/app.php2
-rw-r--r--apps/files_versions/history.php2
-rw-r--r--apps/files_versions/l10n/nb_NO.php6
-rw-r--r--apps/files_versions/lib/hooks.php2
-rw-r--r--apps/files_versions/lib/versions.php554
-rw-r--r--apps/files_versions/settings-personal.php2
-rw-r--r--apps/user_ldap/group_ldap.php2
-rw-r--r--apps/user_ldap/l10n/et_EE.php6
-rw-r--r--apps/user_ldap/l10n/nb_NO.php11
-rw-r--r--apps/user_ldap/lib/connection.php18
-rw-r--r--apps/user_ldap/settings.php14
-rw-r--r--apps/user_ldap/templates/settings.php2
-rw-r--r--apps/user_ldap/tests/group_ldap.php4
-rwxr-xr-xapps/user_webdavauth/appinfo/app.php2
-rwxr-xr-xapps/user_webdavauth/appinfo/info.xml6
-rw-r--r--apps/user_webdavauth/appinfo/version1
-rwxr-xr-xapps/user_webdavauth/settings.php1
-rwxr-xr-xapps/user_webdavauth/templates/settings.php2
-rwxr-xr-xapps/user_webdavauth/user_webdavauth.php20
112 files changed, 1031 insertions, 851 deletions
diff --git a/apps/files/admin.php b/apps/files/admin.php
index e8b3cb0aca0..76616bc4373 100644
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -35,7 +35,7 @@ $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$post_max_size_possible = OCP\Util::computerFileSize(get_cfg_var('post_max_size'));
$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
$maxUploadFilesizePossible = OCP\Util::humanFileSize(min($upload_max_filesize_possible, $post_max_size_possible));
-if($_POST) {
+if($_POST && OC_Util::isCallRegistered()) {
if(isset($_POST['maxUploadSize'])) {
if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
$maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
diff --git a/apps/files/ajax/autocomplete.php b/apps/files/ajax/autocomplete.php
index fae38368a85..b32ba7c3d5b 100644
--- a/apps/files/ajax/autocomplete.php
+++ b/apps/files/ajax/autocomplete.php
@@ -44,7 +44,7 @@ if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)) {
if(substr(strtolower($file), 0, $queryLen)==$query) {
$item=$base.$file;
if((!$dirOnly or OC_Filesystem::is_dir($item))) {
- $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item);
+ $files[]=(object)array('id'=>$item, 'label'=>$item, 'name'=>$item);
}
}
}
diff --git a/apps/files/ajax/move.php b/apps/files/ajax/move.php
index db8f59b43d1..5612716b7e4 100644
--- a/apps/files/ajax/move.php
+++ b/apps/files/ajax/move.php
@@ -9,10 +9,10 @@ OCP\JSON::callCheck();
// Get data
$dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
-$target = stripslashes(urldecode($_GET["target"]));
+$target = stripslashes(rawurldecode($_GET["target"]));
-if(OC_Filesystem::file_exists($target . '/' . $file)){
+if(OC_Filesystem::file_exists($target . '/' . $file)) {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file - File with this name already exists" )));
exit;
}
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php
index dc830570403..4ed0bbc5b0f 100644
--- a/apps/files/ajax/upload.php
+++ b/apps/files/ajax/upload.php
@@ -38,7 +38,7 @@ $totalSize=0;
foreach($files['size'] as $size) {
$totalSize+=$size;
}
-if($totalSize>OC_Filesystem::free_space($dir)){
+if($totalSize>OC_Filesystem::free_space($dir)) {
OCP\JSON::error(array("data" => array( "message" => "Not enough space available" )));
exit();
}
@@ -51,7 +51,7 @@ if(strpos($dir, '..') === false) {
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
$meta = OC_FileCache::get($target);
$id = OC_FileCache::getId($target);
- $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
+ $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'], 'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
}
}
OCP\JSON::encodedPrint($result);
diff --git a/apps/files/appinfo/filesync.php b/apps/files/appinfo/filesync.php
index c1fe444cec7..0e368cb0f42 100644
--- a/apps/files/appinfo/filesync.php
+++ b/apps/files/appinfo/filesync.php
@@ -20,8 +20,8 @@
* The final URL will look like http://.../remote.php/filesync/oc_chunked/path/to/file
*/
-// only need filesystem apps
-$RUNTIME_APPTYPES=array('filesystem','authentication');
+// load needed apps
+$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging');
OC_App::loadApps($RUNTIME_APPTYPES);
if(!OC_User::isLoggedIn()) {
if(!isset($_SERVER['PHP_AUTH_USER'])) {
@@ -36,7 +36,7 @@ if(!OC_User::isLoggedIn()) {
}
}
-list($type,$file) = explode('/', substr($path_info,1+strlen($service)+1), 2);
+list($type, $file) = explode('/', substr($path_info, 1+strlen($service)+1), 2);
if ($type != 'oc_chunked') {
OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php
index 9c7b9ab6d5b..400a978fb17 100644
--- a/apps/files/appinfo/remote.php
+++ b/apps/files/appinfo/remote.php
@@ -22,8 +22,9 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
-// only need filesystem apps
-$RUNTIME_APPTYPES=array('filesystem', 'authentication');
+// load needed apps
+$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging');
+
OC_App::loadApps($RUNTIME_APPTYPES);
// Backends
@@ -41,6 +42,7 @@ $server->setBaseUri($baseuri);
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, 'ownCloud'));
$server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend));
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
+$server->addPlugin(new OC_Connector_Sabre_QuotaPlugin());
// And off we go!
$server->exec();
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php
index bcbbc6035fa..29782ec643e 100644
--- a/apps/files/appinfo/update.php
+++ b/apps/files/appinfo/update.php
@@ -5,10 +5,10 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) {
$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
$result = $query->execute();
- while( $row = $result->fetchRow()){
+ $updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?');
+ while( $row = $result->fetchRow()) {
if ( $row["propertyname"][0] != '{' ) {
- $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
- $query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] ));
+ $updateQuery->execute(array('{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"]));
}
}
}
@@ -39,7 +39,7 @@ foreach($filesToRemove as $file) {
$success = OCP\Files::rmdirr($filepath);
if($success === false) {
//probably not sufficient privileges, give up and give a message.
- OCP\Util::writeLog('files','Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
+ OCP\Util::writeLog('files', 'Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
break;
}
}
diff --git a/apps/files/download.php b/apps/files/download.php
index ff6aefbbe0f..0d632c9b2c2 100644
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -32,7 +32,7 @@ $filename = $_GET["file"];
if(!OC_Filesystem::file_exists($filename)) {
header("HTTP/1.0 404 Not Found");
$tmpl = new OCP\Template( '', '404', 'guest' );
- $tmpl->assign('file',$filename);
+ $tmpl->assign('file', $filename);
$tmpl->printPage();
exit;
}
diff --git a/apps/files/index.php b/apps/files/index.php
index 3441e371a31..c46ec59d03c 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -36,7 +36,7 @@ if(!isset($_SESSION['timezone'])) {
}
OCP\App::setActiveNavigationEntry( 'files_index' );
// Load the files
-$dir = isset( $_GET['dir'] ) ? urldecode(stripslashes($_GET['dir'])) : '';
+$dir = isset( $_GET['dir'] ) ? rawurldecode(stripslashes($_GET['dir'])) : '';
// Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir.'/')) {
header('Location: '.$_SERVER['SCRIPT_NAME'].'');
@@ -67,7 +67,7 @@ $breadcrumb = array();
$pathtohere = '';
foreach( explode( '/', $dir ) as $i ) {
if( $i != '' ) {
- $pathtohere .= '/'.str_replace('+','%20', urlencode($i));
+ $pathtohere .= '/'.str_replace('+', '%20', urlencode($i));
$breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i );
}
}
@@ -86,7 +86,7 @@ $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space($dir);
-$freeSpace=max($freeSpace,0);
+$freeSpace=max($freeSpace, 0);
$maxUploadFilesize = min($maxUploadFilesize, $freeSpace);
$permissions = OCP\Share::PERMISSION_READ;
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js
index 82d990bf780..40dd9f14a69 100644
--- a/apps/files/js/fileactions.js
+++ b/apps/files/js/fileactions.js
@@ -70,6 +70,13 @@ var FileActions = {
}
parent.children('a.name').append('<span class="fileactions" />');
var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
+ var actionHandler = function (parent, action, event) {
+ event.stopPropagation();
+ event.preventDefault();
+ FileActions.currentFile = parent;
+ file = FileActions.getCurrentFile();
+ action(file);
+ };
for (name in actions) {
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name === 'Rename' && $('#dir').val() === '/Shared') {
@@ -87,14 +94,7 @@ var FileActions = {
html += t('files', name) + '</a>';
var element = $(html);
element.data('action', name);
- element.click(function (event) {
- FileActions.currentFile = $(this).parent().parent().parent();
- event.stopPropagation();
- event.preventDefault();
- var action = actions[$(this).data('action')];
- var currentFile = FileActions.getCurrentFile();
- action(currentFile);
- });
+ element.click(actionHandler.bind(null, parent, actions[name]));
parent.find('a.name>span.fileactions').append(element);
}
}
@@ -113,14 +113,8 @@ var FileActions = {
if (img) {
element.append($('<img class ="svg" src="' + img + '"/>'));
}
- element.data('action', 'Delete');
- element.click(function (event) {
- event.stopPropagation();
- event.preventDefault();
- var action = actions[$(this).data('action')];
- var currentFile = FileActions.getCurrentFile();
- action(currentFile);
- });
+ element.data('action', actions['Delete']);
+ element.click(actionHandler.bind(null, parent, actions['Delete']));
parent.parent().children().last().append(element);
}
},
diff --git a/apps/files/l10n/ar.php b/apps/files/l10n/ar.php
index a5530851d2e..78b4915f4ed 100644
--- a/apps/files/l10n/ar.php
+++ b/apps/files/l10n/ar.php
@@ -11,11 +11,13 @@
"Size" => "حجم",
"Modified" => "معدل",
"Maximum upload size" => "الحد الأقصى لحجم الملفات التي يمكن رفعها",
+"Save" => "حفظ",
"New" => "جديد",
"Text file" => "ملف",
"Folder" => "مجلد",
"Upload" => "إرفع",
"Nothing in here. Upload something!" => "لا يوجد شيء هنا. إرفع بعض الملفات!",
+"Share" => "شارك",
"Download" => "تحميل",
"Upload too large" => "حجم الترفيع أعلى من المسموح",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "حجم الملفات التي تريد ترفيعها أعلى من المسموح على الخادم."
diff --git a/apps/files/l10n/bg_BG.php b/apps/files/l10n/bg_BG.php
index 8c8054303bb..0a3bf02e956 100644
--- a/apps/files/l10n/bg_BG.php
+++ b/apps/files/l10n/bg_BG.php
@@ -16,10 +16,10 @@
"Modified" => "Променено",
"Maximum upload size" => "Макс. размер за качване",
"0 is unlimited" => "0 означава без ограничение",
+"Save" => "Запис",
"New" => "Нов",
"Text file" => "Текстов файл",
"Folder" => "Папка",
-"From url" => "От url-адрес",
"Upload" => "Качване",
"Cancel upload" => "Отказване на качването",
"Nothing in here. Upload something!" => "Няма нищо, качете нещо!",
diff --git a/apps/files/l10n/ca.php b/apps/files/l10n/ca.php
index a4d66b297b2..068031bafc7 100644
--- a/apps/files/l10n/ca.php
+++ b/apps/files/l10n/ca.php
@@ -58,7 +58,7 @@
"New" => "Nou",
"Text file" => "Fitxer de text",
"Folder" => "Carpeta",
-"From url" => "Des de la url",
+"From link" => "Des d'enllaç",
"Upload" => "Puja",
"Cancel upload" => "Cancel·la la pujada",
"Nothing in here. Upload something!" => "Res per aquí. Pugeu alguna cosa!",
diff --git a/apps/files/l10n/cs_CZ.php b/apps/files/l10n/cs_CZ.php
index 9f9542ea809..6d96033a8bc 100644
--- a/apps/files/l10n/cs_CZ.php
+++ b/apps/files/l10n/cs_CZ.php
@@ -58,7 +58,7 @@
"New" => "Nový",
"Text file" => "Textový soubor",
"Folder" => "Složka",
-"From url" => "Z url",
+"From link" => "Z odkazu",
"Upload" => "Odeslat",
"Cancel upload" => "Zrušit odesílání",
"Nothing in here. Upload something!" => "Žádný obsah. Nahrajte něco.",
diff --git a/apps/files/l10n/da.php b/apps/files/l10n/da.php
index 5d45991f2a2..a72ecf5f9ab 100644
--- a/apps/files/l10n/da.php
+++ b/apps/files/l10n/da.php
@@ -58,7 +58,6 @@
"New" => "Ny",
"Text file" => "Tekstfil",
"Folder" => "Mappe",
-"From url" => "Fra URL",
"Upload" => "Upload",
"Cancel upload" => "Fortryd upload",
"Nothing in here. Upload something!" => "Her er tomt. Upload noget!",
diff --git a/apps/files/l10n/de.php b/apps/files/l10n/de.php
index 7dc5831e639..f27565398b2 100644
--- a/apps/files/l10n/de.php
+++ b/apps/files/l10n/de.php
@@ -58,7 +58,7 @@
"New" => "Neu",
"Text file" => "Textdatei",
"Folder" => "Ordner",
-"From url" => "Von einer URL",
+"From link" => "Von einem Link",
"Upload" => "Hochladen",
"Cancel upload" => "Upload abbrechen",
"Nothing in here. Upload something!" => "Alles leer. Lade etwas hoch!",
diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php
index 194bf6b4fda..be8f83c0fca 100644
--- a/apps/files/l10n/de_DE.php
+++ b/apps/files/l10n/de_DE.php
@@ -58,7 +58,7 @@
"New" => "Neu",
"Text file" => "Textdatei",
"Folder" => "Ordner",
-"From url" => "Von einer URL",
+"From link" => "Von einem Link",
"Upload" => "Hochladen",
"Cancel upload" => "Upload abbrechen",
"Nothing in here. Upload something!" => "Alles leer. Bitte laden Sie etwas hoch!",
diff --git a/apps/files/l10n/el.php b/apps/files/l10n/el.php
index fef57c62283..93c050b93db 100644
--- a/apps/files/l10n/el.php
+++ b/apps/files/l10n/el.php
@@ -58,7 +58,6 @@
"New" => "Νέο",
"Text file" => "Αρχείο κειμένου",
"Folder" => "Φάκελος",
-"From url" => "Από την διεύθυνση",
"Upload" => "Αποστολή",
"Cancel upload" => "Ακύρωση αποστολής",
"Nothing in here. Upload something!" => "Δεν υπάρχει τίποτα εδώ. Ανέβασε κάτι!",
diff --git a/apps/files/l10n/eo.php b/apps/files/l10n/eo.php
index 8d5d59f70dc..4373bbf58b4 100644
--- a/apps/files/l10n/eo.php
+++ b/apps/files/l10n/eo.php
@@ -27,6 +27,7 @@
"Size" => "Grando",
"Modified" => "Modifita",
"seconds ago" => "sekundoj antaŭe",
+"1 minute ago" => "antaŭ 1 minuto",
"today" => "hodiaŭ",
"yesterday" => "hieraŭ",
"last month" => "lastamonate",
@@ -44,7 +45,6 @@
"New" => "Nova",
"Text file" => "Tekstodosiero",
"Folder" => "Dosierujo",
-"From url" => "El URL",
"Upload" => "Alŝuti",
"Cancel upload" => "Nuligi alŝuton",
"Nothing in here. Upload something!" => "Nenio estas ĉi tie. Alŝutu ion!",
diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php
index 1b783281eb8..04cf10f96b7 100644
--- a/apps/files/l10n/es.php
+++ b/apps/files/l10n/es.php
@@ -58,7 +58,7 @@
"New" => "Nuevo",
"Text file" => "Archivo de texto",
"Folder" => "Carpeta",
-"From url" => "Desde la URL",
+"From link" => "Desde el enlace",
"Upload" => "Subir",
"Cancel upload" => "Cancelar subida",
"Nothing in here. Upload something!" => "Aquí no hay nada. ¡Sube algo!",
diff --git a/apps/files/l10n/es_AR.php b/apps/files/l10n/es_AR.php
index f9a943cf9f2..baa9f257808 100644
--- a/apps/files/l10n/es_AR.php
+++ b/apps/files/l10n/es_AR.php
@@ -58,7 +58,6 @@
"New" => "Nuevo",
"Text file" => "Archivo de texto",
"Folder" => "Carpeta",
-"From url" => "Desde la URL",
"Upload" => "Subir",
"Cancel upload" => "Cancelar subida",
"Nothing in here. Upload something!" => "No hay nada. ¡Subí contenido!",
diff --git a/apps/files/l10n/et_EE.php b/apps/files/l10n/et_EE.php
index 9b9679068c6..20789dde99c 100644
--- a/apps/files/l10n/et_EE.php
+++ b/apps/files/l10n/et_EE.php
@@ -58,7 +58,6 @@
"New" => "Uus",
"Text file" => "Tekstifail",
"Folder" => "Kaust",
-"From url" => "URL-ilt",
"Upload" => "Lae üles",
"Cancel upload" => "Tühista üleslaadimine",
"Nothing in here. Upload something!" => "Siin pole midagi. Lae midagi üles!",
diff --git a/apps/files/l10n/eu.php b/apps/files/l10n/eu.php
index b273c533557..f99c2116077 100644
--- a/apps/files/l10n/eu.php
+++ b/apps/files/l10n/eu.php
@@ -27,6 +27,7 @@
"Size" => "Tamaina",
"Modified" => "Aldatuta",
"seconds ago" => "segundu",
+"1 minute ago" => "orain dela minutu 1",
"today" => "gaur",
"yesterday" => "atzo",
"last month" => "joan den hilabetean",
@@ -44,7 +45,6 @@
"New" => "Berria",
"Text file" => "Testu fitxategia",
"Folder" => "Karpeta",
-"From url" => "URLtik",
"Upload" => "Igo",
"Cancel upload" => "Ezeztatu igoera",
"Nothing in here. Upload something!" => "Ez dago ezer. Igo zerbait!",
diff --git a/apps/files/l10n/fa.php b/apps/files/l10n/fa.php
index 01a1b1e56f7..ea3aa43b8fa 100644
--- a/apps/files/l10n/fa.php
+++ b/apps/files/l10n/fa.php
@@ -8,6 +8,7 @@
"Failed to write to disk" => "نوشتن بر روی دیسک سخت ناموفق بود",
"Files" => "فایل ها",
"Delete" => "پاک کردن",
+"Rename" => "تغییرنام",
"replace" => "جایگزین",
"cancel" => "لغو",
"undo" => "بازگشت",
@@ -20,6 +21,14 @@
"Name" => "نام",
"Size" => "اندازه",
"Modified" => "تغییر یافته",
+"seconds ago" => "ثانیه‌ها پیش",
+"1 minute ago" => "1 دقیقه پیش",
+"today" => "امروز",
+"yesterday" => "دیروز",
+"last month" => "ماه قبل",
+"months ago" => "ماه‌های قبل",
+"last year" => "سال قبل",
+"years ago" => "سال‌های قبل",
"File handling" => "اداره پرونده ها",
"Maximum upload size" => "حداکثر اندازه بارگزاری",
"max. possible: " => "حداکثرمقدارممکن:",
@@ -27,10 +36,10 @@
"Enable ZIP-download" => "فعال سازی بارگیری پرونده های فشرده",
"0 is unlimited" => "0 نامحدود است",
"Maximum input size for ZIP files" => "حداکثرمقدار برای بار گزاری پرونده های فشرده",
+"Save" => "ذخیره",
"New" => "جدید",
"Text file" => "فایل متنی",
"Folder" => "پوشه",
-"From url" => "از نشانی",
"Upload" => "بارگذاری",
"Cancel upload" => "متوقف کردن بار گذاری",
"Nothing in here. Upload something!" => "اینجا هیچ چیز نیست.",
diff --git a/apps/files/l10n/fi_FI.php b/apps/files/l10n/fi_FI.php
index fd86c21ffdb..5cbbc83edb0 100644
--- a/apps/files/l10n/fi_FI.php
+++ b/apps/files/l10n/fi_FI.php
@@ -7,6 +7,7 @@
"Missing a temporary folder" => "Väliaikaiskansiota ei ole olemassa",
"Failed to write to disk" => "Levylle kirjoitus epäonnistui",
"Files" => "Tiedostot",
+"Unshare" => "Peru jakaminen",
"Delete" => "Poista",
"Rename" => "Nimeä uudelleen",
"{new_name} already exists" => "{new_name} on jo olemassa",
@@ -49,7 +50,6 @@
"New" => "Uusi",
"Text file" => "Tekstitiedosto",
"Folder" => "Kansio",
-"From url" => "Verkko-osoitteesta",
"Upload" => "Lähetä",
"Cancel upload" => "Peru lähetys",
"Nothing in here. Upload something!" => "Täällä ei ole mitään. Lähetä tänne jotakin!",
diff --git a/apps/files/l10n/fr.php b/apps/files/l10n/fr.php
index 4f0f01fb23d..3068eb92747 100644
--- a/apps/files/l10n/fr.php
+++ b/apps/files/l10n/fr.php
@@ -58,7 +58,7 @@
"New" => "Nouveau",
"Text file" => "Fichier texte",
"Folder" => "Dossier",
-"From url" => "Depuis URL",
+"From link" => "Depuis le lien",
"Upload" => "Envoyer",
"Cancel upload" => "Annuler l'envoi",
"Nothing in here. Upload something!" => "Il n'y a rien ici ! Envoyez donc quelque chose :)",
diff --git a/apps/files/l10n/gl.php b/apps/files/l10n/gl.php
index bfb455d37f8..7b332d47df3 100644
--- a/apps/files/l10n/gl.php
+++ b/apps/files/l10n/gl.php
@@ -24,6 +24,14 @@
"Name" => "Nome",
"Size" => "Tamaño",
"Modified" => "Modificado",
+"seconds ago" => "hai segundos",
+"1 minute ago" => "hai 1 minuto",
+"today" => "hoxe",
+"yesterday" => "onte",
+"last month" => "último mes",
+"months ago" => "meses atrás",
+"last year" => "último ano",
+"years ago" => "anos atrás",
"File handling" => "Manexo de ficheiro",
"Maximum upload size" => "Tamaño máximo de envío",
"max. possible: " => "máx. posible: ",
@@ -35,7 +43,6 @@
"New" => "Novo",
"Text file" => "Ficheiro de texto",
"Folder" => "Cartafol",
-"From url" => "Desde url",
"Upload" => "Enviar",
"Cancel upload" => "Cancelar subida",
"Nothing in here. Upload something!" => "Nada por aquí. Envíe algo.",
diff --git a/apps/files/l10n/he.php b/apps/files/l10n/he.php
index 997617673e4..fc169710df0 100644
--- a/apps/files/l10n/he.php
+++ b/apps/files/l10n/he.php
@@ -7,6 +7,7 @@
"Missing a temporary folder" => "תיקייה זמנית חסרה",
"Failed to write to disk" => "הכתיבה לכונן נכשלה",
"Files" => "קבצים",
+"Unshare" => "הסר שיתוף",
"Delete" => "מחיקה",
"generating ZIP-file, it may take some time." => "יוצר קובץ ZIP, אנא המתן.",
"Unable to upload your file as it is a directory or has 0 bytes" => "לא יכול להעלות את הקובץ מכיוון שזו תקיה או שמשקל הקובץ 0 בתים",
@@ -17,6 +18,14 @@
"Name" => "שם",
"Size" => "גודל",
"Modified" => "זמן שינוי",
+"seconds ago" => "שניות",
+"1 minute ago" => "לפני דקה אחת",
+"today" => "היום",
+"yesterday" => "אתמול",
+"last month" => "חודש שעבר",
+"months ago" => "חודשים",
+"last year" => "שנה שעברה",
+"years ago" => "שנים",
"File handling" => "טיפול בקבצים",
"Maximum upload size" => "גודל העלאה מקסימלי",
"max. possible: " => "המרבי האפשרי: ",
@@ -24,10 +33,10 @@
"Enable ZIP-download" => "הפעלת הורדת ZIP",
"0 is unlimited" => "0 - ללא הגבלה",
"Maximum input size for ZIP files" => "גודל הקלט המרבי לקובצי ZIP",
+"Save" => "שמירה",
"New" => "חדש",
"Text file" => "קובץ טקסט",
"Folder" => "תיקייה",
-"From url" => "מכתובת",
"Upload" => "העלאה",
"Cancel upload" => "ביטול ההעלאה",
"Nothing in here. Upload something!" => "אין כאן שום דבר. אולי ברצונך להעלות משהו?",
diff --git a/apps/files/l10n/hr.php b/apps/files/l10n/hr.php
index fa16feaa39a..2209d1f4699 100644
--- a/apps/files/l10n/hr.php
+++ b/apps/files/l10n/hr.php
@@ -44,7 +44,6 @@
"New" => "novo",
"Text file" => "tekstualna datoteka",
"Folder" => "mapa",
-"From url" => "od URL-a",
"Upload" => "Pošalji",
"Cancel upload" => "Prekini upload",
"Nothing in here. Upload something!" => "Nema ničega u ovoj mapi. Pošalji nešto!",
diff --git a/apps/files/l10n/hu_HU.php b/apps/files/l10n/hu_HU.php
index 1eeca809d64..6ded4de4800 100644
--- a/apps/files/l10n/hu_HU.php
+++ b/apps/files/l10n/hu_HU.php
@@ -7,6 +7,7 @@
"Missing a temporary folder" => "Hiányzik az ideiglenes könyvtár",
"Failed to write to disk" => "Nem írható lemezre",
"Files" => "Fájlok",
+"Unshare" => "Nem oszt meg",
"Delete" => "Törlés",
"replace" => "cserél",
"cancel" => "mégse",
@@ -20,6 +21,14 @@
"Name" => "Név",
"Size" => "Méret",
"Modified" => "Módosítva",
+"seconds ago" => "másodperccel ezelőtt",
+"1 minute ago" => "1 perccel ezelőtt",
+"today" => "ma",
+"yesterday" => "tegnap",
+"last month" => "múlt hónapban",
+"months ago" => "hónappal ezelőtt",
+"last year" => "tavaly",
+"years ago" => "évvel ezelőtt",
"File handling" => "Fájlkezelés",
"Maximum upload size" => "Maximális feltölthető fájlméret",
"max. possible: " => "max. lehetséges",
@@ -27,10 +36,10 @@
"Enable ZIP-download" => "ZIP-letöltés engedélyezése",
"0 is unlimited" => "0 = korlátlan",
"Maximum input size for ZIP files" => "ZIP file-ok maximum mérete",
+"Save" => "Mentés",
"New" => "Új",
"Text file" => "Szövegfájl",
"Folder" => "Mappa",
-"From url" => "URL-ből",
"Upload" => "Feltöltés",
"Cancel upload" => "Feltöltés megszakítása",
"Nothing in here. Upload something!" => "Töltsön fel egy fájlt.",
diff --git a/apps/files/l10n/ia.php b/apps/files/l10n/ia.php
index 21a0bb52374..bcebebc1405 100644
--- a/apps/files/l10n/ia.php
+++ b/apps/files/l10n/ia.php
@@ -1,17 +1,20 @@
<?php $TRANSLATIONS = array(
"The uploaded file was only partially uploaded" => "Le file incargate solmente esseva incargate partialmente",
"No file was uploaded" => "Nulle file esseva incargate",
+"Missing a temporary folder" => "Manca un dossier temporari",
"Files" => "Files",
"Delete" => "Deler",
"Name" => "Nomine",
"Size" => "Dimension",
"Modified" => "Modificate",
"Maximum upload size" => "Dimension maxime de incargamento",
+"Save" => "Salveguardar",
"New" => "Nove",
"Text file" => "File de texto",
"Folder" => "Dossier",
"Upload" => "Incargar",
"Nothing in here. Upload something!" => "Nihil hic. Incarga alcun cosa!",
+"Share" => "Compartir",
"Download" => "Discargar",
"Upload too large" => "Incargamento troppo longe"
);
diff --git a/apps/files/l10n/id.php b/apps/files/l10n/id.php
index a11894d1a76..061d28c8f78 100644
--- a/apps/files/l10n/id.php
+++ b/apps/files/l10n/id.php
@@ -7,6 +7,7 @@
"Missing a temporary folder" => "Kehilangan folder temporer",
"Failed to write to disk" => "Gagal menulis ke disk",
"Files" => "Berkas",
+"Unshare" => "batalkan berbagi",
"Delete" => "Hapus",
"replace" => "mengganti",
"cancel" => "batalkan",
@@ -20,6 +21,14 @@
"Name" => "Nama",
"Size" => "Ukuran",
"Modified" => "Dimodifikasi",
+"seconds ago" => "beberapa detik yang lalu",
+"1 minute ago" => "1 menit lalu",
+"today" => "hari ini",
+"yesterday" => "kemarin",
+"last month" => "bulan kemarin",
+"months ago" => "beberapa bulan lalu",
+"last year" => "tahun kemarin",
+"years ago" => "beberapa tahun lalu",
"File handling" => "Penanganan berkas",
"Maximum upload size" => "Ukuran unggah maksimum",
"max. possible: " => "Kemungkinan maks:",
@@ -27,10 +36,10 @@
"Enable ZIP-download" => "Aktifkan unduhan ZIP",
"0 is unlimited" => "0 adalah tidak terbatas",
"Maximum input size for ZIP files" => "Ukuran masukan maksimal untuk berkas ZIP",
+"Save" => "simpan",
"New" => "Baru",
"Text file" => "Berkas teks",
"Folder" => "Folder",
-"From url" => "Dari url",
"Upload" => "Unggah",
"Cancel upload" => "Batal mengunggah",
"Nothing in here. Upload something!" => "Tidak ada apa-apa di sini. Unggah sesuatu!",
diff --git a/apps/files/l10n/it.php b/apps/files/l10n/it.php
index 5d3b58e783a..c767fb43b2b 100644
--- a/apps/files/l10n/it.php
+++ b/apps/files/l10n/it.php
@@ -58,7 +58,7 @@
"New" => "Nuovo",
"Text file" => "File di testo",
"Folder" => "Cartella",
-"From url" => "Da URL",
+"From link" => "Da collegamento",
"Upload" => "Carica",
"Cancel upload" => "Annulla invio",
"Nothing in here. Upload something!" => "Non c'è niente qui. Carica qualcosa!",
diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php
index c161f8b3bac..41f26fe3ebc 100644
--- a/apps/files/l10n/ja_JP.php
+++ b/apps/files/l10n/ja_JP.php
@@ -58,7 +58,6 @@
"New" => "新規",
"Text file" => "テキストファイル",
"Folder" => "フォルダ",
-"From url" => "URL",
"Upload" => "アップロード",
"Cancel upload" => "アップロードをキャンセル",
"Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。",
diff --git a/apps/files/l10n/ka_GE.php b/apps/files/l10n/ka_GE.php
index d9672d647c2..cfd0b2fa6ec 100644
--- a/apps/files/l10n/ka_GE.php
+++ b/apps/files/l10n/ka_GE.php
@@ -58,7 +58,6 @@
"New" => "ახალი",
"Text file" => "ტექსტური ფაილი",
"Folder" => "საქაღალდე",
-"From url" => "მისამართიდან",
"Upload" => "ატვირთვა",
"Cancel upload" => "ატვირთვის გაუქმება",
"Nothing in here. Upload something!" => "აქ არაფერი არ არის. ატვირთე რამე!",
diff --git a/apps/files/l10n/ko.php b/apps/files/l10n/ko.php
index 05db100e189..d2561e129dd 100644
--- a/apps/files/l10n/ko.php
+++ b/apps/files/l10n/ko.php
@@ -27,10 +27,10 @@
"Enable ZIP-download" => "ZIP- 다운로드 허용",
"0 is unlimited" => "0은 무제한 입니다",
"Maximum input size for ZIP files" => "ZIP 파일에 대한 최대 입력 크기",
+"Save" => "저장",
"New" => "새로 만들기",
"Text file" => "텍스트 파일",
"Folder" => "폴더",
-"From url" => "URL 에서",
"Upload" => "업로드",
"Cancel upload" => "업로드 취소",
"Nothing in here. Upload something!" => "내용이 없습니다. 업로드할 수 있습니다!",
diff --git a/apps/files/l10n/ku_IQ.php b/apps/files/l10n/ku_IQ.php
new file mode 100644
index 00000000000..3c40831b83a
--- /dev/null
+++ b/apps/files/l10n/ku_IQ.php
@@ -0,0 +1,7 @@
+<?php $TRANSLATIONS = array(
+"Name" => "ناو",
+"Save" => "پاشکه‌وتکردن",
+"Folder" => "بوخچه",
+"Upload" => "بارکردن",
+"Download" => "داگرتن"
+);
diff --git a/apps/files/l10n/lb.php b/apps/files/l10n/lb.php
index aed0938ff04..4e2ce1b1dbf 100644
--- a/apps/files/l10n/lb.php
+++ b/apps/files/l10n/lb.php
@@ -27,10 +27,10 @@
"Enable ZIP-download" => "ZIP-download erlaben",
"0 is unlimited" => "0 ass onlimitéiert",
"Maximum input size for ZIP files" => "Maximal Gréisst fir ZIP Fichieren",
+"Save" => "Späicheren",
"New" => "Nei",
"Text file" => "Text Fichier",
"Folder" => "Dossier",
-"From url" => "From URL",
"Upload" => "Eroplueden",
"Cancel upload" => "Upload ofbriechen",
"Nothing in here. Upload something!" => "Hei ass näischt. Lued eppes rop!",
diff --git a/apps/files/l10n/lt_LT.php b/apps/files/l10n/lt_LT.php
index d224b8cce8e..87c0f578c5f 100644
--- a/apps/files/l10n/lt_LT.php
+++ b/apps/files/l10n/lt_LT.php
@@ -58,7 +58,6 @@
"New" => "Naujas",
"Text file" => "Teksto failas",
"Folder" => "Katalogas",
-"From url" => "Iš adreso",
"Upload" => "Įkelti",
"Cancel upload" => "Atšaukti siuntimą",
"Nothing in here. Upload something!" => "Čia tuščia. Įkelkite ką nors!",
diff --git a/apps/files/l10n/lv.php b/apps/files/l10n/lv.php
index 835416c301b..6488ee534ec 100644
--- a/apps/files/l10n/lv.php
+++ b/apps/files/l10n/lv.php
@@ -2,6 +2,7 @@
"No file was uploaded" => "Neviens fails netika augšuplādēts",
"Failed to write to disk" => "Nav iespējams saglabāt",
"Files" => "Faili",
+"Unshare" => "Pārtraukt līdzdalīšanu",
"Delete" => "Izdzēst",
"replace" => "aizvietot",
"cancel" => "atcelt",
@@ -22,7 +23,6 @@
"New" => "Jauns",
"Text file" => "Teksta fails",
"Folder" => "Mape",
-"From url" => "No URL saites",
"Upload" => "Augšuplādet",
"Cancel upload" => "Atcelt augšuplādi",
"Nothing in here. Upload something!" => "Te vēl nekas nav. Rīkojies, sāc augšuplādēt",
diff --git a/apps/files/l10n/mk.php b/apps/files/l10n/mk.php
index f8953fbaef6..a3c43d266ff 100644
--- a/apps/files/l10n/mk.php
+++ b/apps/files/l10n/mk.php
@@ -24,10 +24,10 @@
"Enable ZIP-download" => "Овозможи ZIP симнување ",
"0 is unlimited" => "0 е неограничено",
"Maximum input size for ZIP files" => "Максимална големина за внес на ZIP датотеки",
+"Save" => "Сними",
"New" => "Ново",
"Text file" => "Текстуална датотека",
"Folder" => "Папка",
-"From url" => "Од адреса",
"Upload" => "Подигни",
"Cancel upload" => "Откажи прикачување",
"Nothing in here. Upload something!" => "Тука нема ништо. Снимете нешто!",
diff --git a/apps/files/l10n/ms_MY.php b/apps/files/l10n/ms_MY.php
index 95f1b418c7e..35dda3d8a6b 100644
--- a/apps/files/l10n/ms_MY.php
+++ b/apps/files/l10n/ms_MY.php
@@ -26,10 +26,10 @@
"Enable ZIP-download" => "Aktifkan muatturun ZIP",
"0 is unlimited" => "0 adalah tanpa had",
"Maximum input size for ZIP files" => "Saiz maksimum input untuk fail ZIP",
+"Save" => "Simpan",
"New" => "Baru",
"Text file" => "Fail teks",
"Folder" => "Folder",
-"From url" => "Dari url",
"Upload" => "Muat naik",
"Cancel upload" => "Batal muat naik",
"Nothing in here. Upload something!" => "Tiada apa-apa di sini. Muat naik sesuatu!",
diff --git a/apps/files/l10n/nb_NO.php b/apps/files/l10n/nb_NO.php
index 0fe6d293393..1d914b866aa 100644
--- a/apps/files/l10n/nb_NO.php
+++ b/apps/files/l10n/nb_NO.php
@@ -10,25 +10,38 @@
"Unshare" => "Avslutt deling",
"Delete" => "Slett",
"Rename" => "Omdøp",
+"{new_name} already exists" => "{new_name} finnes allerede",
"replace" => "erstatt",
"suggest name" => "foreslå navn",
"cancel" => "avbryt",
+"replaced {new_name}" => "erstatt {new_name}",
"undo" => "angre",
+"replaced {new_name} with {old_name}" => "erstatt {new_name} med {old_name}",
+"deleted {files}" => "slettet {files}",
"generating ZIP-file, it may take some time." => "opprettet ZIP-fil, dette kan ta litt tid",
"Unable to upload your file as it is a directory or has 0 bytes" => "Kan ikke laste opp filen din siden det er en mappe eller den har 0 bytes",
"Upload Error" => "Opplasting feilet",
"Pending" => "Ventende",
"1 file uploading" => "1 fil lastes opp",
+"{count} files uploading" => "{count} filer laster opp",
"Upload cancelled." => "Opplasting avbrutt.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Filopplasting pågår. Forlater du siden nå avbrytes opplastingen.",
"Invalid name, '/' is not allowed." => "Ugyldig navn, '/' er ikke tillatt. ",
+"{count} files scanned" => "{count} filer lest inn",
"error while scanning" => "feil under skanning",
"Name" => "Navn",
"Size" => "Størrelse",
"Modified" => "Endret",
+"1 folder" => "1 mappe",
+"{count} folders" => "{count} mapper",
+"1 file" => "1 fil",
+"{count} files" => "{count} filer",
"seconds ago" => "sekunder siden",
+"1 minute ago" => "1 minutt siden",
+"{minutes} minutes ago" => "{minutes} minutter siden",
"today" => "i dag",
"yesterday" => "i går",
+"{days} days ago" => "{days} dager siden",
"last month" => "forrige måned",
"months ago" => "måneder siden",
"last year" => "forrige år",
@@ -44,7 +57,6 @@
"New" => "Ny",
"Text file" => "Tekstfil",
"Folder" => "Mappe",
-"From url" => "Fra url",
"Upload" => "Last opp",
"Cancel upload" => "Avbryt opplasting",
"Nothing in here. Upload something!" => "Ingenting her. Last opp noe!",
diff --git a/apps/files/l10n/nl.php b/apps/files/l10n/nl.php
index e6e5fa52a86..f3bfb397c4f 100644
--- a/apps/files/l10n/nl.php
+++ b/apps/files/l10n/nl.php
@@ -58,7 +58,6 @@
"New" => "Nieuw",
"Text file" => "Tekstbestand",
"Folder" => "Map",
-"From url" => "Van hyperlink",
"Upload" => "Upload",
"Cancel upload" => "Upload afbreken",
"Nothing in here. Upload something!" => "Er bevindt zich hier niets. Upload een bestand!",
diff --git a/apps/files/l10n/nn_NO.php b/apps/files/l10n/nn_NO.php
index 7af37057ce0..df8dcb0e9cf 100644
--- a/apps/files/l10n/nn_NO.php
+++ b/apps/files/l10n/nn_NO.php
@@ -11,6 +11,7 @@
"Size" => "Storleik",
"Modified" => "Endra",
"Maximum upload size" => "Maksimal opplastingsstorleik",
+"Save" => "Lagre",
"New" => "Ny",
"Text file" => "Tekst fil",
"Folder" => "Mappe",
diff --git a/apps/files/l10n/oc.php b/apps/files/l10n/oc.php
index d4bb09e94b3..078545b6d55 100644
--- a/apps/files/l10n/oc.php
+++ b/apps/files/l10n/oc.php
@@ -27,6 +27,7 @@
"Size" => "Talha",
"Modified" => "Modificat",
"seconds ago" => "secondas",
+"1 minute ago" => "1 minuta a",
"today" => "uèi",
"yesterday" => "ièr",
"last month" => "mes passat",
@@ -44,7 +45,6 @@
"New" => "Nòu",
"Text file" => "Fichièr de tèxte",
"Folder" => "Dorsièr",
-"From url" => "Dempuèi l'URL",
"Upload" => "Amontcarga",
"Cancel upload" => " Anulla l'amontcargar",
"Nothing in here. Upload something!" => "Pas res dedins. Amontcarga qualquaren",
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index f84dc7086e6..f2460562087 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -58,7 +58,6 @@
"New" => "Nowy",
"Text file" => "Plik tekstowy",
"Folder" => "Katalog",
-"From url" => "Z adresu",
"Upload" => "Prześlij",
"Cancel upload" => "Przestań wysyłać",
"Nothing in here. Upload something!" => "Brak zawartości. Proszę wysłać pliki!",
diff --git a/apps/files/l10n/pl_PL.php b/apps/files/l10n/pl_PL.php
new file mode 100644
index 00000000000..157d9a41e4d
--- /dev/null
+++ b/apps/files/l10n/pl_PL.php
@@ -0,0 +1,3 @@
+<?php $TRANSLATIONS = array(
+"Save" => "Zapisz"
+);
diff --git a/apps/files/l10n/pt_BR.php b/apps/files/l10n/pt_BR.php
index 4dfbadc8915..31de3f6e600 100644
--- a/apps/files/l10n/pt_BR.php
+++ b/apps/files/l10n/pt_BR.php
@@ -10,25 +10,39 @@
"Unshare" => "Descompartilhar",
"Delete" => "Excluir",
"Rename" => "Renomear",
+"{new_name} already exists" => "{new_name} já existe",
"replace" => "substituir",
"suggest name" => "sugerir nome",
"cancel" => "cancelar",
+"replaced {new_name}" => "substituído {new_name}",
"undo" => "desfazer",
+"replaced {new_name} with {old_name}" => "Substituído {old_name} por {new_name} ",
+"unshared {files}" => "{files} não compartilhados",
+"deleted {files}" => "{files} apagados",
"generating ZIP-file, it may take some time." => "gerando arquivo ZIP, isso pode levar um tempo.",
"Unable to upload your file as it is a directory or has 0 bytes" => "Impossível enviar seus arquivo como diretório ou ele tem 0 bytes.",
"Upload Error" => "Erro de envio",
"Pending" => "Pendente",
"1 file uploading" => "enviando 1 arquivo",
+"{count} files uploading" => "Enviando {count} arquivos",
"Upload cancelled." => "Envio cancelado.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Upload em andamento. Sair da página agora resultará no cancelamento do envio.",
"Invalid name, '/' is not allowed." => "Nome inválido, '/' não é permitido.",
+"{count} files scanned" => "{count} arquivos scaneados",
"error while scanning" => "erro durante verificação",
"Name" => "Nome",
"Size" => "Tamanho",
"Modified" => "Modificado",
+"1 folder" => "1 pasta",
+"{count} folders" => "{count} pastas",
+"1 file" => "1 arquivo",
+"{count} files" => "{count} arquivos",
"seconds ago" => "segundos atrás",
+"1 minute ago" => "1 minuto atrás",
+"{minutes} minutes ago" => "{minutes} minutos atrás",
"today" => "hoje",
"yesterday" => "ontem",
+"{days} days ago" => "{days} dias atrás",
"last month" => "último mês",
"months ago" => "meses atrás",
"last year" => "último ano",
@@ -44,7 +58,7 @@
"New" => "Novo",
"Text file" => "Arquivo texto",
"Folder" => "Pasta",
-"From url" => "URL de origem",
+"From link" => "Do link",
"Upload" => "Carregar",
"Cancel upload" => "Cancelar upload",
"Nothing in here. Upload something!" => "Nada aqui.Carrege alguma coisa!",
diff --git a/apps/files/l10n/pt_PT.php b/apps/files/l10n/pt_PT.php
index 3343d0d04bb..048c6be8350 100644
--- a/apps/files/l10n/pt_PT.php
+++ b/apps/files/l10n/pt_PT.php
@@ -58,7 +58,7 @@
"New" => "Novo",
"Text file" => "Ficheiro de texto",
"Folder" => "Pasta",
-"From url" => "Do endereço",
+"From link" => "Da ligação",
"Upload" => "Enviar",
"Cancel upload" => "Cancelar envio",
"Nothing in here. Upload something!" => "Vazio. Envie alguma coisa!",
diff --git a/apps/files/l10n/ro.php b/apps/files/l10n/ro.php
index 24df128b826..4358e64e7b3 100644
--- a/apps/files/l10n/ro.php
+++ b/apps/files/l10n/ro.php
@@ -27,6 +27,7 @@
"Size" => "Dimensiune",
"Modified" => "Modificat",
"seconds ago" => "secunde în urmă",
+"1 minute ago" => "1 minut în urmă",
"today" => "astăzi",
"yesterday" => "ieri",
"last month" => "ultima lună",
@@ -44,7 +45,6 @@
"New" => "Nou",
"Text file" => "Fișier text",
"Folder" => "Dosar",
-"From url" => "De la URL",
"Upload" => "Încarcă",
"Cancel upload" => "Anulează încărcarea",
"Nothing in here. Upload something!" => "Nimic aici. Încarcă ceva!",
diff --git a/apps/files/l10n/ru.php b/apps/files/l10n/ru.php
index 2ba14a1ac03..55901937b47 100644
--- a/apps/files/l10n/ru.php
+++ b/apps/files/l10n/ru.php
@@ -58,7 +58,6 @@
"New" => "Новый",
"Text file" => "Текстовый файл",
"Folder" => "Папка",
-"From url" => "С url",
"Upload" => "Загрузить",
"Cancel upload" => "Отмена загрузки",
"Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!",
diff --git a/apps/files/l10n/ru_RU.php b/apps/files/l10n/ru_RU.php
index d9792a1f8ab..33d24ed74de 100644
--- a/apps/files/l10n/ru_RU.php
+++ b/apps/files/l10n/ru_RU.php
@@ -58,7 +58,7 @@
"New" => "Новый",
"Text file" => "Текстовый файл",
"Folder" => "Папка",
-"From url" => "Из url",
+"From link" => "По ссылке",
"Upload" => "Загрузить ",
"Cancel upload" => "Отмена загрузки",
"Nothing in here. Upload something!" => "Здесь ничего нет. Загрузите что-нибудь!",
diff --git a/apps/files/l10n/si_LK.php b/apps/files/l10n/si_LK.php
index b0243e89753..5a51f07f7c8 100644
--- a/apps/files/l10n/si_LK.php
+++ b/apps/files/l10n/si_LK.php
@@ -1,9 +1,12 @@
<?php $TRANSLATIONS = array(
"There is no error, the file uploaded with success" => "නිවැරදි ව ගොනුව උඩුගත කෙරිනි",
+"The uploaded file exceeds the upload_max_filesize directive in php.ini" => "php.ini හි upload_max_filesize නියමයට වඩා උඩුගත කළ ගොනුව විශාලයි",
"The uploaded file was only partially uploaded" => "උඩුගත කළ ගොනුවේ කොටසක් පමණක් උඩුගත විය",
"No file was uploaded" => "කිසිදු ගොනවක් උඩුගත නොවිනි",
+"Missing a temporary folder" => "තාවකාලික ෆොල්ඩරයක් සොයාගත නොහැක",
"Failed to write to disk" => "තැටිගත කිරීම අසාර්ථකයි",
"Files" => "ගොනු",
+"Unshare" => "නොබෙදු",
"Delete" => "මකන්න",
"Rename" => "නැවත නම් කරන්න",
"replace" => "ප්‍රතිස්ථාපනය කරන්න",
@@ -14,12 +17,20 @@
"Upload cancelled." => "උඩුගත කිරීම අත් හරින්න ලදී",
"Name" => "නම",
"Size" => "ප්‍රමාණය",
+"Modified" => "වෙනස් කළ",
"1 file" => "1 ගොනුවක්",
+"seconds ago" => "තත්පරයන්ට පෙර",
+"1 minute ago" => "1 මිනිත්තුවකට පෙර",
"today" => "අද",
"yesterday" => "පෙර දින",
+"last month" => "පෙර මාසයේ",
+"months ago" => "මාස කීපයකට පෙර",
+"last year" => "පෙර අවුරුද්දේ",
+"years ago" => "අවුරුදු කීපයකට පෙර",
"File handling" => "ගොනු පරිහරණය",
"Maximum upload size" => "උඩුගත කිරීමක උපරිම ප්‍රමාණය",
"max. possible: " => "හැකි උපරිමය:",
+"0 is unlimited" => "0 යනු සීමාවක් නැති බවය",
"Save" => "සුරකින්න",
"New" => "නව",
"Text file" => "පෙළ ගොනුව",
@@ -27,6 +38,8 @@
"Upload" => "උඩුගත කිරීම",
"Cancel upload" => "උඩුගත කිරීම අත් හරින්න",
"Nothing in here. Upload something!" => "මෙහි කිසිවක් නොමැත. යමක් උඩුගත කරන්න",
+"Share" => "බෙදාහදාගන්න",
"Download" => "බාගත කිරීම",
-"Upload too large" => "උඩුගත කිරීම විශාල වැඩිය"
+"Upload too large" => "උඩුගත කිරීම විශාල වැඩිය",
+"The files you are trying to upload exceed the maximum size for file uploads on this server." => "ඔබ උඩුගත කිරීමට තැත් කරන ගොනු මෙම සේවාදායකයා උඩුගත කිරීමට ඉඩදී ඇති උපරිම ගොනු විශාලත්වයට වඩා වැඩිය"
);
diff --git a/apps/files/l10n/sk_SK.php b/apps/files/l10n/sk_SK.php
index cbb89eb8a3f..a8ec32c05e4 100644
--- a/apps/files/l10n/sk_SK.php
+++ b/apps/files/l10n/sk_SK.php
@@ -58,7 +58,7 @@
"New" => "Nový",
"Text file" => "Textový súbor",
"Folder" => "Priečinok",
-"From url" => "Z url",
+"From link" => "Z odkazu",
"Upload" => "Odoslať",
"Cancel upload" => "Zrušiť odosielanie",
"Nothing in here. Upload something!" => "Žiadny súbor. Nahrajte niečo!",
diff --git a/apps/files/l10n/sl.php b/apps/files/l10n/sl.php
index 21e1bf05253..cb240ab33a8 100644
--- a/apps/files/l10n/sl.php
+++ b/apps/files/l10n/sl.php
@@ -50,7 +50,6 @@
"New" => "Nova",
"Text file" => "Besedilna datoteka",
"Folder" => "Mapa",
-"From url" => "Iz naslova URL",
"Upload" => "Pošlji",
"Cancel upload" => "Prekliči pošiljanje",
"Nothing in here. Upload something!" => "Tukaj ni ničesar. Naložite kaj!",
diff --git a/apps/files/l10n/sr.php b/apps/files/l10n/sr.php
index 99e4b12697c..b61b989f33a 100644
--- a/apps/files/l10n/sr.php
+++ b/apps/files/l10n/sr.php
@@ -11,6 +11,7 @@
"Size" => "Величина",
"Modified" => "Задња измена",
"Maximum upload size" => "Максимална величина пошиљке",
+"Save" => "Сними",
"New" => "Нови",
"Text file" => "текстуални фајл",
"Folder" => "фасцикла",
diff --git a/apps/files/l10n/sr@latin.php b/apps/files/l10n/sr@latin.php
index d8c7ef18989..d5a5920b372 100644
--- a/apps/files/l10n/sr@latin.php
+++ b/apps/files/l10n/sr@latin.php
@@ -11,6 +11,7 @@
"Size" => "Veličina",
"Modified" => "Zadnja izmena",
"Maximum upload size" => "Maksimalna veličina pošiljke",
+"Save" => "Snimi",
"Upload" => "Pošalji",
"Nothing in here. Upload something!" => "Ovde nema ničeg. Pošaljite nešto!",
"Download" => "Preuzmi",
diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php
index 0945145d318..eaf16242ef1 100644
--- a/apps/files/l10n/sv.php
+++ b/apps/files/l10n/sv.php
@@ -58,7 +58,7 @@
"New" => "Ny",
"Text file" => "Textfil",
"Folder" => "Mapp",
-"From url" => "Från webbadress",
+"From link" => "Från länk",
"Upload" => "Ladda upp",
"Cancel upload" => "Avbryt uppladdning",
"Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!",
diff --git a/apps/files/l10n/ta_LK.php b/apps/files/l10n/ta_LK.php
index e1c00d05a72..6d295628139 100644
--- a/apps/files/l10n/ta_LK.php
+++ b/apps/files/l10n/ta_LK.php
@@ -58,7 +58,7 @@
"New" => "புதிய",
"Text file" => "கோப்பு உரை",
"Folder" => "கோப்புறை",
-"From url" => "url இலிருந்து",
+"From link" => "இணைப்பிலிருந்து",
"Upload" => "பதிவேற்றுக",
"Cancel upload" => "பதிவேற்றலை இரத்து செய்க",
"Nothing in here. Upload something!" => "இங்கு ஒன்றும் இல்லை. ஏதாவது பதிவேற்றுக!",
diff --git a/apps/files/l10n/th_TH.php b/apps/files/l10n/th_TH.php
index 9bde85229b4..2dc93d394cc 100644
--- a/apps/files/l10n/th_TH.php
+++ b/apps/files/l10n/th_TH.php
@@ -58,7 +58,6 @@
"New" => "อัพโหลดไฟล์ใหม่",
"Text file" => "ไฟล์ข้อความ",
"Folder" => "แฟ้มเอกสาร",
-"From url" => "จาก url",
"Upload" => "อัพโหลด",
"Cancel upload" => "ยกเลิกการอัพโหลด",
"Nothing in here. Upload something!" => "ยังไม่มีไฟล์ใดๆอยู่ที่นี่ กรุณาอัพโหลดไฟล์!",
diff --git a/apps/files/l10n/tr.php b/apps/files/l10n/tr.php
index d9a619353d1..cc9485010e4 100644
--- a/apps/files/l10n/tr.php
+++ b/apps/files/l10n/tr.php
@@ -7,7 +7,9 @@
"Missing a temporary folder" => "Geçici bir klasör eksik",
"Failed to write to disk" => "Diske yazılamadı",
"Files" => "Dosyalar",
+"Unshare" => "Paylaşılmayan",
"Delete" => "Sil",
+"Rename" => "İsim değiştir.",
"replace" => "değiştir",
"cancel" => "iptal",
"undo" => "geri al",
@@ -28,10 +30,10 @@
"Enable ZIP-download" => "ZIP indirmeyi aktif et",
"0 is unlimited" => "0 limitsiz demektir",
"Maximum input size for ZIP files" => "ZIP dosyaları için en fazla girdi sayısı",
+"Save" => "Kaydet",
"New" => "Yeni",
"Text file" => "Metin dosyası",
"Folder" => "Klasör",
-"From url" => "Url'den",
"Upload" => "Yükle",
"Cancel upload" => "Yüklemeyi iptal et",
"Nothing in here. Upload something!" => "Burada hiçbir şey yok. Birşeyler yükleyin!",
diff --git a/apps/files/l10n/uk.php b/apps/files/l10n/uk.php
index 6276b6074ca..c2c3bbd21cb 100644
--- a/apps/files/l10n/uk.php
+++ b/apps/files/l10n/uk.php
@@ -6,6 +6,7 @@
"No file was uploaded" => "Не відвантажено жодного файлу",
"Missing a temporary folder" => "Відсутній тимчасовий каталог",
"Files" => "Файли",
+"Unshare" => "Заборонити доступ",
"Delete" => "Видалити",
"undo" => "відмінити",
"generating ZIP-file, it may take some time." => "Створення ZIP-файлу, це може зайняти певний час.",
@@ -17,13 +18,21 @@
"Name" => "Ім'я",
"Size" => "Розмір",
"Modified" => "Змінено",
+"seconds ago" => "секунди тому",
+"1 minute ago" => "1 хвилину тому",
+"today" => "сьогодні",
+"yesterday" => "вчора",
+"last month" => "минулого місяця",
+"months ago" => "місяці тому",
+"last year" => "минулого року",
+"years ago" => "роки тому",
"Maximum upload size" => "Максимальний розмір відвантажень",
"max. possible: " => "макс.можливе:",
"0 is unlimited" => "0 є безліміт",
+"Save" => "Зберегти",
"New" => "Створити",
"Text file" => "Текстовий файл",
"Folder" => "Папка",
-"From url" => "З URL",
"Upload" => "Відвантажити",
"Cancel upload" => "Перервати завантаження",
"Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!",
diff --git a/apps/files/l10n/vi.php b/apps/files/l10n/vi.php
index f933d6c7912..f152a8c989d 100644
--- a/apps/files/l10n/vi.php
+++ b/apps/files/l10n/vi.php
@@ -58,7 +58,6 @@
"New" => "Mới",
"Text file" => "Tập tin văn bản",
"Folder" => "Folder",
-"From url" => "Từ url",
"Upload" => "Tải lên",
"Cancel upload" => "Hủy upload",
"Nothing in here. Upload something!" => "Không có gì ở đây .Hãy tải lên một cái gì đó !",
diff --git a/apps/files/l10n/zh_CN.GB2312.php b/apps/files/l10n/zh_CN.GB2312.php
index 2a52ac8096e..e68efb72024 100644
--- a/apps/files/l10n/zh_CN.GB2312.php
+++ b/apps/files/l10n/zh_CN.GB2312.php
@@ -27,6 +27,7 @@
"Size" => "大小",
"Modified" => "修改日期",
"seconds ago" => "秒前",
+"1 minute ago" => "1 分钟前",
"today" => "今天",
"yesterday" => "昨天",
"last month" => "上个月",
@@ -44,7 +45,6 @@
"New" => "新建",
"Text file" => "文本文档",
"Folder" => "文件夹",
-"From url" => "从URL:",
"Upload" => "上传",
"Cancel upload" => "取消上传",
"Nothing in here. Upload something!" => "这里没有东西.上传点什么!",
diff --git a/apps/files/l10n/zh_CN.php b/apps/files/l10n/zh_CN.php
index 506c3ad29c0..0046751b24c 100644
--- a/apps/files/l10n/zh_CN.php
+++ b/apps/files/l10n/zh_CN.php
@@ -58,7 +58,6 @@
"New" => "新建",
"Text file" => "文本文件",
"Folder" => "文件夹",
-"From url" => "来自地址",
"Upload" => "上传",
"Cancel upload" => "取消上传",
"Nothing in here. Upload something!" => "这里还什么都没有。上传些东西吧!",
diff --git a/apps/files/l10n/zh_TW.php b/apps/files/l10n/zh_TW.php
index 9013a752bc2..c2792d9dfb2 100644
--- a/apps/files/l10n/zh_TW.php
+++ b/apps/files/l10n/zh_TW.php
@@ -7,7 +7,9 @@
"Missing a temporary folder" => "遺失暫存資料夾",
"Failed to write to disk" => "寫入硬碟失敗",
"Files" => "檔案",
+"Unshare" => "取消共享",
"Delete" => "刪除",
+"Rename" => "重新命名",
"replace" => "取代",
"cancel" => "取消",
"generating ZIP-file, it may take some time." => "產生壓縮檔, 它可能需要一段時間.",
@@ -19,6 +21,14 @@
"Name" => "名稱",
"Size" => "大小",
"Modified" => "修改",
+"seconds ago" => "幾秒前",
+"1 minute ago" => "1 分鐘前",
+"today" => "今天",
+"yesterday" => "昨天",
+"last month" => "上個月",
+"months ago" => "幾個月前",
+"last year" => "去年",
+"years ago" => "幾年前",
"File handling" => "檔案處理",
"Maximum upload size" => "最大上傳容量",
"max. possible: " => "最大允許: ",
@@ -26,10 +36,10 @@
"Enable ZIP-download" => "啟用 Zip 下載",
"0 is unlimited" => "0代表沒有限制",
"Maximum input size for ZIP files" => "針對ZIP檔案最大輸入大小",
+"Save" => "儲存",
"New" => "新增",
"Text file" => "文字檔",
"Folder" => "資料夾",
-"From url" => "由 url ",
"Upload" => "上傳",
"Cancel upload" => "取消上傳",
"Nothing in here. Upload something!" => "沒有任何東西。請上傳內容!",
diff --git a/apps/files/templates/admin.php b/apps/files/templates/admin.php
index c4fe4c86569..a60a1cebaf9 100644
--- a/apps/files/templates/admin.php
+++ b/apps/files/templates/admin.php
@@ -1,4 +1,4 @@
-<?php OCP\Util::addscript('files','admin'); ?>
+<?php OCP\Util::addscript('files', 'admin'); ?>
<form name="filesForm" action='#' method='post'>
<fieldset class="personalblock">
@@ -11,6 +11,7 @@
<input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php echo $_['maxZipInputSize'] ?>' title="<?php echo $l->t( '0 is unlimited' ); ?>"<?php if (!$_['allowZipDownload']) echo ' disabled="disabled"'; ?> />
<label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for ZIP files' ); ?> </label><br />
+ <input type="hidden" value="<?php echo $_['requesttoken']; ?>" name="requesttoken" />
<input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings" value="<?php echo $l->t( 'Save' ); ?>"/>
</fieldset>
</form>
diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php
index d49f2f4d5d3..e2640c1113c 100644
--- a/apps/files/templates/index.php
+++ b/apps/files/templates/index.php
@@ -8,12 +8,14 @@
<ul class="popup popupTop">
<li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
<li style="background-image:url('<?php echo OCP\mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
- <li style="background-image:url('<?php echo OCP\image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From url');?></p></li>
+ <li style="background-image:url('<?php echo OCP\image_path('core', 'actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From link');?></p></li>
</ul>
</div>
<div class="file_upload_wrapper svg">
<form data-upload-id='1' id="data-upload-form" class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
+ <!-- Send the requesttoken, this is needed for older IE versions because they don't send the CSRF token via HTTP header in this case -->
+ <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<input class="file_upload_start" type="file" name='files[]'/>
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 71b695f65f8..ead9ab1ed7d 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,6 +1,6 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?>
- <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
+ <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core', 'breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
</div>
<?php endfor;?>
diff --git a/apps/files/templates/part.list.php b/apps/files/templates/part.list.php
index aaf9c5f57ee..4b5ac325672 100644
--- a/apps/files/templates/part.list.php
+++ b/apps/files/templates/part.list.php
@@ -14,10 +14,10 @@
$relative_modified_date = OCP\relative_modified_date($file['mtime']);
$relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
if($relative_date_color>200) $relative_date_color = 200;
- $name = str_replace('+','%20', urlencode($file['name']));
- $name = str_replace('%2F','/', $name);
- $directory = str_replace('+','%20', urlencode($file['directory']));
- $directory = str_replace('%2F','/', $directory); ?>
+ $name = str_replace('+', '%20', urlencode($file['name']));
+ $name = str_replace('%2F', '/', $name);
+ $directory = str_replace('+', '%20', urlencode($file['directory']));
+ $directory = str_replace('%2F', '/', $directory); ?>
<tr data-id="<?php echo $file['id']; ?>" data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mimetype']?>" data-size='<?php echo $file['size'];?>' data-permissions='<?php echo $file['permissions']; ?>'>
<td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo OCP\mimetype_icon('dir'); else echo OCP\mimetype_icon($file['mimetype']); ?>)">
<?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php
index bb130a366be..3f76e910a52 100644
--- a/apps/files_encryption/appinfo/app.php
+++ b/apps/files_encryption/appinfo/app.php
@@ -6,9 +6,9 @@ OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php
OC_FileProxy::register(new OC_FileProxy_Encryption());
-OCP\Util::connectHook('OC_User','post_login','OC_Crypt','loginListener');
+OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener');
-stream_wrapper_register('crypt','OC_CryptStream');
+stream_wrapper_register('crypt', 'OC_CryptStream');
if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
OCP\User::logout();
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index d057c1ed194..5ff3f578384 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -40,10 +40,10 @@ class OC_Crypt {
static private $bf = null;
public static function loginListener($params) {
- self::init($params['uid'],$params['password']);
+ self::init($params['uid'], $params['password']);
}
- public static function init($login,$password) {
+ public static function init($login, $password) {
$view=new OC_FilesystemView('/');
if(!$view->file_exists('/'.$login)) {
$view->mkdir('/'.$login);
@@ -51,7 +51,7 @@ class OC_Crypt {
OC_FileProxy::$enabled=false;
if(!$view->file_exists('/'.$login.'/encryption.key')) {// does key exist?
- OC_Crypt::createkey($login,$password);
+ OC_Crypt::createkey($login, $password);
}
$key=$view->file_get_contents('/'.$login.'/encryption.key');
OC_FileProxy::$enabled=true;
@@ -80,18 +80,18 @@ class OC_Crypt {
}
}
- public static function createkey($username,$passcode) {
+ public static function createkey($username, $passcode) {
// generate a random key
- $key=mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999).mt_rand(10000,99999);
+ $key=mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999);
// encrypt the key with the passcode of the user
- $enckey=OC_Crypt::encrypt($key,$passcode);
+ $enckey=OC_Crypt::encrypt($key, $passcode);
// Write the file
$proxyEnabled=OC_FileProxy::$enabled;
OC_FileProxy::$enabled=false;
$view=new OC_FilesystemView('/'.$username);
- $view->file_put_contents('/encryption.key',$enckey);
+ $view->file_put_contents('/encryption.key', $enckey);
OC_FileProxy::$enabled=$proxyEnabled;
}
@@ -195,8 +195,8 @@ class OC_Crypt {
public static function blockEncrypt($data, $key='') {
$result='';
while(strlen($data)) {
- $result.=self::encrypt(substr($data,0,8192),$key);
- $data=substr($data,8192);
+ $result.=self::encrypt(substr($data, 0, 8192), $key);
+ $data=substr($data, 8192);
}
return $result;
}
@@ -204,14 +204,14 @@ class OC_Crypt {
/**
* decrypt data in 8192b sized blocks
*/
- public static function blockDecrypt($data, $key='',$maxLength=0) {
+ public static function blockDecrypt($data, $key='', $maxLength=0) {
$result='';
while(strlen($data)) {
- $result.=self::decrypt(substr($data,0,8192),$key);
- $data=substr($data,8192);
+ $result.=self::decrypt(substr($data, 0, 8192), $key);
+ $data=substr($data, 8192);
}
if($maxLength>0) {
- return substr($result,0,$maxLength);
+ return substr($result, 0, $maxLength);
}else{
return rtrim($result, "\0");
}
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index 95b58b8cce7..8b05560050d 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -23,7 +23,7 @@
/**
* transparently encrypted filestream
*
- * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path,'stream'=>$stream)
+ * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream)
* and then fopen('crypt://streams/foo');
*/
@@ -40,7 +40,7 @@ class OC_CryptStream{
if(!self::$rootView) {
self::$rootView=new OC_FilesystemView('');
}
- $path=str_replace('crypt://','',$path);
+ $path=str_replace('crypt://', '', $path);
if(dirname($path)=='streams' and isset(self::$sourceStreams[basename($path)])) {
$this->source=self::$sourceStreams[basename($path)]['stream'];
$this->path=self::$sourceStreams[basename($path)]['path'];
@@ -50,13 +50,13 @@ class OC_CryptStream{
if($mode=='w' or $mode=='w+' or $mode=='wb' or $mode=='wb+') {
$this->size=0;
}else{
- $this->size=self::$rootView->filesize($path,$mode);
+ $this->size=self::$rootView->filesize($path, $mode);
}
OC_FileProxy::$enabled=false;//disable fileproxies so we can open the source file
- $this->source=self::$rootView->fopen($path,$mode);
+ $this->source=self::$rootView->fopen($path, $mode);
OC_FileProxy::$enabled=true;
if(!is_resource($this->source)) {
- OCP\Util::writeLog('files_encryption','failed to open '.$path,OCP\Util::ERROR);
+ OCP\Util::writeLog('files_encryption', 'failed to open '.$path, OCP\Util::ERROR);
}
}
if(is_resource($this->source)) {
@@ -67,7 +67,7 @@ class OC_CryptStream{
public function stream_seek($offset, $whence=SEEK_SET) {
$this->flush();
- fseek($this->source,$offset,$whence);
+ fseek($this->source, $offset, $whence);
}
public function stream_tell() {
@@ -79,11 +79,11 @@ class OC_CryptStream{
//This makes this function a lot simpler but will breake everything the moment it's fixed
$this->writeCache='';
if($count!=8192) {
- OCP\Util::writeLog('files_encryption','php bug 21641 no longer holds, decryption will not work',OCP\Util::FATAL);
+ OCP\Util::writeLog('files_encryption', 'php bug 21641 no longer holds, decryption will not work', OCP\Util::FATAL);
die();
}
$pos=ftell($this->source);
- $data=fread($this->source,8192);
+ $data=fread($this->source, 8192);
if(strlen($data)) {
$result=OC_Crypt::decrypt($data);
}else{
@@ -91,7 +91,7 @@ class OC_CryptStream{
}
$length=$this->size-$pos;
if($length<8192) {
- $result=substr($result,0,$length);
+ $result=substr($result, 0, $length);
}
return $result;
}
@@ -105,12 +105,12 @@ class OC_CryptStream{
}
if($currentPos%8192!=0) {
//make sure we always start on a block start
- fseek($this->source,-($currentPos%8192),SEEK_CUR);
- $encryptedBlock=fread($this->source,8192);
- fseek($this->source,-($currentPos%8192),SEEK_CUR);
+ fseek($this->source, -($currentPos%8192), SEEK_CUR);
+ $encryptedBlock=fread($this->source, 8192);
+ fseek($this->source, -($currentPos%8192), SEEK_CUR);
$block=OC_Crypt::decrypt($encryptedBlock);
- $data=substr($block,0,$currentPos%8192).$data;
- fseek($this->source,-($currentPos%8192),SEEK_CUR);
+ $data=substr($block, 0, $currentPos%8192).$data;
+ fseek($this->source, -($currentPos%8192), SEEK_CUR);
}
$currentPos=ftell($this->source);
while($remainingLength=strlen($data)>0) {
@@ -118,25 +118,25 @@ class OC_CryptStream{
$this->writeCache=$data;
$data='';
}else{
- $encrypted=OC_Crypt::encrypt(substr($data,0,8192));
- fwrite($this->source,$encrypted);
- $data=substr($data,8192);
+ $encrypted=OC_Crypt::encrypt(substr($data, 0, 8192));
+ fwrite($this->source, $encrypted);
+ $data=substr($data, 8192);
}
}
- $this->size=max($this->size,$currentPos+$length);
+ $this->size=max($this->size, $currentPos+$length);
return $length;
}
- public function stream_set_option($option,$arg1,$arg2) {
+ public function stream_set_option($option, $arg1, $arg2) {
switch($option) {
case STREAM_OPTION_BLOCKING:
- stream_set_blocking($this->source,$arg1);
+ stream_set_blocking($this->source, $arg1);
break;
case STREAM_OPTION_READ_TIMEOUT:
- stream_set_timeout($this->source,$arg1,$arg2);
+ stream_set_timeout($this->source, $arg1, $arg2);
break;
case STREAM_OPTION_WRITE_BUFFER:
- stream_set_write_buffer($this->source,$arg1,$arg2);
+ stream_set_write_buffer($this->source, $arg1, $arg2);
}
}
@@ -145,7 +145,7 @@ class OC_CryptStream{
}
public function stream_lock($mode) {
- flock($this->source,$mode);
+ flock($this->source, $mode);
}
public function stream_flush() {
@@ -159,7 +159,7 @@ class OC_CryptStream{
private function flush() {
if($this->writeCache) {
$encrypted=OC_Crypt::encrypt($this->writeCache);
- fwrite($this->source,$encrypted);
+ fwrite($this->source, $encrypted);
$this->writeCache='';
}
}
@@ -167,7 +167,7 @@ class OC_CryptStream{
public function stream_close() {
$this->flush();
if($this->meta['mode']!='r' and $this->meta['mode']!='rb') {
- OC_FileCache::put($this->path, array('encrypted'=>true,'size'=>$this->size),'');
+ OC_FileCache::put($this->path, array('encrypted'=>true, 'size'=>$this->size), '');
}
return fclose($this->source);
}
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 61b87ab5463..4a390013d20 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -36,7 +36,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
*/
private static function shouldEncrypt($path) {
if(is_null(self::$enableEncryption)) {
- self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
+ self::$enableEncryption=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
}
if(!self::$enableEncryption) {
return false;
@@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
* @return bool
*/
private static function isEncrypted($path) {
- $metadata=OC_FileCache_Cached::get($path,'');
+ $metadata=OC_FileCache_Cached::get($path, '');
return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
}
@@ -68,15 +68,15 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
if (!is_resource($data)) {//stream put contents should have been converter to fopen
$size=strlen($data);
$data=OC_Crypt::blockEncrypt($data);
- OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size),'');
+ OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size), '');
}
}
}
- public function postFile_get_contents($path,$data) {
+ public function postFile_get_contents($path, $data) {
if(self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path,'');
- $data=OC_Crypt::blockDecrypt($data,'',$cached['size']);
+ $cached=OC_FileCache_Cached::get($path, '');
+ $data=OC_Crypt::blockDecrypt($data, '', $cached['size']);
}
return $data;
}
@@ -88,40 +88,40 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
$meta=stream_get_meta_data($result);
if(self::isEncrypted($path)) {
fclose($result);
- $result=fopen('crypt://'.$path,$meta['mode']);
+ $result=fopen('crypt://'.$path, $meta['mode']);
}elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) {
//first encrypt the target file so we don't end up with a half encrypted file
- OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
+ OCP\Util::writeLog('files_encryption', 'Decrypting '.$path.' before writing', OCP\Util::DEBUG);
$tmp=fopen('php://temp');
- OCP\Files::streamCopy($result,$tmp);
+ OCP\Files::streamCopy($result, $tmp);
fclose($result);
- OC_Filesystem::file_put_contents($path,$tmp);
+ OC_Filesystem::file_put_contents($path, $tmp);
fclose($tmp);
}
- $result=fopen('crypt://'.$path,$meta['mode']);
+ $result=fopen('crypt://'.$path, $meta['mode']);
}
return $result;
}
- public function postGetMimeType($path,$mime) {
+ public function postGetMimeType($path, $mime) {
if(self::isEncrypted($path)) {
- $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
+ $mime=OCP\Files::getMimeType('crypt://'.$path, 'w');
}
return $mime;
}
- public function postStat($path,$data) {
+ public function postStat($path, $data) {
if(self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path,'');
+ $cached=OC_FileCache_Cached::get($path, '');
$data['size']=$cached['size'];
}
return $data;
}
- public function postFileSize($path,$size) {
+ public function postFileSize($path, $size) {
if(self::isEncrypted($path)) {
- $cached=OC_FileCache_Cached::get($path,'');
+ $cached=OC_FileCache_Cached::get($path, '');
return $cached['size'];
}else{
return $size;
diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php
index 168124a8d22..ae28b088cd6 100644
--- a/apps/files_encryption/settings.php
+++ b/apps/files_encryption/settings.php
@@ -8,11 +8,11 @@
$tmpl = new OCP\Template( 'files_encryption', 'settings');
$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
-$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
-$tmpl->assign('blacklist',$blackList);
-$tmpl->assign('encryption_enabled',$enabled);
+$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
+$tmpl->assign('blacklist', $blackList);
+$tmpl->assign('encryption_enabled', $enabled);
-OCP\Util::addscript('files_encryption','settings');
-OCP\Util::addscript('core','multiselect');
+OCP\Util::addscript('files_encryption', 'settings');
+OCP\Util::addscript('core', 'multiselect');
return $tmpl->fetchPage();
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index a7bc2df0e12..0e119f55bea 100644
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -11,46 +11,46 @@ class Test_Encryption extends UnitTestCase {
$key=uniqid();
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=file_get_contents($file); //nice large text file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
- $chunk=substr($source,0,8192);
- $encrypted=OC_Crypt::encrypt($chunk,$key);
+ $chunk=substr($source, 0, 8192);
+ $encrypted=OC_Crypt::encrypt($chunk, $key);
$this->assertEqual(strlen($chunk), strlen($encrypted));
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$chunk);
+ $this->assertEqual($decrypted, $chunk);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
$tmpFileEncrypted=OCP\Files::tmpFile();
- OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
+ OC_Crypt::encryptfile($file, $tmpFileEncrypted, $key);
$encrypted=file_get_contents($tmpFileEncrypted);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
$tmpFileDecrypted=OCP\Files::tmpFile();
- OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
+ OC_Crypt::decryptfile($tmpFileEncrypted, $tmpFileDecrypted, $key);
$decrypted=file_get_contents($tmpFileDecrypted);
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
$file=OC::$SERVERROOT.'/core/img/weather-clear.png';
$source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertEqual($decrypted, $source);
}
@@ -59,14 +59,14 @@ class Test_Encryption extends UnitTestCase {
$file=__DIR__.'/binary';
$source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key, strlen($source));
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key, strlen($source));
+ $this->assertEqual($decrypted, $source);
}
}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index c3c8f4a2db0..1c800bbc5f6 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -13,8 +13,8 @@ class Test_CryptProxy extends UnitTestCase {
public function setUp() {
$user=OC_User::getUser();
- $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
- OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+ $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption', 'true');
+ OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
$this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
@@ -30,7 +30,7 @@ class Test_CryptProxy extends UnitTestCase {
//set up temporary storage
OC_Filesystem::clearMounts();
- OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/');
+ OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
OC_Filesystem::init('/'.$user.'/files');
@@ -41,7 +41,7 @@ class Test_CryptProxy extends UnitTestCase {
}
public function tearDown() {
- OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
+ OCP\Config::setAppValue('files_encryption', 'enable_encryption', $this->oldConfig);
if(!is_null($this->oldKey)) {
$_SESSION['enckey']=$this->oldKey;
}
@@ -51,16 +51,16 @@ class Test_CryptProxy extends UnitTestCase {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
}
@@ -72,46 +72,46 @@ class Test_CryptProxy extends UnitTestCase {
$view=new OC_FilesystemView('/'.OC_User::getUser());
$userDir='/'.OC_User::getUser().'/files';
- $rootView->file_put_contents($userDir.'/file',$original);
+ $rootView->file_put_contents($userDir.'/file', $original);
OC_FileProxy::$enabled=false;
$stored=$rootView->file_get_contents($userDir.'/file');
OC_FileProxy::$enabled=true;
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$fromFile=$rootView->file_get_contents($userDir.'/file');
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
$fromFile=$view->file_get_contents('files/file');
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
}
public function testBinary() {
$file=__DIR__.'/binary';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
$file=__DIR__.'/zeros';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
}
}
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 5ea0da48017..67b5e98ae67 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -10,27 +10,27 @@ class Test_CryptStream extends UnitTestCase {
private $tmpFiles=array();
function testStream() {
- $stream=$this->getStream('test1','w', strlen('foobar'));
- fwrite($stream,'foobar');
+ $stream=$this->getStream('test1', 'w', strlen('foobar'));
+ fwrite($stream, 'foobar');
fclose($stream);
- $stream=$this->getStream('test1','r', strlen('foobar'));
- $data=fread($stream,6);
+ $stream=$this->getStream('test1', 'r', strlen('foobar'));
+ $data=fread($stream, 6);
fclose($stream);
- $this->assertEqual('foobar',$data);
+ $this->assertEqual('foobar', $data);
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
- $source=fopen($file,'r');
- $target=$this->getStream('test2','w',0);
- OCP\Files::streamCopy($source,$target);
+ $source=fopen($file, 'r');
+ $target=$this->getStream('test2', 'w', 0);
+ OCP\Files::streamCopy($source, $target);
fclose($target);
fclose($source);
- $stream=$this->getStream('test2','r', filesize($file));
+ $stream=$this->getStream('test2', 'r', filesize($file));
$data=stream_get_contents($stream);
$original=file_get_contents($file);
$this->assertEqual(strlen($original), strlen($data));
- $this->assertEqual($original,$data);
+ $this->assertEqual($original, $data);
}
/**
@@ -40,7 +40,7 @@ class Test_CryptStream extends UnitTestCase {
* @param int size
* @return resource
*/
- function getStream($id,$mode,$size) {
+ function getStream($id, $mode, $size) {
if($id==='') {
$id=uniqid();
}
@@ -50,36 +50,36 @@ class Test_CryptStream extends UnitTestCase {
}else{
$file=$this->tmpFiles[$id];
}
- $stream=fopen($file,$mode);
- OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
- return fopen('crypt://streams/'.$id,$mode);
+ $stream=fopen($file, $mode);
+ OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id, 'stream'=>$stream, 'size'=>$size);
+ return fopen('crypt://streams/'.$id, $mode);
}
function testBinary() {
$file=__DIR__.'/binary';
$source=file_get_contents($file);
- $stream=$this->getStream('test','w', strlen($source));
- fwrite($stream,$source);
+ $stream=$this->getStream('test', 'w', strlen($source));
+ fwrite($stream, $source);
fclose($stream);
- $stream=$this->getStream('test','r', strlen($source));
+ $stream=$this->getStream('test', 'r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source,$data);
+ $this->assertEqual($source, $data);
$file=__DIR__.'/zeros';
$source=file_get_contents($file);
- $stream=$this->getStream('test2','w', strlen($source));
- fwrite($stream,$source);
+ $stream=$this->getStream('test2', 'w', strlen($source));
+ fwrite($stream, $source);
fclose($stream);
- $stream=$this->getStream('test2','r', strlen($source));
+ $stream=$this->getStream('test2', 'r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source,$data);
+ $this->assertEqual($source, $data);
}
}
diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php
index 51951c19bfd..8006be1a2f5 100644
--- a/apps/files_external/l10n/cs_CZ.php
+++ b/apps/files_external/l10n/cs_CZ.php
@@ -10,7 +10,7 @@
"Backend" => "Podpůrná vrstva",
"Configuration" => "Nastavení",
"Options" => "Možnosti",
-"Applicable" => "Platný",
+"Applicable" => "Přístupný pro",
"Add mount point" => "Přidat bod připojení",
"None set" => "Nenastaveno",
"All Users" => "Všichni uživatelé",
diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php
index 6cd3ca2bbfd..cdb168dd385 100644
--- a/apps/files_external/l10n/lt_LT.php
+++ b/apps/files_external/l10n/lt_LT.php
@@ -1,6 +1,6 @@
<?php $TRANSLATIONS = array(
"Access granted" => "Priėjimas suteiktas",
-"Error configuring Dropbox storage" => "Klaida nustatinėjantDropbox talpyklą",
+"Error configuring Dropbox storage" => "Klaida nustatinėjant Dropbox talpyklą",
"Grant access" => "Suteikti priėjimą",
"Fill out all required fields" => "Užpildykite visus reikalingus laukelius",
"Please provide a valid Dropbox app key and secret." => "Prašome įvesti teisingus Dropbox \"app key\" ir \"secret\".",
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 9dc3cdd7147..fdc847fcf2c 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -256,7 +256,7 @@ class OC_Mount_Config {
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n";
foreach ($mounts as $mountPoint => $mount) {
- $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
+ $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
}
$content .= "\t\t),\n";
@@ -285,7 +285,12 @@ class OC_Mount_Config {
public static function getCertificates() {
$view = \OCP\Files::getStorage('files_external');
$path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/';
- if (!is_dir($path)) mkdir($path);
+ \OCP\Util::writeLog('files_external', 'checking path '.$path, \OCP\Util::INFO);
+ if(!is_dir($path)) {
+ //path might not exist (e.g. non-standard OC_User::getHome() value)
+ //in this case create full path using 3rd (recursive=true) parameter.
+ mkdir($path, 0777, true);
+ }
$result = array();
$handle = opendir($path);
if (!$handle) {
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 13d1387f287..650ca88fd93 100644
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -19,7 +19,15 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$this->host=$params['host'];
$this->user=$params['user'];
$this->password=$params['password'];
- $this->secure=isset($params['secure'])?(bool)$params['secure']:false;
+ if(isset($params['secure'])){
+ if(is_string($params['secure'])){
+ $this->secure = ($params['secure'] === 'true');
+ }else{
+ $this->secure = (bool)$params['secure'];
+ }
+ }else{
+ $this->secure = false;
+ }
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
@@ -43,7 +51,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
return $url;
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
switch($mode) {
case 'r':
case 'rb':
@@ -53,7 +61,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
case 'ab':
//these are supported by the wrapper
$context = stream_context_create(array('ftp' => array('overwrite' => true)));
- return fopen($this->constructUrl($path),$mode, false,$context);
+ return fopen($this->constructUrl($path), $mode, false, $context);
case 'r+':
case 'w+':
case 'wb+':
@@ -63,18 +71,18 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
case 'c':
case 'c+':
//emulate these
- if(strrpos($path,'.')!==false) {
- $ext=substr($path, strrpos($path,'.'));
+ if(strrpos($path, '.')!==false) {
+ $ext=substr($path, strrpos($path, '.'));
}else{
$ext='';
}
$tmpFile=OCP\Files::tmpFile($ext);
- OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+ OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
if($this->file_exists($path)) {
- $this->getFile($path,$tmpFile);
+ $this->getFile($path, $tmpFile);
}
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
}
diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php
index 32d57ed3cef..e5de81280ac 100644
--- a/apps/files_external/lib/google.php
+++ b/apps/files_external/lib/google.php
@@ -394,8 +394,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
case 'x+':
case 'c':
case 'c+':
- if (strrpos($path,'.') !== false) {
- $ext = substr($path, strrpos($path,'.'));
+ if (strrpos($path, '.') !== false) {
+ $ext = substr($path, strrpos($path, '.'));
} else {
$ext = '';
}
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index eed2582dc99..802d80d8d1f 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -24,14 +24,14 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
- if(substr($this->root,-1,1)!='/') {
+ if(substr($this->root, -1, 1)!='/') {
$this->root.='/';
}
if(!$this->share || $this->share[0]!='/') {
$this->share='/'.$this->share;
}
- if(substr($this->share,-1,1)=='/') {
- $this->share=substr($this->share,0,-1);
+ if(substr($this->share, -1, 1)=='/') {
+ $this->share=substr($this->share, 0, -1);
}
//create the root folder if necesary
@@ -41,8 +41,8 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
}
public function constructUrl($path) {
- if(substr($path,-1)=='/') {
- $path=substr($path,0,-1);
+ if(substr($path, -1)=='/') {
+ $path=substr($path, 0, -1);
}
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
}
@@ -67,7 +67,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
if(!$path and $this->root=='/') {
//mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough
return true;
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index 7263ef23253..b66a0f0ee1b 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -50,34 +50,34 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
return $succes;
}
- public function fopen($path,$mode) {
- return fopen($this->constructUrl($path),$mode);
+ public function fopen($path, $mode) {
+ return fopen($this->constructUrl($path), $mode);
}
public function free_space($path) {
return 0;
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
if(is_null($mtime)) {
- $fh=$this->fopen($path,'a');
- fwrite($fh,'');
+ $fh=$this->fopen($path, 'a');
+ fwrite($fh, '');
fclose($fh);
}else{
return false;//not supported
}
}
- public function getFile($path,$target) {
- return copy($this->constructUrl($path),$target);
+ public function getFile($path, $target) {
+ return copy($this->constructUrl($path), $target);
}
- public function uploadFile($path,$target) {
- return copy($path,$this->constructUrl($target));
+ public function uploadFile($path, $target) {
+ return copy($path, $this->constructUrl($target));
}
- public function rename($path1,$path2) {
- return rename($this->constructUrl($path1),$this->constructUrl($path2));
+ public function rename($path1, $path2) {
+ return rename($this->constructUrl($path1), $this->constructUrl($path2));
}
public function stat($path) {
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 632c72c280f..9c9754ac346 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -39,8 +39,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @return string
*/
private function getContainerName($path) {
- $path=trim(trim($this->root,'/')."/".$path,'/.');
- return str_replace('/','\\',$path);
+ $path=trim(trim($this->root, '/')."/".$path, '/.');
+ return str_replace('/', '\\', $path);
}
/**
@@ -189,7 +189,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name
* @return bool
*/
- private function addSubContainer($container,$name) {
+ private function addSubContainer($container, $name) {
if(!$name) {
return false;
}
@@ -201,16 +201,16 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
foreach($containers as &$sub) {
$sub=trim($sub);
}
- if(array_search($name,$containers)!==false) {
+ if(array_search($name, $containers)!==false) {
unlink($tmpFile);
return false;
}else{
- $fh=fopen($tmpFile,'a');
- fwrite($fh,$name."\n");
+ $fh=fopen($tmpFile, 'a');
+ fwrite($fh, $name."\n");
}
}catch(Exception $e) {
$containers=array();
- file_put_contents($tmpFile,$name."\n");
+ file_put_contents($tmpFile, $name."\n");
}
$obj->load_from_filename($tmpFile);
@@ -224,7 +224,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name
* @return bool
*/
- private function removeSubContainer($container,$name) {
+ private function removeSubContainer($container, $name) {
if(!$name) {
return false;
}
@@ -239,13 +239,13 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
foreach($containers as &$sub) {
$sub=trim($sub);
}
- $i=array_search($name,$containers);
+ $i=array_search($name, $containers);
if($i===false) {
unlink($tmpFile);
return false;
}else{
unset($containers[$i]);
- file_put_contents($tmpFile, implode("\n",$containers)."\n");
+ file_put_contents($tmpFile, implode("\n", $containers)."\n");
}
$obj->load_from_filename($tmpFile);
@@ -271,7 +271,15 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$this->host=$params['host'];
$this->user=$params['user'];
$this->root=isset($params['root'])?$params['root']:'/';
- $this->secure=isset($params['secure'])?(bool)$params['secure']:true;
+ if(isset($params['secure'])){
+ if(is_string($params['secure'])){
+ $this->secure = ($params['secure'] === 'true');
+ }else{
+ $this->secure = (bool)$params['secure'];
+ }
+ }else{
+ $this->secure = false;
+ }
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
@@ -337,12 +345,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
public function opendir($path) {
$container=$this->getContainer($path);
$files=$this->getObjects($container);
- $i=array_search(self::SUBCONTAINER_FILE,$files);
+ $i=array_search(self::SUBCONTAINER_FILE, $files);
if($i!==false) {
unset($files[$i]);
}
$subContainers=$this->getSubContainers($container);
- $files=array_merge($files,$subContainers);
+ $files=array_merge($files, $subContainers);
$id=$this->getContainerName($path);
OC_FakeDirStream::$dirs[$id]=$files;
return opendir('fakedir://'.$id);
@@ -380,7 +388,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return $obj->read();
}
- public function file_put_contents($path,$content) {
+ public function file_put_contents($path, $content) {
$obj=$this->getObject($path);
if(is_null($obj)) {
$container=$this->getContainer(dirname($path));
@@ -406,7 +414,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
switch($mode) {
case 'r':
case 'rb':
@@ -432,9 +440,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
case 'c':
case 'c+':
$tmpFile=$this->getTmpFile($path);
- OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+ OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
}
@@ -449,7 +457,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return 1024*1024*1024*8;
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
$obj=$this->getObject($path);
if(is_null($obj)) {
return false;
@@ -463,10 +471,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$obj->sync_metadata();
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2));
- $result=$sourceContainer->move_object_to(basename($path1),$targetContainer, basename($path2));
+ $result=$sourceContainer->move_object_to(basename($path1), $targetContainer, basename($path2));
unset($this->objects[$path1]);
if($result) {
$targetObj=$this->getObject($path2);
@@ -475,10 +483,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return $result;
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2));
- $result=$sourceContainer->copy_object_to(basename($path1),$targetContainer, basename($path2));
+ $result=$sourceContainer->copy_object_to(basename($path1), $targetContainer, basename($path2));
if($result) {
$targetObj=$this->getObject($path2);
$this->resetMTime($targetObj);
@@ -525,7 +533,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
}
- private function fromTmpFile($tmpFile,$path) {
+ private function fromTmpFile($tmpFile, $path) {
$obj=$this->getObject($path);
if(is_null($obj)) {
$obj=$this->createObject($path);
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 74e468a2838..ec942b11f6a 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -22,17 +22,25 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
public function __construct($params) {
$host = $params['host'];
//remove leading http[s], will be generated in createBaseUri()
- if (substr($host,0,8) == "https://") $host = substr($host, 8);
- else if (substr($host,0,7) == "http://") $host = substr($host, 7);
+ if (substr($host, 0, 8) == "https://") $host = substr($host, 8);
+ else if (substr($host, 0, 7) == "http://") $host = substr($host, 7);
$this->host=$host;
$this->user=$params['user'];
$this->password=$params['password'];
- $this->secure=(isset($params['secure']) && $params['secure'] == 'true')?true:false;
+ if(isset($params['secure'])){
+ if(is_string($params['secure'])){
+ $this->secure = ($params['secure'] === 'true');
+ }else{
+ $this->secure = (bool)$params['secure'];
+ }
+ }else{
+ $this->secure = false;
+ }
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
- if(substr($this->root,-1,1)!='/') {
+ if(substr($this->root, -1, 1)!='/') {
$this->root.='/';
}
@@ -46,7 +54,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
if($caview = \OCP\Files::getStorage('files_external')) {
$certPath=\OCP\Config::getSystemValue('datadirectory').$caview->getAbsolutePath("").'rootcerts.crt';
- if (file_exists($certPath)) {
+ if (file_exists($certPath)) {
$this->client->addTrustedCertificates($certPath);
}
}
@@ -65,18 +73,18 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
public function mkdir($path) {
$path=$this->cleanPath($path);
- return $this->simpleResponse('MKCOL',$path, null,201);
+ return $this->simpleResponse('MKCOL', $path, null, 201);
}
public function rmdir($path) {
$path=$this->cleanPath($path);
- return $this->simpleResponse('DELETE',$path, null,204);
+ return $this->simpleResponse('DELETE', $path, null, 204);
}
public function opendir($path) {
$path=$this->cleanPath($path);
try{
- $response=$this->client->propfind($path, array(),1);
+ $response=$this->client->propfind($path, array(), 1);
$id=md5('webdav'.$this->root.$path);
OC_FakeDirStream::$dirs[$id]=array();
$files=array_keys($response);
@@ -123,10 +131,10 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
public function unlink($path) {
- return $this->simpleResponse('DELETE',$path, null,204);
+ return $this->simpleResponse('DELETE', $path, null, 204);
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
$path=$this->cleanPath($path);
switch($mode) {
case 'r':
@@ -137,7 +145,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
//straight up curl instead of sabredav here, sabredav put's the entire get result in memory
$curl = curl_init();
$fp = fopen('php://temp', 'r+');
- curl_setopt($curl,CURLOPT_USERPWD,$this->user.':'.$this->password);
+ curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$path);
curl_setopt($curl, CURLOPT_FILE, $fp);
@@ -158,18 +166,18 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
case 'c':
case 'c+':
//emulate these
- if(strrpos($path,'.')!==false) {
- $ext=substr($path, strrpos($path,'.'));
+ if(strrpos($path, '.')!==false) {
+ $ext=substr($path, strrpos($path, '.'));
}else{
$ext='';
}
$tmpFile=OCP\Files::tmpFile($ext);
- OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+ OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
if($this->file_exists($path)) {
- $this->getFile($path,$tmpFile);
+ $this->getFile($path, $tmpFile);
}
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
}
@@ -194,7 +202,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
if(is_null($mtime)) {
$mtime=time();
}
@@ -202,16 +210,16 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
}
- public function getFile($path,$target) {
- $source=$this->fopen($path,'r');
- file_put_contents($target,$source);
+ public function getFile($path, $target) {
+ $source=$this->fopen($path, 'r');
+ file_put_contents($target, $source);
}
- public function uploadFile($path,$target) {
- $source=fopen($path,'r');
+ public function uploadFile($path, $target) {
+ $source=fopen($path, 'r');
$curl = curl_init();
- curl_setopt($curl,CURLOPT_USERPWD,$this->user.':'.$this->password);
+ curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$target);
curl_setopt($curl, CURLOPT_BINARYTRANSFER, true);
curl_setopt($curl, CURLOPT_INFILE, $source); // file pointer
@@ -221,7 +229,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
curl_close ($curl);
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
try{
@@ -235,7 +243,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
try{
@@ -252,7 +260,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
public function stat($path) {
$path=$this->cleanPath($path);
try{
- $response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength'));
+ $response=$this->client->propfind($path, array('{DAV:}getlastmodified', '{DAV:}getcontentlength'));
return array(
'mtime'=>strtotime($response['{DAV:}getlastmodified']),
'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
@@ -266,7 +274,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
public function getMimeType($path) {
$path=$this->cleanPath($path);
try{
- $response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype'));
+ $response=$this->client->propfind($path, array('{DAV:}getcontenttype', '{DAV:}resourcetype'));
$responseType=$response["{DAV:}resourcetype"]->resourceType;
$type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
if($type=='dir') {
@@ -283,16 +291,16 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
private function cleanPath($path) {
if(!$path || $path[0]=='/') {
- return substr($path,1);
+ return substr($path, 1);
}else{
return $path;
}
}
- private function simpleResponse($method,$path,$body,$expected) {
+ private function simpleResponse($method, $path, $body, $expected) {
$path=$this->cleanPath($path);
try{
- $response=$this->client->request($method,$path,$body);
+ $response=$this->client->request($method, $path, $body);
return $response['statusCode']==$expected;
}catch(Exception $e) {
return false;
diff --git a/apps/files_external/tests/ftp.php b/apps/files_external/tests/ftp.php
index 4549c420410..80288b59114 100644
--- a/apps/files_external/tests/ftp.php
+++ b/apps/files_external/tests/ftp.php
@@ -24,4 +24,22 @@ class Test_Filestorage_FTP extends Test_FileStorage {
OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
+
+ public function testConstructUrl(){
+ $config = array ( 'host' => 'localhost', 'user' => 'ftp', 'password' => 'ftp', 'root' => '/', 'secure' => false );
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = true;
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = 'false';
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
+
+ $config['secure'] = 'true';
+ $instance = new OC_Filestorage_FTP($config);
+ $this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
+ }
}
diff --git a/apps/files_sharing/l10n/et_EE.php b/apps/files_sharing/l10n/et_EE.php
index 94b9b1d7aef..36290ad2787 100644
--- a/apps/files_sharing/l10n/et_EE.php
+++ b/apps/files_sharing/l10n/et_EE.php
@@ -1,6 +1,8 @@
<?php $TRANSLATIONS = array(
"Password" => "Parool",
"Submit" => "Saada",
+"%s shared the folder %s with you" => "%s jagas sinuga kausta %s",
+"%s shared the file %s with you" => "%s jagas sinuga faili %s",
"Download" => "Lae alla",
"No preview available for" => "Eelvaadet pole saadaval",
"web services under your control" => "veebitenused sinu kontrolli all"
diff --git a/apps/files_sharing/l10n/nb_NO.php b/apps/files_sharing/l10n/nb_NO.php
index 6102b03db74..4934c341067 100644
--- a/apps/files_sharing/l10n/nb_NO.php
+++ b/apps/files_sharing/l10n/nb_NO.php
@@ -1,6 +1,9 @@
<?php $TRANSLATIONS = array(
-"Size" => "Størrelse",
-"Modified" => "Endret",
-"Delete all" => "Slett alle",
-"Delete" => "Slett"
+"Password" => "Passord",
+"Submit" => "Send inn",
+"%s shared the folder %s with you" => "%s delte mappen %s med deg",
+"%s shared the file %s with you" => "%s delte filen %s med deg",
+"Download" => "Last ned",
+"No preview available for" => "Forhåndsvisning ikke tilgjengelig for",
+"web services under your control" => "web tjenester du kontrollerer"
);
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 7271dcc930b..ac6fb1f683e 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -451,7 +451,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
//TODO
return false;
}
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 105e94f1140..295273d842b 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -1,223 +1,223 @@
-<?php
-// Load other apps for file previews
-OC_App::loadApps();
-
-// Compatibility with shared-by-link items from ownCloud 4.0
-// requires old Sharing table !
-// support will be removed in OC 5.0,a
-if (isset($_GET['token'])) {
- unset($_GET['file']);
- $qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ? LIMIT 1');
- $filepath = $qry->execute(array($_GET['token']))->fetchOne();
- if(isset($filepath)) {
- $info = OC_FileCache_Cached::get($filepath, '');
- if(strtolower($info['mimetype']) == 'httpd/unix-directory') {
- $_GET['dir'] = $filepath;
- } else {
- $_GET['file'] = $filepath;
- }
- \OCP\Util::writeLog('files_sharing', 'You have files that are shared by link originating from ownCloud 4.0. Redistribute the new links, because backwards compatibility will be removed in ownCloud 5.', \OCP\Util::WARN);
- }
-}
-// Enf of backward compatibility
-
-function getID($path) {
- // use the share table from the db to find the item source if the file was reshared because shared files
- //are not stored in the file cache.
- if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") {
- $path_parts = explode('/', $path, 5);
- $user = $path_parts[1];
- $intPath = '/'.$path_parts[4];
- $query = \OC_DB::prepare('SELECT item_source FROM *PREFIX*share WHERE uid_owner = ? AND file_target = ? ');
- $result = $query->execute(array($user, $intPath));
- $row = $result->fetchRow();
- $fileSource = $row['item_source'];
- } else {
- $fileSource = OC_Filecache::getId($path, '');
- }
-
- return $fileSource;
-}
-
-if (isset($_GET['file']) || isset($_GET['dir'])) {
- if (isset($_GET['dir'])) {
- $type = 'folder';
- $path = $_GET['dir'];
- if(strlen($path)>1 and substr($path, -1, 1)==='/') {
- $path=substr($path, 0, -1);
- }
- $baseDir = $path;
- $dir = $baseDir;
- } else {
- $type = 'file';
- $path = $_GET['file'];
- if(strlen($path)>1 and substr($path, -1, 1)==='/') {
- $path=substr($path, 0, -1);
- }
- }
- $uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
- if (OCP\User::userExists($uidOwner)) {
- OC_Util::setupFS($uidOwner);
- $fileSource = getId($path);
- if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {
- // TODO Fix in the getItems
- if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {
- header('HTTP/1.0 404 Not Found');
- $tmpl = new OCP\Template('', '404', 'guest');
- $tmpl->printPage();
- exit();
- }
- if (isset($linkItem['share_with'])) {
- // Check password
- if (isset($_GET['file'])) {
- $url = OCP\Util::linkToPublic('files').'&file='.$_GET['file'];
- } else {
- $url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'];
- }
- if (isset($_POST['password'])) {
- $password = $_POST['password'];
- $storedHash = $linkItem['share_with'];
- $forcePortable = (CRYPT_BLOWFISH != 1);
- $hasher = new PasswordHash(8, $forcePortable);
- if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash))) {
- $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
- $tmpl->assign('URL', $url);
- $tmpl->assign('error', true);
- $tmpl->printPage();
- exit();
- } else {
- // Save item id in session for future requests
- $_SESSION['public_link_authenticated'] = $linkItem['id'];
- }
- // Check if item id is set in session
- } else if (!isset($_SESSION['public_link_authenticated']) || $_SESSION['public_link_authenticated'] !== $linkItem['id']) {
- // Prompt for password
- $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
- $tmpl->assign('URL', $url);
- $tmpl->printPage();
- exit();
- }
- }
- $path = $linkItem['path'];
- if (isset($_GET['path'])) {
- $path .= $_GET['path'];
- $dir .= $_GET['path'];
- if (!OC_Filesystem::file_exists($path)) {
- header('HTTP/1.0 404 Not Found');
- $tmpl = new OCP\Template('', '404', 'guest');
- $tmpl->printPage();
- exit();
- }
- }
- // Download the file
- if (isset($_GET['download'])) {
- if (isset($_GET['dir'])) {
- if ( isset($_GET['files']) ) { // download selected files
- OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
- } else if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
- OC_Files::get('', $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
- } else { // download the whole shared directory
- OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
- }
- } else { // download a single shared file
- OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
- }
-
- } else {
- OCP\Util::addStyle('files_sharing', 'public');
- OCP\Util::addScript('files_sharing', 'public');
- OCP\Util::addScript('files', 'fileactions');
- $tmpl = new OCP\Template('files_sharing', 'public', 'base');
- $tmpl->assign('owner', $uidOwner);
- // Show file list
- if (OC_Filesystem::is_dir($path)) {
- OCP\Util::addStyle('files', 'files');
- OCP\Util::addScript('files', 'files');
- OCP\Util::addScript('files', 'filelist');
- $files = array();
- $rootLength = strlen($baseDir) + 1;
- foreach (OC_Files::getDirectoryContent($path) as $i) {
- $i['date'] = OCP\Util::formatDate($i['mtime']);
- if ($i['type'] == 'file') {
- $fileinfo = pathinfo($i['name']);
- $i['basename'] = $fileinfo['filename'];
- $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
- }
- $i['directory'] = '/'.substr('/'.$uidOwner.'/files'.$i['directory'], $rootLength);
- if ($i['directory'] == '/') {
- $i['directory'] = '';
- }
- $i['permissions'] = OCP\Share::PERMISSION_READ;
- $files[] = $i;
- }
- // Make breadcrumb
- $breadcrumb = array();
- $pathtohere = '';
- $count = 1;
- foreach (explode('/', $dir) as $i) {
- if ($i != '') {
- if ($i != $baseDir) {
- $pathtohere .= '/'.$i;
- }
- if ( strlen($pathtohere) < strlen($_GET['dir'])) {
- continue;
- }
- $breadcrumb[] = array('dir' => str_replace($_GET['dir'], "", $pathtohere, $count), 'name' => $i);
- }
- }
- $list = new OCP\Template('files', 'part.list', '');
- $list->assign('files', $files, false);
- $list->assign('publicListView', true);
- $list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);
- $list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path=', false);
- $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );
- $breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
- $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);
- $folder = new OCP\Template('files', 'index', '');
- $folder->assign('fileList', $list->fetchPage(), false);
- $folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
- $folder->assign('dir', basename($dir));
- $folder->assign('isCreatable', false);
- $folder->assign('permissions', 0);
- $folder->assign('files', $files);
- $folder->assign('uploadMaxFilesize', 0);
- $folder->assign('uploadMaxHumanFilesize', 0);
- $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
- $tmpl->assign('folder', $folder->fetchPage(), false);
- $tmpl->assign('uidOwner', $uidOwner);
- $tmpl->assign('dir', basename($dir));
- $tmpl->assign('filename', basename($path));
- $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
- $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
- if (isset($_GET['path'])) {
- $getPath = $_GET['path'];
- } else {
- $getPath = '';
- }
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.urlencode($getPath), false);
- } else {
- // Show file preview if viewer is available
- $tmpl->assign('uidOwner', $uidOwner);
- $tmpl->assign('dir', dirname($path));
- $tmpl->assign('filename', basename($path));
- $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
- if ($type == 'file') {
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&file='.urlencode($_GET['file']).'&download', false);
- } else {
- if (isset($_GET['path'])) {
- $getPath = $_GET['path'];
- } else {
- $getPath = '';
- }
- $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.urlencode($getPath), false);
- }
- }
- $tmpl->printPage();
- }
- exit();
- }
- }
-}
-header('HTTP/1.0 404 Not Found');
-$tmpl = new OCP\Template('', '404', 'guest');
-$tmpl->printPage();
+<?php
+// Load other apps for file previews
+OC_App::loadApps();
+
+// Compatibility with shared-by-link items from ownCloud 4.0
+// requires old Sharing table !
+// support will be removed in OC 5.0,a
+if (isset($_GET['token'])) {
+ unset($_GET['file']);
+ $qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ? LIMIT 1');
+ $filepath = $qry->execute(array($_GET['token']))->fetchOne();
+ if(isset($filepath)) {
+ $info = OC_FileCache_Cached::get($filepath, '');
+ if(strtolower($info['mimetype']) == 'httpd/unix-directory') {
+ $_GET['dir'] = $filepath;
+ } else {
+ $_GET['file'] = $filepath;
+ }
+ \OCP\Util::writeLog('files_sharing', 'You have files that are shared by link originating from ownCloud 4.0. Redistribute the new links, because backwards compatibility will be removed in ownCloud 5.', \OCP\Util::WARN);
+ }
+}
+// Enf of backward compatibility
+
+function getID($path) {
+ // use the share table from the db to find the item source if the file was reshared because shared files
+ //are not stored in the file cache.
+ if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") {
+ $path_parts = explode('/', $path, 5);
+ $user = $path_parts[1];
+ $intPath = '/'.$path_parts[4];
+ $query = \OC_DB::prepare('SELECT item_source FROM *PREFIX*share WHERE uid_owner = ? AND file_target = ? ');
+ $result = $query->execute(array($user, $intPath));
+ $row = $result->fetchRow();
+ $fileSource = $row['item_source'];
+ } else {
+ $fileSource = OC_Filecache::getId($path, '');
+ }
+
+ return $fileSource;
+}
+
+if (isset($_GET['file']) || isset($_GET['dir'])) {
+ if (isset($_GET['dir'])) {
+ $type = 'folder';
+ $path = $_GET['dir'];
+ if(strlen($path)>1 and substr($path, -1, 1)==='/') {
+ $path=substr($path, 0, -1);
+ }
+ $baseDir = $path;
+ $dir = $baseDir;
+ } else {
+ $type = 'file';
+ $path = $_GET['file'];
+ if(strlen($path)>1 and substr($path, -1, 1)==='/') {
+ $path=substr($path, 0, -1);
+ }
+ }
+ $uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
+ if (OCP\User::userExists($uidOwner)) {
+ OC_Util::setupFS($uidOwner);
+ $fileSource = getId($path);
+ if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {
+ // TODO Fix in the getItems
+ if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {
+ header('HTTP/1.0 404 Not Found');
+ $tmpl = new OCP\Template('', '404', 'guest');
+ $tmpl->printPage();
+ exit();
+ }
+ if (isset($linkItem['share_with'])) {
+ // Check password
+ if (isset($_GET['file'])) {
+ $url = OCP\Util::linkToPublic('files').'&file='.$_GET['file'];
+ } else {
+ $url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'];
+ }
+ if (isset($_POST['password'])) {
+ $password = $_POST['password'];
+ $storedHash = $linkItem['share_with'];
+ $forcePortable = (CRYPT_BLOWFISH != 1);
+ $hasher = new PasswordHash(8, $forcePortable);
+ if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash))) {
+ $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
+ $tmpl->assign('URL', $url);
+ $tmpl->assign('error', true);
+ $tmpl->printPage();
+ exit();
+ } else {
+ // Save item id in session for future requests
+ $_SESSION['public_link_authenticated'] = $linkItem['id'];
+ }
+ // Check if item id is set in session
+ } else if (!isset($_SESSION['public_link_authenticated']) || $_SESSION['public_link_authenticated'] !== $linkItem['id']) {
+ // Prompt for password
+ $tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
+ $tmpl->assign('URL', $url);
+ $tmpl->printPage();
+ exit();
+ }
+ }
+ $path = $linkItem['path'];
+ if (isset($_GET['path'])) {
+ $path .= $_GET['path'];
+ $dir .= $_GET['path'];
+ if (!OC_Filesystem::file_exists($path)) {
+ header('HTTP/1.0 404 Not Found');
+ $tmpl = new OCP\Template('', '404', 'guest');
+ $tmpl->printPage();
+ exit();
+ }
+ }
+ // Download the file
+ if (isset($_GET['download'])) {
+ if (isset($_GET['dir'])) {
+ if ( isset($_GET['files']) ) { // download selected files
+ OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ } else if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
+ OC_Files::get('', $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ } else { // download the whole shared directory
+ OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ }
+ } else { // download a single shared file
+ OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+ }
+
+ } else {
+ OCP\Util::addStyle('files_sharing', 'public');
+ OCP\Util::addScript('files_sharing', 'public');
+ OCP\Util::addScript('files', 'fileactions');
+ $tmpl = new OCP\Template('files_sharing', 'public', 'base');
+ $tmpl->assign('owner', $uidOwner);
+ // Show file list
+ if (OC_Filesystem::is_dir($path)) {
+ OCP\Util::addStyle('files', 'files');
+ OCP\Util::addScript('files', 'files');
+ OCP\Util::addScript('files', 'filelist');
+ $files = array();
+ $rootLength = strlen($baseDir) + 1;
+ foreach (OC_Files::getDirectoryContent($path) as $i) {
+ $i['date'] = OCP\Util::formatDate($i['mtime']);
+ if ($i['type'] == 'file') {
+ $fileinfo = pathinfo($i['name']);
+ $i['basename'] = $fileinfo['filename'];
+ $i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
+ }
+ $i['directory'] = '/'.substr('/'.$uidOwner.'/files'.$i['directory'], $rootLength);
+ if ($i['directory'] == '/') {
+ $i['directory'] = '';
+ }
+ $i['permissions'] = OCP\Share::PERMISSION_READ;
+ $files[] = $i;
+ }
+ // Make breadcrumb
+ $breadcrumb = array();
+ $pathtohere = '';
+ $count = 1;
+ foreach (explode('/', $dir) as $i) {
+ if ($i != '') {
+ if ($i != $baseDir) {
+ $pathtohere .= '/'.$i;
+ }
+ if ( strlen($pathtohere) < strlen($_GET['dir'])) {
+ continue;
+ }
+ $breadcrumb[] = array('dir' => str_replace($_GET['dir'], "", $pathtohere, $count), 'name' => $i);
+ }
+ }
+ $list = new OCP\Template('files', 'part.list', '');
+ $list->assign('files', $files, false);
+ $list->assign('publicListView', true);
+ $list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);
+ $list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path=', false);
+ $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );
+ $breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
+ $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']).'&path=', false);
+ $folder = new OCP\Template('files', 'index', '');
+ $folder->assign('fileList', $list->fetchPage(), false);
+ $folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
+ $folder->assign('dir', basename($dir));
+ $folder->assign('isCreatable', false);
+ $folder->assign('permissions', 0);
+ $folder->assign('files', $files);
+ $folder->assign('uploadMaxFilesize', 0);
+ $folder->assign('uploadMaxHumanFilesize', 0);
+ $folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
+ $tmpl->assign('folder', $folder->fetchPage(), false);
+ $tmpl->assign('uidOwner', $uidOwner);
+ $tmpl->assign('dir', basename($dir));
+ $tmpl->assign('filename', basename($path));
+ $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
+ $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
+ if (isset($_GET['path'])) {
+ $getPath = $_GET['path'];
+ } else {
+ $getPath = '';
+ }
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.urlencode($getPath), false);
+ } else {
+ // Show file preview if viewer is available
+ $tmpl->assign('uidOwner', $uidOwner);
+ $tmpl->assign('dir', dirname($path));
+ $tmpl->assign('filename', basename($path));
+ $tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
+ if ($type == 'file') {
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&file='.urlencode($_GET['file']).'&download', false);
+ } else {
+ if (isset($_GET['path'])) {
+ $getPath = $_GET['path'];
+ } else {
+ $getPath = '';
+ }
+ $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.urlencode($_GET['dir']).'&path='.urlencode($getPath), false);
+ }
+ }
+ $tmpl->printPage();
+ }
+ exit();
+ }
+ }
+}
+header('HTTP/1.0 404 Not Found');
+$tmpl = new OCP\Template('', '404', 'guest');
+$tmpl->printPage();
diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php
index 746f89a8139..599d302e6e4 100644
--- a/apps/files_versions/appinfo/app.php
+++ b/apps/files_versions/appinfo/app.php
@@ -5,7 +5,7 @@ OC::$CLASSPATH['OCA_Versions\Storage'] = 'apps/files_versions/lib/versions.php';
OC::$CLASSPATH['OCA_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php';
OCP\App::registerAdmin('files_versions', 'settings');
-OCP\App::registerPersonal('files_versions','settings-personal');
+OCP\App::registerPersonal('files_versions', 'settings-personal');
OCP\Util::addscript('files_versions', 'versions');
diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php
index 0ebb34f45e4..deff735cedc 100644
--- a/apps/files_versions/history.php
+++ b/apps/files_versions/history.php
@@ -22,7 +22,7 @@
*/
OCP\User::checkLoggedIn( );
-OCP\Util::addStyle('files_versions','versions');
+OCP\Util::addStyle('files_versions', 'versions');
$tmpl = new OCP\Template( 'files_versions', 'history', 'user' );
if ( isset( $_GET['path'] ) ) {
diff --git a/apps/files_versions/l10n/nb_NO.php b/apps/files_versions/l10n/nb_NO.php
index 55cc12113d7..b441008db01 100644
--- a/apps/files_versions/l10n/nb_NO.php
+++ b/apps/files_versions/l10n/nb_NO.php
@@ -1,3 +1,7 @@
<?php $TRANSLATIONS = array(
-"Enable Files Versioning" => "Slå på versjonering"
+"History" => "Historie",
+"Versions" => "Versjoner",
+"This will delete all existing backup versions of your files" => "Dette vil slette alle tidligere versjoner av alle filene dine",
+"Files Versioning" => "Fil versjonering",
+"Enable" => "Aktiver"
);
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 822103ebc32..e897a81f7af 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -64,7 +64,7 @@ class Hooks {
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
if(Storage::isversioned($rel_oldpath)) {
$info=pathinfo($abs_newpath);
- if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750, true);
+ if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true);
$versions = Storage::getVersions($rel_oldpath);
foreach ($versions as $v) {
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 2f27cd0e667..dc83ab12af0 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -1,278 +1,278 @@
-<?php
-/**
- * Copyright (c) 2012 Frank Karlitschek <frank@owncloud.org>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-/**
- * Versions
- *
- * A class to handle the versioning of files.
- */
-
-namespace OCA_Versions;
-
-class Storage {
-
-
- // config.php configuration:
- // - files_versions
- // - files_versionsfolder
- // - files_versionsblacklist
- // - files_versionsmaxfilesize
- // - files_versionsinterval
- // - files_versionmaxversions
- //
- // todo:
- // - finish porting to OC_FilesystemView to enable network transparency
- // - add transparent compression. first test if it´s worth it.
-
- const DEFAULTENABLED=true;
- const DEFAULTBLACKLIST='avi mp3 mpg mp4 ctmp';
- const DEFAULTMAXFILESIZE=1048576; // 10MB
- const DEFAULTMININTERVAL=60; // 1 min
- const DEFAULTMAXVERSIONS=50;
-
- private static function getUidAndFilename($filename)
- {
- if (\OCP\App::isEnabled('files_sharing')
- && substr($filename, 0, 7) == '/Shared'
- && $source = \OCP\Share::getItemSharedWith('file',
- substr($filename, 7),
- \OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) {
- $filename = $source['path'];
- $pos = strpos($filename, '/files', 1);
- $uid = substr($filename, 1, $pos - 1);
- $filename = substr($filename, $pos + 6);
- } else {
- $uid = \OCP\User::getUser();
- }
- return array($uid, $filename);
- }
-
- /**
- * store a new version of a file.
- */
- public function store($filename) {
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- list($uid, $filename) = self::getUidAndFilename($filename);
- $files_view = new \OC_FilesystemView('/'.\OCP\User::getUser() .'/files');
- $users_view = new \OC_FilesystemView('/'.\OCP\User::getUser());
-
- //check if source file already exist as version to avoid recursions.
- // todo does this check work?
- if ($users_view->file_exists($filename)) {
- return false;
- }
-
- // check if filename is a directory
- if($files_view->is_dir($filename)) {
- return false;
- }
-
- // check filetype blacklist
- $blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
- foreach($blacklist as $bl) {
- $parts=explode('.', $filename);
- $ext=end($parts);
- if(strtolower($ext)==$bl) {
- return false;
- }
- }
- // we should have a source file to work with
- if (!$files_view->file_exists($filename)) {
- return false;
- }
-
- // check filesize
- if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
- return false;
- }
-
-
- // check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
- if ($uid == \OCP\User::getUser()) {
- $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
- $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
- $versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
- $matches=glob($versionsName.'.v*');
- sort($matches);
- $parts=explode('.v',end($matches));
- if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {
- return false;
- }
- }
-
-
- // create all parent folders
- $info=pathinfo($filename);
- if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
- mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);
- }
-
- // store a new version of a file
- $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.time());
-
- // expire old revisions if necessary
- Storage::expire($filename);
- }
- }
-
-
- /**
- * rollback to an old version of a file.
- */
- public static function rollback($filename,$revision) {
-
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- list($uid, $filename) = self::getUidAndFilename($filename);
- $users_view = new \OC_FilesystemView('/'.\OCP\User::getUser());
-
- // rollback
- if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
-
- return true;
-
- }else{
-
- return false;
-
- }
-
- }
-
- }
-
- /**
- * check if old versions of a file exist.
- */
- public static function isversioned($filename) {
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- list($uid, $filename) = self::getUidAndFilename($filename);
- $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
-
- $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
-
- // check for old versions
- $matches=glob($versionsName.'.v*');
- if(count($matches)>0) {
- return true;
- }else{
- return false;
- }
- }else{
- return(false);
- }
- }
-
-
-
- /**
- * @brief get a list of all available versions of a file in descending chronological order
- * @param $filename file to find versions of, relative to the user files dir
- * @param $count number of versions to return
- * @returns array
- */
- public static function getVersions( $filename, $count = 0 ) {
- if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
- list($uid, $filename) = self::getUidAndFilename($filename);
- $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
-
- $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
- $versions = array();
- // fetch for old versions
- $matches = glob( $versionsName.'.v*' );
-
- sort( $matches );
-
- $i = 0;
-
- $files_view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files');
- $local_file = $files_view->getLocalFile($filename);
- foreach( $matches as $ma ) {
-
- $i++;
- $versions[$i]['cur'] = 0;
- $parts = explode( '.v', $ma );
- $versions[$i]['version'] = ( end( $parts ) );
-
- // if file with modified date exists, flag it in array as currently enabled version
- ( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
-
- }
-
- $versions = array_reverse( $versions );
-
- foreach( $versions as $key => $value ) {
-
- // flag the first matched file in array (which will have latest modification date) as current version
- if ( $value['fileMatch'] ) {
-
- $value['cur'] = 1;
- break;
-
- }
-
- }
-
- $versions = array_reverse( $versions );
-
- // only show the newest commits
- if( $count != 0 and ( count( $versions )>$count ) ) {
-
- $versions = array_slice( $versions, count( $versions ) - $count );
-
- }
-
- return( $versions );
-
-
- } else {
-
- // if versioning isn't enabled then return an empty array
- return( array() );
-
- }
-
- }
-
- /**
- * @brief Erase a file's versions which exceed the set quota
- */
- public static function expire($filename) {
- if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- list($uid, $filename) = self::getUidAndFilename($filename);
- $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
-
- $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
-
- // check for old versions
- $matches = glob( $versionsName.'.v*' );
-
- if( count( $matches ) > \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ) {
-
- $numberToDelete = count($matches) - \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS );
-
- // delete old versions of a file
- $deleteItems = array_slice( $matches, 0, $numberToDelete );
-
- foreach( $deleteItems as $de ) {
-
- unlink( $versionsName.'.v'.$de );
-
- }
- }
- }
- }
-
- /**
- * @brief Erase all old versions of all user files
- * @return true/false
- */
- public function expireAll() {
- $view = \OCP\Files::getStorage('files_versions');
- return $view->deleteAll('', true);
- }
+<?php
+/**
+ * Copyright (c) 2012 Frank Karlitschek <frank@owncloud.org>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+/**
+ * Versions
+ *
+ * A class to handle the versioning of files.
+ */
+
+namespace OCA_Versions;
+
+class Storage {
+
+
+ // config.php configuration:
+ // - files_versions
+ // - files_versionsfolder
+ // - files_versionsblacklist
+ // - files_versionsmaxfilesize
+ // - files_versionsinterval
+ // - files_versionmaxversions
+ //
+ // todo:
+ // - finish porting to OC_FilesystemView to enable network transparency
+ // - add transparent compression. first test if it´s worth it.
+
+ const DEFAULTENABLED=true;
+ const DEFAULTBLACKLIST='avi mp3 mpg mp4 ctmp';
+ const DEFAULTMAXFILESIZE=1048576; // 10MB
+ const DEFAULTMININTERVAL=60; // 1 min
+ const DEFAULTMAXVERSIONS=50;
+
+ private static function getUidAndFilename($filename)
+ {
+ if (\OCP\App::isEnabled('files_sharing')
+ && substr($filename, 0, 7) == '/Shared'
+ && $source = \OCP\Share::getItemSharedWith('file',
+ substr($filename, 7),
+ \OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) {
+ $filename = $source['path'];
+ $pos = strpos($filename, '/files', 1);
+ $uid = substr($filename, 1, $pos - 1);
+ $filename = substr($filename, $pos + 6);
+ } else {
+ $uid = \OCP\User::getUser();
+ }
+ return array($uid, $filename);
+ }
+
+ /**
+ * store a new version of a file.
+ */
+ public function store($filename) {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ list($uid, $filename) = self::getUidAndFilename($filename);
+ $files_view = new \OC_FilesystemView('/'.\OCP\User::getUser() .'/files');
+ $users_view = new \OC_FilesystemView('/'.\OCP\User::getUser());
+
+ //check if source file already exist as version to avoid recursions.
+ // todo does this check work?
+ if ($users_view->file_exists($filename)) {
+ return false;
+ }
+
+ // check if filename is a directory
+ if($files_view->is_dir($filename)) {
+ return false;
+ }
+
+ // check filetype blacklist
+ $blacklist=explode(' ', \OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
+ foreach($blacklist as $bl) {
+ $parts=explode('.', $filename);
+ $ext=end($parts);
+ if(strtolower($ext)==$bl) {
+ return false;
+ }
+ }
+ // we should have a source file to work with
+ if (!$files_view->file_exists($filename)) {
+ return false;
+ }
+
+ // check filesize
+ if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
+ return false;
+ }
+
+
+ // check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
+ if ($uid == \OCP\User::getUser()) {
+ $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
+ $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
+ $versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
+ $matches=glob($versionsName.'.v*');
+ sort($matches);
+ $parts=explode('.v', end($matches));
+ if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {
+ return false;
+ }
+ }
+
+
+ // create all parent folders
+ $info=pathinfo($filename);
+ if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
+ mkdir($versionsFolderName.'/'.$info['dirname'], 0750, true);
+ }
+
+ // store a new version of a file
+ $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.time());
+
+ // expire old revisions if necessary
+ Storage::expire($filename);
+ }
+ }
+
+
+ /**
+ * rollback to an old version of a file.
+ */
+ public static function rollback($filename, $revision) {
+
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ list($uid, $filename) = self::getUidAndFilename($filename);
+ $users_view = new \OC_FilesystemView('/'.\OCP\User::getUser());
+
+ // rollback
+ if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
+
+ return true;
+
+ }else{
+
+ return false;
+
+ }
+
+ }
+
+ }
+
+ /**
+ * check if old versions of a file exist.
+ */
+ public static function isversioned($filename) {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ list($uid, $filename) = self::getUidAndFilename($filename);
+ $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
+
+ $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
+
+ // check for old versions
+ $matches=glob($versionsName.'.v*');
+ if(count($matches)>0) {
+ return true;
+ }else{
+ return false;
+ }
+ }else{
+ return(false);
+ }
+ }
+
+
+
+ /**
+ * @brief get a list of all available versions of a file in descending chronological order
+ * @param $filename file to find versions of, relative to the user files dir
+ * @param $count number of versions to return
+ * @returns array
+ */
+ public static function getVersions( $filename, $count = 0 ) {
+ if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
+ list($uid, $filename) = self::getUidAndFilename($filename);
+ $versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
+
+ $versionsName = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
+ $versions = array();
+ // fetch for old versions
+ $matches = glob( $versionsName.'.v*' );
+
+ sort( $matches );
+
+ $i = 0;
+
+ $files_view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files');
+ $local_file = $files_view->getLocalFile($filename);
+ foreach( $matches as $ma ) {
+
+ $i++;
+ $versions[$i]['cur'] = 0;
+ $parts = explode( '.v', $ma );
+ $versions[$i]['version'] = ( end( $parts ) );
+
+ // if file with modified date exists, flag it in array as currently enabled version
+ ( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
+
+ }
+
+ $versions = array_reverse( $versions );
+
+ foreach( $versions as $key => $value ) {
+
+ // flag the first matched file in array (which will have latest modification date) as current version
+ if ( $value['fileMatch'] ) {
+
+ $value['cur'] = 1;
+ break;
+
+ }
+
+ }
+
+ $versions = array_reverse( $versions );
+
+ // only show the newest commits
+ if( $count != 0 and ( count( $versions )>$count ) ) {
+
+ $versions = array_slice( $versions, count( $versions ) - $count );
+
+ }
+
+ return( $versions );
+
+
+ } else {
+
+ // if versioning isn't enabled then return an empty array
+ return( array() );
+
+ }
+
+ }
+
+ /**
+ * @brief Erase a file's versions which exceed the set quota
+ */
+ public static function expire($filename) {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ list($uid, $filename) = self::getUidAndFilename($filename);
+ $versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
+
+ $versionsName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath($filename);
+
+ // check for old versions
+ $matches = glob( $versionsName.'.v*' );
+
+ if( count( $matches ) > \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ) {
+
+ $numberToDelete = count($matches) - \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS );
+
+ // delete old versions of a file
+ $deleteItems = array_slice( $matches, 0, $numberToDelete );
+
+ foreach( $deleteItems as $de ) {
+
+ unlink( $versionsName.'.v'.$de );
+
+ }
+ }
+ }
+ }
+
+ /**
+ * @brief Erase all old versions of all user files
+ * @return true/false
+ */
+ public function expireAll() {
+ $view = \OCP\Files::getStorage('files_versions');
+ return $view->deleteAll('', true);
+ }
}
diff --git a/apps/files_versions/settings-personal.php b/apps/files_versions/settings-personal.php
index 4fb866bd999..6555bc99c3e 100644
--- a/apps/files_versions/settings-personal.php
+++ b/apps/files_versions/settings-personal.php
@@ -2,6 +2,6 @@
$tmpl = new OCP\Template( 'files_versions', 'settings-personal');
-OCP\Util::addscript('files_versions','settings-personal');
+OCP\Util::addscript('files_versions', 'settings-personal');
return $tmpl->fetchPage();
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 6c6cc5679ba..63437310088 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -124,7 +124,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
$this->connection->ldapGroupFilter,
$this->connection->ldapGroupMemberAssocAttr.'='.$uid
));
- $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName,'dn'));
+ $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName, 'dn'));
$groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING);
$this->connection->writeToCache($cacheKey, $groups);
diff --git a/apps/user_ldap/l10n/et_EE.php b/apps/user_ldap/l10n/et_EE.php
index f83142225e2..9752d73c1c0 100644
--- a/apps/user_ldap/l10n/et_EE.php
+++ b/apps/user_ldap/l10n/et_EE.php
@@ -1,9 +1,14 @@
<?php $TRANSLATIONS = array(
"Host" => "Host",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Sa ei saa protokolli ära jätta, välja arvatud siis, kui sa nõuad SSL-ühendust. Sel juhul alusta eesliitega ldaps://",
"Base DN" => "Baas DN",
+"You can specify Base DN for users and groups in the Advanced tab" => "Sa saad kasutajate ja gruppide baas DN-i määrata lisavalikute vahekaardilt",
"User DN" => "Kasutaja DN",
+"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "Klientkasutaja DN, kellega seotakse, nt. uid=agent,dc=näidis,dc=com. Anonüümseks ligipääsuks jäta DN ja parool tühjaks.",
"Password" => "Parool",
+"For anonymous access, leave DN and Password empty." => "Anonüümseks ligipääsuks jäta DN ja parool tühjaks.",
"User Login Filter" => "Kasutajanime filter",
+"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "Määrab sisselogimisel kasutatava filtri. %%uid asendab sisselogimistegevuses kasutajanime.",
"use %%uid placeholder, e.g. \"uid=%%uid\"" => "kasuta %%uid kohatäitjat, nt. \"uid=%%uid\"",
"User List Filter" => "Kasutajate nimekirja filter",
"Defines the filter to apply, when retrieving users." => "Määrab kasutajaid hankides filtri, mida rakendatakse.",
@@ -19,6 +24,7 @@
"Do not use it for SSL connections, it will fail." => "Ära kasuta seda SSL ühenduse jaoks, see ei toimi.",
"Case insensitve LDAP server (Windows)" => "Mittetõstutundlik LDAP server (Windows)",
"Turn off SSL certificate validation." => "Lülita SSL sertifikaadi kontrollimine välja.",
+"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Kui ühendus toimib ainult selle valikuga, siis impordi LDAP serveri SSL sertifikaat oma ownCloud serverisse.",
"Not recommended, use for testing only." => "Pole soovitatav, kasuta ainult testimiseks.",
"User Display Name Field" => "Kasutaja näidatava nime väli",
"The LDAP attribute to use to generate the user`s ownCloud name." => "LDAP omadus, mida kasutatakse kasutaja ownCloudi nime loomiseks.",
diff --git a/apps/user_ldap/l10n/nb_NO.php b/apps/user_ldap/l10n/nb_NO.php
new file mode 100644
index 00000000000..a5f4657d045
--- /dev/null
+++ b/apps/user_ldap/l10n/nb_NO.php
@@ -0,0 +1,11 @@
+<?php $TRANSLATIONS = array(
+"Password" => "Passord",
+"Group Filter" => "Gruppefilter",
+"Port" => "Port",
+"Use TLS" => "Bruk TLS",
+"Do not use it for SSL connections, it will fail." => "Ikke bruk for SSL tilkoblinger, dette vil ikke fungere.",
+"Not recommended, use for testing only." => "Ikke anbefalt, bruk kun for testing",
+"in bytes" => "i bytes",
+"in seconds. A change empties the cache." => "i sekunder. En endring tømmer bufferen.",
+"Help" => "Hjelp"
+);
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index a570b29b793..ef92bbad40a 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -180,22 +180,22 @@ class Connection {
* Caches the general LDAP configuration.
*/
private function readConfiguration($force = false) {
- \OCP\Util::writeLog('user_ldap','Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG);
if((!$this->configured || $force) && !is_null($this->configID)) {
- \OCP\Util::writeLog('user_ldap','Reading the configuration', \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'Reading the configuration', \OCP\Util::DEBUG);
$this->config['ldapHost'] = \OCP\Config::getAppValue($this->configID, 'ldap_host', '');
$this->config['ldapPort'] = \OCP\Config::getAppValue($this->configID, 'ldap_port', 389);
- $this->config['ldapAgentName'] = \OCP\Config::getAppValue($this->configID, 'ldap_dn','');
- $this->config['ldapAgentPassword'] = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password',''));
+ $this->config['ldapAgentName'] = \OCP\Config::getAppValue($this->configID, 'ldap_dn', '');
+ $this->config['ldapAgentPassword'] = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password', ''));
$this->config['ldapBase'] = \OCP\Config::getAppValue($this->configID, 'ldap_base', '');
- $this->config['ldapBaseUsers'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_users',$this->config['ldapBase']);
+ $this->config['ldapBaseUsers'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_users', $this->config['ldapBase']);
$this->config['ldapBaseGroups'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_groups', $this->config['ldapBase']);
- $this->config['ldapTLS'] = \OCP\Config::getAppValue($this->configID, 'ldap_tls',0);
+ $this->config['ldapTLS'] = \OCP\Config::getAppValue($this->configID, 'ldap_tls', 0);
$this->config['ldapNoCase'] = \OCP\Config::getAppValue($this->configID, 'ldap_nocase', 0);
$this->config['turnOffCertCheck'] = \OCP\Config::getAppValue($this->configID, 'ldap_turn_off_cert_check', 0);
$this->config['ldapUserDisplayName'] = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_display_name', 'uid'), 'UTF-8');
- $this->config['ldapUserFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter','objectClass=person');
- $this->config['ldapGroupFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter','(objectClass=posixGroup)');
+ $this->config['ldapUserFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter', 'objectClass=person');
+ $this->config['ldapGroupFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter', '(objectClass=posixGroup)');
$this->config['ldapLoginFilter'] = \OCP\Config::getAppValue($this->configID, 'ldap_login_filter', '(uid=%uid)');
$this->config['ldapGroupDisplayName'] = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_group_display_name', 'uid'), 'UTF-8');
$this->config['ldapQuotaAttribute'] = \OCP\Config::getAppValue($this->configID, 'ldap_quota_attr', '');
@@ -263,7 +263,7 @@ class Connection {
if(empty($this->config['ldapGroupFilter']) && empty($this->config['ldapGroupMemberAssocAttr'])) {
\OCP\Util::writeLog('user_ldap', 'No group filter is specified, LDAP group feature will not be used.', \OCP\Util::INFO);
}
- if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) {
+ if(!in_array($this->config['ldapUuidAttribute'], array('auto', 'entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) {
\OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto');
\OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO);
}
diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php
index f765151456a..2ee936d29a8 100644
--- a/apps/user_ldap/settings.php
+++ b/apps/user_ldap/settings.php
@@ -26,16 +26,12 @@ OCP\Util::addscript('user_ldap', 'settings');
OCP\Util::addstyle('user_ldap', 'settings');
if ($_POST) {
+ $clearCache = false;
foreach($params as $param) {
if(isset($_POST[$param])) {
+ $clearCache = true;
if('ldap_agent_password' == $param) {
OCP\Config::setAppValue('user_ldap', $param, base64_encode($_POST[$param]));
- } elseif('ldap_cache_ttl' == $param) {
- if(OCP\Config::getAppValue('user_ldap', $param,'') != $_POST[$param]) {
- $ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
- $ldap->clearCache();
- OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
- }
} elseif('home_folder_naming_rule' == $param) {
$value = empty($_POST[$param]) ? 'opt:username' : 'attr:'.$_POST[$param];
OCP\Config::setAppValue('user_ldap', $param, $value);
@@ -54,12 +50,16 @@ if ($_POST) {
OCP\Config::setAppValue('user_ldap', $param, 0);
}
}
+ if($clearCache) {
+ $ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
+ $ldap->clearCache();
+ }
}
// fill template
$tmpl = new OCP\Template( 'user_ldap', 'settings');
foreach($params as $param) {
- $value = OCP\Config::getAppValue('user_ldap', $param,'');
+ $value = OCP\Config::getAppValue('user_ldap', $param, '');
$tmpl->assign($param, $value);
}
diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php
index 3a653ad7208..d10062c1d9d 100644
--- a/apps/user_ldap/templates/settings.php
+++ b/apps/user_ldap/templates/settings.php
@@ -29,7 +29,7 @@
<p><label for="ldap_cache_ttl">Cache Time-To-Live</label><input type="text" id="ldap_cache_ttl" name="ldap_cache_ttl" value="<?php echo $_['ldap_cache_ttl']; ?>" title="<?php echo $l->t('in seconds. A change empties the cache.');?>" /></p>
<p><label for="home_folder_naming_rule">User Home Folder Naming Rule</label><input type="text" id="home_folder_naming_rule" name="home_folder_naming_rule" value="<?php echo $_['home_folder_naming_rule']; ?>" title="<?php echo $l->t('Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute.');?>" /></p>
</fieldset>
- <input type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection">Test Configuration</button> <a href="http://owncloud.org/support/ldap-backend/" target="_blank"><img src="<?php echo OCP\Util::imagePath('','actions/info.png'); ?>" style="height:1.75ex" /> <?php echo $l->t('Help');?></a>
+ <input type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection">Test Configuration</button> <a href="http://owncloud.org/support/ldap-backend/" target="_blank"><img src="<?php echo OCP\Util::imagePath('', 'actions/info.png'); ?>" style="height:1.75ex" /> <?php echo $l->t('Help');?></a>
</div>
</form>
diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php
index 2acb8c35a19..f99902d32f5 100644
--- a/apps/user_ldap/tests/group_ldap.php
+++ b/apps/user_ldap/tests/group_ldap.php
@@ -32,8 +32,8 @@ class Test_Group_Ldap extends UnitTestCase {
$this->assertIsA(OC_Group::getGroups(), gettype(array()));
$this->assertIsA($group_ldap->getGroups(), gettype(array()));
- $this->assertFalse(OC_Group::inGroup('john','dosers'), gettype(false));
- $this->assertFalse($group_ldap->inGroup('john','dosers'), gettype(false));
+ $this->assertFalse(OC_Group::inGroup('john', 'dosers'), gettype(false));
+ $this->assertFalse($group_ldap->inGroup('john', 'dosers'), gettype(false));
//TODO: check also for expected true result. This backend won't be able to do any modifications, maybe use a dummy for this.
$this->assertIsA(OC_Group::getUserGroups('john doe'), gettype(array()));
diff --git a/apps/user_webdavauth/appinfo/app.php b/apps/user_webdavauth/appinfo/app.php
index 3ab323becce..c4c131b7ef0 100755
--- a/apps/user_webdavauth/appinfo/app.php
+++ b/apps/user_webdavauth/appinfo/app.php
@@ -23,7 +23,7 @@
require_once 'apps/user_webdavauth/user_webdavauth.php';
-OC_APP::registerAdmin('user_webdavauth','settings');
+OC_APP::registerAdmin('user_webdavauth', 'settings');
OC_User::registerBackend("WEBDAVAUTH");
OC_User::useBackend( "WEBDAVAUTH" );
diff --git a/apps/user_webdavauth/appinfo/info.xml b/apps/user_webdavauth/appinfo/info.xml
index 9a8027daee6..0d9f529ed1b 100755
--- a/apps/user_webdavauth/appinfo/info.xml
+++ b/apps/user_webdavauth/appinfo/info.xml
@@ -2,10 +2,12 @@
<info>
<id>user_webdavauth</id>
<name>WebDAV user backend</name>
- <description>Authenticate Users by a WebDAV call</description>
- <version>1.0</version>
+ <description>Authenticate users by a WebDAV call. You can use any WebDAV server, ownCloud server or other webserver to authenticate. It should return http 200 for right credentials and http 401 for wrong ones.</description>
<licence>AGPL</licence>
<author>Frank Karlitschek</author>
<require>4.9</require>
<shipped>true</shipped>
+ <types>
+ <authentication/>
+ </types>
</info>
diff --git a/apps/user_webdavauth/appinfo/version b/apps/user_webdavauth/appinfo/version
new file mode 100644
index 00000000000..a6bbdb5ff48
--- /dev/null
+++ b/apps/user_webdavauth/appinfo/version
@@ -0,0 +1 @@
+1.1.0.0
diff --git a/apps/user_webdavauth/settings.php b/apps/user_webdavauth/settings.php
index 4f1ddbbefda..497a3385caa 100755
--- a/apps/user_webdavauth/settings.php
+++ b/apps/user_webdavauth/settings.php
@@ -21,7 +21,6 @@
*
*/
-print_r($_POST);
if($_POST) {
if(isset($_POST['webdav_url'])) {
diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php
index c00c199632a..e6ca5d97d3c 100755
--- a/apps/user_webdavauth/templates/settings.php
+++ b/apps/user_webdavauth/templates/settings.php
@@ -1,7 +1,7 @@
<form id="webdavauth" action="#" method="post">
<fieldset class="personalblock">
<legend><strong>WebDAV Authentication</strong></legend>
- <p><label for="webdav_url"><?php echo $l->t('webdav_url');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
+ <p><label for="webdav_url"><?php echo $l->t('WebDAV URL: http://');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
<input type="submit" value="Save" />
</fieldset>
</form>
diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php
index bd9f45d357b..0b0be7c2fa1 100755
--- a/apps/user_webdavauth/user_webdavauth.php
+++ b/apps/user_webdavauth/user_webdavauth.php
@@ -30,24 +30,23 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
public function createUser() {
// Can't create user
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend', 3);
return false;
}
- public function deleteUser() {
+ public function deleteUser($uid) {
// Can't delete user
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend', 3);
return false;
}
public function setPassword ( $uid, $password ) {
// We can't change user password
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend', 3);
return false;
}
public function checkPassword( $uid, $password ) {
-
$url= 'http://'.urlencode($uid).':'.urlencode($password).'@'.$this->webdavauth_url;
$headers = get_headers($url);
if($headers==false) {
@@ -58,9 +57,9 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
$returncode= substr($headers[0], 9, 3);
if($returncode=='401') {
- return false;
+ return(false);
}else{
- return true;
+ return($uid);
}
}
@@ -68,14 +67,15 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
/*
* we don´t know if a user exists without the password. so we have to return false all the time
*/
- public function userExists( $uid ) {
- return false;
+ public function userExists( $uid ){
+ return true;
}
+
/*
* we don´t know the users so all we can do it return an empty array here
*/
- public function getUsers() {
+ public function getUsers($search = '', $limit = 10, $offset = 0) {
$returnArray = array();
return $returnArray;