diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-02-12 23:01:54 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-02-12 23:01:54 +0100 |
commit | a814361ca7b26e1499f4e3bb66908d7da89662fe (patch) | |
tree | f26f4a6d6fe79a4d1c9f9c7639b44e4eec232cb0 /apps | |
parent | 6b594c1eb84dccb57c5050f9d686734c98cc6d39 (diff) | |
parent | 316807e0d3f050af3fdd4c8dbc1ca3e1e7bc8cbb (diff) | |
download | nextcloud-server-a814361ca7b26e1499f4e3bb66908d7da89662fe.tar.gz nextcloud-server-a814361ca7b26e1499f4e3bb66908d7da89662fe.zip |
Merge branch 'master' into external_storage_ui_feedback
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/l10n/de_DE.php | 1 | ||||
-rw-r--r-- | apps/files/l10n/ja_JP.php | 1 | ||||
-rw-r--r-- | apps/files_encryption/l10n/pl.php | 3 | ||||
-rw-r--r-- | apps/files_external/ajax/addRootCertificate.php | 1 | ||||
-rw-r--r-- | apps/files_external/ajax/dropbox.php | 2 | ||||
-rw-r--r-- | apps/files_external/ajax/google.php | 2 | ||||
-rw-r--r-- | apps/files_external/l10n/hi.php | 3 | ||||
-rw-r--r-- | apps/files_external/lib/smb.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/l10n/de_DE.php | 2 | ||||
-rw-r--r-- | apps/files_versions/l10n/de_DE.php | 4 | ||||
-rw-r--r-- | apps/files_versions/l10n/hu_HU.php | 8 | ||||
-rw-r--r-- | apps/files_versions/l10n/pl.php | 8 | ||||
-rw-r--r-- | apps/user_ldap/l10n/de_DE.php | 1 | ||||
-rw-r--r-- | apps/user_ldap/l10n/hi.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/lib/access.php | 121 | ||||
-rw-r--r-- | apps/user_webdavauth/l10n/ru.php | 4 |
16 files changed, 146 insertions, 22 deletions
diff --git a/apps/files/l10n/de_DE.php b/apps/files/l10n/de_DE.php index 0dfc19ff01b..012cfd69dae 100644 --- a/apps/files/l10n/de_DE.php +++ b/apps/files/l10n/de_DE.php @@ -60,6 +60,7 @@ "Text file" => "Textdatei", "Folder" => "Ordner", "From link" => "Von einem Link", +"Trash bin" => "Mülleimer", "Cancel upload" => "Upload abbrechen", "Nothing in here. Upload something!" => "Alles leer. Bitte laden Sie etwas hoch!", "Download" => "Herunterladen", diff --git a/apps/files/l10n/ja_JP.php b/apps/files/l10n/ja_JP.php index 85ec6b6e953..88f8ab985a0 100644 --- a/apps/files/l10n/ja_JP.php +++ b/apps/files/l10n/ja_JP.php @@ -60,6 +60,7 @@ "Text file" => "テキストファイル", "Folder" => "フォルダ", "From link" => "リンク", +"Trash bin" => "ゴミ箱", "Cancel upload" => "アップロードをキャンセル", "Nothing in here. Upload something!" => "ここには何もありません。何かアップロードしてください。", "Download" => "ダウンロード", diff --git a/apps/files_encryption/l10n/pl.php b/apps/files_encryption/l10n/pl.php index 505e8659f08..2fa86f454f9 100644 --- a/apps/files_encryption/l10n/pl.php +++ b/apps/files_encryption/l10n/pl.php @@ -1,4 +1,7 @@ <?php $TRANSLATIONS = array( "Encryption" => "Szyfrowanie", +"File encryption is enabled." => "Szyfrowanie plików jest włączone", +"The following file types will not be encrypted:" => "Poniższe typy plików nie będą szyfrowane:", +"Exclude the following file types from encryption:" => "Wyłącz poniższe typy plików z szyfrowania:", "None" => "Brak" ); diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php index 2f67e801b2c..ba8a14d2ea1 100644 --- a/apps/files_external/ajax/addRootCertificate.php +++ b/apps/files_external/ajax/addRootCertificate.php @@ -1,6 +1,7 @@ <?php OCP\JSON::checkAppEnabled('files_external'); +OCP\JSON::callCheck(); if ( ! ($filename = $_FILES['rootcert_import']['name']) ) { header("Location: settings/personal.php"); diff --git a/apps/files_external/ajax/dropbox.php b/apps/files_external/ajax/dropbox.php index 58c41d69062..bc9821c62ec 100644 --- a/apps/files_external/ajax/dropbox.php +++ b/apps/files_external/ajax/dropbox.php @@ -4,6 +4,8 @@ require_once 'Dropbox/autoload.php'; OCP\JSON::checkAppEnabled('files_external'); OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); + if (isset($_POST['app_key']) && isset($_POST['app_secret'])) { $oauth = new Dropbox_OAuth_Curl($_POST['app_key'], $_POST['app_secret']); if (isset($_POST['step'])) { diff --git a/apps/files_external/ajax/google.php b/apps/files_external/ajax/google.php index c76c7618e4d..70adcb2c2ad 100644 --- a/apps/files_external/ajax/google.php +++ b/apps/files_external/ajax/google.php @@ -4,6 +4,8 @@ require_once 'Google/common.inc.php'; OCP\JSON::checkAppEnabled('files_external'); OCP\JSON::checkLoggedIn(); +OCP\JSON::callCheck(); + $consumer = new OAuthConsumer('anonymous', 'anonymous'); $sigMethod = new OAuthSignatureMethod_HMAC_SHA1(); if (isset($_POST['step'])) { diff --git a/apps/files_external/l10n/hi.php b/apps/files_external/l10n/hi.php new file mode 100644 index 00000000000..0482efc4b23 --- /dev/null +++ b/apps/files_external/l10n/hi.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Users" => "उपयोगकर्ता" +); diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index 989a53a4fc6..e0ec9fa0f8f 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -50,7 +50,9 @@ class SMB extends \OC\Files\Storage\StreamWrapper{ $path=substr($path, 0, -1); } $path = urlencode($path); - return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path; + $user = urlencode($this->user); + $pass = urlencode($this->password); + return 'smb://'.$user.':'.$pass.'@'.$this->host.$this->share.$this->root.$path; } public function stat($path) { diff --git a/apps/files_trashbin/l10n/de_DE.php b/apps/files_trashbin/l10n/de_DE.php index e293bf0b2eb..7cb1834141b 100644 --- a/apps/files_trashbin/l10n/de_DE.php +++ b/apps/files_trashbin/l10n/de_DE.php @@ -1,4 +1,6 @@ <?php $TRANSLATIONS = array( +"Couldn't delete %s permanently" => "Konnte %s nicht permanent löschen", +"Couldn't restore %s" => "Konnte %s nicht wiederherstellen", "perform restore operation" => "Führe die Wiederherstellung aus", "delete file permanently" => "Datei entgültig löschen", "Name" => "Name", diff --git a/apps/files_versions/l10n/de_DE.php b/apps/files_versions/l10n/de_DE.php index cf33bb071e6..896c765096f 100644 --- a/apps/files_versions/l10n/de_DE.php +++ b/apps/files_versions/l10n/de_DE.php @@ -1,9 +1,13 @@ <?php $TRANSLATIONS = array( +"Could not revert: %s" => "Konnte nicht zurücksetzen: %s", "success" => "Erfolgreich", +"File %s was reverted to version %s" => "Die Datei %s wurde zur Version %s zurückgesetzt", "failure" => "Fehlgeschlagen", +"File %s could not be reverted to version %s" => "Doe Dateo %s konnte nicht zur Version %s zurückgesetzt werden", "No old versions available" => "keine älteren Versionen verfügbar", "No path specified" => "Kein Pfad angegeben", "History" => "Historie", +"Revert a file to a previous version by clicking on its revert button" => "Setze eine Datei zu durch Klicken auf den Zurücksetzen-Button auf einer frühere Version zurück", "Files Versioning" => "Dateiversionierung", "Enable" => "Aktivieren" ); diff --git a/apps/files_versions/l10n/hu_HU.php b/apps/files_versions/l10n/hu_HU.php index 95d37ad06ed..dcf28838158 100644 --- a/apps/files_versions/l10n/hu_HU.php +++ b/apps/files_versions/l10n/hu_HU.php @@ -1,5 +1,13 @@ <?php $TRANSLATIONS = array( +"Could not revert: %s" => "Nem sikerült átállni a változatra: %s", +"success" => "sikerült", +"File %s was reverted to version %s" => "%s állományt átállítottuk erre a változatra: %s", +"failure" => "nem sikerült", +"File %s could not be reverted to version %s" => "%s állományt nem sikerült átállítani erre a változatra: %s", +"No old versions available" => "Nincs régebbi változat", +"No path specified" => "Nincs megadva az útvonal", "History" => "Korábbi változatok", +"Revert a file to a previous version by clicking on its revert button" => "Az állomány átállítható egy régebbi változatra, ha a gombra kattint", "Files Versioning" => "Az állományok verzionálása", "Enable" => "engedélyezve" ); diff --git a/apps/files_versions/l10n/pl.php b/apps/files_versions/l10n/pl.php index a0247b8abc6..ae3bfc4a842 100644 --- a/apps/files_versions/l10n/pl.php +++ b/apps/files_versions/l10n/pl.php @@ -1,5 +1,13 @@ <?php $TRANSLATIONS = array( +"Could not revert: %s" => "Nie można było przywrócić: %s", +"success" => "sukces", +"File %s was reverted to version %s" => "Plik %s został przywrócony do wersji %s", +"failure" => "porażka", +"File %s could not be reverted to version %s" => "Plik %s nie mógł być przywrócony do wersji %s", +"No old versions available" => "Nie są dostępne żadne starsze wersje", +"No path specified" => "Nie podano ścieżki", "History" => "Historia", +"Revert a file to a previous version by clicking on its revert button" => "Przywróć plik do poprzedniej wersji klikając w jego przycisk przywrócenia", "Files Versioning" => "Wersjonowanie plików", "Enable" => "Włącz" ); diff --git a/apps/user_ldap/l10n/de_DE.php b/apps/user_ldap/l10n/de_DE.php index 7d3847f8a89..69faf5dc45d 100644 --- a/apps/user_ldap/l10n/de_DE.php +++ b/apps/user_ldap/l10n/de_DE.php @@ -43,6 +43,7 @@ "Disable Main Server" => "Hauptserver deaktivieren", "When switched on, ownCloud will only connect to the replica server." => "Wenn eingeschaltet wird sich ownCloud nur mit dem Replilat-Server verbinden.", "Use TLS" => "Nutze TLS", +"Do not use it additionally for LDAPS connections, it will fail." => "Benutze es nicht zusätzlich für LDAPS Verbindungen, es wird scheitern.", "Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)", "Turn off SSL certificate validation." => "Schalten Sie die SSL-Zertifikatsprüfung aus.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.", diff --git a/apps/user_ldap/l10n/hi.php b/apps/user_ldap/l10n/hi.php new file mode 100644 index 00000000000..60d4ea98e84 --- /dev/null +++ b/apps/user_ldap/l10n/hi.php @@ -0,0 +1,3 @@ +<?php $TRANSLATIONS = array( +"Help" => "सहयोग" +); diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 68cbe4a5e75..057ae17c308 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -4,7 +4,7 @@ * ownCloud – LDAP Access * * @author Arthur Schiwon - * @copyright 2012 Arthur Schiwon blizzz@owncloud.com + * @copyright 2012, 2013 Arthur Schiwon blizzz@owncloud.com * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE @@ -293,6 +293,10 @@ abstract class Access { $query->execute(array($dn, $uuid)); return $component; } + } else { + //If the UUID can't be detected something is foul. + \OCP\Util::writeLog('user_ldap', 'Cannot determine UUID for '.$dn.'. Skipping.', \OCP\Util::INFO); + return false; } if(is_null($ldapname)) { @@ -303,21 +307,24 @@ abstract class Access { } $ldapname = $ldapname[0]; } - $ldapname = $this->sanitizeUsername($ldapname); + $intname = $isUser ? $this->sanitizeUsername($uuid) : $this->sanitizeUsername($ldapname); //a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups - if(($isUser && !\OCP\User::userExists($ldapname, 'OCA\\user_ldap\\USER_LDAP')) || (!$isUser && !\OC_Group::groupExists($ldapname))) { - if($this->mapComponent($dn, $ldapname, $isUser)) { - return $ldapname; + //disabling Cache is required to avoid that the new user is cached as not-existing in fooExists check + $originalTTL = $this->connection->ldapCacheTTL; + $this->connection->setConfiguration(array('ldapCacheTTL' => 0)); + if(($isUser && !\OCP\User::userExists($intname)) + || (!$isUser && !\OC_Group::groupExists($intname))) { + if($this->mapComponent($dn, $intname, $isUser)) { + $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); + return $intname; } } + $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); - //doh! There is a conflict. We need to distinguish between users/groups. Adding indexes is an idea, but not much of a help for the user. The DN is ugly, but for now the only reasonable way. But we transform it to a readable format and remove the first part to only give the path where this object is located. - $oc_name = $this->alternateOwnCloudName($ldapname, $dn); - if(($isUser && !\OCP\User::userExists($oc_name)) || (!$isUser && !\OC_Group::groupExists($oc_name))) { - if($this->mapComponent($dn, $oc_name, $isUser)) { - return $oc_name; - } + $altname = $this->createAltInternalOwnCloudName($intname, $isUser); + if($this->mapComponent($dn, $altname, $isUser)) { + return $altname; } //if everything else did not help.. @@ -400,18 +407,92 @@ abstract class Access { } /** - * @brief creates a hopefully unique name for owncloud based on the display name and the dn of the LDAP object + * @brief creates a unique name for internal ownCloud use for users. Don't call it directly. * @param $name the display name of the object - * @param $dn the dn of the object - * @returns string with with the name to use in ownCloud + * @returns string with with the name to use in ownCloud or false if unsuccessful * - * creates a hopefully unique name for owncloud based on the display name and the dn of the LDAP object + * Instead of using this method directly, call + * createAltInternalOwnCloudName($name, true) */ - private function alternateOwnCloudName($name, $dn) { - $ufn = ldap_dn2ufn($dn); - $name = $name . '@' . trim(\OCP\Util::mb_substr_replace($ufn, '', 0, mb_strpos($ufn, ',', 0, 'UTF-8'), 'UTF-8')); - $name = $this->sanitizeUsername($name); - return $name; + private function _createAltInternalOwnCloudNameForUsers($name) { + $attempts = 0; + //while loop is just a precaution. If a name is not generated within + //20 attempts, something else is very wrong. Avoids infinite loop. + while($attempts < 20){ + $altName = $name . '_' . uniqid(); + if(\OCP\User::userExists($altName)) { + return $altName; + } + $attempts++; + } + return false; + } + + /** + * @brief creates a unique name for internal ownCloud use for groups. Don't call it directly. + * @param $name the display name of the object + * @returns string with with the name to use in ownCloud or false if unsuccessful. + * + * Instead of using this method directly, call + * createAltInternalOwnCloudName($name, false) + * + * Group names are also used as display names, so we do a sequential + * numbering, e.g. Developers_42 when there are 41 other groups called + * "Developers" + */ + private function _createAltInternalOwnCloudNameForGroups($name) { + $query = \OCP\DB::prepare(' + SELECT `owncloud_name` + FROM `'.$this->getMapTable(false).'` + WHERE `owncloud_name` LIKE ? + '); + + $usedNames = array(); + $res = $query->execute(array($name.'_%')); + while($row = $res->fetchRow()) { + $usedNames[] = $row['owncloud_name']; + } + if(!($usedNames) || count($usedNames) == 0) { + $lastNo = 1; //will become name_2 + } else { + natsort($usedNames); + $lastname = array_pop($usedNames); + $lastNo = intval(substr($lastname, strrpos($lastname, '_') + 1)); + } + $altName = $name.'_'.strval($lastNo+1); + unset($usedNames); + + $attempts = 1; + while($attempts < 21){ + //Pro forma check to be really sure it is unique + //while loop is just a precaution. If a name is not generated within + //20 attempts, something else is very wrong. Avoids infinite loop. + if(!\OC_Group::groupExists($altName)) { + return $altName; + } + $altName = $name . '_' . $lastNo + $attempts; + $attempts++; + } + return false; + } + + /** + * @brief creates a unique name for internal ownCloud use. + * @param $name the display name of the object + * @param $isUser boolean, whether name should be created for a user (true) or a group (false) + * @returns string with with the name to use in ownCloud or false if unsuccessful + */ + private function createAltInternalOwnCloudName($name, $isUser) { + $originalTTL = $this->connection->ldapCacheTTL; + $this->connection->setConfiguration(array('ldapCacheTTL' => 0)); + if($isUser) { + $altName = $this->_createAltInternalOwnCloudNameForUsers($name); + } else { + $altName = $this->_createAltInternalOwnCloudNameForGroups($name); + } + $this->connection->setConfiguration(array('ldapCacheTTL' => $originalTTL)); + + return $altName; } /** diff --git a/apps/user_webdavauth/l10n/ru.php b/apps/user_webdavauth/l10n/ru.php index 245a5101341..f12982fc406 100644 --- a/apps/user_webdavauth/l10n/ru.php +++ b/apps/user_webdavauth/l10n/ru.php @@ -1,3 +1,5 @@ <?php $TRANSLATIONS = array( -"URL: http://" => "URL: http://" +"WebDAV Authentication" => "Идентификация WebDAV", +"URL: http://" => "URL: http://", +"ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials." => "ownCloud отправит пользовательские данные на этот URL. Затем плагин проверит ответ, в случае HTTP ответа 401 или 403 данные будут считаться неверными, при любых других ответах - верными." ); |