diff options
Diffstat (limited to 'lib')
53 files changed, 681 insertions, 315 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 3eb532be0c6..06879c5179a 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -521,6 +521,7 @@ return array( 'OC\\Core\\Controller\\JsController' => $baseDir . '/core/Controller/JsController.php', 'OC\\Core\\Controller\\LoginController' => $baseDir . '/core/Controller/LoginController.php', 'OC\\Core\\Controller\\LostController' => $baseDir . '/core/Controller/LostController.php', + 'OC\\Core\\Controller\\NavigationController' => $baseDir . '/core/Controller/NavigationController.php', 'OC\\Core\\Controller\\OCJSController' => $baseDir . '/core/Controller/OCJSController.php', 'OC\\Core\\Controller\\OCSController' => $baseDir . '/core/Controller/OCSController.php', 'OC\\Core\\Controller\\PreviewController' => $baseDir . '/core/Controller/PreviewController.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 2483b5689b3..118094c30ef 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -551,6 +551,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OC\\Core\\Controller\\JsController' => __DIR__ . '/../../..' . '/core/Controller/JsController.php', 'OC\\Core\\Controller\\LoginController' => __DIR__ . '/../../..' . '/core/Controller/LoginController.php', 'OC\\Core\\Controller\\LostController' => __DIR__ . '/../../..' . '/core/Controller/LostController.php', + 'OC\\Core\\Controller\\NavigationController' => __DIR__ . '/../../..' . '/core/Controller/NavigationController.php', 'OC\\Core\\Controller\\OCJSController' => __DIR__ . '/../../..' . '/core/Controller/OCJSController.php', 'OC\\Core\\Controller\\OCSController' => __DIR__ . '/../../..' . '/core/Controller/OCSController.php', 'OC\\Core\\Controller\\PreviewController' => __DIR__ . '/../../..' . '/core/Controller/PreviewController.php', diff --git a/lib/l10n/ar.js b/lib/l10n/ar.js index d5c3652f6d0..1cfe6fa1ce2 100644 --- a/lib/l10n/ar.js +++ b/lib/l10n/ar.js @@ -21,23 +21,41 @@ OC.L10N.register( "The library %s is not available." : "مكتبة %s غير متوفرة.", "Unknown filetype" : "نوع الملف غير معروف", "Invalid image" : "الصورة غير صالحة", + "Avatar image is not square" : "الصورة الرمزية ليست على شكل مربّع", "today" : "اليوم", + "tomorrow" : "غدًا", "yesterday" : "يوم أمس", "_%n day ago_::_%n days ago_" : ["قبل ساعات","قبل يوم","قبل يومين","قبل %n يوماً","قبل %n يوماً","قبل %n يوماً"], + "next month" : "الشهر القادم", "last month" : "الشهر الماضي", "_%n month ago_::_%n months ago_" : ["قبل عدة أيام","قبل شهر","قبل شهرين","قبل %n شهراً","قبل %n شهراً","قبل %n شهراً"], + "next year" : "العام القادم", "last year" : "السنةالماضية", + "in a few seconds" : "خلال بضع ثواني", "seconds ago" : "منذ ثواني", "File name is a reserved word" : "اسم الملف كلمة محجوزة", "File name contains at least one invalid character" : "اسم الملف به ، على الأقل ، حرف غير صالح", "File name is too long" : "اسم الملف طويل جداً", "Empty filename is not allowed" : "لا يسمح بأسماء فارغة للملفات", + "Help" : "المساعدة", "Apps" : "التطبيقات", + "Settings" : "الإعدادات", + "Log out" : "الخروج", "Users" : "المستخدمين", "Unknown user" : "المستخدم غير معروف", "Basic settings" : "الإعدادات الأساسية", + "Sharing" : "المشاركة", + "Security" : "الأمان", + "Encryption" : "التعمية", "Additional settings" : "الإعدادات المتقدمة", + "Tips & tricks" : "نصائح و تلميحات", + "Personal info" : "المعلومات الشخصية", + "Sync clients" : "مزامنة العملاء", + "Unlimited" : "غير محدود", "__language_name__" : "اللغة العربية", + "Verifying" : "التحقق", + "Verifying …" : "عملية التحقق جارية …", + "Verify" : "التحقق", "%s enter the database username and name." : "%s أدخِل اسم قاعدة البيانات واسم مستخدمها.", "%s enter the database username." : "%s ادخل اسم المستخدم الخاص بقاعدة البيانات.", "%s enter the database name." : "%s ادخل اسم فاعدة البيانات", @@ -58,13 +76,67 @@ OC.L10N.register( "Sharing %s failed, because the user %s does not exist" : "فشلت مشاركة %s لأن المستخدم %s غير موجود", "Share type %s is not valid for %s" : "مشاركة النوع %s غير صالحة لـ %s", "%s shared »%s« with you" : "%s شارك »%s« معك", + "Click the button below to open it." : "أنقر على الزر أدناه لفتحه.", "%s via %s" : "%s عبر %s", "Could not find category \"%s\"" : "تعذر العثور على المجلد \"%s\"", + "Sunday" : "الأحد", + "Monday" : "الإثنين", + "Tuesday" : "الثلاثاء", + "Wednesday" : "الأربعاء", + "Thursday" : "الخميس", + "Friday" : "الجمعة", + "Saturday" : "السبت", + "Sun." : "أح.", + "Mon." : "إث.", + "Tue." : "ثلا.", + "Wed." : "أر.", + "Thu." : "خم.", + "Fri." : "جم.", + "Sat." : "سب.", + "Su" : "أح", + "Mo" : "إث", + "Tu" : "ثلا", + "We" : "أر", + "Th" : "خم", + "Fr" : "جم", + "Sa" : "سب", + "January" : "جانفي", + "February" : "فيفري", + "March" : "مارس", + "April" : "أفريل", + "May" : "ماي", + "June" : "جوان", + "July" : "جويلية", + "August" : "أوت", + "September" : "سبتمبر", + "October" : "أكتوبر", + "November" : "نوفمبر", + "December" : "ديسمبر", + "Jan." : "جان.", + "Feb." : "فيف.", + "Mar." : "مار.", + "Apr." : "أفر.", + "May." : "ماي", + "Jun." : "جوا.", + "Jul." : "جوي.", + "Aug." : "أوت", + "Sep." : "سبت.", + "Oct." : "أكت.", + "Nov." : "نوف.", + "Dec." : "ديس.", "A valid username must be provided" : "يجب ادخال اسم مستخدم صحيح", + "Username contains whitespace at the beginning or at the end" : "إنّ إسم المستخدم يحتوي على مسافة بيضاء سواءا في البداية أو النهاية", "A valid password must be provided" : "يجب ادخال كلمة مرور صحيحة", + "Could not create user" : "لا يمكن إنشاء المستخدم", + "User disabled" : "المستخدم معطّل", + "Login canceled by app" : "تم إلغاء الدخول مِن طرف التطبيق", "a safe home for all your data" : "المكان الآمن لجميع بياناتك", + "File is currently busy, please try again later" : "إنّ الملف مشغول الآمن، يرجى إعادة المحاولة لاحقًا", + "Can't read file" : "لا يمكن قراءة الملف", "Application is not enabled" : "التطبيق غير مفعّل", "Authentication error" : "لم يتم التأكد من الشخصية بنجاح", - "Token expired. Please reload page." : "انتهت صلاحية الكلمة , يرجى اعادة تحميل الصفحة" + "Token expired. Please reload page." : "انتهت صلاحية الكلمة , يرجى اعادة تحميل الصفحة", + "Personal" : "الحساب الشخصي", + "Admin" : "المدير" }, "nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"); diff --git a/lib/l10n/ar.json b/lib/l10n/ar.json index 7c8b3f37ac1..386a516e0a6 100644 --- a/lib/l10n/ar.json +++ b/lib/l10n/ar.json @@ -19,23 +19,41 @@ "The library %s is not available." : "مكتبة %s غير متوفرة.", "Unknown filetype" : "نوع الملف غير معروف", "Invalid image" : "الصورة غير صالحة", + "Avatar image is not square" : "الصورة الرمزية ليست على شكل مربّع", "today" : "اليوم", + "tomorrow" : "غدًا", "yesterday" : "يوم أمس", "_%n day ago_::_%n days ago_" : ["قبل ساعات","قبل يوم","قبل يومين","قبل %n يوماً","قبل %n يوماً","قبل %n يوماً"], + "next month" : "الشهر القادم", "last month" : "الشهر الماضي", "_%n month ago_::_%n months ago_" : ["قبل عدة أيام","قبل شهر","قبل شهرين","قبل %n شهراً","قبل %n شهراً","قبل %n شهراً"], + "next year" : "العام القادم", "last year" : "السنةالماضية", + "in a few seconds" : "خلال بضع ثواني", "seconds ago" : "منذ ثواني", "File name is a reserved word" : "اسم الملف كلمة محجوزة", "File name contains at least one invalid character" : "اسم الملف به ، على الأقل ، حرف غير صالح", "File name is too long" : "اسم الملف طويل جداً", "Empty filename is not allowed" : "لا يسمح بأسماء فارغة للملفات", + "Help" : "المساعدة", "Apps" : "التطبيقات", + "Settings" : "الإعدادات", + "Log out" : "الخروج", "Users" : "المستخدمين", "Unknown user" : "المستخدم غير معروف", "Basic settings" : "الإعدادات الأساسية", + "Sharing" : "المشاركة", + "Security" : "الأمان", + "Encryption" : "التعمية", "Additional settings" : "الإعدادات المتقدمة", + "Tips & tricks" : "نصائح و تلميحات", + "Personal info" : "المعلومات الشخصية", + "Sync clients" : "مزامنة العملاء", + "Unlimited" : "غير محدود", "__language_name__" : "اللغة العربية", + "Verifying" : "التحقق", + "Verifying …" : "عملية التحقق جارية …", + "Verify" : "التحقق", "%s enter the database username and name." : "%s أدخِل اسم قاعدة البيانات واسم مستخدمها.", "%s enter the database username." : "%s ادخل اسم المستخدم الخاص بقاعدة البيانات.", "%s enter the database name." : "%s ادخل اسم فاعدة البيانات", @@ -56,13 +74,67 @@ "Sharing %s failed, because the user %s does not exist" : "فشلت مشاركة %s لأن المستخدم %s غير موجود", "Share type %s is not valid for %s" : "مشاركة النوع %s غير صالحة لـ %s", "%s shared »%s« with you" : "%s شارك »%s« معك", + "Click the button below to open it." : "أنقر على الزر أدناه لفتحه.", "%s via %s" : "%s عبر %s", "Could not find category \"%s\"" : "تعذر العثور على المجلد \"%s\"", + "Sunday" : "الأحد", + "Monday" : "الإثنين", + "Tuesday" : "الثلاثاء", + "Wednesday" : "الأربعاء", + "Thursday" : "الخميس", + "Friday" : "الجمعة", + "Saturday" : "السبت", + "Sun." : "أح.", + "Mon." : "إث.", + "Tue." : "ثلا.", + "Wed." : "أر.", + "Thu." : "خم.", + "Fri." : "جم.", + "Sat." : "سب.", + "Su" : "أح", + "Mo" : "إث", + "Tu" : "ثلا", + "We" : "أر", + "Th" : "خم", + "Fr" : "جم", + "Sa" : "سب", + "January" : "جانفي", + "February" : "فيفري", + "March" : "مارس", + "April" : "أفريل", + "May" : "ماي", + "June" : "جوان", + "July" : "جويلية", + "August" : "أوت", + "September" : "سبتمبر", + "October" : "أكتوبر", + "November" : "نوفمبر", + "December" : "ديسمبر", + "Jan." : "جان.", + "Feb." : "فيف.", + "Mar." : "مار.", + "Apr." : "أفر.", + "May." : "ماي", + "Jun." : "جوا.", + "Jul." : "جوي.", + "Aug." : "أوت", + "Sep." : "سبت.", + "Oct." : "أكت.", + "Nov." : "نوف.", + "Dec." : "ديس.", "A valid username must be provided" : "يجب ادخال اسم مستخدم صحيح", + "Username contains whitespace at the beginning or at the end" : "إنّ إسم المستخدم يحتوي على مسافة بيضاء سواءا في البداية أو النهاية", "A valid password must be provided" : "يجب ادخال كلمة مرور صحيحة", + "Could not create user" : "لا يمكن إنشاء المستخدم", + "User disabled" : "المستخدم معطّل", + "Login canceled by app" : "تم إلغاء الدخول مِن طرف التطبيق", "a safe home for all your data" : "المكان الآمن لجميع بياناتك", + "File is currently busy, please try again later" : "إنّ الملف مشغول الآمن، يرجى إعادة المحاولة لاحقًا", + "Can't read file" : "لا يمكن قراءة الملف", "Application is not enabled" : "التطبيق غير مفعّل", "Authentication error" : "لم يتم التأكد من الشخصية بنجاح", - "Token expired. Please reload page." : "انتهت صلاحية الكلمة , يرجى اعادة تحميل الصفحة" + "Token expired. Please reload page." : "انتهت صلاحية الكلمة , يرجى اعادة تحميل الصفحة", + "Personal" : "الحساب الشخصي", + "Admin" : "المدير" },"pluralForm" :"nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;" }
\ No newline at end of file diff --git a/lib/l10n/ast.js b/lib/l10n/ast.js index 73955dbdb93..3d9a5084ab9 100644 --- a/lib/l10n/ast.js +++ b/lib/l10n/ast.js @@ -25,6 +25,7 @@ OC.L10N.register( "Invalid image" : "Imaxe inválida", "Avatar image is not square" : "La imaxe del avatar nun ye cuadrada", "today" : "güei", + "tomorrow" : "mañana", "yesterday" : "ayeri", "_%n day ago_::_%n days ago_" : ["hai %n día","hai %n díes"], "last month" : "mes caberu", diff --git a/lib/l10n/ast.json b/lib/l10n/ast.json index 3e0047ee423..a52d3721b34 100644 --- a/lib/l10n/ast.json +++ b/lib/l10n/ast.json @@ -23,6 +23,7 @@ "Invalid image" : "Imaxe inválida", "Avatar image is not square" : "La imaxe del avatar nun ye cuadrada", "today" : "güei", + "tomorrow" : "mañana", "yesterday" : "ayeri", "_%n day ago_::_%n days ago_" : ["hai %n día","hai %n díes"], "last month" : "mes caberu", diff --git a/lib/l10n/lt_LT.js b/lib/l10n/lt_LT.js index bb8c53361f9..24e337afa70 100644 --- a/lib/l10n/lt_LT.js +++ b/lib/l10n/lt_LT.js @@ -198,6 +198,7 @@ OC.L10N.register( "Storage incomplete configuration. %s" : "Nepilna saugyklos konfigūracija. %s", "Storage connection error. %s" : "Saugyklos sujungimo ryšio klaida. %s", "Storage is temporarily not available" : "Saugykla yra laikinai neprieinama", - "Storage connection timeout. %s" : "Sujungimo su saugykla laikas baigėsi. %s" + "Storage connection timeout. %s" : "Sujungimo su saugykla laikas baigėsi. %s", + "DB Error: \"%s\"" : "DB klaida: \"%s\"" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"); diff --git a/lib/l10n/lt_LT.json b/lib/l10n/lt_LT.json index 5548e6ceebe..0e3912a2ecb 100644 --- a/lib/l10n/lt_LT.json +++ b/lib/l10n/lt_LT.json @@ -196,6 +196,7 @@ "Storage incomplete configuration. %s" : "Nepilna saugyklos konfigūracija. %s", "Storage connection error. %s" : "Saugyklos sujungimo ryšio klaida. %s", "Storage is temporarily not available" : "Saugykla yra laikinai neprieinama", - "Storage connection timeout. %s" : "Sujungimo su saugykla laikas baigėsi. %s" + "Storage connection timeout. %s" : "Sujungimo su saugykla laikas baigėsi. %s", + "DB Error: \"%s\"" : "DB klaida: \"%s\"" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);" }
\ No newline at end of file diff --git a/lib/l10n/lv.js b/lib/l10n/lv.js index b3d655e3769..54d625af61c 100644 --- a/lib/l10n/lv.js +++ b/lib/l10n/lv.js @@ -4,7 +4,7 @@ OC.L10N.register( "Cannot write into \"config\" directory!" : "Nevar rakstīt \"config\" mapē!", "This can usually be fixed by giving the webserver write access to the config directory" : "To parasti var labot, dodot tīmekļa servera rakstīšanas piekļuvi config direktorijai", "See %s" : "Skatīt %s", - "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Faili no programmas %$1s netika aizvietoti pareizi. Pārliecinieties, vai tā ir versija, kas ir saderīga ar serveri.", + "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Datnes no programmas %$1s netika aizvietotas pareizi. Pārliecinieties, vai tā ir versija, kas ir saderīga ar serveri.", "Sample configuration detected" : "Atrasta konfigurācijas paraugs", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Konstatēts, ka paraug konfigurācija ir nokopēta. Tas var izjaukt jūsu instalāciju un nav atbalstīts. Lūdzu, izlasiet dokumentāciju, pirms veicat izmaiņas config.php", "%1$s and %2$s" : "%1$s un %2$s", diff --git a/lib/l10n/lv.json b/lib/l10n/lv.json index 33956326c84..7a549f53c4f 100644 --- a/lib/l10n/lv.json +++ b/lib/l10n/lv.json @@ -2,7 +2,7 @@ "Cannot write into \"config\" directory!" : "Nevar rakstīt \"config\" mapē!", "This can usually be fixed by giving the webserver write access to the config directory" : "To parasti var labot, dodot tīmekļa servera rakstīšanas piekļuvi config direktorijai", "See %s" : "Skatīt %s", - "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Faili no programmas %$1s netika aizvietoti pareizi. Pārliecinieties, vai tā ir versija, kas ir saderīga ar serveri.", + "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "Datnes no programmas %$1s netika aizvietotas pareizi. Pārliecinieties, vai tā ir versija, kas ir saderīga ar serveri.", "Sample configuration detected" : "Atrasta konfigurācijas paraugs", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Konstatēts, ka paraug konfigurācija ir nokopēta. Tas var izjaukt jūsu instalāciju un nav atbalstīts. Lūdzu, izlasiet dokumentāciju, pirms veicat izmaiņas config.php", "%1$s and %2$s" : "%1$s un %2$s", diff --git a/lib/l10n/nb.js b/lib/l10n/nb.js index 261ecd7d1c2..9fa5ef569d0 100644 --- a/lib/l10n/nb.js +++ b/lib/l10n/nb.js @@ -227,6 +227,20 @@ OC.L10N.register( "Storage incomplete configuration. %s" : "Ikke komplett oppsett for lager. %s", "Storage connection error. %s" : "Tilkoblingsfeil for lager. %s", "Storage is temporarily not available" : "Lagring er midlertidig utilgjengelig", - "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s" + "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s", + "Personal" : "Personlig", + "Admin" : "Administrator", + "DB Error: \"%s\"" : "Databasefeil: \"%s\"", + "Offending command was: \"%s\"" : "Kommandoen som mislyktes: \"%s\"", + "Offending command was: \"%s\", name: %s, password: %s" : "Kommandoen som mislyktes var: \"%s\", navn: %s, passord: %s", + "Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Setting av tillatelser for %s mislyktes, fordi tillatelsene gikk ut over tillatelsene som er gitt til %s", + "Setting permissions for %s failed, because the item was not found" : "Setting av tillatelser for %s mislyktes, fordi elementet ikke ble funnet", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Kan ikke fjerne utløpsdato. Delinger må ha en utløpsdato.", + "Cannot increase permissions of %s" : "Kan ikke øke tillatelser for %s", + "Files can't be shared with delete permissions" : "Filer kan ikke deles med rettigheter til sletting", + "Files can't be shared with create permissions" : "Filer kan ikke deles med rettigheter til å opprette", + "Cannot set expiration date more than %s days in the future" : "Kan ikke sette utløpsdato mer enn %s dager fram i tid", + "No app name specified" : "Intet programnavn spesifisert", + "App '%s' could not be installed!" : "Programmet '%s' kunne ikke installeres!" }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/nb.json b/lib/l10n/nb.json index 238bcde7a2c..327e7a0e0ae 100644 --- a/lib/l10n/nb.json +++ b/lib/l10n/nb.json @@ -225,6 +225,20 @@ "Storage incomplete configuration. %s" : "Ikke komplett oppsett for lager. %s", "Storage connection error. %s" : "Tilkoblingsfeil for lager. %s", "Storage is temporarily not available" : "Lagring er midlertidig utilgjengelig", - "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s" + "Storage connection timeout. %s" : "Tidsavbrudd ved tilkobling av lager: %s", + "Personal" : "Personlig", + "Admin" : "Administrator", + "DB Error: \"%s\"" : "Databasefeil: \"%s\"", + "Offending command was: \"%s\"" : "Kommandoen som mislyktes: \"%s\"", + "Offending command was: \"%s\", name: %s, password: %s" : "Kommandoen som mislyktes var: \"%s\", navn: %s, passord: %s", + "Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "Setting av tillatelser for %s mislyktes, fordi tillatelsene gikk ut over tillatelsene som er gitt til %s", + "Setting permissions for %s failed, because the item was not found" : "Setting av tillatelser for %s mislyktes, fordi elementet ikke ble funnet", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Kan ikke fjerne utløpsdato. Delinger må ha en utløpsdato.", + "Cannot increase permissions of %s" : "Kan ikke øke tillatelser for %s", + "Files can't be shared with delete permissions" : "Filer kan ikke deles med rettigheter til sletting", + "Files can't be shared with create permissions" : "Filer kan ikke deles med rettigheter til å opprette", + "Cannot set expiration date more than %s days in the future" : "Kan ikke sette utløpsdato mer enn %s dager fram i tid", + "No app name specified" : "Intet programnavn spesifisert", + "App '%s' could not be installed!" : "Programmet '%s' kunne ikke installeres!" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/l10n/nl.js b/lib/l10n/nl.js index 393927174da..a13c99f77d8 100644 --- a/lib/l10n/nl.js +++ b/lib/l10n/nl.js @@ -230,6 +230,10 @@ OC.L10N.register( "Storage connection timeout. %s" : "Opslag verbinding time-out. %s", "Personal" : "Persoonlijk", "Admin" : "Beheerder", - "DB Error: \"%s\"" : "DB Fout: \"%s\"" + "DB Error: \"%s\"" : "DB Fout: \"%s\"", + "Files can't be shared with delete permissions" : "Bestanden kunnen niet gedeeld worden met 'verwijder' rechten", + "Files can't be shared with create permissions" : "Bestanden kunnen niet gedeeld worden met 'creëer' rechten", + "No app name specified" : "Geen app naam gespecificeerd", + "App '%s' could not be installed!" : "App '%s' kon niet geïnstalleerd worden!" }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/nl.json b/lib/l10n/nl.json index c3c8f6cf072..3cd3b329711 100644 --- a/lib/l10n/nl.json +++ b/lib/l10n/nl.json @@ -228,6 +228,10 @@ "Storage connection timeout. %s" : "Opslag verbinding time-out. %s", "Personal" : "Persoonlijk", "Admin" : "Beheerder", - "DB Error: \"%s\"" : "DB Fout: \"%s\"" + "DB Error: \"%s\"" : "DB Fout: \"%s\"", + "Files can't be shared with delete permissions" : "Bestanden kunnen niet gedeeld worden met 'verwijder' rechten", + "Files can't be shared with create permissions" : "Bestanden kunnen niet gedeeld worden met 'creëer' rechten", + "No app name specified" : "Geen app naam gespecificeerd", + "App '%s' could not be installed!" : "App '%s' kon niet geïnstalleerd worden!" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/l10n/pt_PT.js b/lib/l10n/pt_PT.js index 223f7286a00..77d44beac2c 100644 --- a/lib/l10n/pt_PT.js +++ b/lib/l10n/pt_PT.js @@ -7,6 +7,10 @@ OC.L10N.register( "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Isto pode geralmente ser corrigido ao adicionar permissões de escrita à pasta de configuração ao servidor web. Ver %s.", "Sample configuration detected" : "Detetado exemplo de configuração", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Foi detectado que a configuração de amostra foi copiada. Isso pode danificar a sua instalação e não é suportado. Por favor, leia a documentação antes de realizar mudanças no config.php", + "%1$s and %2$s" : "%1$s e %2$s", + "%1$s, %2$s and %3$s" : "%1$s, %2$s e %3$s", + "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s e %4$s", + "%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s e %5$s", "PHP %s or higher is required." : "Necessário PHP %s ou superior.", "PHP with a version lower than %s is required." : "É necessário um PHP com uma versão inferir a %s.", "%sbit or higher PHP required." : "Necessário PHP %sbit ou superior.", @@ -18,13 +22,25 @@ OC.L10N.register( "Following platforms are supported: %s" : "São suportadas as seguintes plataformas: %s", "Unknown filetype" : "Tipo de ficheiro desconhecido", "Invalid image" : "Imagem inválida", + "Avatar image is not square" : "A imagem do avatar não é quadrada.", "today" : "hoje", "tomorrow" : "Amanhã", "yesterday" : "ontem", + "_in %n day_::_in %n days_" : ["em %n dia","em %n dias"], "_%n day ago_::_%n days ago_" : ["%n dia atrás","%n dias atrás"], + "next month" : "Próximo mês", "last month" : "ultimo mês", + "_in %n month_::_in %n months_" : ["em %n mês","em %n meses"], + "_%n month ago_::_%n months ago_" : ["%n mês atrás","%n meses atrás"], + "next year" : "Próximo ano", "last year" : "ano passado", + "_in %n year_::_in %n years_" : ["dentro de%n ano","dentro de%n anos"], "_%n year ago_::_%n years ago_" : ["%n ano atrás","%n anos atrás"], + "_in %n hour_::_in %n hours_" : ["dentro de %n hora","dentro de %n horas"], + "_%n hour ago_::_%n hours ago_" : ["%n hora atrás","%n horas atrás"], + "_in %n minute_::_in %n minutes_" : ["dentro de %n minuto","dentro de %n minutos"], + "_%n minute ago_::_%n minutes ago_" : ["%n minuto atrás","%n minutos atrás"], + "in a few seconds" : "em breves segundos", "seconds ago" : "Minutos atrás", "File name is a reserved word" : "Nome de ficheiro é uma palavra reservada", "File name contains at least one invalid character" : "Nome de ficheiro contém pelo menos um caráter inválido", @@ -39,9 +55,19 @@ OC.L10N.register( "Log out" : "Sair", "Users" : "Utilizadores", "Unknown user" : "Utilizador desconhecido", + "Basic settings" : "Definições básicas", "Sharing" : "Partilhar", "Security" : "Segurança", + "Encryption" : "Encriptação", + "Additional settings" : "Definições adicionais", + "Tips & tricks" : "Dicas e truques", + "Personal info" : "Informação pessoal", + "Sync clients" : "Sincronizar clientes", + "Unlimited" : "Ilimitado", "__language_name__" : "Português", + "Verifying" : "A verificar", + "Verifying …" : "A verificar...", + "Verify" : "Verificar", "%s enter the database username and name." : "%s introduza o nome de utilizador da base de dados e o nome da base de dados.", "%s enter the database username." : "%s introduza o nome de utilizador da base de dados", "%s enter the database name." : "%s introduza o nome da base de dados", @@ -49,6 +75,7 @@ OC.L10N.register( "Oracle connection could not be established" : "Não foi possível estabelecer a ligação Oracle", "Oracle username and/or password not valid" : "Nome de utilizador/password do Oracle inválida", "PostgreSQL username and/or password not valid" : "Nome de utilizador/password do PostgreSQL inválido", + "You need to enter details of an existing account." : "Precisa de introduzir detalhes de uma conta existente.", "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Esta plataforma não suporta o sistema operativo Mac OS X e o %s poderá não funcionar correctamente. Utilize por sua conta e risco.", "For the best results, please consider using a GNU/Linux server instead." : "Para um melhor resultado, utilize antes o servidor 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." : "Parece que a instância %s está a ser executada num ambiente PHP de 32-bits e o open_basedir foi configurado no php.ini. Isto levará a problemas com ficheiros de tamanho superior a 4 GB e é altamente desencorajado.", @@ -82,19 +109,74 @@ OC.L10N.register( "Sharing %s failed, because resharing is not allowed" : "A partilha %s falhou, porque repartilhar não é permitido", "Sharing %s failed, because the sharing backend for %s could not find its source" : "A partilha %s falhou porque a partilha da interface para %s não conseguiu encontrar a sua fonte", "Sharing %s failed, because the file could not be found in the file cache" : "A partilha %s falhou, devido ao ficheiro não poder ser encontrado na cache de ficheiros", + "Can’t increase permissions of %s" : "Não é possível aumentar as permissões de %s", + "Files can’t be shared with delete permissions" : "Ficheiros não podem ser partilhados com permissões de apagar", + "Files can’t be shared with create permissions" : "Ficheiros não podem ser partilhados com permissões de criação", "Expiration date is in the past" : "A data de expiração está no passado", + "Can’t set expiration date more than %s days in the future" : "Não é possível definir data de expiração a mais de %s dias no futuro", "%s shared »%s« with you" : "%s partilhado »%s« consigo", + "%s shared »%s« with you." : "%s partilhou »%s« consigo.", + "Click the button below to open it." : "Clicar no botão abaixo para abrir.", + "Open »%s«" : "Abrir »%s«", "%s via %s" : "%s via %s", + "The requested share does not exist anymore" : "A partilha requisitada já não existe", "Could not find category \"%s\"" : "Não foi encontrado a categoria \"%s\"", + "Sunday" : "Domingo", + "Monday" : "Segunda-feira", + "Tuesday" : "Terça-feira", + "Wednesday" : "Quarta-feira", + "Thursday" : "Quinta-feira", + "Friday" : "Sexta-feira", + "Saturday" : "Sábado", + "Sun." : "Dom.", + "Mon." : "Seg.", + "Tue." : "Ter.", + "Wed." : "Qua.", + "Thu." : "Qui.", + "Fri." : "Sex.", + "Sat." : "Sáb.", + "Su" : "Dom", + "Mo" : "Seg", + "Tu" : "Ter", + "We" : "Qua", + "Th" : "Qui", + "Fr" : "Sex", + "Sa" : "Sáb", + "January" : "Janeiro", + "February" : "Fevereiro", + "March" : "Março", + "April" : "Abril", + "May" : "Maio", + "June" : "Junho", + "July" : "Julho", + "August" : "Agosto", + "September" : "Setembro", + "October" : "Outubro", + "November" : "Novembro", + "December" : "Dezembro", + "Jan." : "Jan.", + "Feb." : "Fev.", + "Mar." : "Mar.", + "Apr." : "Abr.", + "May." : "Mai.", + "Jun." : "Jun.", + "Jul." : "Jul.", + "Aug." : "Ago.", + "Sep." : "Set.", + "Oct." : "Out.", + "Nov." : "Nov.", + "Dec." : "Dez.", "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-'\"" : "Apenas os seguintes caracteres são permitidos num nome de utilizador: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-'\"", "A valid username must be provided" : "Um nome de utilizador válido deve ser fornecido", "Username contains whitespace at the beginning or at the end" : "Nome de utilizador contém espaço em branco no início ou no fim", + "Username must not consist of dots only" : "O utilizador não pode consistir de apenas pontos", "A valid password must be provided" : "Uma password válida deve ser fornecida", "The username is already being used" : "O nome de utilizador já está a ser usado", "Could not create user" : "Não foi possível criar o utilizador", "User disabled" : "Utilizador desativado", "Login canceled by app" : "Sessão cancelada pela app", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "A aplicação \"%s\" não pode ser instalada porque as seguintes dependências não podem ser realizadas: %s", + "a safe home for all your data" : "Um lugar seguro para todos os seus dados", "File is currently busy, please try again later" : "O ficheiro está ocupado, por favor, tente mais tarde", "Can't read file" : "Não é possível ler o ficheiro", "Application is not enabled" : "A aplicação não está activada", @@ -103,6 +185,10 @@ OC.L10N.register( "No database drivers (sqlite, mysql, or postgresql) installed." : "Nenhuma base de dados de drivers (sqlite, mysql, or postgresql) instaladas.", "Cannot write into \"config\" directory" : "Não é possível escrever na directoria \"configurar\"", "Cannot write into \"apps\" directory" : "Não é possivel escrever na directoria \"aplicações\"", + "This can usually be fixed by giving the webserver write access to the apps directory or disabling the appstore in the config file. See %s" : "Isto pode ser normalmente resolvido dando ao servidor web direito de escrita para o directório de aplicação ou desactivando a loja de aplicações no ficheiro de configuração. Ver %s", + "Cannot create \"data\" directory" : "Não é possivel criar a directoria \"data\"", + "This can usually be fixed by giving the webserver write access to the root directory. See %s" : "Isto pode geralmente ser corrigido ao adicionar permissões de escrita à pasta de raiz. Ver %s", + "Permissions can usually be fixed by giving the webserver write access to the root directory. See %s." : "As permissões podem geralmente ser corrigidas dando ao servidor web permissões de escrita na pasta de raiz. Ver %s.", "Setting locale to %s failed" : "Definindo local para %s falhado", "Please install one of these locales on your system and restart your webserver." : "Por favor instale um destes locais no seu sistema e reinicie o seu servidor web.", "Please ask your server administrator to install the module." : "Por favor pergunte ao seu administrador do servidor para instalar o modulo.", @@ -124,6 +210,8 @@ OC.L10N.register( "Storage unauthorized. %s" : "Armazenamento desautorizado. %s", "Storage incomplete configuration. %s" : "Configuração incompleta do armazenamento. %s", "Storage connection error. %s" : "Erro de ligação ao armazenamento. %s", - "Storage connection timeout. %s" : "Tempo de ligação ao armazenamento expirou. %s" + "Storage connection timeout. %s" : "Tempo de ligação ao armazenamento expirou. %s", + "Personal" : "Pessoal", + "Admin" : "Admin" }, "nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/pt_PT.json b/lib/l10n/pt_PT.json index d0403a5fcce..b2f9b699f0b 100644 --- a/lib/l10n/pt_PT.json +++ b/lib/l10n/pt_PT.json @@ -5,6 +5,10 @@ "This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Isto pode geralmente ser corrigido ao adicionar permissões de escrita à pasta de configuração ao servidor web. Ver %s.", "Sample configuration detected" : "Detetado exemplo de configuração", "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Foi detectado que a configuração de amostra foi copiada. Isso pode danificar a sua instalação e não é suportado. Por favor, leia a documentação antes de realizar mudanças no config.php", + "%1$s and %2$s" : "%1$s e %2$s", + "%1$s, %2$s and %3$s" : "%1$s, %2$s e %3$s", + "%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s e %4$s", + "%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s e %5$s", "PHP %s or higher is required." : "Necessário PHP %s ou superior.", "PHP with a version lower than %s is required." : "É necessário um PHP com uma versão inferir a %s.", "%sbit or higher PHP required." : "Necessário PHP %sbit ou superior.", @@ -16,13 +20,25 @@ "Following platforms are supported: %s" : "São suportadas as seguintes plataformas: %s", "Unknown filetype" : "Tipo de ficheiro desconhecido", "Invalid image" : "Imagem inválida", + "Avatar image is not square" : "A imagem do avatar não é quadrada.", "today" : "hoje", "tomorrow" : "Amanhã", "yesterday" : "ontem", + "_in %n day_::_in %n days_" : ["em %n dia","em %n dias"], "_%n day ago_::_%n days ago_" : ["%n dia atrás","%n dias atrás"], + "next month" : "Próximo mês", "last month" : "ultimo mês", + "_in %n month_::_in %n months_" : ["em %n mês","em %n meses"], + "_%n month ago_::_%n months ago_" : ["%n mês atrás","%n meses atrás"], + "next year" : "Próximo ano", "last year" : "ano passado", + "_in %n year_::_in %n years_" : ["dentro de%n ano","dentro de%n anos"], "_%n year ago_::_%n years ago_" : ["%n ano atrás","%n anos atrás"], + "_in %n hour_::_in %n hours_" : ["dentro de %n hora","dentro de %n horas"], + "_%n hour ago_::_%n hours ago_" : ["%n hora atrás","%n horas atrás"], + "_in %n minute_::_in %n minutes_" : ["dentro de %n minuto","dentro de %n minutos"], + "_%n minute ago_::_%n minutes ago_" : ["%n minuto atrás","%n minutos atrás"], + "in a few seconds" : "em breves segundos", "seconds ago" : "Minutos atrás", "File name is a reserved word" : "Nome de ficheiro é uma palavra reservada", "File name contains at least one invalid character" : "Nome de ficheiro contém pelo menos um caráter inválido", @@ -37,9 +53,19 @@ "Log out" : "Sair", "Users" : "Utilizadores", "Unknown user" : "Utilizador desconhecido", + "Basic settings" : "Definições básicas", "Sharing" : "Partilhar", "Security" : "Segurança", + "Encryption" : "Encriptação", + "Additional settings" : "Definições adicionais", + "Tips & tricks" : "Dicas e truques", + "Personal info" : "Informação pessoal", + "Sync clients" : "Sincronizar clientes", + "Unlimited" : "Ilimitado", "__language_name__" : "Português", + "Verifying" : "A verificar", + "Verifying …" : "A verificar...", + "Verify" : "Verificar", "%s enter the database username and name." : "%s introduza o nome de utilizador da base de dados e o nome da base de dados.", "%s enter the database username." : "%s introduza o nome de utilizador da base de dados", "%s enter the database name." : "%s introduza o nome da base de dados", @@ -47,6 +73,7 @@ "Oracle connection could not be established" : "Não foi possível estabelecer a ligação Oracle", "Oracle username and/or password not valid" : "Nome de utilizador/password do Oracle inválida", "PostgreSQL username and/or password not valid" : "Nome de utilizador/password do PostgreSQL inválido", + "You need to enter details of an existing account." : "Precisa de introduzir detalhes de uma conta existente.", "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Esta plataforma não suporta o sistema operativo Mac OS X e o %s poderá não funcionar correctamente. Utilize por sua conta e risco.", "For the best results, please consider using a GNU/Linux server instead." : "Para um melhor resultado, utilize antes o servidor 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." : "Parece que a instância %s está a ser executada num ambiente PHP de 32-bits e o open_basedir foi configurado no php.ini. Isto levará a problemas com ficheiros de tamanho superior a 4 GB e é altamente desencorajado.", @@ -80,19 +107,74 @@ "Sharing %s failed, because resharing is not allowed" : "A partilha %s falhou, porque repartilhar não é permitido", "Sharing %s failed, because the sharing backend for %s could not find its source" : "A partilha %s falhou porque a partilha da interface para %s não conseguiu encontrar a sua fonte", "Sharing %s failed, because the file could not be found in the file cache" : "A partilha %s falhou, devido ao ficheiro não poder ser encontrado na cache de ficheiros", + "Can’t increase permissions of %s" : "Não é possível aumentar as permissões de %s", + "Files can’t be shared with delete permissions" : "Ficheiros não podem ser partilhados com permissões de apagar", + "Files can’t be shared with create permissions" : "Ficheiros não podem ser partilhados com permissões de criação", "Expiration date is in the past" : "A data de expiração está no passado", + "Can’t set expiration date more than %s days in the future" : "Não é possível definir data de expiração a mais de %s dias no futuro", "%s shared »%s« with you" : "%s partilhado »%s« consigo", + "%s shared »%s« with you." : "%s partilhou »%s« consigo.", + "Click the button below to open it." : "Clicar no botão abaixo para abrir.", + "Open »%s«" : "Abrir »%s«", "%s via %s" : "%s via %s", + "The requested share does not exist anymore" : "A partilha requisitada já não existe", "Could not find category \"%s\"" : "Não foi encontrado a categoria \"%s\"", + "Sunday" : "Domingo", + "Monday" : "Segunda-feira", + "Tuesday" : "Terça-feira", + "Wednesday" : "Quarta-feira", + "Thursday" : "Quinta-feira", + "Friday" : "Sexta-feira", + "Saturday" : "Sábado", + "Sun." : "Dom.", + "Mon." : "Seg.", + "Tue." : "Ter.", + "Wed." : "Qua.", + "Thu." : "Qui.", + "Fri." : "Sex.", + "Sat." : "Sáb.", + "Su" : "Dom", + "Mo" : "Seg", + "Tu" : "Ter", + "We" : "Qua", + "Th" : "Qui", + "Fr" : "Sex", + "Sa" : "Sáb", + "January" : "Janeiro", + "February" : "Fevereiro", + "March" : "Março", + "April" : "Abril", + "May" : "Maio", + "June" : "Junho", + "July" : "Julho", + "August" : "Agosto", + "September" : "Setembro", + "October" : "Outubro", + "November" : "Novembro", + "December" : "Dezembro", + "Jan." : "Jan.", + "Feb." : "Fev.", + "Mar." : "Mar.", + "Apr." : "Abr.", + "May." : "Mai.", + "Jun." : "Jun.", + "Jul." : "Jul.", + "Aug." : "Ago.", + "Sep." : "Set.", + "Oct." : "Out.", + "Nov." : "Nov.", + "Dec." : "Dez.", "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-'\"" : "Apenas os seguintes caracteres são permitidos num nome de utilizador: \"a-z\", \"A-Z\", \"0-9\", e \"_.@-'\"", "A valid username must be provided" : "Um nome de utilizador válido deve ser fornecido", "Username contains whitespace at the beginning or at the end" : "Nome de utilizador contém espaço em branco no início ou no fim", + "Username must not consist of dots only" : "O utilizador não pode consistir de apenas pontos", "A valid password must be provided" : "Uma password válida deve ser fornecida", "The username is already being used" : "O nome de utilizador já está a ser usado", "Could not create user" : "Não foi possível criar o utilizador", "User disabled" : "Utilizador desativado", "Login canceled by app" : "Sessão cancelada pela app", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "A aplicação \"%s\" não pode ser instalada porque as seguintes dependências não podem ser realizadas: %s", + "a safe home for all your data" : "Um lugar seguro para todos os seus dados", "File is currently busy, please try again later" : "O ficheiro está ocupado, por favor, tente mais tarde", "Can't read file" : "Não é possível ler o ficheiro", "Application is not enabled" : "A aplicação não está activada", @@ -101,6 +183,10 @@ "No database drivers (sqlite, mysql, or postgresql) installed." : "Nenhuma base de dados de drivers (sqlite, mysql, or postgresql) instaladas.", "Cannot write into \"config\" directory" : "Não é possível escrever na directoria \"configurar\"", "Cannot write into \"apps\" directory" : "Não é possivel escrever na directoria \"aplicações\"", + "This can usually be fixed by giving the webserver write access to the apps directory or disabling the appstore in the config file. See %s" : "Isto pode ser normalmente resolvido dando ao servidor web direito de escrita para o directório de aplicação ou desactivando a loja de aplicações no ficheiro de configuração. Ver %s", + "Cannot create \"data\" directory" : "Não é possivel criar a directoria \"data\"", + "This can usually be fixed by giving the webserver write access to the root directory. See %s" : "Isto pode geralmente ser corrigido ao adicionar permissões de escrita à pasta de raiz. Ver %s", + "Permissions can usually be fixed by giving the webserver write access to the root directory. See %s." : "As permissões podem geralmente ser corrigidas dando ao servidor web permissões de escrita na pasta de raiz. Ver %s.", "Setting locale to %s failed" : "Definindo local para %s falhado", "Please install one of these locales on your system and restart your webserver." : "Por favor instale um destes locais no seu sistema e reinicie o seu servidor web.", "Please ask your server administrator to install the module." : "Por favor pergunte ao seu administrador do servidor para instalar o modulo.", @@ -122,6 +208,8 @@ "Storage unauthorized. %s" : "Armazenamento desautorizado. %s", "Storage incomplete configuration. %s" : "Configuração incompleta do armazenamento. %s", "Storage connection error. %s" : "Erro de ligação ao armazenamento. %s", - "Storage connection timeout. %s" : "Tempo de ligação ao armazenamento expirou. %s" + "Storage connection timeout. %s" : "Tempo de ligação ao armazenamento expirou. %s", + "Personal" : "Pessoal", + "Admin" : "Admin" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index 084a79561bb..5a18e75ed32 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -227,6 +227,11 @@ OC.L10N.register( "Storage incomplete configuration. %s" : "Неполная конфигурация хранилища. %s", "Storage connection error. %s" : "Ошибка подключения к хранилищу. %s", "Storage is temporarily not available" : "Хранилище временно недоступно", - "Storage connection timeout. %s" : "Истекло время ожидания подключения к хранилищу. %s" + "Storage connection timeout. %s" : "Истекло время ожидания подключения к хранилищу. %s", + "Personal" : "Личное", + "Admin" : "Администратор", + "DB Error: \"%s\"" : "Ошибка БД: «%s»", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Невозможно очистить дату истечения срока действия. Общие ресурсы должны иметь срок действия.", + "No app name specified" : "Не указано имя приложения" }, "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"); diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index f9bd45402e8..62da4204b93 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -225,6 +225,11 @@ "Storage incomplete configuration. %s" : "Неполная конфигурация хранилища. %s", "Storage connection error. %s" : "Ошибка подключения к хранилищу. %s", "Storage is temporarily not available" : "Хранилище временно недоступно", - "Storage connection timeout. %s" : "Истекло время ожидания подключения к хранилищу. %s" + "Storage connection timeout. %s" : "Истекло время ожидания подключения к хранилищу. %s", + "Personal" : "Личное", + "Admin" : "Администратор", + "DB Error: \"%s\"" : "Ошибка БД: «%s»", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Невозможно очистить дату истечения срока действия. Общие ресурсы должны иметь срок действия.", + "No app name specified" : "Не указано имя приложения" },"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 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/App/AppManager.php b/lib/private/App/AppManager.php index 0e921ba1b7f..690dcfe5639 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -380,10 +380,10 @@ class AppManager implements IAppManager { return $data; } - public function getAppVersion(string $appId, bool $useCache = true) { + public function getAppVersion(string $appId, bool $useCache = true): string { if(!$useCache || !isset($this->appVersions[$appId])) { $appInfo = \OC::$server->getAppManager()->getAppInfo($appId); - $this->appVersions[$appId] = ($appInfo !== null) ? $appInfo['version'] : '0'; + $this->appVersions[$appId] = ($appInfo !== null && isset($appInfo['version'])) ? $appInfo['version'] : '0'; } return $this->appVersions[$appId]; } @@ -411,6 +411,7 @@ class AppManager implements IAppManager { /** * @inheritdoc + * In case you change this method, also change \OC\App\CodeChecker\InfoChecker::isShipped() */ public function isShipped($appId) { $this->loadShippedJson(); @@ -422,6 +423,10 @@ class AppManager implements IAppManager { return in_array($appId, $alwaysEnabled, true); } + /** + * In case you change this method, also change \OC\App\CodeChecker\InfoChecker::loadShippedJson() + * @throws \Exception + */ private function loadShippedJson() { if ($this->shippedApps === null) { $shippedJson = \OC::$SERVERROOT . '/core/shipped.json'; diff --git a/lib/private/App/CodeChecker/DeprecationCheck.php b/lib/private/App/CodeChecker/DeprecationCheck.php index c337e71f27e..722697f3313 100644 --- a/lib/private/App/CodeChecker/DeprecationCheck.php +++ b/lib/private/App/CodeChecker/DeprecationCheck.php @@ -146,6 +146,8 @@ class DeprecationCheck extends AbstractCheck { 'OCP\IServerContainer::getDb' => '8.1.0', 'OCP\IServerContainer::getHTTPHelper' => '8.1.0', + 'OCP\Response::disableCaching' => '14.0.0', + 'OCP\User::getUser' => '8.0.0', 'OCP\User::getUsers' => '8.1.0', 'OCP\User::getDisplayName' => '8.1.0', diff --git a/lib/private/App/CodeChecker/InfoChecker.php b/lib/private/App/CodeChecker/InfoChecker.php index e8791bd7037..f5de6d376d8 100644 --- a/lib/private/App/CodeChecker/InfoChecker.php +++ b/lib/private/App/CodeChecker/InfoChecker.php @@ -23,121 +23,88 @@ namespace OC\App\CodeChecker; -use OC\App\InfoParser; use OC\Hooks\BasicEmitter; +use OCP\App\AppPathNotFoundException; +use OCP\App\IAppManager; class InfoChecker extends BasicEmitter { - /** @var InfoParser */ - private $infoParser; + /** @var string[] */ + private $shippedApps; - private $mandatoryFields = [ - 'author', - 'description', - 'dependencies', - 'id', - 'licence', - 'name', - 'version', - ]; - private $optionalFields = [ - 'bugs', - 'category', - 'default_enable', - 'documentation', - 'namespace', - 'ocsid', - 'public', - 'remote', - 'repository', - 'types', - 'website', - ]; - private $deprecatedFields = [ - 'info', - 'require', - 'requiremax', - 'requiremin', - 'shipped', - 'standalone', - ]; - - public function __construct(InfoParser $infoParser) { - $this->infoParser = $infoParser; - } + /** @var string[] */ + private $alwaysEnabled; /** * @param string $appId * @return array + * @throws \RuntimeException */ - public function analyse($appId) { + public function analyse($appId): array { $appPath = \OC_App::getAppPath($appId); if ($appPath === false) { throw new \RuntimeException("No app with given id <$appId> known."); } - $errors = []; - - $info = $this->infoParser->parse($appPath . '/appinfo/info.xml'); - - if (!isset($info['dependencies']['nextcloud']['@attributes']['min-version'])) { - $errors[] = [ - 'type' => 'missingRequirement', - 'field' => 'min', - ]; - $this->emit('InfoChecker', 'missingRequirement', ['min']); - } - - if (!isset($info['dependencies']['nextcloud']['@attributes']['max-version'])) { - $errors[] = [ - 'type' => 'missingRequirement', - 'field' => 'max', - ]; - $this->emit('InfoChecker', 'missingRequirement', ['max']); - } - - foreach ($info as $key => $value) { - if(is_array($value)) { - $value = json_encode($value); - } - if (in_array($key, $this->mandatoryFields)) { - $this->emit('InfoChecker', 'mandatoryFieldFound', [$key, $value]); - continue; - } + $xml = new \DOMDocument(); + $xml->load($appPath . '/appinfo/info.xml'); - if (in_array($key, $this->optionalFields)) { - $this->emit('InfoChecker', 'optionalFieldFound', [$key, $value]); - continue; + $schema = \OC::$SERVERROOT . '/resources/app-info.xsd'; + try { + if ($this->isShipped($appId)) { + // Shipped apps are allowed to have the public and default_enabled tags + $schema = \OC::$SERVERROOT . '/resources/app-info-shipped.xsd'; } - - if (in_array($key, $this->deprecatedFields)) { - // skip empty arrays - empty arrays for remote and public are always added - if($value === '[]' && in_array($key, ['public', 'remote', 'info'])) { - continue; - } - $this->emit('InfoChecker', 'deprecatedFieldFound', [$key, $value]); - continue; - } - - $this->emit('InfoChecker', 'unusedFieldFound', [$key, $value]); + } catch (\Exception $e) { + // Assume it is not shipped } - foreach ($this->mandatoryFields as $key) { - if(!isset($info[$key])) { - $this->emit('InfoChecker', 'mandatoryFieldMissing', [$key]); + $errors = []; + if (!$xml->schemaValidate($schema)) { + foreach (libxml_get_errors() as $error) { $errors[] = [ - 'type' => 'mandatoryFieldMissing', - 'field' => $key, + 'type' => 'parseError', + 'field' => $error->message, ]; + $this->emit('InfoChecker', 'parseError', [$error->message]); } } - $versionFile = $appPath . '/appinfo/version'; - if (is_file($versionFile)) { - $version = trim(file_get_contents($versionFile)); - $this->emit('InfoChecker', 'migrateVersion', [$version]); - } - return $errors; } + + /** + * This is a copy of \OC\App\AppManager::isShipped(), keep both in sync. + * This method is copied, so the code checker works even when Nextcloud is + * not installed yet. The AppManager requires a database connection, which + * fails in that case. + * + * @param string $appId + * @return bool + * @throws \Exception + */ + protected function isShipped(string $appId): bool { + $this->loadShippedJson(); + return \in_array($appId, $this->shippedApps, true); + } + + /** + * This is a copy of \OC\App\AppManager::loadShippedJson(), keep both in sync + * This method is copied, so the code checker works even when Nextcloud is + * not installed yet. The AppManager requires a database connection, which + * fails in that case. + * + * @throws \Exception + */ + protected function loadShippedJson() { + if ($this->shippedApps === null) { + $shippedJson = \OC::$SERVERROOT . '/core/shipped.json'; + if (!file_exists($shippedJson)) { + throw new \Exception("File not found: $shippedJson"); + } + $content = json_decode(file_get_contents($shippedJson), true); + $this->shippedApps = $content['shippedApps']; + $this->alwaysEnabled = $content['alwaysEnabled']; + } + } } diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php index fe4d7ff48f7..efe01d291d7 100644 --- a/lib/private/App/Platform.php +++ b/lib/private/App/Platform.php @@ -61,7 +61,7 @@ class Platform { */ public function getOcVersion() { $v = \OCP\Util::getVersion(); - return join('.', $v); + return implode('.', $v); } /** diff --git a/lib/private/AppFramework/Middleware/Security/BruteForceMiddleware.php b/lib/private/AppFramework/Middleware/Security/BruteForceMiddleware.php index 79359b142ac..e09dfdfcb87 100644 --- a/lib/private/AppFramework/Middleware/Security/BruteForceMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/BruteForceMiddleware.php @@ -26,7 +26,6 @@ namespace OC\AppFramework\Middleware\Security; use OC\AppFramework\Utility\ControllerMethodReflector; use OC\Security\Bruteforce\Throttler; -use OCP\AppFramework\Controller; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Middleware; use OCP\IRequest; diff --git a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php index c3b5a844ed5..dca761bdfc0 100644 --- a/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php +++ b/lib/private/AppFramework/Middleware/Security/RateLimitingMiddleware.php @@ -27,7 +27,6 @@ namespace OC\AppFramework\Middleware\Security; use OC\AppFramework\Utility\ControllerMethodReflector; use OC\Security\RateLimiting\Exception\RateLimitExceededException; use OC\Security\RateLimiting\Limiter; -use OCP\AppFramework\Controller; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Middleware; diff --git a/lib/private/Collaboration/Collaborators/GroupPlugin.php b/lib/private/Collaboration/Collaborators/GroupPlugin.php index b147d2d7b58..7eee042076e 100644 --- a/lib/private/Collaboration/Collaborators/GroupPlugin.php +++ b/lib/private/Collaboration/Collaborators/GroupPlugin.php @@ -59,7 +59,7 @@ class GroupPlugin implements ISearchPlugin { $groups = $this->groupManager->search($search, $limit, $offset); $groupIds = array_map(function (IGroup $group) { return $group->getGID(); }, $groups); - if (!$this->shareeEnumeration || sizeof($groups) < $limit) { + if (!$this->shareeEnumeration || count($groups) < $limit) { $hasMoreResults = true; } diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php index 2e946c4a872..2d85ff334bc 100644 --- a/lib/private/Collaboration/Collaborators/MailPlugin.php +++ b/lib/private/Collaboration/Collaborators/MailPlugin.php @@ -28,9 +28,11 @@ use OCP\Collaboration\Collaborators\ISearchPlugin; use OCP\Collaboration\Collaborators\ISearchResult; use OCP\Collaboration\Collaborators\SearchResultType; use OCP\Contacts\IManager; +use OCP\Federation\ICloudId; use OCP\Federation\ICloudIdManager; use OCP\IConfig; use OCP\IGroupManager; +use OCP\IUser; use OCP\IUserSession; use OCP\Share; @@ -112,7 +114,7 @@ class MailPlugin implements ISearchPlugin { continue; } - if (!$searchResult->hasResult($userType, $cloud->getUser())) { + if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) { $singleResult = [[ 'label' => $contact['FN'] . " ($emailAddress)", 'value' => [ @@ -133,7 +135,7 @@ class MailPlugin implements ISearchPlugin { continue; } - if (!$searchResult->hasResult($userType, $cloud->getUser())) { + if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) { $singleResult = [[ 'label' => $contact['FN'] . " ($emailAddress)", 'value' => [ @@ -189,4 +191,9 @@ class MailPlugin implements ISearchPlugin { return true; } + + public function isCurrentUser(ICloudId $cloud): bool { + $currentUser = $this->userSession->getUser(); + return $currentUser instanceof IUser ? $currentUser->getUID() === $cloud->getUser() : false; + } } diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php index d2639249d56..62f76876031 100644 --- a/lib/private/Collaboration/Collaborators/UserPlugin.php +++ b/lib/private/Collaboration/Collaborators/UserPlugin.php @@ -85,7 +85,7 @@ class UserPlugin implements ISearchPlugin { $this->takeOutCurrentUser($users); - if (!$this->shareeEnumeration || sizeof($users) < $limit) { + if (!$this->shareeEnumeration || count($users) < $limit) { $hasMoreResults = true; } diff --git a/lib/private/Contacts/ContactsMenu/ContactsStore.php b/lib/private/Contacts/ContactsMenu/ContactsStore.php index 43600470e1f..73319151d6e 100644 --- a/lib/private/Contacts/ContactsMenu/ContactsStore.php +++ b/lib/private/Contacts/ContactsMenu/ContactsStore.php @@ -27,14 +27,12 @@ namespace OC\Contacts\ContactsMenu; -use OC\Share\Share; use OCP\Contacts\ContactsMenu\IEntry; use OCP\Contacts\IManager; use OCP\IConfig; use OCP\IGroupManager; use OCP\IUser; use OCP\IUserManager; -use OCP\IUserSession; use OCP\Contacts\ContactsMenu\IContactsStore; class ContactsStore implements IContactsStore { diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 29f717b886c..77ac23fe5d2 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -31,8 +31,6 @@ use OCP\AppFramework\QueryException; use OCP\IDBConnection; use OCP\Migration\IMigrationStep; use OCP\Migration\IOutput; -use Doctrine\DBAL\Schema\Column; -use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; class MigrationService { diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php index 4f05b7b00ef..35aae082699 100644 --- a/lib/private/DB/SchemaWrapper.php +++ b/lib/private/DB/SchemaWrapper.php @@ -23,7 +23,6 @@ namespace OC\DB; -use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Schema\Schema; use OCP\DB\ISchemaWrapper; use OCP\IDBConnection; diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 384e6e5e457..cc655018f8d 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -25,7 +25,6 @@ namespace OC\Files\Config; -use OC\DB\QueryBuilder\Literal; use OCA\Files_Sharing\SharedMount; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\Config\ICachedMountFileInfo; diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index defeda4c21a..280a8efa81c 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -23,10 +23,7 @@ namespace OC\Files\ObjectStore; -use Aws\Exception\MultipartUploadException; -use Aws\S3\MultipartUploader; use Aws\S3\S3Client; -use Psr\Http\Message\StreamInterface; const S3_UPLOAD_PART_SIZE = 524288000; // 500MB diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php index f9c6175308c..1496fda5140 100644 --- a/lib/private/Files/Storage/DAV.php +++ b/lib/private/Files/Storage/DAV.php @@ -35,7 +35,7 @@ namespace OC\Files\Storage; use Exception; use GuzzleHttp\Exception\RequestException; -use GuzzleHttp\Message\ResponseInterface; +use Psr\Http\Message\ResponseInterface; use Icewind\Streams\CallbackWrapper; use OC\Files\Filesystem; use Icewind\Streams\IteratorDirectory; @@ -344,7 +344,7 @@ class DAV extends Common { 'auth' => [$this->user, $this->password], 'stream' => true ]); - } catch (RequestException $e) { + } catch (\GuzzleHttp\Exception\ClientException $e) { if ($e->getResponse() instanceof ResponseInterface && $e->getResponse()->getStatusCode() === 404) { return false; diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index e40a4830953..b65db054055 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -351,9 +351,7 @@ class Encryption extends Wrapper { // need to stream copy file by file in case we copy between a encrypted // and a unencrypted storage $this->unlink($path2); - $result = $this->copyFromStorage($this, $path1, $path2); - - return $result; + return $this->copyFromStorage($this, $path1, $path2); } /** diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index 4e6843d7b9f..0387fcabfaf 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -25,10 +25,13 @@ declare(strict_types=1); namespace OC\Http\Client; use GuzzleHttp\Client as GuzzleClient; +use GuzzleHttp\HandlerStack; +use GuzzleHttp\Middleware; use OCP\Http\Client\IClient; use OCP\Http\Client\IResponse; use OCP\ICertificateManager; use OCP\IConfig; +use Psr\Http\Message\RequestInterface; /** * Class Client @@ -43,17 +46,23 @@ class Client implements IClient { /** @var ICertificateManager */ private $certificateManager; private $configured = false; + /** @var HandlerStack */ + private $stack; /** * @param IConfig $config * @param ICertificateManager $certificateManager * @param GuzzleClient $client */ - public function __construct(IConfig $config, - ICertificateManager $certificateManager, - GuzzleClient $client) { + public function __construct( + IConfig $config, + ICertificateManager $certificateManager, + GuzzleClient $client, + HandlerStack $stack + ) { $this->config = $config; $this->client = $client; + $this->stack = $stack; $this->certificateManager = $certificateManager; } @@ -65,25 +74,37 @@ class Client implements IClient { return; } $this->configured = true; - // Either use user bundle or the system bundle if nothing is specified + + $this->stack->push(Middleware::mapRequest(function (RequestInterface $request) { + return $request + ->withHeader('User-Agent', 'Nextcloud Server Crawler'); + })); + } + + private function getRequestOptions() { + $options = [ + 'verify' => $this->getCertBundle(), + ]; + $proxyUri = $this->getProxyUri(); + if ($proxyUri !== '') { + $options['proxy'] = $proxyUri; + } + return $options; + } + + private function getCertBundle() { if ($this->certificateManager->listCertificates() !== []) { - $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath()); + return $this->certificateManager->getAbsoluteBundlePath(); } else { // If the instance is not yet setup we need to use the static path as // $this->certificateManager->getAbsoluteBundlePath() tries to instantiiate // a view if ($this->config->getSystemValue('installed', false)) { - $this->client->setDefaultOption('verify', $this->certificateManager->getAbsoluteBundlePath(null)); + return $this->certificateManager->getAbsoluteBundlePath(null); } else { - $this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'); + return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt'; } } - - $this->client->setDefaultOption('headers/User-Agent', 'Nextcloud Server Crawler'); - $proxyUri = $this->getProxyUri(); - if ($proxyUri !== '') { - $this->client->setDefaultOption('proxy', $proxyUri); - } } /** @@ -137,7 +158,7 @@ class Client implements IClient { */ public function get(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->get($uri, $options); + $response = $this->client->request('get', $uri, array_merge($options, $this->getRequestOptions())); $isStream = isset($options['stream']) && $options['stream']; return new Response($response, $isStream); } @@ -168,7 +189,7 @@ class Client implements IClient { */ public function head(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->head($uri, $options); + $response = $this->client->request('head', $uri, array_merge($options, $this->getRequestOptions())); return new Response($response); } @@ -203,7 +224,11 @@ class Client implements IClient { */ public function post(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->post($uri, $options); + if (isset($options['body']) && is_array($options['body'])) { + $options['form_params'] = $options['body']; + unset($options['body']); + } + $response = $this->client->request('post', $uri, array_merge($options, $this->getRequestOptions())); return new Response($response); } @@ -238,7 +263,7 @@ class Client implements IClient { */ public function put(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->put($uri, $options); + $response = $this->client->request('put', $uri, array_merge($options, $this->getRequestOptions())); return new Response($response); } @@ -273,7 +298,7 @@ class Client implements IClient { */ public function delete(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->delete($uri, $options); + $response = $this->client->request('delete', $uri, array_merge($options, $this->getRequestOptions())); return new Response($response); } @@ -309,7 +334,7 @@ class Client implements IClient { */ public function options(string $uri, array $options = []): IResponse { $this->setDefaultOptions(); - $response = $this->client->options($uri, $options); + $response = $this->client->request('options', $uri, array_merge($options, $this->getRequestOptions())); return new Response($response); } } diff --git a/lib/private/Http/Client/ClientService.php b/lib/private/Http/Client/ClientService.php index 1df54010a2d..fa8544f07a5 100644 --- a/lib/private/Http/Client/ClientService.php +++ b/lib/private/Http/Client/ClientService.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace OC\Http\Client; use GuzzleHttp\Client as GuzzleClient; +use GuzzleHttp\HandlerStack; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\ICertificateManager; @@ -54,6 +55,6 @@ class ClientService implements IClientService { * @return Client */ public function newClient(): IClient { - return new Client($this->config, $this->certificateManager, new GuzzleClient()); + return new Client($this->config, $this->certificateManager, new GuzzleClient(), HandlerStack::create()); } } diff --git a/lib/private/Http/Client/Response.php b/lib/private/Http/Client/Response.php index 0ce6cc98e0d..73c14c2926d 100644 --- a/lib/private/Http/Client/Response.php +++ b/lib/private/Http/Client/Response.php @@ -25,7 +25,7 @@ declare(strict_types=1); namespace OC\Http\Client; use OCP\Http\Client\IResponse; -use GuzzleHttp\Message\ResponseInterface as GuzzleResponse; +use Psr\Http\Message\ResponseInterface; /** * Class Response @@ -33,7 +33,7 @@ use GuzzleHttp\Message\ResponseInterface as GuzzleResponse; * @package OC\Http */ class Response implements IResponse { - /** @var GuzzleResponse */ + /** @var ResponseInterface */ private $response; /** @@ -42,10 +42,10 @@ class Response implements IResponse { private $stream; /** - * @param GuzzleResponse $response + * @param ResponseInterface $response * @param bool $stream */ - public function __construct(GuzzleResponse $response, $stream = false) { + public function __construct(ResponseInterface $response, $stream = false) { $this->response = $response; $this->stream = $stream; } @@ -71,7 +71,7 @@ class Response implements IResponse { * @return string */ public function getHeader(string $key): string { - return $this->response->getHeader($key); + return $this->response->getHeader($key)[0]; } /** diff --git a/lib/private/Installer.php b/lib/private/Installer.php index ad2dcb60f20..8a8ece82077 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -36,17 +36,12 @@ namespace OC; use Doctrine\DBAL\Exception\TableExistsException; -use OC\App\AppManager; use OC\App\AppStore\Bundles\Bundle; use OC\App\AppStore\Fetcher\AppFetcher; -use OC\App\CodeChecker\CodeChecker; -use OC\App\CodeChecker\EmptyCheck; -use OC\App\CodeChecker\PrivateCheck; use OC\Archive\TAR; use OC_App; use OC_DB; use OC_Helper; -use OCP\App\IAppManager; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\ILogger; @@ -117,7 +112,7 @@ class Installer { ); } - $version = \OCP\Util::getVersion(); + $version = implode('.', \OCP\Util::getVersion()); if (!\OC_App::isAppCompatible($version, $info)) { throw new \Exception( // TODO $l diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php index 31d147a3b80..279c899c5fa 100644 --- a/lib/private/NavigationManager.php +++ b/lib/private/NavigationManager.php @@ -104,26 +104,61 @@ class NavigationManager implements INavigationManager { } /** - * returns all the added Menu entries - * @param string $type - * @return array an array of the added entries + * Get a list of navigation entries + * + * @param string $type type of the navigation entries + * @return array */ - public function getAll($type = 'link') { + public function getAll(string $type = 'link'): array { $this->init(); foreach ($this->closureEntries as $c) { $this->add($c()); } $this->closureEntries = array(); - if ($type === 'all') { - return $this->entries; + $result = $this->entries; + if ($type !== 'all') { + $result = array_filter($this->entries, function($entry) use ($type) { + return $entry['type'] === $type; + }); } - return array_filter($this->entries, function($entry) use ($type) { - return $entry['type'] === $type; + return $this->proceedNavigation($result); + } + + /** + * Sort navigation entries by order, name and set active flag + * + * @param array $list + * @return array + */ + private function proceedNavigation(array $list): array { + usort($list, function($a, $b) { + if (isset($a['order']) && isset($b['order'])) { + return ($a['order'] < $b['order']) ? -1 : 1; + } else if (isset($a['order']) || isset($b['order'])) { + return isset($a['order']) ? -1 : 1; + } else { + return ($a['name'] < $b['name']) ? -1 : 1; + } }); + + $activeApp = $this->getActiveEntry(); + if ($activeApp !== null) { + foreach ($list as $index => &$navEntry) { + if ($navEntry['id'] == $activeApp) { + $navEntry['active'] = true; + } else { + $navEntry['active'] = false; + } + } + unset($navEntry); + } + + return $list; } + /** * removes all the entries */ diff --git a/lib/private/Repair.php b/lib/private/Repair.php index d787a1c802b..a257ef061e7 100644 --- a/lib/private/Repair.php +++ b/lib/private/Repair.php @@ -30,8 +30,6 @@ namespace OC; -use OC\App\AppStore\Bundles\BundleFetcher; -use OC\Files\AppData\Factory; use OC\Repair\CleanTags; use OC\Repair\ClearFrontendCaches; use OC\Repair\Collation; diff --git a/lib/private/Repair/Collation.php b/lib/private/Repair/Collation.php index 2642985371b..f2cc9373176 100644 --- a/lib/private/Repair/Collation.php +++ b/lib/private/Repair/Collation.php @@ -6,6 +6,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <robin@icewind.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Robin Müller <robin.mueller@1und1.de> * * @license AGPL-3.0 * @@ -124,7 +125,7 @@ class Collation implements IRepairStep { " FROM INFORMATION_SCHEMA . COLUMNS" . " WHERE TABLE_SCHEMA = ?" . " AND (COLLATION_NAME <> '" . $characterSet . "_bin' OR CHARACTER_SET_NAME <> '" . $characterSet . "')" . - " AND TABLE_NAME LIKE \"*PREFIX*%\"", + " AND TABLE_NAME LIKE '*PREFIX*%'", array($dbName) ); $rows = $statement->fetchAll(); @@ -139,7 +140,7 @@ class Collation implements IRepairStep { " FROM INFORMATION_SCHEMA . TABLES" . " WHERE TABLE_SCHEMA = ?" . " AND TABLE_COLLATION <> '" . $characterSet . "_bin'" . - " AND TABLE_NAME LIKE \"*PREFIX*%\"", + " AND TABLE_NAME LIKE '*PREFIX*%'", [$dbName] ); $rows = $statement->fetchAll(); diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 9507eaf5c1f..e6056679c1c 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -39,12 +39,7 @@ namespace OC\Share; -use OC\Files\Filesystem; use OCP\DB\QueryBuilder\IQueryBuilder; -use OCP\ILogger; -use OCP\IUserManager; -use OCP\IUserSession; -use OCP\IDBConnection; use OCP\IConfig; use OCP\Util; @@ -1038,7 +1033,7 @@ class Share extends Constants { } else { $itemTypes = $collectionTypes; } - $placeholders = join(',', array_fill(0, count($itemTypes), '?')); + $placeholders = implode(',', array_fill(0, count($itemTypes), '?')); $where = ' WHERE `item_type` IN ('.$placeholders.'))'; $queryArgs = $itemTypes; } else { @@ -1064,7 +1059,7 @@ class Share extends Constants { $groups = \OC::$server->getGroupManager()->getUserGroupIds($user); } if (!empty($groups)) { - $placeholders = join(',', array_fill(0, count($groups), '?')); + $placeholders = implode(',', array_fill(0, count($groups), '?')); $where .= ' OR (`share_type` = ? AND `share_with` IN ('.$placeholders.')) '; $queryArgs[] = self::SHARE_TYPE_GROUP; $queryArgs = array_merge($queryArgs, $groups); @@ -1129,7 +1124,7 @@ class Share extends Constants { } $queryArgs[] = $item; if ($includeCollections && $collectionTypes && !in_array('folder', $collectionTypes)) { - $placeholders = join(',', array_fill(0, count($collectionTypes), '?')); + $placeholders = implode(',', array_fill(0, count($collectionTypes), '?')); $where .= ' OR `item_type` IN ('.$placeholders.'))'; $queryArgs = array_merge($queryArgs, $collectionTypes); } diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index b9ab7a46873..3c56b24707c 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -30,7 +30,6 @@ namespace OC\Share20; use OC\Files\Cache\Cache; -use OCP\Files\File; use OCP\Files\Folder; use OCP\Share\IShareProvider; use OC\Share20\Exception\InvalidShare; diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index d37a8bbabbe..8cc235bf818 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -80,9 +80,9 @@ class TemplateLayout extends \OC_Template { // Add navigation entry $this->assign( 'application', ''); $this->assign( 'appid', $appId ); - $navigation = \OC_App::getNavigation(); + $navigation = \OC::$server->getNavigationManager()->getAll(); $this->assign( 'navigation', $navigation); - $settingsNavigation = \OC_App::getSettingsNavigation(); + $settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings'); $this->assign( 'settingsnavigation', $settingsNavigation); foreach($navigation as $entry) { if ($entry['active']) { diff --git a/lib/private/Updater.php b/lib/private/Updater.php index 43096e7c1f8..727147e0905 100644 --- a/lib/private/Updater.php +++ b/lib/private/Updater.php @@ -250,7 +250,7 @@ class Updater extends BasicEmitter { $this->upgradeAppStoreApps(\OC::$server->getAppManager()->getInstalledApps()); // install new shipped apps on upgrade - OC_App::loadApps('authentication'); + OC_App::loadApps(['authentication']); $errors = Installer::installShippedApps(true); foreach ($errors as $appId => $exception) { /** @var \Exception $exception */ @@ -346,7 +346,7 @@ class Updater extends BasicEmitter { if(!isset($stacks[$type])) { $stacks[$type] = array(); } - if (\OC_App::isType($appId, $type)) { + if (\OC_App::isType($appId, [$type])) { $stacks[$type][] = $appId; $priorityType = true; break; diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index c2b58c37cdb..4ac8888cee1 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -55,7 +55,6 @@ use OCP\ILogger; use OCP\IRequest; use OCP\ISession; use OCP\IUser; -use OCP\IUserManager; use OCP\IUserSession; use OCP\Lockdown\ILockdownManager; use OCP\Security\ISecureRandom; diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index b19d63f560e..4e6ed99f5c3 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -1,4 +1,5 @@ <?php +declare(strict_types=1); /** * @copyright Copyright (c) 2016, ownCloud, Inc. * @copyright Copyright (c) 2016, Lukas Reschke <lukas@statuscode.ch> @@ -62,21 +63,21 @@ use OCP\App\ManagerEvent; * upgrading and removing apps. */ class OC_App { - static private $adminForms = array(); - static private $personalForms = array(); - static private $appTypes = array(); - static private $loadedApps = array(); - static private $altLogin = array(); + static private $adminForms = []; + static private $personalForms = []; + static private $appTypes = []; + static private $loadedApps = []; + static private $altLogin = []; static private $alreadyRegistered = []; const officialApp = 200; /** * clean the appId * - * @param string|boolean $app AppId that needs to be cleaned + * @param string $app AppId that needs to be cleaned * @return string */ - public static function cleanAppId($app) { + public static function cleanAppId(string $app): string { return str_replace(array('\0', '/', '\\', '..'), '', $app); } @@ -86,23 +87,23 @@ class OC_App { * @param string $app * @return bool */ - public static function isAppLoaded($app) { + public static function isAppLoaded(string $app): bool { return in_array($app, self::$loadedApps, true); } /** * loads all apps * - * @param string[] | string | null $types + * @param string[] $types * @return bool * * This function walks through the ownCloud directory and loads all apps * it can find. A directory contains an app if the file /appinfo/info.xml * exists. * - * if $types is set, only apps of those types will be loaded + * if $types is set to non-empty array, only apps of those types will be loaded */ - public static function loadApps($types = null) { + public static function loadApps(array $types = []): bool { if (\OC::$server->getSystemConfig()->getValue('maintenance', false)) { return false; } @@ -120,7 +121,7 @@ class OC_App { // prevent app.php from printing output ob_start(); foreach ($apps as $app) { - if ((is_null($types) or self::isType($app, $types)) && !in_array($app, self::$loadedApps)) { + if (($types === [] or self::isType($app, $types)) && !in_array($app, self::$loadedApps)) { self::loadApp($app); } } @@ -133,8 +134,9 @@ class OC_App { * load a single app * * @param string $app + * @throws Exception */ - public static function loadApp($app) { + public static function loadApp(string $app) { self::$loadedApps[] = $app; $appPath = self::getAppPath($app); if($appPath === false) { @@ -146,13 +148,21 @@ class OC_App { if (is_file($appPath . '/appinfo/app.php')) { \OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app); - self::requireAppFile($app); + try { + self::requireAppFile($app); + } catch (Error $ex) { + \OC::$server->getLogger()->logException($ex); + if (!\OC::$server->getAppManager()->isShipped($app)) { + // Only disable apps which are not shipped + self::disable($app); + } + } if (self::isType($app, array('authentication'))) { // since authentication apps affect the "is app enabled for group" check, // the enabled apps cache needs to be cleared to make sure that the // next time getEnableApps() is called it will also include apps that were // enabled for groups - self::$enabledAppsCache = array(); + self::$enabledAppsCache = []; } \OC::$server->getEventLogger()->end('load_app_' . $app); } @@ -218,7 +228,7 @@ class OC_App { * @param string $app * @param string $path */ - public static function registerAutoloading($app, $path) { + public static function registerAutoloading(string $app, string $path) { $key = $app . '-' . $path; if(isset(self::$alreadyRegistered[$key])) { return; @@ -248,31 +258,21 @@ class OC_App { * Load app.php from the given app * * @param string $app app name + * @throws Error */ - private static function requireAppFile($app) { - try { - // encapsulated here to avoid variable scope conflicts - require_once $app . '/appinfo/app.php'; - } catch (Error $ex) { - \OC::$server->getLogger()->logException($ex); - if (!\OC::$server->getAppManager()->isShipped($app)) { - // Only disable apps which are not shipped - self::disable($app); - } - } + private static function requireAppFile(string $app) { + // encapsulated here to avoid variable scope conflicts + require_once $app . '/appinfo/app.php'; } /** * check if an app is of a specific type * * @param string $app - * @param string|array $types + * @param array $types * @return bool */ - public static function isType($app, $types) { - if (is_string($types)) { - $types = array($types); - } + public static function isType(string $app, array $types): bool { $appTypes = self::getAppTypes($app); foreach ($types as $type) { if (array_search($type, $appTypes) !== false) { @@ -288,7 +288,7 @@ class OC_App { * @param string $app * @return array */ - private static function getAppTypes($app) { + private static function getAppTypes(string $app): array { //load the cache if (count(self::$appTypes) == 0) { self::$appTypes = \OC::$server->getAppConfig()->getValues(false, 'types'); @@ -296,16 +296,17 @@ class OC_App { if (isset(self::$appTypes[$app])) { return explode(',', self::$appTypes[$app]); - } else { - return array(); } + + return []; } /** * read app types from info.xml and cache them in the database */ - public static function setAppTypes($app) { - $appData = self::getAppInfo($app); + public static function setAppTypes(string $app) { + $appManager = \OC::$server->getAppManager(); + $appData = $appManager->getAppInfo($app); if(!is_array($appData)) { return; } @@ -317,12 +318,13 @@ class OC_App { $appData['types'] = []; } - \OC::$server->getConfig()->setAppValue($app, 'types', $appTypes); + $config = \OC::$server->getConfig(); + $config->setAppValue($app, 'types', $appTypes); - if (\OC::$server->getAppManager()->hasProtectedAppType($appData['types'])) { - $enabled = \OC::$server->getConfig()->getAppValue($app, 'enabled', 'yes'); + if ($appManager->hasProtectedAppType($appData['types'])) { + $enabled = $config->getAppValue($app, 'enabled', 'yes'); if ($enabled !== 'yes' && $enabled !== 'no') { - \OC::$server->getConfig()->setAppValue($app, 'enabled', 'yes'); + $config->setAppValue($app, 'enabled', 'yes'); } } } @@ -330,7 +332,7 @@ class OC_App { /** * get all enabled apps */ - protected static $enabledAppsCache = array(); + protected static $enabledAppsCache = []; /** * Returns apps enabled for the current user. @@ -340,9 +342,9 @@ class OC_App { * currently logged in one * @return string[] */ - public static function getEnabledApps($forceRefresh = false, $all = false) { + public static function getEnabledApps(bool $forceRefresh = false, bool $all = false): array { if (!\OC::$server->getSystemConfig()->getValue('installed', false)) { - return array(); + return []; } // in incognito mode or when logged out, $user will be false, // which is also the case during an upgrade @@ -375,7 +377,7 @@ class OC_App { * * This function checks whether or not an app is enabled. */ - public static function isEnabled($app) { + public static function isEnabled(string $app): bool { return \OC::$server->getAppManager()->isEnabledForUser($app); } @@ -389,8 +391,8 @@ class OC_App { * * This function set an app as enabled in appconfig. */ - public function enable($appId, - $groups = null) { + public function enable(string $appId, + array $groups = []) { self::$enabledAppsCache = []; // flush // Check if app is already downloaded @@ -404,7 +406,7 @@ class OC_App { $installer->installApp($appId); $appManager = \OC::$server->getAppManager(); - if (!is_null($groups)) { + if ($groups !== []) { $groupManager = \OC::$server->getGroupManager(); $groupsList = []; foreach ($groups as $group) { @@ -425,9 +427,9 @@ class OC_App { * @param string $app app * @throws Exception */ - public static function disable($app) { + public static function disable(string $app) { // flush - self::$enabledAppsCache = array(); + self::$enabledAppsCache = []; // run uninstall steps $appData = OC_App::getAppInfo($app); @@ -443,31 +445,6 @@ class OC_App { $appManager->disableApp($app); } - // This is private as well. It simply works, so don't ask for more details - private static function proceedNavigation($list) { - usort($list, function($a, $b) { - if (isset($a['order']) && isset($b['order'])) { - return ($a['order'] < $b['order']) ? -1 : 1; - } else if (isset($a['order']) || isset($b['order'])) { - return isset($a['order']) ? -1 : 1; - } else { - return ($a['name'] < $b['name']) ? -1 : 1; - } - }); - - $activeApp = OC::$server->getNavigationManager()->getActiveEntry(); - foreach ($list as $index => &$navEntry) { - if ($navEntry['id'] == $activeApp) { - $navEntry['active'] = true; - } else { - $navEntry['active'] = false; - } - } - unset($navEntry); - - return $list; - } - /** * Get the path where to install apps * @@ -495,18 +472,18 @@ class OC_App { * @param string $appId * @return false|string */ - public static function findAppInDirectories($appId) { + public static function findAppInDirectories(string $appId) { $sanitizedAppId = self::cleanAppId($appId); if($sanitizedAppId !== $appId) { return false; } - static $app_dir = array(); + static $app_dir = []; if (isset($app_dir[$appId])) { return $app_dir[$appId]; } - $possibleApps = array(); + $possibleApps = []; foreach (OC::$APPSROOTS as $dir) { if (file_exists($dir['path'] . '/' . $appId)) { $possibleApps[] = $dir; @@ -520,7 +497,7 @@ class OC_App { $app_dir[$appId] = $dir; return $dir; } else { - $versionToLoad = array(); + $versionToLoad = []; foreach ($possibleApps as $possibleApp) { $version = self::getAppVersionByPath($possibleApp['path']); if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) { @@ -543,7 +520,7 @@ class OC_App { * @param string $appId * @return string|false */ - public static function getAppPath($appId) { + public static function getAppPath(string $appId) { if ($appId === null || trim($appId) === '') { return false; } @@ -561,7 +538,7 @@ class OC_App { * @param string $appId * @return string|false */ - public static function getAppWebPath($appId) { + public static function getAppWebPath(string $appId) { if (($dir = self::findAppInDirectories($appId)) != false) { return OC::$WEBROOT . $dir['url'] . '/' . $appId; } @@ -576,7 +553,7 @@ class OC_App { * @return string * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppVersion() */ - public static function getAppVersion($appId, $useCache = true) { + public static function getAppVersion(string $appId, bool $useCache = true): string { return \OC::$server->getAppManager()->getAppVersion($appId, $useCache); } @@ -586,7 +563,7 @@ class OC_App { * @param string $path * @return string */ - public static function getAppVersionByPath($path) { + public static function getAppVersionByPath(string $path): string { $infoFile = $path . '/appinfo/info.xml'; $appData = \OC::$server->getAppManager()->getAppInfo($infoFile, true); return isset($appData['version']) ? $appData['version'] : ''; @@ -603,7 +580,7 @@ class OC_App { * @note all data is read from info.xml, not just pre-defined fields * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppInfo() */ - public static function getAppInfo($appId, $path = false, $lang = null) { + public static function getAppInfo(string $appId, bool $path = false, string $lang = null) { return \OC::$server->getAppManager()->getAppInfo($appId, $path, $lang); } @@ -611,28 +588,28 @@ class OC_App { * Returns the navigation * * @return array + * @deprecated 14.0.0 use \OC::$server->getNavigationManager()->getAll() * * This function returns an array containing all entries added. The * entries are sorted by the key 'order' ascending. Additional to the keys * given for each app the following keys exist: * - active: boolean, signals if the user is on this navigation entry */ - public static function getNavigation() { - $entries = OC::$server->getNavigationManager()->getAll(); - return self::proceedNavigation($entries); + public static function getNavigation(): array { + return OC::$server->getNavigationManager()->getAll(); } /** * Returns the Settings Navigation * * @return string[] + * @deprecated 14.0.0 use \OC::$server->getNavigationManager()->getAll('settings') * * This function returns an array containing all settings pages added. The * entries are sorted by the key 'order' ascending. */ - public static function getSettingsNavigation() { - $entries = OC::$server->getNavigationManager()->getAll('settings'); - return self::proceedNavigation($entries); + public static function getSettingsNavigation(): array { + return OC::$server->getNavigationManager()->getAll('settings'); } /** @@ -640,7 +617,7 @@ class OC_App { * * @return string */ - public static function getCurrentApp() { + public static function getCurrentApp(): string { $request = \OC::$server->getRequest(); $script = substr($request->getScriptName(), strlen(OC::$WEBROOT) + 1); $topFolder = substr($script, 0, strpos($script, '/') ?: 0); @@ -652,7 +629,7 @@ class OC_App { } if ($topFolder == 'apps') { $length = strlen($topFolder); - return substr($script, $length + 1, strpos($script, '/', $length + 1) - $length - 1); + return substr($script, $length + 1, strpos($script, '/', $length + 1) - $length - 1) ?: ''; } else { return $topFolder; } @@ -662,8 +639,8 @@ class OC_App { * @param string $type * @return array */ - public static function getForms($type) { - $forms = array(); + public static function getForms(string $type): array { + $forms = []; switch ($type) { case 'admin': $source = self::$adminForms; @@ -672,7 +649,7 @@ class OC_App { $source = self::$personalForms; break; default: - return array(); + return []; } foreach ($source as $form) { $forms[] = include $form; @@ -686,7 +663,7 @@ class OC_App { * @param string $app * @param string $page */ - public static function registerAdmin($app, $page) { + public static function registerAdmin(string $app, string $page) { self::$adminForms[] = $app . '/' . $page . '.php'; } @@ -695,7 +672,7 @@ class OC_App { * @param string $app * @param string $page */ - public static function registerPersonal($app, $page) { + public static function registerPersonal(string $app, string $page) { self::$personalForms[] = $app . '/' . $page . '.php'; } @@ -709,7 +686,7 @@ class OC_App { /** * @return array */ - public static function getAlternativeLogIns() { + public static function getAlternativeLogIns(): array { return self::$altLogin; } @@ -719,9 +696,9 @@ class OC_App { * @return array an array of app names (string IDs) * @todo: change the name of this method to getInstalledApps, which is more accurate */ - public static function getAllApps() { + public static function getAllApps(): array { - $apps = array(); + $apps = []; foreach (OC::$APPSROOTS as $apps_dir) { if (!is_readable($apps_dir['path'])) { @@ -751,13 +728,13 @@ class OC_App { * * @return array */ - public function listAllApps() { + public function listAllApps(): array { $installedApps = OC_App::getAllApps(); $appManager = \OC::$server->getAppManager(); //we don't want to show configuration for these $blacklist = $appManager->getAlwaysEnabledApps(); - $appList = array(); + $appList = []; $langCode = \OC::$server->getL10N('core')->getLanguageCode(); $urlGenerator = \OC::$server->getURLGenerator(); @@ -832,7 +809,7 @@ class OC_App { return $appList; } - public static function shouldUpgrade($app) { + public static function shouldUpgrade(string $app): bool { $versions = self::getAppVersions(); $currentVersion = OC_App::getAppVersion($app); if ($currentVersion && isset($versions[$app])) { @@ -852,7 +829,7 @@ class OC_App { * @param string $version2 version to take the number of parts from * @return string shortened $version1 */ - private static function adjustVersionParts($version1, $version2) { + private static function adjustVersionParts(string $version1, string $version2): string { $version1 = explode('.', $version1); $version2 = explode('.', $version2); // reduce $version1 to match the number of parts in $version2 @@ -882,7 +859,7 @@ class OC_App { * * @return boolean true if compatible, otherwise false */ - public static function isAppCompatible($ocVersion, $appInfo) { + public static function isAppCompatible(string $ocVersion, array $appInfo): bool { $requireMin = ''; $requireMax = ''; if (isset($appInfo['dependencies']['nextcloud']['@attributes']['min-version'])) { @@ -903,10 +880,6 @@ class OC_App { $requireMax = $appInfo['requiremax']; } - if (is_array($ocVersion)) { - $ocVersion = implode('.', $ocVersion); - } - if (!empty($requireMin) && version_compare(self::adjustVersionParts($ocVersion, $requireMin), $requireMin, '<') ) { @@ -942,7 +915,7 @@ class OC_App { * @param string $appId * @return bool */ - public static function updateApp($appId) { + public static function updateApp(sstring $appId): bool { $appPath = self::getAppPath($appId); if($appPath === false) { return false; @@ -1001,7 +974,7 @@ class OC_App { * @param string[] $steps * @throws \OC\NeedsUpdateException */ - public static function executeRepairSteps($appId, array $steps) { + public static function executeRepairSteps(string $appId, array $steps) { if (empty($steps)) { return; } @@ -1035,7 +1008,7 @@ class OC_App { * @param string $appId * @param string[] $steps */ - private static function setupLiveMigrations($appId, array $steps) { + private static function setupLiveMigrations(string $appId, array $steps) { $queue = \OC::$server->getJobList(); foreach ($steps as $step) { $queue->add('OC\Migration\BackgroundRepair', [ @@ -1048,7 +1021,7 @@ class OC_App { * @param string $appId * @return \OC\Files\View|false */ - public static function getStorage($appId) { + public static function getStorage(string $appId) { if (\OC::$server->getAppManager()->isEnabledForUser($appId)) { //sanity check if (\OC::$server->getUserSession()->isLoggedIn()) { $view = new \OC\Files\View('/' . OC_User::getUser()); @@ -1066,7 +1039,7 @@ class OC_App { } } - protected static function findBestL10NOption($options, $lang) { + protected static function findBestL10NOption(array $options, string $lang): string { $fallback = $similarLangFallback = $englishFallback = false; $lang = strtolower($lang); @@ -1118,7 +1091,7 @@ class OC_App { * @param string $lang * @return array improved app data */ - public static function parseAppInfo(array $data, $lang = null) { + public static function parseAppInfo(array $data, $lang = null): array { if ($lang && isset($data['name']) && is_array($data['name'])) { $data['name'] = self::findBestL10NOption($data['name'], $lang); @@ -1143,7 +1116,7 @@ class OC_App { * @param array $info * @throws \Exception */ - public static function checkAppDependencies($config, $l, $info) { + public static function checkAppDependencies(\OCP\IConfig $config, \OCP\IL10N $l, array $info) { $dependencyAnalyzer = new DependencyAnalyzer(new Platform($config), $l); $missing = $dependencyAnalyzer->analyze($info); if (!empty($missing)) { diff --git a/lib/private/legacy/files.php b/lib/private/legacy/files.php index 24324bca095..def9f82fab9 100644 --- a/lib/private/legacy/files.php +++ b/lib/private/legacy/files.php @@ -75,7 +75,9 @@ class OC_Files { private static function sendHeaders($filename, $name, array $rangeArray) { OC_Response::setContentDispositionHeader($name, 'attachment'); header('Content-Transfer-Encoding: binary', true); - OC_Response::disableCaching(); + header('Pragma: public');// enable caching in IE + header('Expires: 0'); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); $fileSize = \OC\Files\Filesystem::filesize($filename); $type = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename)); if ($fileSize > -1) { diff --git a/lib/private/legacy/response.php b/lib/private/legacy/response.php index 975ff570485..1b0b01de972 100644 --- a/lib/private/legacy/response.php +++ b/lib/private/legacy/response.php @@ -55,7 +55,7 @@ class OC_Response { header('Cache-Control: max-age='.$cache_time.', must-revalidate'); } else { - self::setExpiresHeader(0); + header('Expires: 0'); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); } } @@ -67,14 +67,6 @@ class OC_Response { } /** - * disable browser caching - * @see enableCaching with cache_time = 0 - */ - static public function disableCaching() { - self::enableCaching(0); - } - - /** * Set response status * @param int $status a HTTP status code, see also the STATUS constants */ diff --git a/lib/public/App/IAppManager.php b/lib/public/App/IAppManager.php index 0c087b61515..f0f14061e35 100644 --- a/lib/public/App/IAppManager.php +++ b/lib/public/App/IAppManager.php @@ -51,10 +51,10 @@ interface IAppManager { * * @param string $appId * @param bool $useCache - * @return mixed + * @return string * @since 14.0.0 */ - public function getAppVersion(string $appId, bool $useCache = true); + public function getAppVersion(string $appId, bool $useCache = true): string; /** * Check if an app is enabled for user diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php index 216f8a897d8..77b881b8b15 100644 --- a/lib/public/INavigationManager.php +++ b/lib/public/INavigationManager.php @@ -57,4 +57,13 @@ interface INavigationManager { * @since 6.0.0 */ public function setActiveEntry($appId); + + /** + * Get a list of navigation entries + * + * @param string $type type of the navigation entries + * @return array + * @since 14.0.0 + */ + public function getAll(string $type = 'link'): array; } diff --git a/lib/public/Response.php b/lib/public/Response.php index dd029e12dbf..dbd506d379d 100644 --- a/lib/public/Response.php +++ b/lib/public/Response.php @@ -89,9 +89,12 @@ class Response { * Disable browser caching * @see enableCaching with cache_time = 0 * @since 4.0.0 + * @deprecated 14.0.0 just set the headers */ static public function disableCaching() { - \OC_Response::disableCaching(); + header('Pragma: public');// enable caching in IE + header('Expires: 0'); + header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); } /** diff --git a/lib/public/Util.php b/lib/public/Util.php index 2fb6bdf491d..106107591c3 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -51,7 +51,6 @@ // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; -use DateTimeZone; /** * This class provides different helper functions to make the life of a developer easier |