diff options
Diffstat (limited to 'lib')
28 files changed, 874 insertions, 176 deletions
diff --git a/lib/l10n/de.js b/lib/l10n/de.js index fc71d1fb6d5..5b0025ef601 100644 --- a/lib/l10n/de.js +++ b/lib/l10n/de.js @@ -101,6 +101,7 @@ OC.L10N.register( "Setting permissions for %s failed, because the item was not found" : "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da das Objekt nicht gefunden wurde", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Ablaufdatum kann nicht gesetzt werden. Freigaben können nach dem Teilen, nicht länger als %s gültig sein.", "Cannot set expiration date. Expiration date is in the past" : "Ablaufdatum kann nicht gesetzt werden. Ablaufdatum liegt in der Vergangenheit.", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Ablaufdatum kann nicht gelöscht werden. Freigaben werden für ein Ablaufdatum benötigt.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Freigabe-Backend %s muss in der OCP\\Share_Backend - Schnittstelle implementiert werden", "Sharing backend %s not found" : "Freigabe-Backend %s nicht gefunden", "Sharing backend for %s not found" : "Freigabe-Backend für %s nicht gefunden", diff --git a/lib/l10n/de.json b/lib/l10n/de.json index f10d3578fb3..f83f1cf1382 100644 --- a/lib/l10n/de.json +++ b/lib/l10n/de.json @@ -99,6 +99,7 @@ "Setting permissions for %s failed, because the item was not found" : "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da das Objekt nicht gefunden wurde", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Ablaufdatum kann nicht gesetzt werden. Freigaben können nach dem Teilen, nicht länger als %s gültig sein.", "Cannot set expiration date. Expiration date is in the past" : "Ablaufdatum kann nicht gesetzt werden. Ablaufdatum liegt in der Vergangenheit.", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Ablaufdatum kann nicht gelöscht werden. Freigaben werden für ein Ablaufdatum benötigt.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Freigabe-Backend %s muss in der OCP\\Share_Backend - Schnittstelle implementiert werden", "Sharing backend %s not found" : "Freigabe-Backend %s nicht gefunden", "Sharing backend for %s not found" : "Freigabe-Backend für %s nicht gefunden", diff --git a/lib/l10n/de_DE.js b/lib/l10n/de_DE.js index 823fde2d789..2a1d4a42da4 100644 --- a/lib/l10n/de_DE.js +++ b/lib/l10n/de_DE.js @@ -101,6 +101,7 @@ OC.L10N.register( "Setting permissions for %s failed, because the item was not found" : "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da das Objekt nicht gefunden wurde", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Ablaufdatum kann nicht gesetzt werden. Freigaben können nach dem Teilen, nicht länger als %s gültig sein.", "Cannot set expiration date. Expiration date is in the past" : "Ablaufdatum kann nicht gesetzt werden. Ablaufdatum liegt in der Vergangenheit.", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Ablaufdatum kann nicht gelöscht werden. Freigaben werden für ein Ablaufdatum benötigt.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Freigabe-Backend %s muss in der OCP\\Share_Backend - Schnittstelle implementiert werden", "Sharing backend %s not found" : "Freigabe-Backend %s nicht gefunden", "Sharing backend for %s not found" : "Freigabe-Backend für %s nicht gefunden", diff --git a/lib/l10n/de_DE.json b/lib/l10n/de_DE.json index 42b6d72303e..cd133dc2982 100644 --- a/lib/l10n/de_DE.json +++ b/lib/l10n/de_DE.json @@ -99,6 +99,7 @@ "Setting permissions for %s failed, because the item was not found" : "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da das Objekt nicht gefunden wurde", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Ablaufdatum kann nicht gesetzt werden. Freigaben können nach dem Teilen, nicht länger als %s gültig sein.", "Cannot set expiration date. Expiration date is in the past" : "Ablaufdatum kann nicht gesetzt werden. Ablaufdatum liegt in der Vergangenheit.", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Ablaufdatum kann nicht gelöscht werden. Freigaben werden für ein Ablaufdatum benötigt.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Freigabe-Backend %s muss in der OCP\\Share_Backend - Schnittstelle implementiert werden", "Sharing backend %s not found" : "Freigabe-Backend %s nicht gefunden", "Sharing backend for %s not found" : "Freigabe-Backend für %s nicht gefunden", diff --git a/lib/l10n/el.js b/lib/l10n/el.js index ff7a38d94a9..950e1ae38be 100644 --- a/lib/l10n/el.js +++ b/lib/l10n/el.js @@ -8,7 +8,12 @@ OC.L10N.register( "Sample configuration detected" : "Ανιχνεύθηκε δείγμα εγκατάστασης", "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" : "Έχει ανιχνευθεί ότι το δείγμα εγκατάστασης έχει αντιγραφεί. Αυτό μπορεί να σπάσει την εγκατάστασή σας και δεν υποστηρίζεται. Παρακαλώ διαβάστε την τεκμηρίωση πριν εκτελέσετε αλλαγές στο config.php", "PHP %s or higher is required." : "PHP %s ή νεώτερη απαιτείται.", + "PHP with a version lower than %s is required." : "Απαιτείται PHP παλαιότερη από την έκδοση %s.", + "Following databases are supported: %s" : " Υποστηρίζονται οι ακόλουθες βάσεις δεδομένων: %s", + "The command line tool %s could not be found" : "Το εργαλείο γραμμής εντολών %s δεν μπορεί να βρεθεί", "The library %s is not available." : "Το %s της βιβλιοθήκης δεν είναι διαθέσιμο.", + "Library %s with a version higher than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s νεότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", + "Library %s with a version lower than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s παλαιότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", "Following platforms are supported: %s" : "Οι ακόλουθες πλατφόρμες υποστηρίζονται: %s", "ownCloud %s or higher is required." : "Απαιτείται ownCloud %s ή νεότερο", "ownCloud with a version lower than %s is required." : "Απαιτείται έκδοση ownCloud παλαιότερη από την %s.", @@ -17,6 +22,8 @@ OC.L10N.register( "Users" : "Χρήστες", "Admin" : "Διαχείριση", "Recommended" : "Προτείνεται", + "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : "Η εφαρμογή \"%s\" δεν μπορεί να εγκατασταθεί επειδή δεν είναι συμβατή με αυτή την έκδοση του ownCloud.", + "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Αυτή η εφαρμογή %s δεν μπορεί να εγκατασταθεί διότι δεν πληρούνται οι ακόλουθες εξαρτήσεις: %s", "No app name specified" : "Δεν προδιορίστηκε όνομα εφαρμογής", "Unknown filetype" : "Άγνωστος τύπος αρχείου", "Invalid image" : "Μη έγκυρη εικόνα", @@ -32,6 +39,11 @@ OC.L10N.register( "seconds ago" : "δευτερόλεπτα πριν", "web services under your control" : "υπηρεσίες δικτύου υπό τον έλεγχό σας", "Empty filename is not allowed" : "Δεν επιτρέπεται άδειο όνομα αρχείου", + "Dot files are not allowed" : "Δεν επιτρέπονται αρχεία που ξεκινούν από τελεία - Dot ", + "4-byte characters are not supported in file names" : "Χαρακτήρες 4-byte δεν υποστηρίζονται σε ονόματα αρχείων", + "File name is a reserved word" : "Το όνομα αρχείου είναι λέξη που έχει δεσμευτεί", + "File name contains at least one invalid character" : "Το όνομα αρχείου περιέχει έναν τουλάχιστον μη έγκυρο χαρακτήρα", + "File name is too long" : "Το όνομα αρχείου είνια πολύ μεγάλο", "App directory already exists" : "Ο κατάλογος εφαρμογών υπάρχει ήδη", "Can't create app folder. Please fix permissions. %s" : "Δεν είναι δυνατόν να δημιουργηθεί ο φάκελος εφαρμογής. Παρακαλώ διορθώστε τις άδειες πρόσβασης. %s", "No source specified when installing app" : "Δεν προσδιορίστηκε πηγή κατά την εγκατάσταση της εφαρμογής", @@ -89,6 +101,7 @@ OC.L10N.register( "Setting permissions for %s failed, because the item was not found" : "Ο ορισμός δικαιωμάτων για το %s απέτυχε, γιατί το αντικείμενο δεν βρέθηκε", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Δεν μπορεί να οριστεί ημερομηνία λήξης. Οι κοινοποιήσεις δεν μπορεί να λήγουν αργότερα από %s αφού έχουν διαμοιραστεί.", "Cannot set expiration date. Expiration date is in the past" : "Δεν μπορεί να οριστεί ημερομηνία λήξης. Η ημερομηνία λήξης είναι στο παρελθόν", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Δεν είναι σαφής η ημερομηνία λήξης. Ο διαμοιρασμός πρέπει να έχει ημερομηνία λήξης", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Το σύστημα διαμοιρασμού %s πρέπει να υλοποιεί την διεπαφή OCP\\Share_Backend", "Sharing backend %s not found" : "Το σύστημα διαμοιρασμού %s δεν βρέθηκε", "Sharing backend for %s not found" : "Το σύστημα διαμοιρασμού για το %s δεν βρέθηκε", @@ -114,7 +127,9 @@ OC.L10N.register( "Please ask your server administrator to install the module." : "Παρακαλώ ζητήστε από το διαχειριστή του διακομιστή σας να εγκαταστήσει τη μονάδα.", "PHP module %s not installed." : "Η μονάδα %s PHP δεν είναι εγκατεστημένη. ", "PHP setting \"%s\" is not set to \"%s\"." : "Η ρύθμιση \"%s\"της PHP δεν είναι ορισμένη σε \"%s\".", + "Adjusting this setting in php.ini will make ownCloud run again" : "Η διόρθωση της ρύθμισης στο αρχείο php.ini θα επιτρέψει στο ownCloud να επαναλειτουργήσει", "Please ask your server administrator to update PHP to the latest version. Your PHP version is no longer supported by ownCloud and the PHP community." : "Παρακαλώ ζητήστε από το διαχειριστή του διακομιστή σας να ενημερώσει τον PHP στη νεώτερη έκδοση. Η έκδοση του PHP σας δεν υποστηρίζεται πλεον από το ownCloud και την κοινότητα PHP.", + "To fix this issue set <code>always_populate_raw_post_data</code> to <code>-1</code> in your php.ini" : "Για να διορθώσετε το πρόβλημα ορίστε το <code>always_populate_raw_post_data</code> ως <code>-1</code> στο αρχείο php.ini", "PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible." : "Ο PHP φαίνεται να είναι ρυθμισμένος ώστε να αφαιρεί μπλοκ εσωτερικών κειμένων (inline doc). Αυτό θα καταστήσει κύριες εφαρμογές μη-διαθέσιμες.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Αυτό πιθανόν προκλήθηκε από προσωρινή μνήμη (cache)/επιταχυντή όπως τη Zend OPcache ή τον eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Κάποιες μονάδες PHP έχουν εγκατασταθεί, αλλά είναι ακόμα καταγεγραμμένες ως απούσες;", diff --git a/lib/l10n/el.json b/lib/l10n/el.json index e1d19d812ab..5e0e573c55b 100644 --- a/lib/l10n/el.json +++ b/lib/l10n/el.json @@ -6,7 +6,12 @@ "Sample configuration detected" : "Ανιχνεύθηκε δείγμα εγκατάστασης", "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" : "Έχει ανιχνευθεί ότι το δείγμα εγκατάστασης έχει αντιγραφεί. Αυτό μπορεί να σπάσει την εγκατάστασή σας και δεν υποστηρίζεται. Παρακαλώ διαβάστε την τεκμηρίωση πριν εκτελέσετε αλλαγές στο config.php", "PHP %s or higher is required." : "PHP %s ή νεώτερη απαιτείται.", + "PHP with a version lower than %s is required." : "Απαιτείται PHP παλαιότερη από την έκδοση %s.", + "Following databases are supported: %s" : " Υποστηρίζονται οι ακόλουθες βάσεις δεδομένων: %s", + "The command line tool %s could not be found" : "Το εργαλείο γραμμής εντολών %s δεν μπορεί να βρεθεί", "The library %s is not available." : "Το %s της βιβλιοθήκης δεν είναι διαθέσιμο.", + "Library %s with a version higher than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s νεότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", + "Library %s with a version lower than %s is required - available version %s." : "Απαιτείται βιβλιοθήκη %s παλαιότερη από την έκδοση %s - διαθέσιμη έκδοση %s ", "Following platforms are supported: %s" : "Οι ακόλουθες πλατφόρμες υποστηρίζονται: %s", "ownCloud %s or higher is required." : "Απαιτείται ownCloud %s ή νεότερο", "ownCloud with a version lower than %s is required." : "Απαιτείται έκδοση ownCloud παλαιότερη από την %s.", @@ -15,6 +20,8 @@ "Users" : "Χρήστες", "Admin" : "Διαχείριση", "Recommended" : "Προτείνεται", + "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : "Η εφαρμογή \"%s\" δεν μπορεί να εγκατασταθεί επειδή δεν είναι συμβατή με αυτή την έκδοση του ownCloud.", + "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Αυτή η εφαρμογή %s δεν μπορεί να εγκατασταθεί διότι δεν πληρούνται οι ακόλουθες εξαρτήσεις: %s", "No app name specified" : "Δεν προδιορίστηκε όνομα εφαρμογής", "Unknown filetype" : "Άγνωστος τύπος αρχείου", "Invalid image" : "Μη έγκυρη εικόνα", @@ -30,6 +37,11 @@ "seconds ago" : "δευτερόλεπτα πριν", "web services under your control" : "υπηρεσίες δικτύου υπό τον έλεγχό σας", "Empty filename is not allowed" : "Δεν επιτρέπεται άδειο όνομα αρχείου", + "Dot files are not allowed" : "Δεν επιτρέπονται αρχεία που ξεκινούν από τελεία - Dot ", + "4-byte characters are not supported in file names" : "Χαρακτήρες 4-byte δεν υποστηρίζονται σε ονόματα αρχείων", + "File name is a reserved word" : "Το όνομα αρχείου είναι λέξη που έχει δεσμευτεί", + "File name contains at least one invalid character" : "Το όνομα αρχείου περιέχει έναν τουλάχιστον μη έγκυρο χαρακτήρα", + "File name is too long" : "Το όνομα αρχείου είνια πολύ μεγάλο", "App directory already exists" : "Ο κατάλογος εφαρμογών υπάρχει ήδη", "Can't create app folder. Please fix permissions. %s" : "Δεν είναι δυνατόν να δημιουργηθεί ο φάκελος εφαρμογής. Παρακαλώ διορθώστε τις άδειες πρόσβασης. %s", "No source specified when installing app" : "Δεν προσδιορίστηκε πηγή κατά την εγκατάσταση της εφαρμογής", @@ -87,6 +99,7 @@ "Setting permissions for %s failed, because the item was not found" : "Ο ορισμός δικαιωμάτων για το %s απέτυχε, γιατί το αντικείμενο δεν βρέθηκε", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Δεν μπορεί να οριστεί ημερομηνία λήξης. Οι κοινοποιήσεις δεν μπορεί να λήγουν αργότερα από %s αφού έχουν διαμοιραστεί.", "Cannot set expiration date. Expiration date is in the past" : "Δεν μπορεί να οριστεί ημερομηνία λήξης. Η ημερομηνία λήξης είναι στο παρελθόν", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Δεν είναι σαφής η ημερομηνία λήξης. Ο διαμοιρασμός πρέπει να έχει ημερομηνία λήξης", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Το σύστημα διαμοιρασμού %s πρέπει να υλοποιεί την διεπαφή OCP\\Share_Backend", "Sharing backend %s not found" : "Το σύστημα διαμοιρασμού %s δεν βρέθηκε", "Sharing backend for %s not found" : "Το σύστημα διαμοιρασμού για το %s δεν βρέθηκε", @@ -112,7 +125,9 @@ "Please ask your server administrator to install the module." : "Παρακαλώ ζητήστε από το διαχειριστή του διακομιστή σας να εγκαταστήσει τη μονάδα.", "PHP module %s not installed." : "Η μονάδα %s PHP δεν είναι εγκατεστημένη. ", "PHP setting \"%s\" is not set to \"%s\"." : "Η ρύθμιση \"%s\"της PHP δεν είναι ορισμένη σε \"%s\".", + "Adjusting this setting in php.ini will make ownCloud run again" : "Η διόρθωση της ρύθμισης στο αρχείο php.ini θα επιτρέψει στο ownCloud να επαναλειτουργήσει", "Please ask your server administrator to update PHP to the latest version. Your PHP version is no longer supported by ownCloud and the PHP community." : "Παρακαλώ ζητήστε από το διαχειριστή του διακομιστή σας να ενημερώσει τον PHP στη νεώτερη έκδοση. Η έκδοση του PHP σας δεν υποστηρίζεται πλεον από το ownCloud και την κοινότητα PHP.", + "To fix this issue set <code>always_populate_raw_post_data</code> to <code>-1</code> in your php.ini" : "Για να διορθώσετε το πρόβλημα ορίστε το <code>always_populate_raw_post_data</code> ως <code>-1</code> στο αρχείο php.ini", "PHP is apparently setup to strip inline doc blocks. This will make several core apps inaccessible." : "Ο PHP φαίνεται να είναι ρυθμισμένος ώστε να αφαιρεί μπλοκ εσωτερικών κειμένων (inline doc). Αυτό θα καταστήσει κύριες εφαρμογές μη-διαθέσιμες.", "This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "Αυτό πιθανόν προκλήθηκε από προσωρινή μνήμη (cache)/επιταχυντή όπως τη Zend OPcache ή τον eAccelerator.", "PHP modules have been installed, but they are still listed as missing?" : "Κάποιες μονάδες PHP έχουν εγκατασταθεί, αλλά είναι ακόμα καταγεγραμμένες ως απούσες;", diff --git a/lib/l10n/en_GB.js b/lib/l10n/en_GB.js index adb0a0524a3..bc4836a0a7e 100644 --- a/lib/l10n/en_GB.js +++ b/lib/l10n/en_GB.js @@ -42,6 +42,8 @@ OC.L10N.register( "Dot files are not allowed" : "Dot files are not allowed", "4-byte characters are not supported in file names" : "4-byte characters are not supported in file names", "File name is a reserved word" : "File name is a reserved word", + "File name contains at least one invalid character" : "File name contains at least one invalid character", + "File name is too long" : "File name is too long", "App directory already exists" : "App directory already exists", "Can't create app folder. Please fix permissions. %s" : "Can't create app folder. Please fix permissions. %s", "No source specified when installing app" : "No source specified when installing app", @@ -99,6 +101,7 @@ OC.L10N.register( "Setting permissions for %s failed, because the item was not found" : "Setting permissions for %s failed, because the item was not found", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Cannot set expiry date. Shares cannot expire later than %s after they have been shared", "Cannot set expiration date. Expiration date is in the past" : "Cannot set expiry date. Expiry date is in the past", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Cannot clear expiration date. Shares are required to have an expiration date.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Sharing backend %s must implement the interface OCP\\Share_Backend", "Sharing backend %s not found" : "Sharing backend %s not found", "Sharing backend for %s not found" : "Sharing backend for %s not found", diff --git a/lib/l10n/en_GB.json b/lib/l10n/en_GB.json index 835188e88ef..896b9f19b92 100644 --- a/lib/l10n/en_GB.json +++ b/lib/l10n/en_GB.json @@ -40,6 +40,8 @@ "Dot files are not allowed" : "Dot files are not allowed", "4-byte characters are not supported in file names" : "4-byte characters are not supported in file names", "File name is a reserved word" : "File name is a reserved word", + "File name contains at least one invalid character" : "File name contains at least one invalid character", + "File name is too long" : "File name is too long", "App directory already exists" : "App directory already exists", "Can't create app folder. Please fix permissions. %s" : "Can't create app folder. Please fix permissions. %s", "No source specified when installing app" : "No source specified when installing app", @@ -97,6 +99,7 @@ "Setting permissions for %s failed, because the item was not found" : "Setting permissions for %s failed, because the item was not found", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "Cannot set expiry date. Shares cannot expire later than %s after they have been shared", "Cannot set expiration date. Expiration date is in the past" : "Cannot set expiry date. Expiry date is in the past", + "Cannot clear expiration date. Shares are required to have an expiration date." : "Cannot clear expiration date. Shares are required to have an expiration date.", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "Sharing backend %s must implement the interface OCP\\Share_Backend", "Sharing backend %s not found" : "Sharing backend %s not found", "Sharing backend for %s not found" : "Sharing backend for %s not found", diff --git a/lib/l10n/ja.js b/lib/l10n/ja.js index ff781afc8d0..e1121b6344b 100644 --- a/lib/l10n/ja.js +++ b/lib/l10n/ja.js @@ -22,6 +22,8 @@ OC.L10N.register( "Users" : "ユーザー", "Admin" : "管理", "Recommended" : "おすすめ", + "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : " \"%s\" アプリは、このバージョンのownCloudと互換性がない為、インストールできません。", + "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "次の依存関係が満たされないため、\"%s\" アプリをインストールできません:%s", "No app name specified" : "アプリ名が未指定", "Unknown filetype" : "不明なファイルタイプ", "Invalid image" : "無効な画像", @@ -76,6 +78,7 @@ OC.L10N.register( "PostgreSQL username and/or password not valid" : "PostgreSQLのユーザー名もしくはパスワードは有効ではありません", "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X では、サポートされていません。このOSでは、%sは正常に動作しないかもしれません。ご自身の責任においてご利用ください。", "For the best results, please consider using a GNU/Linux server instead." : "最も良い方法としては、代わりにGNU/Linuxサーバーを利用することをご検討ください。", + "It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged." : "このインスタンス %s は、32bit PHP 環境で動作しており、php.ini に open_basedir が設定されているようです。4GB以上のファイルで問題が発生するため、この設定を利用しないことをお勧めします。", "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "php.ini から open_basedir 設定を削除するか、64bit PHPに切り替えてください。", "Set an admin username." : "管理者のユーザー名を設定", "Set an admin password." : "管理者のパスワードを設定。", @@ -98,6 +101,7 @@ OC.L10N.register( "Setting permissions for %s failed, because the item was not found" : "%s の権限設定に失敗しました。アイテムが存在しません。", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "有効期限を設定できません。共有開始から %s 以降に有効期限を設定することはできません。", "Cannot set expiration date. Expiration date is in the past" : "有効期限を設定できません。有効期限が過去を示しています。", + "Cannot clear expiration date. Shares are required to have an expiration date." : "有効期限を解除できません。共有するには有効期限を設定する必要があります。", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "%s のバックエンドの共有には、OCP\\Share_Backend インターフェースを実装しなければなりません。", "Sharing backend %s not found" : "共有バックエンド %s が見つかりません", "Sharing backend for %s not found" : "%s のための共有バックエンドが見つかりません", diff --git a/lib/l10n/ja.json b/lib/l10n/ja.json index f9dc5322c0c..25bbc7b72fa 100644 --- a/lib/l10n/ja.json +++ b/lib/l10n/ja.json @@ -20,6 +20,8 @@ "Users" : "ユーザー", "Admin" : "管理", "Recommended" : "おすすめ", + "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : " \"%s\" アプリは、このバージョンのownCloudと互換性がない為、インストールできません。", + "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "次の依存関係が満たされないため、\"%s\" アプリをインストールできません:%s", "No app name specified" : "アプリ名が未指定", "Unknown filetype" : "不明なファイルタイプ", "Invalid image" : "無効な画像", @@ -74,6 +76,7 @@ "PostgreSQL username and/or password not valid" : "PostgreSQLのユーザー名もしくはパスワードは有効ではありません", "Mac OS X is not supported and %s will not work properly on this platform. Use it at your own risk! " : "Mac OS X では、サポートされていません。このOSでは、%sは正常に動作しないかもしれません。ご自身の責任においてご利用ください。", "For the best results, please consider using a GNU/Linux server instead." : "最も良い方法としては、代わりにGNU/Linuxサーバーを利用することをご検討ください。", + "It seems that this %s instance is running on a 32-bit PHP environment and the open_basedir has been configured in php.ini. This will lead to problems with files over 4 GB and is highly discouraged." : "このインスタンス %s は、32bit PHP 環境で動作しており、php.ini に open_basedir が設定されているようです。4GB以上のファイルで問題が発生するため、この設定を利用しないことをお勧めします。", "Please remove the open_basedir setting within your php.ini or switch to 64-bit PHP." : "php.ini から open_basedir 設定を削除するか、64bit PHPに切り替えてください。", "Set an admin username." : "管理者のユーザー名を設定", "Set an admin password." : "管理者のパスワードを設定。", @@ -96,6 +99,7 @@ "Setting permissions for %s failed, because the item was not found" : "%s の権限設定に失敗しました。アイテムが存在しません。", "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "有効期限を設定できません。共有開始から %s 以降に有効期限を設定することはできません。", "Cannot set expiration date. Expiration date is in the past" : "有効期限を設定できません。有効期限が過去を示しています。", + "Cannot clear expiration date. Shares are required to have an expiration date." : "有効期限を解除できません。共有するには有効期限を設定する必要があります。", "Sharing backend %s must implement the interface OCP\\Share_Backend" : "%s のバックエンドの共有には、OCP\\Share_Backend インターフェースを実装しなければなりません。", "Sharing backend %s not found" : "共有バックエンド %s が見つかりません", "Sharing backend for %s not found" : "%s のための共有バックエンドが見つかりません", diff --git a/lib/private/connector/sabre/exceptionloggerplugin.php b/lib/private/connector/sabre/exceptionloggerplugin.php index a0dc6e7c182..efef6ea9a54 100644 --- a/lib/private/connector/sabre/exceptionloggerplugin.php +++ b/lib/private/connector/sabre/exceptionloggerplugin.php @@ -24,6 +24,9 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { // exactly the same time from two clients, only one client // wins, the second one gets "Precondition failed" 'Sabre\DAV\Exception\PreconditionFailed' => true, + // forbidden can be expected when trying to upload to + // read-only folders for example + 'Sabre\DAV\Exception\Forbidden' => true, ); /** @var string */ diff --git a/lib/private/connector/sabre/principal.php b/lib/private/connector/sabre/principal.php index 5db9e505709..b4d8d3ec5fa 100644 --- a/lib/private/connector/sabre/principal.php +++ b/lib/private/connector/sabre/principal.php @@ -177,9 +177,10 @@ class Principal implements \Sabre\DAVACL\PrincipalBackend\BackendInterface { /** * @param string $uri + * @param string $principalPrefix * @return string */ - function findByUri($uri) { + function findByUri($uri, $principalPrefix) { return ''; } } diff --git a/lib/private/files.php b/lib/private/files.php index 496ba1baff0..b7df99c7d70 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -161,11 +161,12 @@ class OC_Files { * @param false|string $filename */ private static function addSendfileHeader($filename) { - $filename = \OC\Files\Filesystem::getLocalFile($filename); if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) { + $filename = \OC\Files\Filesystem::getLocalFile($filename); header("X-Sendfile: " . $filename); } if (isset($_SERVER['MOD_X_SENDFILE2_ENABLED'])) { + $filename = \OC\Files\Filesystem::getLocalFile($filename); if (isset($_SERVER['HTTP_RANGE']) && preg_match("/^bytes=([0-9]+)-([0-9]*)$/", $_SERVER['HTTP_RANGE'], $range)) { $filelength = filesize($filename); @@ -181,6 +182,11 @@ class OC_Files { } if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) { + if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'])) { + $filename = $_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'] . \OC\Files\Filesystem::getLocalFile($filename); + } else { + $filename = \OC::$WEBROOT . '/data' . \OC\Files\Filesystem::getRoot() . $filename; + } header("X-Accel-Redirect: " . $filename); } } diff --git a/lib/private/http/client/client.php b/lib/private/http/client/client.php new file mode 100644 index 00000000000..7c022272375 --- /dev/null +++ b/lib/private/http/client/client.php @@ -0,0 +1,268 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Http\Client; + +use GuzzleHttp\Client as GuzzleClient; +use OCP\Http\Client\IClient; +use OCP\ICertificateManager; +use OCP\IConfig; + +/** + * Class Client + * + * @package OC\Http + */ +class Client implements IClient { + /** @var GuzzleClient */ + private $client; + /** @var IConfig */ + private $config; + /** @var ICertificateManager */ + private $certificateManager; + + /** + * @param IConfig $config + * @param ICertificateManager $certificateManager + * @param GuzzleClient $client + */ + public function __construct(IConfig $config, + ICertificateManager $certificateManager, + GuzzleClient $client) { + $this->config = $config; + $this->client = $client; + $this->certificateManager = $certificateManager; + $this->setDefaultOptions(); + } + + /** + * Sets the default options to the client + */ + private function setDefaultOptions() { + // Either use default bundle or the user bundle if nothing is specified + if($this->certificateManager->listCertificates() !== []) { + $dataDir = $this->config->getSystemValue('datadirectory'); + $this->client->setDefaultOption('verify', $dataDir.'/'.$this->certificateManager->getCertificateBundle()); + } else { + $this->client->setDefaultOption('verify', \OC::$SERVERROOT . '/config/ca-bundle.crt'); + } + + $this->client->setDefaultOption('headers/User-Agent', 'ownCloud Server Crawler'); + if($this->getProxyUri() !== '') { + $this->client->setDefaultOption('proxy', $this->getProxyUri()); + } + } + + /** + * Get the proxy URI + * @return string + */ + private function getProxyUri() { + $proxyHost = $this->config->getSystemValue('proxy', null); + $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); + $proxyUri = ''; + + if(!is_null($proxyUserPwd)) { + $proxyUri .= $proxyUserPwd.'@'; + } + if(!is_null($proxyHost)) { + $proxyUri .= $proxyHost; + } + + return $proxyUri; + } + + /** + * Sends a GET request + * @param string $uri + * @param array $options Array such as + * 'query' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + * @throws \Exception If the request could not get completed + */ + public function get($uri, array $options = []) { + $response = $this->client->get($uri, $options); + return new Response($response); + } + + /** + * Sends a HEAD request + * @param string $uri + * @param array $options Array such as + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + */ + public function head($uri, $options = []) { + $response = $this->client->head($uri, $options); + return new Response($response); + } + + /** + * Sends a POST request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + */ + public function post($uri, array $options = []) { + $response = $this->client->post($uri, $options); + return new Response($response); + } + + /** + * Sends a PUT request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + */ + public function put($uri, array $options = []) { + $response = $this->client->put($uri, $options); + return new Response($response); + } + + /** + * Sends a DELETE request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + */ + public function delete($uri, array $options = []) { + $response = $this->client->delete($uri, $options); + return new Response($response); + } + + + /** + * Sends a options request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * 'timeout' => 5, + * @return Response + */ + public function options($uri, array $options = []) { + $response = $this->client->options($uri, $options); + return new Response($response); + } +} diff --git a/lib/private/http/client/clientservice.php b/lib/private/http/client/clientservice.php new file mode 100644 index 00000000000..795d508e5f9 --- /dev/null +++ b/lib/private/http/client/clientservice.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Http\Client; + +use GuzzleHttp\Client as GuzzleClient; +use OCP\Http\Client\IClientService; +use OCP\ICertificateManager; +use OCP\IConfig; + +/** + * Class ClientService + * + * @package OC\Http + */ +class ClientService implements IClientService { + /** @var IConfig */ + private $config; + /** @var ICertificateManager */ + private $certificateManager; + + /** + * @param IConfig $config + * @param ICertificateManager $certificateManager + */ + public function __construct(IConfig $config, + ICertificateManager $certificateManager) { + $this->config = $config; + $this->certificateManager = $certificateManager; + } + + /** + * @return Client + */ + public function newClient() { + return new Client($this->config, $this->certificateManager, new GuzzleClient()); + } +} diff --git a/lib/private/http/client/response.php b/lib/private/http/client/response.php new file mode 100644 index 00000000000..54b7a93543c --- /dev/null +++ b/lib/private/http/client/response.php @@ -0,0 +1,58 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Http\Client; + +use OCP\Http\Client\IResponse; +use GuzzleHttp\Message\Response as GuzzleResponse; + +/** + * Class Response + * + * @package OC\Http + */ +class Response implements IResponse { + /** @var GuzzleResponse */ + private $response; + + /** + * @param GuzzleResponse $response + */ + public function __construct(GuzzleResponse $response) { + $this->response = $response; + } + + /** + * @return string + */ + public function getBody() { + return $this->response->getBody()->getContents(); + } + + /** + * @return int + */ + public function getStatusCode() { + return $this->response->getStatusCode(); + } + + /** + * @param $key + * @return string + */ + public function getHeader($key) { + return $this->response->getHeader($key); + } + + /** + * @return array + */ + public function getHeaders() { + return $this->response->getHeaders(); + } +} diff --git a/lib/private/httphelper.php b/lib/private/httphelper.php index 6bb8e1d3ec0..16b824e927f 100644 --- a/lib/private/httphelper.php +++ b/lib/private/httphelper.php @@ -1,6 +1,6 @@ <?php /** - * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com> + * Copyright (c) 2014-2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -8,41 +8,31 @@ namespace OC; +use OCP\Http\Client\IClientService; use OCP\IConfig; -use OCP\ICertificateManager; +/** + * Class HTTPHelper + * + * @package OC + * @deprecated Use \OCP\Http\Client\IClientService + */ class HTTPHelper { const USER_AGENT = 'ownCloud Server Crawler'; /** @var \OCP\IConfig */ private $config; - - /** @var \OC\Security\CertificateManager */ - private $certificateManager; + /** @var IClientService */ + private $clientService; /** - * @param \OCP\IConfig $config + * @param IConfig $config + * @param IClientService $clientService */ - public function __construct(IConfig $config, ICertificateManager $certificateManager) { + public function __construct(IConfig $config, + IClientService $clientService) { $this->config = $config; - $this->certificateManager = $certificateManager; - } - - /** - * Returns the default context array - * @return array - */ - public function getDefaultContextArray() { - return array( - 'http' => array( - 'header' => 'User-Agent: ' . self::USER_AGENT . "\r\n", - 'timeout' => 10, - 'follow_location' => false, // Do not follow the location since we can't limit the protocol - ), - 'ssl' => array( - 'disable_compression' => true - ) - ); + $this->clientService = $clientService; } /** @@ -52,87 +42,28 @@ class HTTPHelper { * @return string of the response or false on error * This function get the content of a page via curl, if curl is enabled. * If not, file_get_contents is used. + * @deprecated Use \OCP\Http\Client\IClientService */ public function getUrlContent($url) { - if (!$this->isHTTPURL($url)) { - throw new \Exception('$url must start with https:// or http://', 1); - } - - $proxy = $this->config->getSystemValue('proxy', null); - $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); - $curl = curl_init(); - $max_redirects = 10; - - curl_setopt($curl, CURLOPT_HEADER, 0); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); - curl_setopt($curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); - - curl_setopt($curl, CURLOPT_USERAGENT, self::USER_AGENT); - if ($proxy !== null) { - curl_setopt($curl, CURLOPT_PROXY, $proxy); - } - if ($proxyUserPwd !== null) { - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUserPwd); - } - - if (ini_get('open_basedir') === '') { - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($curl, CURLOPT_MAXREDIRS, $max_redirects); - $data = curl_exec($curl); - } else { - curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false); - $mr = $max_redirects; - if ($mr > 0) { - $newURL = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); - $rCurl = curl_copy_handle($curl); - curl_setopt($rCurl, CURLOPT_HEADER, true); - curl_setopt($rCurl, CURLOPT_NOBODY, true); - curl_setopt($rCurl, CURLOPT_FORBID_REUSE, false); - curl_setopt($rCurl, CURLOPT_RETURNTRANSFER, true); - curl_setopt($rCurl, CURLOPT_USERAGENT, self::USER_AGENT); - do { - curl_setopt($rCurl, CURLOPT_URL, $newURL); - $header = curl_exec($rCurl); - if (curl_errno($rCurl)) { - $code = 0; - } else { - $code = curl_getinfo($rCurl, CURLINFO_HTTP_CODE); - if ($code == 301 || $code == 302) { - preg_match('/Location:(.*?)\n/', $header, $matches); - $newURL = trim(array_pop($matches)); - } else { - $code = 0; - } - } - } while ($code && --$mr); - curl_close($rCurl); - if ($mr > 0) { - curl_setopt($curl, CURLOPT_URL, $newURL); - } - } - - if ($mr == 0 && $max_redirects > 0) { - $data = false; - } else { - $data = curl_exec($curl); - } + try { + $client = $this->clientService->newClient(); + $response = $client->get($url); + return $response->getBody(); + } catch (\Exception $e) { + return false; } - curl_close($curl); - - return $data; } /** * Returns the response headers of a HTTP URL without following redirects * @param string $location Needs to be a HTTPS or HTTP URL * @return array + * @deprecated Use \OCP\Http\Client\IClientService */ public function getHeaders($location) { - stream_context_set_default($this->getDefaultContextArray()); - return get_headers($location, 1); + $client = $this->clientService->newClient(); + $response = $client->get($location); + return $response->getHeaders(); } /** @@ -145,50 +76,23 @@ class HTTPHelper { } /** - * create string of parameters for post request - * - * @param array $parameters - * @return string - */ - private function assemblePostParameters(array $parameters) { - $parameterString = ''; - foreach ($parameters as $key => $value) { - $parameterString .= $key . '=' . urlencode($value) . '&'; - } - - return rtrim($parameterString, '&'); - } - - /** * send http post request * * @param string $url * @param array $fields data send by the request - * @return bool + * @return array + * @deprecated Use \OCP\Http\Client\IClientService */ public function post($url, array $fields) { + $client = $this->clientService->newClient(); - $fieldsString = $this->assemblePostParameters($fields); - - $certBundle = $this->certificateManager->getCertificateBundle(); - - $ch = curl_init(); - - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, count($fields)); - curl_setopt($ch, CURLOPT_POSTFIELDS, (string)$fieldsString); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - if (is_readable($certBundle)) { - curl_setopt($ch, CURLOPT_CAINFO, $certBundle); + try { + $response = $client->post($url, ['body' => $fields]); + } catch (\Exception $e) { + return ['success' => false, 'result' => $e->getMessage()]; } - $result = curl_exec($ch); - $success = $result ? true : false; - - curl_close($ch); - - return array('success' => $success, 'result' => $result); + return ['success' => true, 'result' => $response->getBody()]; } } diff --git a/lib/private/installer.php b/lib/private/installer.php index 3956e503767..3af8fcf3b23 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -244,8 +244,9 @@ class OC_Installer{ if(!isset($data['href'])) { throw new \Exception($l->t("No href specified when installing app from http")); } - file_put_contents($path, \OC_Util::getUrlContent($data['href'])); - }else{ + $client = \OC::$server->getHTTPClientService()->newClient(); + $client->get($data['href'], ['save_to' => $path]); + } else { if(!isset($data['path'])) { throw new \Exception($l->t("No path specified when installing app from local file")); } diff --git a/lib/private/memcache/apcu.php b/lib/private/memcache/apcu.php index 1043690a361..410877e2eec 100644 --- a/lib/private/memcache/apcu.php +++ b/lib/private/memcache/apcu.php @@ -12,6 +12,8 @@ class APCu extends APC { static public function isAvailable() { if (!extension_loaded('apcu')) { return false; + } elseif (!ini_get('apc.enabled')) { + return false; } elseif (!ini_get('apc.enable_cli') && \OC::$CLI) { return false; } elseif (version_compare(phpversion('apc'), '4.0.6') === -1) { diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php index f27ab487efc..1e09d409297 100644 --- a/lib/private/ocsclient.php +++ b/lib/private/ocsclient.php @@ -67,16 +67,24 @@ class OCSClient { return null; } $url = self::getAppStoreURL() . '/content/categories'; - $xml = \OC::$server->getHTTPHelper()->getUrlContent($url); - if ($xml == false) { + + $client = \OC::$server->getHTTPClientService()->newClient(); + try { + $response = $client->get($url, ['timeout' => 5]); + } catch(\Exception $e) { + return null; + } + + if($response->getStatusCode() !== 200) { return null; } + $loadEntities = libxml_disable_entity_loader(true); - $data = simplexml_load_string($xml); + $data = simplexml_load_string($response->getBody()); libxml_disable_entity_loader($loadEntities); $tmp = $data->data; - $cats = array(); + $cats = []; foreach ($tmp->category as $value) { @@ -114,14 +122,21 @@ class OCSClient { $filterUrl = '&filter=' . urlencode($filter); $url = self::getAppStoreURL() . '/content/data?categories=' . urlencode($categoriesString) . '&sortmode=new&page=' . urlencode($page) . '&pagesize=100' . $filterUrl . $version; - $apps = array(); - $xml = \OC::$server->getHTTPHelper()->getUrlContent($url); + $apps = []; + + $client = \OC::$server->getHTTPClientService()->newClient(); + try { + $response = $client->get($url, ['timeout' => 5]); + } catch(\Exception $e) { + return null; + } - if ($xml == false) { + if($response->getStatusCode() !== 200) { return null; } + $loadEntities = libxml_disable_entity_loader(true); - $data = simplexml_load_string($xml); + $data = simplexml_load_string($response->getBody()); libxml_disable_entity_loader($loadEntities); $tmp = $data->data->content; @@ -163,14 +178,19 @@ class OCSClient { return null; } $url = self::getAppStoreURL() . '/content/data/' . urlencode($id); - $xml = \OC::$server->getHTTPHelper()->getUrlContent($url); + $client = \OC::$server->getHTTPClientService()->newClient(); + try { + $response = $client->get($url, ['timeout' => 5]); + } catch(\Exception $e) { + return null; + } - if ($xml == false) { - \OC_Log::write('core', 'Unable to parse OCS content for app ' . $id, \OC_Log::FATAL); + if($response->getStatusCode() !== 200) { return null; } + $loadEntities = libxml_disable_entity_loader(true); - $data = simplexml_load_string($xml); + $data = simplexml_load_string($response->getBody()); libxml_disable_entity_loader($loadEntities); $tmp = $data->data->content; @@ -178,7 +198,7 @@ class OCSClient { \OC_Log::write('core', 'Invalid OCS content returned for app ' . $id, \OC_Log::FATAL); return null; } - $app = array(); + $app = []; $app['id'] = $tmp->id; $app['name'] = $tmp->name; $app['version'] = $tmp->version; @@ -212,14 +232,19 @@ class OCSClient { return null; } $url = self::getAppStoreURL() . '/content/download/' . urlencode($id) . '/' . urlencode($item); - $xml = \OC::$server->getHTTPHelper()->getUrlContent($url); + $client = \OC::$server->getHTTPClientService()->newClient(); + try { + $response = $client->get($url, ['timeout' => 5]); + } catch(\Exception $e) { + return null; + } - if ($xml == false) { - \OC_Log::write('core', 'Unable to parse OCS content', \OC_Log::FATAL); + if($response->getStatusCode() !== 200) { return null; } + $loadEntities = libxml_disable_entity_loader(true); - $data = simplexml_load_string($xml); + $data = simplexml_load_string($response->getBody()); libxml_disable_entity_loader($loadEntities); $tmp = $data->data->content; diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php index 7bc83766365..d3a6dcd71eb 100644 --- a/lib/private/security/certificatemanager.php +++ b/lib/private/security/certificatemanager.php @@ -63,11 +63,13 @@ class CertificateManager implements ICertificateManager { /** * create the certificate bundle of all trusted certificated */ - protected function createCertificateBundle() { + public function createCertificateBundle() { $path = $this->getPathToCertificates(); $certs = $this->listCertificates(); $fh_certs = $this->view->fopen($path . '/rootcerts.crt', 'w'); + + // Write user certificates foreach ($certs as $cert) { $file = $path . '/uploads/' . $cert->getName(); $data = $this->view->file_get_contents($file); @@ -77,6 +79,9 @@ class CertificateManager implements ICertificateManager { } } + // Append the default certificates + $defaultCertificates = file_get_contents(\OC::$SERVERROOT . '/config/ca-bundle.crt'); + fwrite($fh_certs, $defaultCertificates); fclose($fh_certs); } @@ -137,6 +142,9 @@ class CertificateManager implements ICertificateManager { return $this->getPathToCertificates() . 'rootcerts.crt'; } + /** + * @return string + */ private function getPathToCertificates() { $path = is_null($this->uid) ? '/files_external/' : '/' . $this->uid . '/files_external/'; diff --git a/lib/private/server.php b/lib/private/server.php index fd7a2bea2d1..1f275d658bf 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -13,6 +13,7 @@ use OC\Diagnostics\EventLogger; use OC\Diagnostics\QueryLogger; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; +use OC\Http\Client\ClientService; use OC\Security\CertificateManager; use OC\Files\Node\Root; use OC\Files\View; @@ -236,9 +237,18 @@ class Server extends SimpleContainer implements IServerContainer { }); $this->registerService('HTTPHelper', function (Server $c) { $config = $c->getConfig(); - $user = $c->getUserSession()->getUser(); - $uid = $user ? $user->getUID() : null; - return new HTTPHelper($config, new \OC\Security\CertificateManager($uid, new \OC\Files\View())); + return new HTTPHelper( + $config, + $c->getHTTPClientService() + ); + }); + $this->registerService('HttpClientService', function (Server $c) { + $user = \OC_User::getUser(); + $uid = $user ? $user : null; + return new ClientService( + $c->getConfig(), + new \OC\Security\CertificateManager($uid, new \OC\Files\View()) + ); }); $this->registerService('EventLogger', function (Server $c) { if (defined('DEBUG') and DEBUG) { @@ -664,7 +674,7 @@ class Server extends SimpleContainer implements IServerContainer { /** * Returns an instance of the HTTP helper class - * + * @deprecated Use getHTTPClientService() * @return \OC\HTTPHelper */ function getHTTPHelper() { @@ -690,6 +700,15 @@ class Server extends SimpleContainer implements IServerContainer { } /** + * Returns an instance of the HTTP client service + * + * @return \OCP\Http\Client\IClientService + */ + function getHTTPClientService() { + return $this->query('HttpClientService'); + } + + /** * Create a new event source * * @return \OCP\IEventSource diff --git a/lib/private/util.php b/lib/private/util.php index a048996da6e..921bfd8067e 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1193,33 +1193,21 @@ class OC_Util { /** * Check if the ownCloud server can connect to the internet * + * @param \OCP\Http\Client\IClientService $clientService * @return bool */ - public static function isInternetConnectionWorking() { + public static function isInternetConnectionWorking(\OCP\Http\Client\IClientService $clientService) { // in case there is no internet connection on purpose return false if (self::isInternetConnectionEnabled() === false) { return false; } - // in case the connection is via proxy return true to avoid connecting to owncloud.org - if (OC_Config::getValue('proxy', '') != '') { - return true; - } - - // try to connect to owncloud.org to see if http connections to the internet are possible. - $connected = @fsockopen("www.owncloud.org", 80); - if ($connected) { - fclose($connected); - return true; - } else { - // second try in case one server is down - $connected = @fsockopen("apps.owncloud.com", 80); - if ($connected) { - fclose($connected); - return true; - } else { - return false; - } + try { + $client = $clientService->newClient(); + $response = $client->get('https://www.owncloud.org/'); + return $response->getStatusCode() === 200; + } catch (\Exception $e) { + return false; } } diff --git a/lib/public/http/client/iclient.php b/lib/public/http/client/iclient.php new file mode 100644 index 00000000000..2946bcfa18d --- /dev/null +++ b/lib/public/http/client/iclient.php @@ -0,0 +1,181 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Http\Client; + +/** + * Interface IClient + * + * @package OCP\Http + */ +interface IClient { + + /** + * Sends a GET request + * @param string $uri + * @param array $options Array such as + * 'query' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + * @throws \Exception If the request could not get completed + */ + public function get($uri, array $options = []); + + /** + * Sends a HEAD request + * @param string $uri + * @param array $options Array such as + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + */ + public function head($uri, $options = []); + + /** + * Sends a POST request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + */ + public function post($uri, array $options = []); + + /** + * Sends a PUT request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + */ + public function put($uri, array $options = []); + + /** + * Sends a DELETE request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + */ + public function delete($uri, array $options = []); + + /** + * Sends a options request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [' + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'save_to' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IResponse + */ + public function options($uri, array $options = []); +} diff --git a/lib/public/http/client/iclientservice.php b/lib/public/http/client/iclientservice.php new file mode 100644 index 00000000000..4dc65f1721e --- /dev/null +++ b/lib/public/http/client/iclientservice.php @@ -0,0 +1,21 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Http\Client; + +/** + * Interface IClientService + * + * @package OCP\Http + */ +interface IClientService { + /** + * @return IClient + */ + public function newClient(); +} diff --git a/lib/public/http/client/iresponse.php b/lib/public/http/client/iresponse.php new file mode 100644 index 00000000000..5355046a2a7 --- /dev/null +++ b/lib/public/http/client/iresponse.php @@ -0,0 +1,37 @@ +<?php +/** + * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\Http\Client; + +/** + * Interface IResponse + * + * @package OCP\Http + */ +interface IResponse { + /** + * @return string + */ + public function getBody(); + + /** + * @return int + */ + public function getStatusCode(); + + /** + * @param $key + * @return string + */ + public function getHeader($key); + + /** + * @return array + */ + public function getHeaders(); +} diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 20345e61212..a01ae5e200d 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -267,10 +267,18 @@ interface IServerContainer { /** * Returns an instance of the HTTP helper class * @return \OC\HTTPHelper + * @deprecated Use \OCP\Http\Client\IClientService */ function getHTTPHelper(); /** + * Returns an instance of the HTTP client service + * + * @return \OCP\Http\Client\IClientService + */ + function getHTTPClientService(); + + /** * Get the active event logger * * @return \OCP\Diagnostics\IEventLogger diff --git a/lib/repair/updatecertificatestore.php b/lib/repair/updatecertificatestore.php new file mode 100644 index 00000000000..e1f6be45ef9 --- /dev/null +++ b/lib/repair/updatecertificatestore.php @@ -0,0 +1,77 @@ +<?php +/** + * @author Lukas Reschke + * @copyright 2015 Lukas Reschke lukas@owncloud.com + * + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Repair; + +use OC\Files\View; +use OC\Hooks\BasicEmitter; +use OC\RepairStep; +use OC\Server; +use OCP\IConfig; + +/** + * Class UpdateCertificateStore rewrites the user specific certificate store after + * an update has been performed. This is done because a new root certificate file + * might have been added. + * + * @package OC\Repair + */ +class UpdateCertificateStore extends BasicEmitter implements RepairStep { + /** + * FIXME: The certificate manager does only allow specifying the user + * within the constructor. This makes DI impossible. + * @var Server + */ + protected $server; + /** @var IConfig */ + protected $config; + + /** + * @param Server $server + * @param IConfig $config + */ + public function __construct(Server $server, + IConfig $config) { + $this->server = $server; + $this->config = $config; + } + + /** {@inheritDoc} */ + public function getName() { + return 'Update user certificate stores with new root certificates'; + } + + /** {@inheritDoc} */ + public function run() { + $rootView = new View(); + $dataDirectory = $this->config->getSystemValue('datadirectory', null); + if(is_null($dataDirectory)) { + throw new \Exception('No data directory specified'); + } + + $pathToRootCerts = '/files_external/rootcerts.crt'; + + foreach($rootView->getDirectoryContent('', 'httpd/unix-directory') as $fileInfo) { + $uid = trim($fileInfo->getPath(), '/'); + if($rootView->file_exists($uid . $pathToRootCerts)) { + // Delete the existing root certificate + $rootView->unlink($uid . $pathToRootCerts); + + /** + * FIXME: The certificate manager does only allow specifying the user + * within the constructor. This makes DI impossible. + */ + // Regenerate the certificates + $certificateManager = $this->server->getCertificateManager($uid); + $certificateManager->createCertificateBundle(); + } + } + } +} |