diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 2 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 2 | ||||
-rw-r--r-- | lib/l10n/cs.js | 22 | ||||
-rw-r--r-- | lib/l10n/cs.json | 22 | ||||
-rw-r--r-- | lib/l10n/fa.js | 12 | ||||
-rw-r--r-- | lib/l10n/fa.json | 12 | ||||
-rw-r--r-- | lib/l10n/he.js | 6 | ||||
-rw-r--r-- | lib/l10n/he.json | 6 | ||||
-rw-r--r-- | lib/l10n/ka_GE.js | 22 | ||||
-rw-r--r-- | lib/l10n/ka_GE.json | 22 | ||||
-rw-r--r-- | lib/l10n/kn.js | 2 | ||||
-rw-r--r-- | lib/l10n/kn.json | 2 | ||||
-rw-r--r-- | lib/l10n/lt_LT.js | 12 | ||||
-rw-r--r-- | lib/l10n/lt_LT.json | 12 | ||||
-rw-r--r-- | lib/l10n/sk.js | 22 | ||||
-rw-r--r-- | lib/l10n/sk.json | 22 | ||||
-rw-r--r-- | lib/l10n/uk.js | 6 | ||||
-rw-r--r-- | lib/l10n/uk.json | 6 | ||||
-rw-r--r-- | lib/private/Authentication/Exceptions/ExpiredTokenException.php | 41 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultToken.php | 25 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenMapper.php | 6 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 40 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IProvider.php | 12 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IToken.php | 30 |
24 files changed, 255 insertions, 111 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index cd5090cc93c..ebf5197d4dd 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -414,6 +414,7 @@ return array( 'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php', 'OC\\Authentication\\Token\\DefaultTokenMapper' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenMapper.php', 'OC\\Authentication\\Token\\DefaultTokenProvider' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenProvider.php', + 'OC\\Authentication\\Token\\ExpiredTokenException' => $baseDir . '/lib/private/Authentication/Exceptions/ExpiredTokenException.php', 'OC\\Authentication\\Token\\IProvider' => $baseDir . '/lib/private/Authentication/Token/IProvider.php', 'OC\\Authentication\\Token\\IToken' => $baseDir . '/lib/private/Authentication/Token/IToken.php', 'OC\\Authentication\\TwoFactorAuth\\Manager' => $baseDir . '/lib/private/Authentication/TwoFactorAuth/Manager.php', @@ -563,6 +564,7 @@ return array( 'OC\\Core\\Migrations\\Version13000Date20170926101637' => $baseDir . '/core/Migrations/Version13000Date20170926101637.php', 'OC\\Core\\Migrations\\Version14000Date20180129121024' => $baseDir . '/core/Migrations/Version14000Date20180129121024.php', 'OC\\Core\\Migrations\\Version14000Date20180404140050' => $baseDir . '/core/Migrations/Version14000Date20180404140050.php', + 'OC\\Core\\Migrations\\Version14000Date20180516101403' => $baseDir . '/core/Migrations/Version14000Date20180516101403.php', 'OC\\DB\\Adapter' => $baseDir . '/lib/private/DB/Adapter.php', 'OC\\DB\\AdapterMySQL' => $baseDir . '/lib/private/DB/AdapterMySQL.php', 'OC\\DB\\AdapterOCI8' => $baseDir . '/lib/private/DB/AdapterOCI8.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 4e47536eacc..9a1dfebf52b 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -444,6 +444,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php', 'OC\\Authentication\\Token\\DefaultTokenMapper' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenMapper.php', 'OC\\Authentication\\Token\\DefaultTokenProvider' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenProvider.php', + 'OC\\Authentication\\Token\\ExpiredTokenException' => __DIR__ . '/../../..' . '/lib/private/Authentication/Exceptions/ExpiredTokenException.php', 'OC\\Authentication\\Token\\IProvider' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/IProvider.php', 'OC\\Authentication\\Token\\IToken' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/IToken.php', 'OC\\Authentication\\TwoFactorAuth\\Manager' => __DIR__ . '/../../..' . '/lib/private/Authentication/TwoFactorAuth/Manager.php', @@ -593,6 +594,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Core\\Migrations\\Version13000Date20170926101637' => __DIR__ . '/../../..' . '/core/Migrations/Version13000Date20170926101637.php', 'OC\\Core\\Migrations\\Version14000Date20180129121024' => __DIR__ . '/../../..' . '/core/Migrations/Version14000Date20180129121024.php', 'OC\\Core\\Migrations\\Version14000Date20180404140050' => __DIR__ . '/../../..' . '/core/Migrations/Version14000Date20180404140050.php', + 'OC\\Core\\Migrations\\Version14000Date20180516101403' => __DIR__ . '/../../..' . '/core/Migrations/Version14000Date20180516101403.php', 'OC\\DB\\Adapter' => __DIR__ . '/../../..' . '/lib/private/DB/Adapter.php', 'OC\\DB\\AdapterMySQL' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterMySQL.php', 'OC\\DB\\AdapterOCI8' => __DIR__ . '/../../..' . '/lib/private/DB/AdapterOCI8.php', diff --git a/lib/l10n/cs.js b/lib/l10n/cs.js index 575b12e59c8..81b70c6f056 100644 --- a/lib/l10n/cs.js +++ b/lib/l10n/cs.js @@ -33,20 +33,20 @@ OC.L10N.register( "today" : "dnes", "tomorrow" : "zítra", "yesterday" : "včera", - "_in %n day_::_in %n days_" : ["během %n dne","během %n dnů","během %n dnů"], - "_%n day ago_::_%n days ago_" : ["včera","před %n dny","před %n dny"], + "_in %n day_::_in %n days_" : ["během %n dne","během %n dnů","během %n dnů","během %n dnů"], + "_%n day ago_::_%n days ago_" : ["včera","před %n dny","před %n dny","před %n dny"], "next month" : "následující měsíc", "last month" : "minulý měsíc", - "_in %n month_::_in %n months_" : ["během %n měsíce","během %n měsíců","během %n měsíců"], - "_%n month ago_::_%n months ago_" : ["před %n měsícem","před %n měsíci","před %n měsíci"], + "_in %n month_::_in %n months_" : ["během %n měsíce","během %n měsíců","během %n měsíců","během %n měsíců"], + "_%n month ago_::_%n months ago_" : ["před %n měsícem","před %n měsíci","před %n měsíci","před %n měsíci"], "next year" : "následující rok", "last year" : "minulý rok", - "_in %n year_::_in %n years_" : ["během %n roku","během %n roků","během %n roků"], - "_%n year ago_::_%n years ago_" : ["před rokem","před %n lety","před %n lety"], - "_in %n hour_::_in %n hours_" : ["během %n hodiny","během %n hodin","během %n hodin"], - "_%n hour ago_::_%n hours ago_" : ["před %n hodinou","před %n hodinami","před %n hodinami"], - "_in %n minute_::_in %n minutes_" : ["během %n minuty","během %n minut","během %n minut"], - "_%n minute ago_::_%n minutes ago_" : ["před %n minutou","před %n minutami","před %n minutami"], + "_in %n year_::_in %n years_" : ["během %n roku","během %n roků","během %n roků","během %n roků"], + "_%n year ago_::_%n years ago_" : ["před rokem","před %n lety","před %n lety","před %n lety"], + "_in %n hour_::_in %n hours_" : ["během %n hodiny","během %n hodin","během %n hodin","během %n hodin"], + "_%n hour ago_::_%n hours ago_" : ["před %n hodinou","před %n hodinami","před %n hodinami","před %n hodinami"], + "_in %n minute_::_in %n minutes_" : ["během %n minuty","během %n minut","během %n minut","během %n minut"], + "_%n minute ago_::_%n minutes ago_" : ["před %n minutou","před %n minutami","před %n minutami","před %n minutami"], "in a few seconds" : "během několika sekund", "seconds ago" : "před pár sekundami", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul s ID: %s neexistuje. Povolte ho v nastavení aplikací, nebo kontaktujte vašeho administrátora.", @@ -233,4 +233,4 @@ OC.L10N.register( "Storage is temporarily not available" : "Úložiště je dočasně nedostupné", "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s" }, -"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"); +"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;"); diff --git a/lib/l10n/cs.json b/lib/l10n/cs.json index c5a613123f9..a6d5d5c702d 100644 --- a/lib/l10n/cs.json +++ b/lib/l10n/cs.json @@ -31,20 +31,20 @@ "today" : "dnes", "tomorrow" : "zítra", "yesterday" : "včera", - "_in %n day_::_in %n days_" : ["během %n dne","během %n dnů","během %n dnů"], - "_%n day ago_::_%n days ago_" : ["včera","před %n dny","před %n dny"], + "_in %n day_::_in %n days_" : ["během %n dne","během %n dnů","během %n dnů","během %n dnů"], + "_%n day ago_::_%n days ago_" : ["včera","před %n dny","před %n dny","před %n dny"], "next month" : "následující měsíc", "last month" : "minulý měsíc", - "_in %n month_::_in %n months_" : ["během %n měsíce","během %n měsíců","během %n měsíců"], - "_%n month ago_::_%n months ago_" : ["před %n měsícem","před %n měsíci","před %n měsíci"], + "_in %n month_::_in %n months_" : ["během %n měsíce","během %n měsíců","během %n měsíců","během %n měsíců"], + "_%n month ago_::_%n months ago_" : ["před %n měsícem","před %n měsíci","před %n měsíci","před %n měsíci"], "next year" : "následující rok", "last year" : "minulý rok", - "_in %n year_::_in %n years_" : ["během %n roku","během %n roků","během %n roků"], - "_%n year ago_::_%n years ago_" : ["před rokem","před %n lety","před %n lety"], - "_in %n hour_::_in %n hours_" : ["během %n hodiny","během %n hodin","během %n hodin"], - "_%n hour ago_::_%n hours ago_" : ["před %n hodinou","před %n hodinami","před %n hodinami"], - "_in %n minute_::_in %n minutes_" : ["během %n minuty","během %n minut","během %n minut"], - "_%n minute ago_::_%n minutes ago_" : ["před %n minutou","před %n minutami","před %n minutami"], + "_in %n year_::_in %n years_" : ["během %n roku","během %n roků","během %n roků","během %n roků"], + "_%n year ago_::_%n years ago_" : ["před rokem","před %n lety","před %n lety","před %n lety"], + "_in %n hour_::_in %n hours_" : ["během %n hodiny","během %n hodin","během %n hodin","během %n hodin"], + "_%n hour ago_::_%n hours ago_" : ["před %n hodinou","před %n hodinami","před %n hodinami","před %n hodinami"], + "_in %n minute_::_in %n minutes_" : ["během %n minuty","během %n minut","během %n minut","během %n minut"], + "_%n minute ago_::_%n minutes ago_" : ["před %n minutou","před %n minutami","před %n minutami","před %n minutami"], "in a few seconds" : "během několika sekund", "seconds ago" : "před pár sekundami", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul s ID: %s neexistuje. Povolte ho v nastavení aplikací, nebo kontaktujte vašeho administrátora.", @@ -230,5 +230,5 @@ "Storage connection error. %s" : "Chyba připojení úložiště. %s", "Storage is temporarily not available" : "Úložiště je dočasně nedostupné", "Storage connection timeout. %s" : "Vypršení připojení k úložišti. %s" -},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" +},"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;" }
\ No newline at end of file diff --git a/lib/l10n/fa.js b/lib/l10n/fa.js index d8c4fc2cbbe..a6bf129a454 100644 --- a/lib/l10n/fa.js +++ b/lib/l10n/fa.js @@ -14,13 +14,13 @@ OC.L10N.register( "Invalid image" : "عکس نامعتبر", "today" : "امروز", "yesterday" : "دیروز", - "_%n day ago_::_%n days ago_" : ["%n روز پیش"], + "_%n day ago_::_%n days ago_" : ["%n روز پیش","%n روز پیش"], "last month" : "ماه قبل", - "_%n month ago_::_%n months ago_" : ["%n ماه قبل"], + "_%n month ago_::_%n months ago_" : ["%n ماه قبل","%n ماه قبل"], "last year" : "سال قبل", - "_%n year ago_::_%n years ago_" : ["%n سال پیش"], - "_%n hour ago_::_%n hours ago_" : ["%n ساعت قبل"], - "_%n minute ago_::_%n minutes ago_" : ["%n دقیقه قبل"], + "_%n year ago_::_%n years ago_" : ["%n سال پیش","%n سال پیش"], + "_%n hour ago_::_%n hours ago_" : ["%n ساعت قبل","%n ساعت قبل"], + "_%n minute ago_::_%n minutes ago_" : ["%n دقیقه قبل","%n دقیقه قبل"], "seconds ago" : "ثانیهها پیش", "File name is a reserved word" : "این نام فایل جزو کلمات رزرو میباشد", "File name contains at least one invalid character" : "نام فایل دارای حداقل یک کاراکتر نامعتبر است", @@ -55,4 +55,4 @@ OC.L10N.register( "PostgreSQL >= 9 required" : "PostgreSQL >= 9 نیاز است", "Please upgrade your database version" : "لطفا نسخهی پایگاهدادهی خود را بروز کنید" }, -"nplurals=1; plural=0;"); +"nplurals=2; plural=(n > 1);"); diff --git a/lib/l10n/fa.json b/lib/l10n/fa.json index 946e4f2fd42..958071c7684 100644 --- a/lib/l10n/fa.json +++ b/lib/l10n/fa.json @@ -12,13 +12,13 @@ "Invalid image" : "عکس نامعتبر", "today" : "امروز", "yesterday" : "دیروز", - "_%n day ago_::_%n days ago_" : ["%n روز پیش"], + "_%n day ago_::_%n days ago_" : ["%n روز پیش","%n روز پیش"], "last month" : "ماه قبل", - "_%n month ago_::_%n months ago_" : ["%n ماه قبل"], + "_%n month ago_::_%n months ago_" : ["%n ماه قبل","%n ماه قبل"], "last year" : "سال قبل", - "_%n year ago_::_%n years ago_" : ["%n سال پیش"], - "_%n hour ago_::_%n hours ago_" : ["%n ساعت قبل"], - "_%n minute ago_::_%n minutes ago_" : ["%n دقیقه قبل"], + "_%n year ago_::_%n years ago_" : ["%n سال پیش","%n سال پیش"], + "_%n hour ago_::_%n hours ago_" : ["%n ساعت قبل","%n ساعت قبل"], + "_%n minute ago_::_%n minutes ago_" : ["%n دقیقه قبل","%n دقیقه قبل"], "seconds ago" : "ثانیهها پیش", "File name is a reserved word" : "این نام فایل جزو کلمات رزرو میباشد", "File name contains at least one invalid character" : "نام فایل دارای حداقل یک کاراکتر نامعتبر است", @@ -52,5 +52,5 @@ "PHP module %s not installed." : "ماژول PHP %s نصب نشده است.", "PostgreSQL >= 9 required" : "PostgreSQL >= 9 نیاز است", "Please upgrade your database version" : "لطفا نسخهی پایگاهدادهی خود را بروز کنید" -},"pluralForm" :"nplurals=1; plural=0;" +},"pluralForm" :"nplurals=2; plural=(n > 1);" }
\ No newline at end of file diff --git a/lib/l10n/he.js b/lib/l10n/he.js index dc5b4a5ce38..0f962400dff 100644 --- a/lib/l10n/he.js +++ b/lib/l10n/he.js @@ -19,10 +19,10 @@ OC.L10N.register( "Invalid image" : "תמונה לא חוקית", "today" : "היום", "yesterday" : "אתמול", - "_%n day ago_::_%n days ago_" : ["לפני %n יום","לפני %n ימים"], + "_%n day ago_::_%n days ago_" : ["לפני %n יום","לפני %n ימים","לפני %n ימים"], "last month" : "חודש שעבר", "last year" : "שנה שעברה", - "_%n year ago_::_%n years ago_" : ["לפני %n שנה","לפני %n שנים"], + "_%n year ago_::_%n years ago_" : ["לפני %n שנה","לפני %n שנים","לפני %n שנים"], "seconds ago" : "שניות", "File name is a reserved word" : "שם קובץ הנו מילה שמורה", "File name contains at least one invalid character" : "שם קובץ כולל לפחות תו אחד לא חוקי", @@ -168,4 +168,4 @@ OC.L10N.register( "Storage connection error. %s" : "שגיאת חיבור אחסון. %s", "Storage connection timeout. %s" : "פסק זמן חיבור אחסון. %s" }, -"nplurals=2; plural=(n != 1);"); +"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;"); diff --git a/lib/l10n/he.json b/lib/l10n/he.json index 38218b4ecc7..c88db5ab4a3 100644 --- a/lib/l10n/he.json +++ b/lib/l10n/he.json @@ -17,10 +17,10 @@ "Invalid image" : "תמונה לא חוקית", "today" : "היום", "yesterday" : "אתמול", - "_%n day ago_::_%n days ago_" : ["לפני %n יום","לפני %n ימים"], + "_%n day ago_::_%n days ago_" : ["לפני %n יום","לפני %n ימים","לפני %n ימים"], "last month" : "חודש שעבר", "last year" : "שנה שעברה", - "_%n year ago_::_%n years ago_" : ["לפני %n שנה","לפני %n שנים"], + "_%n year ago_::_%n years ago_" : ["לפני %n שנה","לפני %n שנים","לפני %n שנים"], "seconds ago" : "שניות", "File name is a reserved word" : "שם קובץ הנו מילה שמורה", "File name contains at least one invalid character" : "שם קובץ כולל לפחות תו אחד לא חוקי", @@ -165,5 +165,5 @@ "Storage incomplete configuration. %s" : "תצורה לא מושלמת של האחסון. %s", "Storage connection error. %s" : "שגיאת חיבור אחסון. %s", "Storage connection timeout. %s" : "פסק זמן חיבור אחסון. %s" -},"pluralForm" :"nplurals=2; plural=(n != 1);" +},"pluralForm" :"nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n == 2 && n % 1 == 0) ? 1: (n % 10 == 0 && n % 1 == 0 && n > 10) ? 2 : 3;" }
\ No newline at end of file diff --git a/lib/l10n/ka_GE.js b/lib/l10n/ka_GE.js index 4bf2a9506b0..48c5e67e49f 100644 --- a/lib/l10n/ka_GE.js +++ b/lib/l10n/ka_GE.js @@ -34,20 +34,20 @@ OC.L10N.register( "today" : "დღეს", "tomorrow" : "ხვალ", "yesterday" : "გუშინ", - "_in %n day_::_in %n days_" : ["%n დღეში"], - "_%n day ago_::_%n days ago_" : ["%n დღის წინ"], + "_in %n day_::_in %n days_" : ["%n დღეში","%n დღეში"], + "_%n day ago_::_%n days ago_" : ["%n დღის წინ","%n დღის წინ"], "next month" : "შემდეგი თვე", "last month" : "გასულ თვეში", - "_in %n month_::_in %n months_" : ["%n თვეში"], - "_%n month ago_::_%n months ago_" : ["%n თვის წინ"], + "_in %n month_::_in %n months_" : ["%n თვეში","%n თვეში"], + "_%n month ago_::_%n months ago_" : ["%n თვის წინ","%n თვის წინ"], "next year" : "შემდეგი წელი", "last year" : "გასულ წელს", - "_in %n year_::_in %n years_" : ["%n წელიწადში"], - "_%n year ago_::_%n years ago_" : ["%n წლის წინ"], - "_in %n hour_::_in %n hours_" : ["%n საათში"], - "_%n hour ago_::_%n hours ago_" : ["%n საათის წინ"], - "_in %n minute_::_in %n minutes_" : ["%n წუთში"], - "_%n minute ago_::_%n minutes ago_" : ["%n წუთის წინ"], + "_in %n year_::_in %n years_" : ["%n წელიწადში","%n წელიწადში"], + "_%n year ago_::_%n years ago_" : ["%n წლის წინ","%n წლის წინ"], + "_in %n hour_::_in %n hours_" : ["%n საათში","%n საათში"], + "_%n hour ago_::_%n hours ago_" : ["%n საათის წინ","%n საათის წინ"], + "_in %n minute_::_in %n minutes_" : ["%n წუთში","%n წუთში"], + "_%n minute ago_::_%n minutes ago_" : ["%n წუთის წინ","%n წუთის წინ"], "in a few seconds" : "რამდენიმე წამში", "seconds ago" : "წამის წინ", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "მოდული ID-ით: %s არ არსებობს. გთხოვთ აამოქმედოთ ის აპლიკაციების პარამეტრებში ან დაუკავშირდეთ ადმინისტრატორს.", @@ -248,4 +248,4 @@ OC.L10N.register( "No app name specified" : "აპლიკაციის სახელი არაა მოცემული", "App '%s' could not be installed!" : "აპლიკაცია '%s' ვერ ყენდება!" }, -"nplurals=1; plural=0;"); +"nplurals=2; plural=(n!=1);"); diff --git a/lib/l10n/ka_GE.json b/lib/l10n/ka_GE.json index 81ba596f141..fed1604a821 100644 --- a/lib/l10n/ka_GE.json +++ b/lib/l10n/ka_GE.json @@ -32,20 +32,20 @@ "today" : "დღეს", "tomorrow" : "ხვალ", "yesterday" : "გუშინ", - "_in %n day_::_in %n days_" : ["%n დღეში"], - "_%n day ago_::_%n days ago_" : ["%n დღის წინ"], + "_in %n day_::_in %n days_" : ["%n დღეში","%n დღეში"], + "_%n day ago_::_%n days ago_" : ["%n დღის წინ","%n დღის წინ"], "next month" : "შემდეგი თვე", "last month" : "გასულ თვეში", - "_in %n month_::_in %n months_" : ["%n თვეში"], - "_%n month ago_::_%n months ago_" : ["%n თვის წინ"], + "_in %n month_::_in %n months_" : ["%n თვეში","%n თვეში"], + "_%n month ago_::_%n months ago_" : ["%n თვის წინ","%n თვის წინ"], "next year" : "შემდეგი წელი", "last year" : "გასულ წელს", - "_in %n year_::_in %n years_" : ["%n წელიწადში"], - "_%n year ago_::_%n years ago_" : ["%n წლის წინ"], - "_in %n hour_::_in %n hours_" : ["%n საათში"], - "_%n hour ago_::_%n hours ago_" : ["%n საათის წინ"], - "_in %n minute_::_in %n minutes_" : ["%n წუთში"], - "_%n minute ago_::_%n minutes ago_" : ["%n წუთის წინ"], + "_in %n year_::_in %n years_" : ["%n წელიწადში","%n წელიწადში"], + "_%n year ago_::_%n years ago_" : ["%n წლის წინ","%n წლის წინ"], + "_in %n hour_::_in %n hours_" : ["%n საათში","%n საათში"], + "_%n hour ago_::_%n hours ago_" : ["%n საათის წინ","%n საათის წინ"], + "_in %n minute_::_in %n minutes_" : ["%n წუთში","%n წუთში"], + "_%n minute ago_::_%n minutes ago_" : ["%n წუთის წინ","%n წუთის წინ"], "in a few seconds" : "რამდენიმე წამში", "seconds ago" : "წამის წინ", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "მოდული ID-ით: %s არ არსებობს. გთხოვთ აამოქმედოთ ის აპლიკაციების პარამეტრებში ან დაუკავშირდეთ ადმინისტრატორს.", @@ -245,5 +245,5 @@ "Cannot set expiration date more than %s days in the future" : "ვადის ამოწურვის თარიღი %s დღეზე მეტი მომავალში ვერ იქნება", "No app name specified" : "აპლიკაციის სახელი არაა მოცემული", "App '%s' could not be installed!" : "აპლიკაცია '%s' ვერ ყენდება!" -},"pluralForm" :"nplurals=1; plural=0;" +},"pluralForm" :"nplurals=2; plural=(n!=1);" }
\ No newline at end of file diff --git a/lib/l10n/kn.js b/lib/l10n/kn.js index e8332f6cfde..9494afe50dd 100644 --- a/lib/l10n/kn.js +++ b/lib/l10n/kn.js @@ -10,4 +10,4 @@ OC.L10N.register( "A valid password must be provided" : "ಸರಿಯಾದ ಬಳಕೆದಾರ ಗುಪ್ತಪದ ಒದಗಿಸಬೇಕಾಗಿದೆ", "Authentication error" : "ದೃಢೀಕರಣ ದೋಷ" }, -"nplurals=1; plural=0;"); +"nplurals=2; plural=(n > 1);"); diff --git a/lib/l10n/kn.json b/lib/l10n/kn.json index bf547fdd363..cb88e314b42 100644 --- a/lib/l10n/kn.json +++ b/lib/l10n/kn.json @@ -7,5 +7,5 @@ "A valid username must be provided" : "ಮಾನ್ಯ ಬಳಕೆದಾರ ಹೆಸರು ಒದಗಿಸಬೇಕಾಗುತ್ತದೆ", "A valid password must be provided" : "ಸರಿಯಾದ ಬಳಕೆದಾರ ಗುಪ್ತಪದ ಒದಗಿಸಬೇಕಾಗಿದೆ", "Authentication error" : "ದೃಢೀಕರಣ ದೋಷ" -},"pluralForm" :"nplurals=1; plural=0;" +},"pluralForm" :"nplurals=2; plural=(n > 1);" }
\ No newline at end of file diff --git a/lib/l10n/lt_LT.js b/lib/l10n/lt_LT.js index 0faa87ebcd0..bbb21d08f9b 100644 --- a/lib/l10n/lt_LT.js +++ b/lib/l10n/lt_LT.js @@ -27,13 +27,13 @@ OC.L10N.register( "today" : "šiandien", "tomorrow" : "rytoj", "yesterday" : "vakar", - "_%n day ago_::_%n days ago_" : ["prieš %n dieną","prieš %n dienas","prieš %n dienų"], + "_%n day ago_::_%n days ago_" : ["prieš %n dieną","prieš %n dienas","prieš %n dienų","prieš %n dienų"], "last month" : "praeitą mėnesį", - "_%n month ago_::_%n months ago_" : ["prieš %n mėnesį","prieš %n mėnesius","prieš %n mėnesių"], + "_%n month ago_::_%n months ago_" : ["prieš %n mėnesį","prieš %n mėnesius","prieš %n mėnesių","prieš %n mėnesių"], "last year" : "praeitais metais", - "_%n year ago_::_%n years ago_" : ["prieš %n metus","prieš %n metus","prieš %n metų"], - "_%n hour ago_::_%n hours ago_" : ["prieš %n valandą","prieš %n valandas","prieš %n valandų"], - "_%n minute ago_::_%n minutes ago_" : ["prieš %n minutę","prieš % minutes","prieš %n minučių"], + "_%n year ago_::_%n years ago_" : ["prieš %n metus","prieš %n metus","prieš %n metų","prieš %n metų"], + "_%n hour ago_::_%n hours ago_" : ["prieš %n valandą","prieš %n valandas","prieš %n valandų","prieš %n valandų"], + "_%n minute ago_::_%n minutes ago_" : ["prieš %n minutę","prieš % minutes","prieš %n minučių","prieš %n minučių"], "seconds ago" : "prieš keletą sekundžių", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modulio, kurio id: %s, nėra. Prašome jį įjungti savo programėlių nustatymuose arba susisiekti su savo administratoriumi.", "File name is a reserved word" : "Failo pavadinimas negalimas, žodis rezervuotas", @@ -209,4 +209,4 @@ OC.L10N.register( "No app name specified" : "Nenurodytas programėlės pavadinimas", "App '%s' could not be installed!" : "Nepavyko įdiegti \"%s\" programėlės!" }, -"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"); +"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);"); diff --git a/lib/l10n/lt_LT.json b/lib/l10n/lt_LT.json index 85e5fbef41f..c0d64e18e24 100644 --- a/lib/l10n/lt_LT.json +++ b/lib/l10n/lt_LT.json @@ -25,13 +25,13 @@ "today" : "šiandien", "tomorrow" : "rytoj", "yesterday" : "vakar", - "_%n day ago_::_%n days ago_" : ["prieš %n dieną","prieš %n dienas","prieš %n dienų"], + "_%n day ago_::_%n days ago_" : ["prieš %n dieną","prieš %n dienas","prieš %n dienų","prieš %n dienų"], "last month" : "praeitą mėnesį", - "_%n month ago_::_%n months ago_" : ["prieš %n mėnesį","prieš %n mėnesius","prieš %n mėnesių"], + "_%n month ago_::_%n months ago_" : ["prieš %n mėnesį","prieš %n mėnesius","prieš %n mėnesių","prieš %n mėnesių"], "last year" : "praeitais metais", - "_%n year ago_::_%n years ago_" : ["prieš %n metus","prieš %n metus","prieš %n metų"], - "_%n hour ago_::_%n hours ago_" : ["prieš %n valandą","prieš %n valandas","prieš %n valandų"], - "_%n minute ago_::_%n minutes ago_" : ["prieš %n minutę","prieš % minutes","prieš %n minučių"], + "_%n year ago_::_%n years ago_" : ["prieš %n metus","prieš %n metus","prieš %n metų","prieš %n metų"], + "_%n hour ago_::_%n hours ago_" : ["prieš %n valandą","prieš %n valandas","prieš %n valandų","prieš %n valandų"], + "_%n minute ago_::_%n minutes ago_" : ["prieš %n minutę","prieš % minutes","prieš %n minučių","prieš %n minučių"], "seconds ago" : "prieš keletą sekundžių", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modulio, kurio id: %s, nėra. Prašome jį įjungti savo programėlių nustatymuose arba susisiekti su savo administratoriumi.", "File name is a reserved word" : "Failo pavadinimas negalimas, žodis rezervuotas", @@ -206,5 +206,5 @@ "Files can't be shared with create permissions" : "Failai negali būti bendrinami su sukūrimo leidimais", "No app name specified" : "Nenurodytas programėlės pavadinimas", "App '%s' could not be installed!" : "Nepavyko įdiegti \"%s\" programėlės!" -},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" +},"pluralForm" :"nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 : n % 1 != 0 ? 2: 3);" }
\ No newline at end of file diff --git a/lib/l10n/sk.js b/lib/l10n/sk.js index 5b5f93ce175..63c8af929e4 100644 --- a/lib/l10n/sk.js +++ b/lib/l10n/sk.js @@ -33,20 +33,20 @@ OC.L10N.register( "today" : "dnes", "tomorrow" : "zajtra", "yesterday" : "včera", - "_in %n day_::_in %n days_" : ["o %n deň","o %n dni","o %n dní"], - "_%n day ago_::_%n days ago_" : ["včera","pred %n dňami","pred %n dňami"], + "_in %n day_::_in %n days_" : ["o %n deň","o %n dni","o %n dní","o %n dní"], + "_%n day ago_::_%n days ago_" : ["včera","pred %n dňami","pred %n dňami","pred %n dňami"], "next month" : "budúci mesiac", "last month" : "minulý mesiac", - "_in %n month_::_in %n months_" : ["o %n mesiac ","o %n mesiace","o %n mesiacov"], - "_%n month ago_::_%n months ago_" : ["pred %n mesiacom","pred %n mesiacmi","pred %n mesiacmi"], + "_in %n month_::_in %n months_" : ["o %n mesiac ","o %n mesiace","o %n mesiacov","o %n mesiacov"], + "_%n month ago_::_%n months ago_" : ["pred %n mesiacom","pred %n mesiacmi","pred %n mesiacmi","pred %n mesiacmi"], "next year" : "budúci rok", "last year" : "minulý rok", - "_in %n year_::_in %n years_" : ["o %n rok","o %n roky","o %n rokov"], - "_%n year ago_::_%n years ago_" : ["vlani","pred %n rokmi","pred %n rokmi"], - "_in %n hour_::_in %n hours_" : ["o %n hodinu","o %n hodiny","o %n hodín"], - "_%n hour ago_::_%n hours ago_" : ["pred %n hodinou","pred %n hodinami","pred %n hodinami"], - "_in %n minute_::_in %n minutes_" : ["o %n minútu","o %n minúty","o %n minút"], - "_%n minute ago_::_%n minutes ago_" : ["pred %n minútou","pred %n minútami","pred %n minútami"], + "_in %n year_::_in %n years_" : ["o %n rok","o %n roky","o %n rokov","o %n rokov"], + "_%n year ago_::_%n years ago_" : ["vlani","pred %n rokmi","pred %n rokmi","pred %n rokmi"], + "_in %n hour_::_in %n hours_" : ["o %n hodinu","o %n hodiny","o %n hodín","o %n hodín"], + "_%n hour ago_::_%n hours ago_" : ["pred %n hodinou","pred %n hodinami","pred %n hodinami","pred %n hodinami"], + "_in %n minute_::_in %n minutes_" : ["o %n minútu","o %n minúty","o %n minút","o %n minút"], + "_%n minute ago_::_%n minutes ago_" : ["pred %n minútou","pred %n minútami","pred %n minútami","pred %n minútami"], "in a few seconds" : "o pár sekúnd", "seconds ago" : "pred sekundami", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul s ID: %s neexistuje. Povoľte ho prosím vo vašom nastavení aplikácií alebo kontaktujte správcu.", @@ -234,4 +234,4 @@ OC.L10N.register( "Personal" : "Osobné", "App '%s' could not be installed!" : "Aplikáciu '%s' nebolo možné nainštalovať!" }, -"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"); +"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);"); diff --git a/lib/l10n/sk.json b/lib/l10n/sk.json index 107c44a73c3..15a46f491b0 100644 --- a/lib/l10n/sk.json +++ b/lib/l10n/sk.json @@ -31,20 +31,20 @@ "today" : "dnes", "tomorrow" : "zajtra", "yesterday" : "včera", - "_in %n day_::_in %n days_" : ["o %n deň","o %n dni","o %n dní"], - "_%n day ago_::_%n days ago_" : ["včera","pred %n dňami","pred %n dňami"], + "_in %n day_::_in %n days_" : ["o %n deň","o %n dni","o %n dní","o %n dní"], + "_%n day ago_::_%n days ago_" : ["včera","pred %n dňami","pred %n dňami","pred %n dňami"], "next month" : "budúci mesiac", "last month" : "minulý mesiac", - "_in %n month_::_in %n months_" : ["o %n mesiac ","o %n mesiace","o %n mesiacov"], - "_%n month ago_::_%n months ago_" : ["pred %n mesiacom","pred %n mesiacmi","pred %n mesiacmi"], + "_in %n month_::_in %n months_" : ["o %n mesiac ","o %n mesiace","o %n mesiacov","o %n mesiacov"], + "_%n month ago_::_%n months ago_" : ["pred %n mesiacom","pred %n mesiacmi","pred %n mesiacmi","pred %n mesiacmi"], "next year" : "budúci rok", "last year" : "minulý rok", - "_in %n year_::_in %n years_" : ["o %n rok","o %n roky","o %n rokov"], - "_%n year ago_::_%n years ago_" : ["vlani","pred %n rokmi","pred %n rokmi"], - "_in %n hour_::_in %n hours_" : ["o %n hodinu","o %n hodiny","o %n hodín"], - "_%n hour ago_::_%n hours ago_" : ["pred %n hodinou","pred %n hodinami","pred %n hodinami"], - "_in %n minute_::_in %n minutes_" : ["o %n minútu","o %n minúty","o %n minút"], - "_%n minute ago_::_%n minutes ago_" : ["pred %n minútou","pred %n minútami","pred %n minútami"], + "_in %n year_::_in %n years_" : ["o %n rok","o %n roky","o %n rokov","o %n rokov"], + "_%n year ago_::_%n years ago_" : ["vlani","pred %n rokmi","pred %n rokmi","pred %n rokmi"], + "_in %n hour_::_in %n hours_" : ["o %n hodinu","o %n hodiny","o %n hodín","o %n hodín"], + "_%n hour ago_::_%n hours ago_" : ["pred %n hodinou","pred %n hodinami","pred %n hodinami","pred %n hodinami"], + "_in %n minute_::_in %n minutes_" : ["o %n minútu","o %n minúty","o %n minút","o %n minút"], + "_%n minute ago_::_%n minutes ago_" : ["pred %n minútou","pred %n minútami","pred %n minútami","pred %n minútami"], "in a few seconds" : "o pár sekúnd", "seconds ago" : "pred sekundami", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modul s ID: %s neexistuje. Povoľte ho prosím vo vašom nastavení aplikácií alebo kontaktujte správcu.", @@ -231,5 +231,5 @@ "Storage connection timeout. %s" : "Vypršanie pripojenia k úložisku. %s", "Personal" : "Osobné", "App '%s' could not be installed!" : "Aplikáciu '%s' nebolo možné nainštalovať!" -},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" +},"pluralForm" :"nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);" }
\ No newline at end of file diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js index d5f0982e1db..4c75023395c 100644 --- a/lib/l10n/uk.js +++ b/lib/l10n/uk.js @@ -18,10 +18,10 @@ OC.L10N.register( "Invalid image" : "Невірне зображення", "today" : "сьогодні", "yesterday" : "вчора", - "_%n day ago_::_%n days ago_" : ["%n день тому","%n днів тому","%n днів тому"], + "_%n day ago_::_%n days ago_" : ["%n день тому","%n днів тому","%n днів тому","%n днів тому"], "last month" : "минулого місяця", "last year" : "минулого року", - "_%n year ago_::_%n years ago_" : ["%n рік тому","%n років тому","%n років тому"], + "_%n year ago_::_%n years ago_" : ["%n рік тому","%n років тому","%n років тому","%n років тому"], "seconds ago" : "секунди тому", "File name is a reserved word" : "Ім’я файлу є зарезервованим словом", "File name contains at least one invalid character" : "Ім’я файлу містить принаймні один некоректний символ", @@ -115,4 +115,4 @@ OC.L10N.register( "Storage connection error. %s" : "Помилка з'єднання зі сховищем. %s", "Storage connection timeout. %s" : "Час під'єднання до сховища вичерпався. %s" }, -"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"); +"nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);"); diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json index bd4735da5f3..05c475862a4 100644 --- a/lib/l10n/uk.json +++ b/lib/l10n/uk.json @@ -16,10 +16,10 @@ "Invalid image" : "Невірне зображення", "today" : "сьогодні", "yesterday" : "вчора", - "_%n day ago_::_%n days ago_" : ["%n день тому","%n днів тому","%n днів тому"], + "_%n day ago_::_%n days ago_" : ["%n день тому","%n днів тому","%n днів тому","%n днів тому"], "last month" : "минулого місяця", "last year" : "минулого року", - "_%n year ago_::_%n years ago_" : ["%n рік тому","%n років тому","%n років тому"], + "_%n year ago_::_%n years ago_" : ["%n рік тому","%n років тому","%n років тому","%n років тому"], "seconds ago" : "секунди тому", "File name is a reserved word" : "Ім’я файлу є зарезервованим словом", "File name contains at least one invalid character" : "Ім’я файлу містить принаймні один некоректний символ", @@ -112,5 +112,5 @@ "Storage incomplete configuration. %s" : "Неповна конфігурація сховища. %s", "Storage connection error. %s" : "Помилка з'єднання зі сховищем. %s", "Storage connection timeout. %s" : "Час під'єднання до сховища вичерпався. %s" -},"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);" +},"pluralForm" :"nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);" }
\ No newline at end of file diff --git a/lib/private/Authentication/Exceptions/ExpiredTokenException.php b/lib/private/Authentication/Exceptions/ExpiredTokenException.php new file mode 100644 index 00000000000..a45ca5b6955 --- /dev/null +++ b/lib/private/Authentication/Exceptions/ExpiredTokenException.php @@ -0,0 +1,41 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OC\Authentication\Token; + +use OC\Authentication\Exceptions\InvalidTokenException; + +class ExpiredTokenException extends InvalidTokenException { + /** @var IToken */ + private $token; + + public function __construct(IToken $token) { + parent::__construct(); + + $this->token = $token; + } + + public function getToken(): IToken { + return $this->token; + } +} diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php index e2753ba979c..67aa89ea66b 100644 --- a/lib/private/Authentication/Token/DefaultToken.php +++ b/lib/private/Authentication/Token/DefaultToken.php @@ -30,9 +30,7 @@ use OCP\AppFramework\Db\Entity; * @method void setId(int $id) * @method void setUid(string $uid); * @method void setLoginName(string $loginname) - * @method void setPassword(string $password) * @method void setName(string $name) - * @method void setToken(string $token) * @method string getToken() * @method void setType(int $type) * @method int getType() @@ -72,6 +70,9 @@ class DefaultToken extends Entity implements IToken { /** @var string */ protected $scope; + /** @var int */ + protected $expires; + public function __construct() { $this->addType('uid', 'string'); $this->addType('loginName', 'string'); @@ -83,6 +84,7 @@ class DefaultToken extends Entity implements IToken { $this->addType('lastActivity', 'int'); $this->addType('lastCheck', 'int'); $this->addType('scope', 'string'); + $this->addType('expires', 'int'); } public function getId(): int { @@ -173,4 +175,23 @@ class DefaultToken extends Entity implements IToken { public function getRemember(): int { return parent::getRemember(); } + + public function setToken(string $token) { + parent::setToken($token); + } + + public function setPassword(string $password = null) { + parent::setPassword($password); + } + + public function setExpires($expires) { + parent::setExpires($expires); + } + + /** + * @return int|null + */ + public function getExpires() { + return parent::getExpires(); + } } diff --git a/lib/private/Authentication/Token/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php index 285b043c2c1..a67d7d151e9 100644 --- a/lib/private/Authentication/Token/DefaultTokenMapper.php +++ b/lib/private/Authentication/Token/DefaultTokenMapper.php @@ -79,7 +79,7 @@ class DefaultTokenMapper extends QBMapper { public function getToken(string $token): DefaultToken { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); - $result = $qb->select('id', 'uid', 'login_name', 'password', 'name', 'type', 'remember', 'token', 'last_activity', 'last_check', 'scope') + $result = $qb->select('*') ->from('authtoken') ->where($qb->expr()->eq('token', $qb->createNamedParameter($token))) ->execute(); @@ -102,7 +102,7 @@ class DefaultTokenMapper extends QBMapper { public function getTokenById(int $id): DefaultToken { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); - $result = $qb->select('id', 'uid', 'login_name', 'password', 'name', 'type', 'token', 'last_activity', 'last_check', 'scope') + $result = $qb->select('*') ->from('authtoken') ->where($qb->expr()->eq('id', $qb->createNamedParameter($id))) ->execute(); @@ -127,7 +127,7 @@ class DefaultTokenMapper extends QBMapper { public function getTokenByUser(IUser $user): array { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); - $qb->select('id', 'uid', 'login_name', 'password', 'name', 'type', 'remember', 'token', 'last_activity', 'last_check', 'scope') + $qb->select('*') ->from('authtoken') ->where($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID()))) ->setMaxResults(1000); diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index 747fb8ef6ea..5df74cadac4 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -161,14 +161,21 @@ class DefaultTokenProvider implements IProvider { * * @param string $tokenId * @throws InvalidTokenException + * @throws ExpiredTokenException * @return IToken */ public function getToken(string $tokenId): IToken { try { - return $this->mapper->getToken($this->hashToken($tokenId)); + $token = $this->mapper->getToken($this->hashToken($tokenId)); } catch (DoesNotExistException $ex) { throw new InvalidTokenException(); } + + if ($token->getExpires() !== null && $token->getExpires() < $this->time->getTime()) { + throw new ExpiredTokenException($token); + } + + return $token; } /** @@ -176,14 +183,21 @@ class DefaultTokenProvider implements IProvider { * * @param int $tokenId * @throws InvalidTokenException + * @throws ExpiredTokenException * @return IToken */ public function getTokenById(int $tokenId): IToken { try { - return $this->mapper->getTokenById($tokenId); + $token = $this->mapper->getTokenById($tokenId); } catch (DoesNotExistException $ex) { throw new InvalidTokenException(); } + + if ($token->getExpires() !== null && $token->getExpires() < $this->time->getTime()) { + throw new ExpiredTokenException($token); + } + + return $token; } /** @@ -274,6 +288,28 @@ class DefaultTokenProvider implements IProvider { } /** + * Rotate the token. Usefull for for example oauth tokens + * + * @param IToken $token + * @param string $oldTokenId + * @param string $newTokenId + * @return IToken + */ + public function rotate(IToken $token, string $oldTokenId, string $newTokenId): IToken { + try { + $password = $this->getPassword($token, $oldTokenId); + $token->setPassword($this->encryptPassword($password, $newTokenId)); + } catch (PasswordlessTokenException $e) { + + } + + $token->setToken($this->hashToken($newTokenId)); + $this->updateToken($token); + + return $token; + } + + /** * @param string $token * @return string */ diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index 9b9048b1635..0efffefac68 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -58,6 +58,7 @@ interface IProvider { * * @param string $tokenId * @throws InvalidTokenException + * @throws ExpiredTokenException * @return IToken */ public function getToken(string $tokenId): IToken; @@ -67,6 +68,7 @@ interface IProvider { * * @param int $tokenId * @throws InvalidTokenException + * @throws ExpiredTokenException * @return IToken */ public function getTokenById(int $tokenId): IToken; @@ -145,4 +147,14 @@ interface IProvider { * @throws InvalidTokenException */ public function setPassword(IToken $token, string $tokenId, string $password); + + /** + * Rotate the token. Usefull for for example oauth tokens + * + * @param IToken $token + * @param string $oldTokenId + * @param string $newTokenId + * @return IToken + */ + public function rotate(IToken $token, string $oldTokenId, string $newTokenId): IToken; } diff --git a/lib/private/Authentication/Token/IToken.php b/lib/private/Authentication/Token/IToken.php index b40f55fb6ca..e122ec02764 100644 --- a/lib/private/Authentication/Token/IToken.php +++ b/lib/private/Authentication/Token/IToken.php @@ -96,7 +96,37 @@ interface IToken extends JsonSerializable { */ public function setScope($scope); + /** + * Get the name of the token + * @return string + */ public function getName(): string; + /** + * Get the remember state of the token + * + * @return int + */ public function getRemember(): int; + + /** + * Set the token + * + * @param string $token + */ + public function setToken(string $token); + + /** + * Set the password + * + * @param string $password + */ + public function setPassword(string $password); + + /** + * Set the expiration time of the token + * + * @param int|null $expires + */ + public function setExpires($expires); } |