summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-02-19 16:42:36 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-02-19 16:42:36 +0100
commit407b8fddfc5db1da207f177bd2c7f5a06f13dfbd (patch)
treeb30029ee4f2184f3e039ee91a2b59e9722748969
parent29f610edfdf3804ca7c3e216483a7f0b6d0e541a (diff)
downloadnextcloud-server-407b8fddfc5db1da207f177bd2c7f5a06f13dfbd.tar.gz
nextcloud-server-407b8fddfc5db1da207f177bd2c7f5a06f13dfbd.zip
remove noise from detectUuid and cache results
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/user_ldap/lib/Access.php42
1 files changed, 25 insertions, 17 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 258222a7f3a..de02cbdf869 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -1712,13 +1712,19 @@ class Access extends LDAPUtility {
$uuidOverride = $this->connection->ldapExpertUUIDGroupAttr;
}
- if(($this->connection->$uuidAttr !== 'auto') && !$force) {
- return true;
- }
+ if(!$force) {
+ if($this->connection->$uuidAttr !== 'auto') {
+ return true;
+ } else if (is_string($uuidOverride) && trim($uuidOverride) !== '') {
+ $this->connection->$uuidAttr = $uuidOverride;
+ return true;
+ }
- if (is_string($uuidOverride) && trim($uuidOverride) !== '' && !$force) {
- $this->connection->$uuidAttr = $uuidOverride;
- return true;
+ $attribute = $this->connection->getFromCache($uuidAttr);
+ if(!$attribute === null) {
+ $this->connection->$uuidAttr = $attribute;
+ return true;
+ }
}
foreach(self::UUID_ATTRIBUTES as $attribute) {
@@ -1727,27 +1733,29 @@ class Access extends LDAPUtility {
if(isset($ldapRecord[$attribute])) {
$this->connection->$uuidAttr = $attribute;
return true;
- } else {
- continue;
}
+ continue;
}
$value = $this->readAttribute($dn, $attribute);
if(is_array($value) && isset($value[0]) && !empty($value[0])) {
- \OCP\Util::writeLog(
- 'user_ldap',
- 'Setting '.$attribute.' as '.$uuidAttr,
- ILogger::DEBUG
+ \OC::$server->getLogger()->debug(
+ 'Setting {attribute} as {subject}',
+ [
+ 'app' => 'user_ldap',
+ 'attribute' => $attribute,
+ 'subject' => $uuidAttr
+ ]
);
$this->connection->$uuidAttr = $attribute;
+ $this->connection->writeToCache($uuidAttr, $attribute);
return true;
+ } elseif ($value === false) {
+ // record not available
+ return false;
}
}
- \OCP\Util::writeLog(
- 'user_ldap',
- 'Could not autodetect the UUID attribute',
- ILogger::ERROR
- );
+ \OC::$server->getLogger()->debug('Could not autodetect the UUID attribute', ['app' => 'user_ldap']);
return false;
}
n.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<?php
$TRANSLATIONS = array(
"Could not move %s - File with this name already exists" => "Не вдалося перемістити %s - Файл з таким ім'ям вже існує",
"Could not move %s" => "Не вдалося перемістити %s",
"No file was uploaded. Unknown error" => "Не завантажено жодного файлу. Невідома помилка",
"There is no error, the file uploaded with success" => "Файл успішно вивантажено без помилок.",
"The uploaded file exceeds the upload_max_filesize directive in php.ini: " => "Розмір звантаження перевищує upload_max_filesize параметра в php.ini: ",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Розмір відвантаженого файлу перевищує директиву MAX_FILE_SIZE вказану в HTML формі",
"The uploaded file was only partially uploaded" => "Файл відвантажено лише частково",
"No file was uploaded" => "Не відвантажено жодного файлу",
"Missing a temporary folder" => "Відсутній тимчасовий каталог",
"Failed to write to disk" => "Невдалося записати на диск",
"Not enough storage available" => "Місця більше немає",
"Invalid directory." => "Невірний каталог.",
"Files" => "Файли",
"Unable to upload your file as it is a directory or has 0 bytes" => "Неможливо завантажити ваш файл тому, що він тека або файл розміром 0 байт",
"Not enough space available" => "Місця більше немає",
"Upload cancelled." => "Завантаження перервано.",
"File upload is in progress. Leaving the page now will cancel the upload." => "Виконується завантаження файлу. Закриття цієї сторінки приведе до відміни завантаження.",
"URL cannot be empty." => "URL не може бути пустим.",
"Error" => "Помилка",
"Share" => "Поділитися",
"Delete permanently" => "Видалити назавжди",
"Rename" => "Перейменувати",
"Pending" => "Очікування",
"{new_name} already exists" => "{new_name} вже існує",
"replace" => "заміна",
"suggest name" => "запропонуйте назву",
"cancel" => "відміна",
"replaced {new_name} with {old_name}" => "замінено {new_name} на {old_name}",
"undo" => "відмінити",
"_Uploading %n file_::_Uploading %n files_" => array("","",""),
"files uploading" => "файли завантажуються",
"'.' is an invalid file name." => "'.' це невірне ім'я файлу.",
"File name cannot be empty." => " Ім'я файлу не може бути порожнім.",
"Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed." => "Невірне ім'я, '\\', '/', '<', '>', ':', '\"', '|', '?' та '*' не дозволені.",
"Your storage is full, files can not be updated or synced anymore!" => "Ваше сховище переповнене, файли більше не можуть бути оновлені або синхронізовані !",
"Your storage is almost full ({usedSpacePercent}%)" => "Ваше сховище майже повне ({usedSpacePercent}%)",
"Your download is being prepared. This might take some time if the files are big." => "Ваше завантаження готується. Це може зайняти деякий час, якщо файли завеликі.",
"Name" => "Ім'я",
"Size" => "Розмір",
"Modified" => "Змінено",
"_%n folder_::_%n folders_" => array("","",""),
"_%n file_::_%n files_" => array("","",""),
"%s could not be renamed" => "%s не може бути перейменований",
"Upload" => "Вивантажити",
"File handling" => "Робота з файлами",
"Maximum upload size" => "Максимальний розмір відвантажень",
"max. possible: " => "макс.можливе:",
"Needed for multi-file and folder downloads." => "Необхідно для мульти-файлового та каталогового завантаження.",
"Enable ZIP-download" => "Активувати ZIP-завантаження",
"0 is unlimited" => "0 є безліміт",
"Maximum input size for ZIP files" => "Максимальний розмір завантажуємого ZIP файлу",
"Save" => "Зберегти",
"New" => "Створити",
"Text file" => "Текстовий файл",
"Folder" => "Папка",
"From link" => "З посилання",
"Deleted files" => "Видалено файлів",
"Cancel upload" => "Перервати завантаження",
"You don’t have write permissions here." => "У вас тут немає прав на запис.",
"Nothing in here. Upload something!" => "Тут нічого немає. Відвантажте що-небудь!",
"Download" => "Завантажити",
"Unshare" => "Закрити доступ",
"Delete" => "Видалити",
"Upload too large" => "Файл занадто великий",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файли,що ви намагаєтесь відвантажити перевищують максимальний дозволений розмір файлів на цьому сервері.",
"Files are being scanned, please wait." => "Файли скануються, зачекайте, будь-ласка.",
"Current scanning" => "Поточне сканування",
"directory" => "каталог",
"directories" => "каталоги",
"file" => "файл",
"files" => "файли",
"Upgrading filesystem cache..." => "Оновлення кеша файлової системи..."
);
$PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);";