Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/l10n/cs.js2
-rw-r--r--lib/l10n/cs.json2
-rw-r--r--lib/l10n/el.js2
-rw-r--r--lib/l10n/el.json2
-rw-r--r--lib/l10n/he.js3
-rw-r--r--lib/l10n/he.json3
-rw-r--r--lib/l10n/lt_LT.js1
-rw-r--r--lib/l10n/lt_LT.json1
-rw-r--r--lib/l10n/uk.js2
-rw-r--r--lib/l10n/uk.json2
-rw-r--r--lib/private/Accounts/AccountManager.php2
-rw-r--r--lib/private/Group/Database.php26
-rw-r--r--lib/private/Group/Manager.php51
13 files changed, 67 insertions, 32 deletions
diff --git a/lib/l10n/cs.js b/lib/l10n/cs.js
index 780c1c67105..ba42e8589e7 100644
--- a/lib/l10n/cs.js
+++ b/lib/l10n/cs.js
@@ -18,7 +18,7 @@ OC.L10N.register(
"Enterprise bundle" : "Sada pro organizace",
"Groupware bundle" : "Sada pro podporu spolupráce",
"Hub bundle" : "Sada pro centrum aktivity (hub)",
- "Social sharing bundle" : "Balíček sociálního sdílení",
+ "Social sharing bundle" : "Balíček pro sdílení na sociálních sítích",
"PHP %s or higher is required." : "Je vyžadováno PHP %s nebo novější.",
"PHP with a version lower than %s is required." : "Je vyžadováno PHP ve verzi nižší než %s.",
"%sbit or higher PHP required." : "Je vyžadováno PHP %sbit nebo vyšší.",
diff --git a/lib/l10n/cs.json b/lib/l10n/cs.json
index c93016e3e10..66b4b812264 100644
--- a/lib/l10n/cs.json
+++ b/lib/l10n/cs.json
@@ -16,7 +16,7 @@
"Enterprise bundle" : "Sada pro organizace",
"Groupware bundle" : "Sada pro podporu spolupráce",
"Hub bundle" : "Sada pro centrum aktivity (hub)",
- "Social sharing bundle" : "Balíček sociálního sdílení",
+ "Social sharing bundle" : "Balíček pro sdílení na sociálních sítích",
"PHP %s or higher is required." : "Je vyžadováno PHP %s nebo novější.",
"PHP with a version lower than %s is required." : "Je vyžadováno PHP ve verzi nižší než %s.",
"%sbit or higher PHP required." : "Je vyžadováno PHP %sbit nebo vyšší.",
diff --git a/lib/l10n/el.js b/lib/l10n/el.js
index be48e4eaed4..9967dc8e929 100644
--- a/lib/l10n/el.js
+++ b/lib/l10n/el.js
@@ -22,10 +22,12 @@ OC.L10N.register(
"PHP %s or higher is required." : "PHP %s ή νεώτερη απαιτείται.",
"PHP with a version lower than %s is required." : "Απαιτείται PHP παλαιότερη από την έκδοση %s.",
"%sbit or higher PHP required." : "%sbit απαιτείται νεώτερη έκδοση PHP.",
+ "The following databases are supported: %s" : " Υποστηρίζονται οι ακόλουθες βάσεις δεδομένων: %s",
"The command line tool %s could not be found" : "Το εργαλείο γραμμής εντολών %s δεν μπορεί να βρεθεί",
"The library %s is not available." : "Το %s της βιβλιοθήκης δεν είναι διαθέσιμο.",
"Library %1$s with a version higher than %2$s is required - available version %3$s." : "Απαιτείται βιβλιοθήκη %1$s νεότερη από την έκδοση %2$s - διαθέσιμη έκδοση %3$s.",
"Library %1$s with a version lower than %2$s is required - available version %3$s." : "Απαιτείται βιβλιοθήκη %1$s παλαιότερη από την έκδοση %2$s - διαθέσιμη έκδοση %3$s.",
+ "The following platforms are supported: %s" : "Υποστηρίζονται οι ακόλουθες πλατφόρμες: %s",
"Server version %s or higher is required." : "Απαιτείται έκδοση διακομιστή %s ή νεότερη.",
"Server version %s or lower is required." : "Απαιτείται έκδοση διακομιστή %s ή παλαιότερη.",
"Logged in user must be an admin or sub admin" : "Ο συνδεδεμένος χρήστης πρέπει να είναι admin ή subadmin",
diff --git a/lib/l10n/el.json b/lib/l10n/el.json
index bf54057ea45..8335f765ef8 100644
--- a/lib/l10n/el.json
+++ b/lib/l10n/el.json
@@ -20,10 +20,12 @@
"PHP %s or higher is required." : "PHP %s ή νεώτερη απαιτείται.",
"PHP with a version lower than %s is required." : "Απαιτείται PHP παλαιότερη από την έκδοση %s.",
"%sbit or higher PHP required." : "%sbit απαιτείται νεώτερη έκδοση PHP.",
+ "The following databases are supported: %s" : " Υποστηρίζονται οι ακόλουθες βάσεις δεδομένων: %s",
"The command line tool %s could not be found" : "Το εργαλείο γραμμής εντολών %s δεν μπορεί να βρεθεί",
"The library %s is not available." : "Το %s της βιβλιοθήκης δεν είναι διαθέσιμο.",
"Library %1$s with a version higher than %2$s is required - available version %3$s." : "Απαιτείται βιβλιοθήκη %1$s νεότερη από την έκδοση %2$s - διαθέσιμη έκδοση %3$s.",
"Library %1$s with a version lower than %2$s is required - available version %3$s." : "Απαιτείται βιβλιοθήκη %1$s παλαιότερη από την έκδοση %2$s - διαθέσιμη έκδοση %3$s.",
+ "The following platforms are supported: %s" : "Υποστηρίζονται οι ακόλουθες πλατφόρμες: %s",
"Server version %s or higher is required." : "Απαιτείται έκδοση διακομιστή %s ή νεότερη.",
"Server version %s or lower is required." : "Απαιτείται έκδοση διακομιστή %s ή παλαιότερη.",
"Logged in user must be an admin or sub admin" : "Ο συνδεδεμένος χρήστης πρέπει να είναι admin ή subadmin",
diff --git a/lib/l10n/he.js b/lib/l10n/he.js
index 2b4a8f456de..b42247d0cfe 100644
--- a/lib/l10n/he.js
+++ b/lib/l10n/he.js
@@ -17,6 +17,7 @@ OC.L10N.register(
"PHP %s or higher is required." : "נדרש PHP בגרסת %s ומעלה.",
"PHP with a version lower than %s is required." : "נדרש PHP בגרסה נמוכה מ- %s.",
"%sbit or higher PHP required." : "נדרש PHP בגרסת %s ומעלה.",
+ "The following databases are supported: %s" : "יש תמיכה במסדי הנתונים הבאים: %s",
"The command line tool %s could not be found" : "כלי שורת הפקודה %s לא אותר",
"The library %s is not available." : "הספריה %s אינה זמינה.",
"Library %1$s with a version lower than %2$s is required - available version %3$s." : "נדרשת ספרייה %1$s עם גרסה מתחת ל־%2$s - הגרסה הזמינה היא %3$s.",
@@ -91,6 +92,8 @@ OC.L10N.register(
"Files can’t be shared with create permissions" : "לא ניתן לשתף קבצים עם הרשאות יצירה",
"Expiration date is in the past" : "תאריך תפוגה הנו בעבר",
"Can’t set expiration date more than %s days in the future" : "לא ניתן להגדיר את תאריך התפוגה מעל %s ימים בעתיד",
+ "%1$s shared »%2$s« with you" : "%2$s שותף אתך על ידי %1$s",
+ "%1$s shared »%2$s« with you." : "„%2$s” שותף אתך על ידי %1$s.",
"Click the button below to open it." : "יש ללחוץ על הכפתור להלן כדי לפתוח אותו.",
"The requested share does not exist anymore" : "השיתוף המבוקש אינו קיים עוד",
"Could not find category \"%s\"" : "לא ניתן למצוא את הקטגוריה „%s“",
diff --git a/lib/l10n/he.json b/lib/l10n/he.json
index 57e1f600f1a..1f137b46688 100644
--- a/lib/l10n/he.json
+++ b/lib/l10n/he.json
@@ -15,6 +15,7 @@
"PHP %s or higher is required." : "נדרש PHP בגרסת %s ומעלה.",
"PHP with a version lower than %s is required." : "נדרש PHP בגרסה נמוכה מ- %s.",
"%sbit or higher PHP required." : "נדרש PHP בגרסת %s ומעלה.",
+ "The following databases are supported: %s" : "יש תמיכה במסדי הנתונים הבאים: %s",
"The command line tool %s could not be found" : "כלי שורת הפקודה %s לא אותר",
"The library %s is not available." : "הספריה %s אינה זמינה.",
"Library %1$s with a version lower than %2$s is required - available version %3$s." : "נדרשת ספרייה %1$s עם גרסה מתחת ל־%2$s - הגרסה הזמינה היא %3$s.",
@@ -89,6 +90,8 @@
"Files can’t be shared with create permissions" : "לא ניתן לשתף קבצים עם הרשאות יצירה",
"Expiration date is in the past" : "תאריך תפוגה הנו בעבר",
"Can’t set expiration date more than %s days in the future" : "לא ניתן להגדיר את תאריך התפוגה מעל %s ימים בעתיד",
+ "%1$s shared »%2$s« with you" : "%2$s שותף אתך על ידי %1$s",
+ "%1$s shared »%2$s« with you." : "„%2$s” שותף אתך על ידי %1$s.",
"Click the button below to open it." : "יש ללחוץ על הכפתור להלן כדי לפתוח אותו.",
"The requested share does not exist anymore" : "השיתוף המבוקש אינו קיים עוד",
"Could not find category \"%s\"" : "לא ניתן למצוא את הקטגוריה „%s“",
diff --git a/lib/l10n/lt_LT.js b/lib/l10n/lt_LT.js
index a9a19214f9e..7887960e852 100644
--- a/lib/l10n/lt_LT.js
+++ b/lib/l10n/lt_LT.js
@@ -189,6 +189,7 @@ OC.L10N.register(
"Your data directory is invalid" : "Neteisingas duomenų katalogas",
"Ensure there is a file called \".ocdata\" in the root of the data directory." : "Įsitikinkite, kad šakniniame duomenų kataloge yra yra \".ocdata\" failas.",
"Action \"%s\" not supported or implemented." : "Veiksmas \"%s\" nepalaikomas ar neįgyvendintas.",
+ "Authentication failed, wrong token or provider ID given" : "Tapatybės nustatymas nepavyko, nurodytas neteisingas prieigos raktas arba teikėjo ID",
"Could not obtain lock type %d on \"%s\"." : "Nepavyko gauti užrakto tipo %d ties \"%s\".",
"Storage unauthorized. %s" : "Saugykla nesankcionuota. %s",
"Storage incomplete configuration. %s" : "Nepilna saugyklos konfigūracija. %s",
diff --git a/lib/l10n/lt_LT.json b/lib/l10n/lt_LT.json
index 1baaa354d35..e8cfc19211f 100644
--- a/lib/l10n/lt_LT.json
+++ b/lib/l10n/lt_LT.json
@@ -187,6 +187,7 @@
"Your data directory is invalid" : "Neteisingas duomenų katalogas",
"Ensure there is a file called \".ocdata\" in the root of the data directory." : "Įsitikinkite, kad šakniniame duomenų kataloge yra yra \".ocdata\" failas.",
"Action \"%s\" not supported or implemented." : "Veiksmas \"%s\" nepalaikomas ar neįgyvendintas.",
+ "Authentication failed, wrong token or provider ID given" : "Tapatybės nustatymas nepavyko, nurodytas neteisingas prieigos raktas arba teikėjo ID",
"Could not obtain lock type %d on \"%s\"." : "Nepavyko gauti užrakto tipo %d ties \"%s\".",
"Storage unauthorized. %s" : "Saugykla nesankcionuota. %s",
"Storage incomplete configuration. %s" : "Nepilna saugyklos konfigūracija. %s",
diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js
index ef00d23c0d3..ba034b66c6b 100644
--- a/lib/l10n/uk.js
+++ b/lib/l10n/uk.js
@@ -44,7 +44,7 @@ OC.L10N.register(
"Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X не підтримується і %s не буде коректно працювати на цій платформі. Випробовуєте на свій риск!",
"For the best results, please consider using a GNU/Linux server instead." : "Для кращих результатів розгляньте можливість використання GNU/Linux серверу",
"It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged." : "Здається що екземпляр цього %s працює в 32-бітному PHP середовищі і open_basedir повинен бути налаштований в php.ini. Це призведе до проблем з файлами більше 4 ГБ і це дуже не рекомендується.",
- "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "Будь ласка, видаліть параметр open_basedir у вашому php.ini або перейдіть на 64-бітний PHP.",
+ "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "Будь ласка, вилучіть параметр open_basedir у вашому php.ini або перейдіть на 64-бітний PHP.",
"Set an admin username." : "Встановіть ім'я адміністратора.",
"Set an admin password." : "Встановіть пароль адміністратора.",
"Can't create or write into the data directory %s" : "Неможливо створити або записати каталог даних %s",
diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json
index 78bc50071be..0f70682be6e 100644
--- a/lib/l10n/uk.json
+++ b/lib/l10n/uk.json
@@ -42,7 +42,7 @@
"Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X не підтримується і %s не буде коректно працювати на цій платформі. Випробовуєте на свій риск!",
"For the best results, please consider using a GNU/Linux server instead." : "Для кращих результатів розгляньте можливість використання GNU/Linux серверу",
"It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged." : "Здається що екземпляр цього %s працює в 32-бітному PHP середовищі і open_basedir повинен бути налаштований в php.ini. Це призведе до проблем з файлами більше 4 ГБ і це дуже не рекомендується.",
- "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "Будь ласка, видаліть параметр open_basedir у вашому php.ini або перейдіть на 64-бітний PHP.",
+ "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "Будь ласка, вилучіть параметр open_basedir у вашому php.ini або перейдіть на 64-бітний PHP.",
"Set an admin username." : "Встановіть ім'я адміністратора.",
"Set an admin password." : "Встановіть пароль адміністратора.",
"Can't create or write into the data directory %s" : "Неможливо створити або записати каталог даних %s",
diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index 8b0cb972c59..7b99fb0a410 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -148,7 +148,7 @@ class AccountManager implements IAccountManager {
$userDataArray = json_decode($result[0]['data'], true);
$jsonError = json_last_error();
- if ($userDataArray === null || $jsonError !== JSON_ERROR_NONE) {
+ if ($userDataArray === null || $userDataArray === [] || $jsonError !== JSON_ERROR_NONE) {
$this->logger->critical("User data of $uid contained invalid JSON (error $jsonError), hence falling back to a default user record");
return $this->buildDefaultUserRecord($user);
}
diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php
index 1202ba09b13..ec8f7ea6f53 100644
--- a/lib/private/Group/Database.php
+++ b/lib/private/Group/Database.php
@@ -118,7 +118,10 @@ class Database extends ABackend implements
}
// Add to cache
- $this->groupCache[$gid] = $gid;
+ $this->groupCache[$gid] = [
+ 'gid' => $gid,
+ 'displayname' => $gid
+ ];
return $result === 1;
}
@@ -244,15 +247,19 @@ class Database extends ABackend implements
// No magic!
$qb = $this->dbConn->getQueryBuilder();
- $cursor = $qb->select('gid')
- ->from('group_user')
+ $cursor = $qb->select('gu.gid', 'g.displayname')
+ ->from('group_user', 'gu')
+ ->leftJoin('gu', 'groups', 'g', $qb->expr()->eq('gu.gid', 'g.gid'))
->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid)))
->execute();
$groups = [];
while ($row = $cursor->fetch()) {
$groups[] = $row['gid'];
- $this->groupCache[$row['gid']] = $row['gid'];
+ $this->groupCache[$row['gid']] = [
+ 'gid' => $row['gid'],
+ 'displayname' => $row['displayname'],
+ ];
}
$cursor->closeCursor();
@@ -309,7 +316,7 @@ class Database extends ABackend implements
}
$qb = $this->dbConn->getQueryBuilder();
- $cursor = $qb->select('gid')
+ $cursor = $qb->select('gid', 'displayname')
->from('groups')
->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid)))
->execute();
@@ -317,7 +324,10 @@ class Database extends ABackend implements
$cursor->closeCursor();
if ($result !== false) {
- $this->groupCache[$gid] = $gid;
+ $this->groupCache[$gid] = [
+ 'gid' => $gid,
+ 'displayname' => $result['displayname'],
+ ];
return true;
}
return false;
@@ -430,6 +440,10 @@ class Database extends ABackend implements
}
public function getDisplayName(string $gid): string {
+ if (isset($this->groupCache[$gid])) {
+ return $this->groupCache[$gid]['displayname'];
+ }
+
$this->fixDI();
$query = $this->dbConn->getQueryBuilder();
diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php
index 73c07a6197f..6056bcdb3e3 100644
--- a/lib/private/Group/Manager.php
+++ b/lib/private/Group/Manager.php
@@ -77,7 +77,7 @@ class Manager extends PublicEmitter implements IGroupManager {
/** @var \OC\Group\Group[] */
private $cachedGroups = [];
- /** @var \OC\Group\Group[] */
+ /** @var (string[])[] */
private $cachedUserGroups = [];
/** @var \OC\SubAdmin */
@@ -276,25 +276,18 @@ class Manager extends PublicEmitter implements IGroupManager {
* @return \OC\Group\Group[]
*/
public function getUserIdGroups($uid) {
- if (isset($this->cachedUserGroups[$uid])) {
- return $this->cachedUserGroups[$uid];
- }
$groups = [];
- foreach ($this->backends as $backend) {
- $groupIds = $backend->getUserGroups($uid);
- if (is_array($groupIds)) {
- foreach ($groupIds as $groupId) {
- $aGroup = $this->get($groupId);
- if ($aGroup instanceof IGroup) {
- $groups[$groupId] = $aGroup;
- } else {
- $this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']);
- }
- }
+
+ foreach ($this->getUserIdGroupIds($uid) as $groupId) {
+ $aGroup = $this->get($groupId);
+ if ($aGroup instanceof IGroup) {
+ $groups[$groupId] = $aGroup;
+ } else {
+ $this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']);
}
}
- $this->cachedUserGroups[$uid] = $groups;
- return $this->cachedUserGroups[$uid];
+
+ return $groups;
}
/**
@@ -320,7 +313,7 @@ class Manager extends PublicEmitter implements IGroupManager {
* @return bool if in group
*/
public function isInGroup($userId, $group) {
- return array_key_exists($group, $this->getUserIdGroups($userId));
+ return array_search($group, $this->getUserIdGroupIds($userId)) !== false;
}
/**
@@ -330,9 +323,25 @@ class Manager extends PublicEmitter implements IGroupManager {
* @return array with group ids
*/
public function getUserGroupIds(IUser $user) {
- return array_map(function ($value) {
- return (string)$value;
- }, array_keys($this->getUserGroups($user)));
+ return $this->getUserIdGroupIds($user->getUID());
+ }
+
+ /**
+ * @param string $uid the user id
+ * @return GroupInterface[]
+ */
+ private function getUserIdGroupIds($uid) {
+ if (!isset($this->cachedUserGroups[$uid])) {
+ $groups = [];
+ foreach ($this->backends as $backend) {
+ if ($groupIds = $backend->getUserGroups($uid)) {
+ $groups = array_merge($groups, $groupIds);
+ }
+ }
+ $this->cachedUserGroups[$uid] = $groups;
+ }
+
+ return $this->cachedUserGroups[$uid];
}
/**