diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-04-25 11:47:06 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2014-04-25 11:47:06 +0200 |
commit | 6c20a014eaecd19c3f68143485c6f74891ee9643 (patch) | |
tree | 84bd8e37536e7f28a25afd7586c209d38a25d610 /lib | |
parent | cd0c5990f895bcdce47acf2dbf11ebadd920a404 (diff) | |
parent | 3fc809dfd80a296d7da922a06f9e13d446b3d3f0 (diff) | |
download | nextcloud-server-6c20a014eaecd19c3f68143485c6f74891ee9643.tar.gz nextcloud-server-6c20a014eaecd19c3f68143485c6f74891ee9643.zip |
merge master into webdav-injection
Diffstat (limited to 'lib')
34 files changed, 671 insertions, 197 deletions
diff --git a/lib/base.php b/lib/base.php index 83f54a8e4db..0f55c1175c7 100644 --- a/lib/base.php +++ b/lib/base.php @@ -698,6 +698,7 @@ class OC { * @brief Handle the request */ public static function handleRequest() { + $l = \OC_L10N::get('lib'); // load all the classpaths from the enabled apps so they are available // in the routing files of each app OC::loadAppClassPaths(); @@ -719,8 +720,8 @@ class OC { header('HTTP/1.1 400 Bad Request'); header('Status: 400 Bad Request'); OC_Template::printErrorPage( - 'You are accessing the server from an untrusted domain.', - 'Please contact your administrator' + $l->t('You are accessing the server from an untrusted domain.'), + $l->t('Please contact your administrator') ); return; } diff --git a/lib/l10n/af_ZA.php b/lib/l10n/af_ZA.php index d6bf5771e8d..566694d1fd9 100644 --- a/lib/l10n/af_ZA.php +++ b/lib/l10n/af_ZA.php @@ -5,6 +5,7 @@ $TRANSLATIONS = array( "Settings" => "Instellings", "Users" => "Gebruikers", "Admin" => "Admin", +"Unknown filetype" => "Onbekende leertipe", "web services under your control" => "webdienste onder jou beheer", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php index 8348f7ef0dc..671251884ae 100644 --- a/lib/l10n/cs_CZ.php +++ b/lib/l10n/cs_CZ.php @@ -56,6 +56,12 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, rozhraní WebDAV se zdá být rozbité.", "Please double check the <a href='%s'>installation guides</a>." => "Zkonzultujte, prosím, <a href='%s'>průvodce instalací</a>.", "%s shared »%s« with you" => "%s s vámi sdílí »%s«", +"Sharing %s failed, because the user %s is the item owner" => "Sdílení položky %s selhalo, protože uživatel %s je jejím vlastníkem", +"Sharing %s failed, because the user %s does not exist" => "Sdílení položky %s selhalo, protože uživatel %s neexistuje", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Sdílení položky %s selhalo, protože uživatel %s není členem žádné skupiny společné s uživatelem %s", +"Sharing %s failed, because this item is already shared with %s" => "Sdílení položky %s selhalo, protože položka již je s uživatelem %s sdílená", +"Sharing %s failed, because the group %s does not exist" => "Sdílení položky %s selhalo, protože skupina %s neexistuje", +"Sharing %s failed, because %s is not a member of the group %s" => "Sdílení položky %s selhalo, protože uživatel %s není členem skupiny %s", "Could not find category \"%s\"" => "Nelze nalézt kategorii \"%s\"", "seconds ago" => "před pár sekundami", "_%n minute ago_::_%n minutes ago_" => array("před %n minutou","před %n minutami","před %n minutami"), diff --git a/lib/l10n/de.php b/lib/l10n/de.php index 297cc57bde7..9a334a6ccc2 100644 --- a/lib/l10n/de.php +++ b/lib/l10n/de.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.", "%s shared »%s« with you" => "%s teilte »%s« mit Dir", +"Sharing %s failed, because the user %s is the item owner" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s Besitzer des Objektes ist", +"Sharing %s failed, because the user %s does not exist" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s nicht existiert", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s kein Gruppenmitglied einer der Gruppen von %s ist", +"Sharing %s failed, because this item is already shared with %s" => "Freigabe von %s fehlgeschlagen, da dieses Objekt schon mit %s geteilt wird", +"Sharing %s failed, because the group %s does not exist" => "Freigabe von %s fehlgeschlagen, da die Gruppe %s nicht existiert", +"Sharing %s failed, because %s is not a member of the group %s" => "Freigabe von %s fehlgeschlagen, da %s kein Mitglied der Gruppe %s ist", +"Sharing %s failed, because sharing with links is not allowed" => "Freigabe von %s fehlgeschlagen, da das Teilen von Verknüpfungen nicht erlaubt ist", +"Share type %s is not valid for %s" => "Freigabetyp %s ist nicht gültig für %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da die Berechtigungen, die erteilten Berechtigungen %s überschreiten", +"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", +"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", +"Sharing %s failed, because the user %s is the original sharer" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s der offizielle Freigeber ist", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Freigabe von %s fehlgeschlagen, da die Berechtigungen die erteilten Berechtigungen %s überschreiten", +"Sharing %s failed, because resharing is not allowed" => "Freigabe von %s fehlgeschlagen, da das nochmalige Freigeben einer Freigabe nicht erlaubt ist", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Freigabe von %s fehlgeschlagen, da das Freigabe-Backend für %s nicht in dieser Quelle gefunden werden konnte", +"Sharing %s failed, because the file could not be found in the file cache" => "Freigabe von %s fehlgeschlagen, da die Datei im Datei-Cache nicht gefunden werden konnte", "Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden.", "seconds ago" => "Gerade eben", "_%n minute ago_::_%n minutes ago_" => array("Vor %n Minute","Vor %n Minuten"), diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index d0a4a9b1c6e..ae71118979e 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.", "%s shared »%s« with you" => "%s hat »%s« mit Ihnen geteilt", +"Sharing %s failed, because the user %s is the item owner" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s Besitzer des Objektes ist", +"Sharing %s failed, because the user %s does not exist" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s nicht existiert", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s kein Gruppenmitglied einer der Gruppen von %s ist", +"Sharing %s failed, because this item is already shared with %s" => "Freigabe von %s fehlgeschlagen, da dieses Objekt schon mit %s geteilt wird", +"Sharing %s failed, because the group %s does not exist" => "Freigabe von %s fehlgeschlagen, da die Gruppe %s nicht existiert", +"Sharing %s failed, because %s is not a member of the group %s" => "Freigabe von %s fehlgeschlagen, da %s kein Mitglied der Gruppe %s ist", +"Sharing %s failed, because sharing with links is not allowed" => "Freigabe von %s fehlgeschlagen, da das Teilen von Verknüpfungen nicht erlaubt ist", +"Share type %s is not valid for %s" => "Freigabetyp %s ist nicht gültig für %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Das Setzen der Berechtigungen für %s ist fehlgeschlagen, da die Berechtigungen, die erteilten Berechtigungen %s überschreiten", +"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", +"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", +"Sharing %s failed, because the user %s is the original sharer" => "Freigabe von %s fehlgeschlagen, da der Nutzer %s der offizielle Freigeber ist", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Freigabe von %s fehlgeschlagen, da die Berechtigungen die erteilten Berechtigungen %s überschreiten", +"Sharing %s failed, because resharing is not allowed" => "Freigabe von %s fehlgeschlagen, da das nochmalige Freigeben einer Freigabe nicht erlaubt ist", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Freigabe von %s fehlgeschlagen, da das Freigabe-Backend für %s nicht in dieser Quelle gefunden werden konnte", +"Sharing %s failed, because the file could not be found in the file cache" => "Freigabe von %s fehlgeschlagen, da die Datei im Datei-Cache nicht gefunden werden konnte", "Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden.", "seconds ago" => "Gerade eben", "_%n minute ago_::_%n minutes ago_" => array("Vor %n Minute","Vor %n Minuten"), diff --git a/lib/l10n/en_GB.php b/lib/l10n/en_GB.php index e1c49392bd8..5b519c75df7 100644 --- a/lib/l10n/en_GB.php +++ b/lib/l10n/en_GB.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Your web server is not yet properly setup to allow files synchronisation because the WebDAV interface seems to be broken.", "Please double check the <a href='%s'>installation guides</a>." => "Please double check the <a href='%s'>installation guides</a>.", "%s shared »%s« with you" => "%s shared \"%s\" with you", +"Sharing %s failed, because the user %s is the item owner" => "Sharing %s failed, because the user %s is the item owner", +"Sharing %s failed, because the user %s does not exist" => "Sharing %s failed, because the user %s does not exist", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Sharing %s failed, because the user %s is not a member of any groups that %s is a member of", +"Sharing %s failed, because this item is already shared with %s" => "Sharing %s failed, because this item is already shared with %s", +"Sharing %s failed, because the group %s does not exist" => "Sharing %s failed, because the group %s does not exist", +"Sharing %s failed, because %s is not a member of the group %s" => "Sharing %s failed, because %s is not a member of the group %s", +"Sharing %s failed, because sharing with links is not allowed" => "Sharing %s failed, because sharing with links is not allowed", +"Share type %s is not valid for %s" => "Share type %s is not valid for %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Setting permissions for %s failed, because the permissions exceed permissions granted to %s", +"Setting permissions for %s failed, because the item was not found" => "Setting permissions for %s failed, because the item was not found", +"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", +"Sharing %s failed, because the user %s is the original sharer" => "Sharing %s failed, because the user %s is the original sharer", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Sharing %s failed, because the permissions exceed permissions granted to %s", +"Sharing %s failed, because resharing is not allowed" => "Sharing %s failed, because resharing is not allowed", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Sharing %s failed, because the sharing backend for %s could not find its source", +"Sharing %s failed, because the file could not be found in the file cache" => "Sharing %s failed, because the file could not be found in the file cache", "Could not find category \"%s\"" => "Could not find category \"%s\"", "seconds ago" => "seconds ago", "_%n minute ago_::_%n minutes ago_" => array("%n minute ago","%n minutes ago"), diff --git a/lib/l10n/es.php b/lib/l10n/es.php index c01239cca7a..351d469225d 100644 --- a/lib/l10n/es.php +++ b/lib/l10n/es.php @@ -56,6 +56,20 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Su servidor web aún no está configurado adecuadamente para permitir sincronización de archivos ya que la interfaz WebDAV parece no estar funcionando.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, vuelva a comprobar las <a href='%s'>guías de instalación</a>.", "%s shared »%s« with you" => "%s ha compatido »%s« contigo", +"Sharing %s failed, because the user %s is the item owner" => "Compartiendo %s ha fallado, ya que el usuario %s es el dueño del elemento", +"Sharing %s failed, because the user %s does not exist" => "Compartiendo %s ha fallado, ya que el usuario %s no existe", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Compartiendo %s ha fallado, ya que el usuario %s no es miembro de algún grupo que %s es miembro", +"Sharing %s failed, because this item is already shared with %s" => "Compartiendo %s ha fallado, ya que este elemento ya está compartido con %s", +"Sharing %s failed, because the group %s does not exist" => "Compartiendo %s ha fallado, ya que el grupo %s no existe", +"Sharing %s failed, because %s is not a member of the group %s" => "Compartiendo %s ha fallado, ya que %s no es miembro del grupo %s", +"Sharing %s failed, because sharing with links is not allowed" => "Compartiendo %s ha fallado, ya que compartir con enlaces no está permitido", +"Share type %s is not valid for %s" => "Compartir tipo %s no es válido para %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Configuración de permisos para %s ha fallado, ya que los permisos superan los permisos dados a %s", +"Setting permissions for %s failed, because the item was not found" => "Configuración de permisos para %s ha fallado, ya que el elemento no fue encontrado", +"Sharing %s failed, because the user %s is the original sharer" => "Compartiendo %s ha fallado, ya que el usuario %s es el compartidor original", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Compartiendo %s ha fallado, ya que los permisos superan los permisos otorgados a %s", +"Sharing %s failed, because resharing is not allowed" => "Compartiendo %s ha fallado, ya que volver a compartir no está permitido", +"Sharing %s failed, because the file could not be found in the file cache" => "Compartiendo %s ha fallado, ya que el archivo no pudo ser encontrado en el cache de archivo", "Could not find category \"%s\"" => "No puede encontrar la categoria \"%s\"", "seconds ago" => "hace segundos", "_%n minute ago_::_%n minutes ago_" => array("Hace %n minuto","Hace %n minutos"), diff --git a/lib/l10n/es_CR.php b/lib/l10n/es_CR.php new file mode 100644 index 00000000000..15f78e0bce6 --- /dev/null +++ b/lib/l10n/es_CR.php @@ -0,0 +1,8 @@ +<?php +$TRANSLATIONS = array( +"_%n minute ago_::_%n minutes ago_" => array("",""), +"_%n hour ago_::_%n hours ago_" => array("",""), +"_%n day go_::_%n days ago_" => array("",""), +"_%n month ago_::_%n months ago_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php index 883c7323c0c..082e1222d70 100644 --- a/lib/l10n/et_EE.php +++ b/lib/l10n/et_EE.php @@ -56,6 +56,15 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Veebiserveri ei ole veel korralikult seadistatud võimaldamaks failide sünkroniseerimist, kuna WebDAV liides näib olevat mittetoimiv.", "Please double check the <a href='%s'>installation guides</a>." => "Palun tutvu veelkord <a href='%s'>paigalduse juhenditega</a>.", "%s shared »%s« with you" => "%s jagas sinuga »%s«", +"Share type %s is not valid for %s" => "Jagamise tüüp %s ei ole õige %s jaoks", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Jagamise tagarakend %s peab kasutusele võtma OCP\\Share_Backend liidese", +"Sharing backend %s not found" => "Jagamise tagarakendit %s ei leitud", +"Sharing backend for %s not found" => "Jagamise tagarakendit %s jaoks ei leitud", +"Sharing %s failed, because the user %s is the original sharer" => "%s jagamine ebaõnnestus, kuna kasutaja %s on algne jagaja", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "%s jagamine ebaõnnestus, kuna jagamise õigused ületavad %s jaoks määratud õigusi", +"Sharing %s failed, because resharing is not allowed" => "%s jagamine ebaõnnestus, kuna edasijagamine pole lubatud", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "%s jagamine ebaõnnestus, kuna jagamise tagarakend ei suutnud leida %s jaoks lähteallikat", +"Sharing %s failed, because the file could not be found in the file cache" => "%s jagamine ebaõnnestus, kuna faili ei suudetud leida failide puhvrist", "Could not find category \"%s\"" => "Ei leia kategooriat \"%s\"", "seconds ago" => "sekundit tagasi", "_%n minute ago_::_%n minutes ago_" => array("","%n minutit tagasi"), @@ -67,6 +76,7 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","%n kuud tagasi"), "last year" => "viimasel aastal", "years ago" => "aastat tagasi", +"Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Kasutajanimes on lubatud ainult järgnevad tähemärgid: \"a-z\", \"A-Z\", \"0-9\" ja \"_.@-\"", "A valid username must be provided" => "Sisesta nõuetele vastav kasutajatunnus", "A valid password must be provided" => "Sisesta nõuetele vastav parool", "The username is already being used" => "Kasutajanimi on juba kasutuses" diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php index 13e97e1b677..8396cf14387 100644 --- a/lib/l10n/fi_FI.php +++ b/lib/l10n/fi_FI.php @@ -23,6 +23,7 @@ $TRANSLATIONS = array( "App does not provide an info.xml file" => "Sovellus ei sisällä info.xml-tiedostoa", "App can't be installed because of not allowed code in the App" => "Sovellusta ei voi asentaa, koska sovellus sisältää kiellettyä koodia", "App can't be installed because it is not compatible with this version of ownCloud" => "Sovellusta ei voi asentaa, koska se ei ole yhteensopiva käytössä olevan ownCloud-version kanssa", +"App can't be installed because the version in info.xml/version is not the same as the version reported from the app store" => "Sovellusta ei voi asentaa, koska info.xml/version ilmoittaa versioksi eri arvon kuin sovelluskauppa", "App directory already exists" => "Sovelluskansio on jo olemassa", "Can't create app folder. Please fix permissions. %s" => "Sovelluskansion luominen ei onnistu. Korjaa käyttöoikeudet. %s", "Application is not enabled" => "Sovellusta ei ole otettu käyttöön", @@ -38,17 +39,30 @@ $TRANSLATIONS = array( "MS SQL username and/or password not valid: %s" => "MS SQL -käyttäjätunnus ja/tai -salasana on väärin: %s", "MySQL/MariaDB username and/or password not valid" => "MySQL/MariaDB-käyttäjätunnus ja/tai salasana on virheellinen", "DB Error: \"%s\"" => "Tietokantavirhe: \"%s\"", +"Offending command was: \"%s\"" => "Loukkaava komento oli: \"%s\"", "MySQL/MariaDB user '%s'@'localhost' exists already." => "MySQL/MariaDB-käyttäjä '%s'@'localhost' on jo olemassa.", "Drop this user from MySQL/MariaDB" => "Pudota tämä käyttäjä MySQL/MariaDB:stä", "MySQL/MariaDB user '%s'@'%%' already exists" => "MySQL/MariaDB-käyttäjä '%s'@'%%' on jo olemassa", "Drop this user from MySQL/MariaDB." => "Pudota tämä käyttäjä MySQL/MariaDB:stä.", "Oracle connection could not be established" => "Oracle-yhteyttä ei voitu muodostaa", "Oracle username and/or password not valid" => "Oraclen käyttäjätunnus ja/tai salasana on väärin", +"Offending command was: \"%s\", name: %s, password: %s" => "Loukkaava komento oli: \"%s\", nimi: %s, salasana: %s", "PostgreSQL username and/or password not valid" => "PostgreSQL:n käyttäjätunnus ja/tai salasana on väärin", "Set an admin username." => "Aseta ylläpitäjän käyttäjätunnus.", "Set an admin password." => "Aseta ylläpitäjän salasana.", +"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web-palvelimen asetukset eivät ole kelvolliset tiedostojen synkronointia varten, koska WebDAV-liitäntä vaikuttaa olevan rikki.", "Please double check the <a href='%s'>installation guides</a>." => "Lue tarkasti <a href='%s'>asennusohjeet</a>.", "%s shared »%s« with you" => "%s jakoi kohteen »%s« kanssasi", +"Sharing %s failed, because the user %s is the item owner" => "Kohteen %s jakaminen epäonnistui, koska käyttäjä %s on kohteen omistaja", +"Sharing %s failed, because the user %s does not exist" => "Kohteen %s jakaminen epäonnistui, koska käyttäjää %s ei ole olemassa", +"Sharing %s failed, because this item is already shared with %s" => "Kohteen %s jakaminen epäonnistui, koska kohde on jo jaettu käyttäjän %s kanssa", +"Sharing %s failed, because the group %s does not exist" => "Kohteen %s jakaminen epäonnistui, koska ryhmää %s ei ole olemassa", +"Sharing %s failed, because %s is not a member of the group %s" => "Kohteen %s jakaminen epäonnistui, koska käyttäjä %s ei ole ryhmän %s jäsen", +"Sharing %s failed, because sharing with links is not allowed" => "Kohteen %s jakaminen epäonnistui, koska jakaminen linkkejä käyttäen ei ole sallittu", +"Setting permissions for %s failed, because the item was not found" => "Kohteen %s oikeuksien asettaminen epäonnistui, koska kohdetta ei löytynyt", +"Sharing %s failed, because the user %s is the original sharer" => "Kohteen %s jakaminen epäonnistui, koska käyttäjä %s on alkuperäinen jakaja", +"Sharing %s failed, because resharing is not allowed" => "Kohteen %s jakaminen epäonnistui, koska jakaminen uudelleen ei ole sallittu", +"Sharing %s failed, because the file could not be found in the file cache" => "Kohteen %s jakaminen epäonnistui, koska tiedostoa ei löytynyt tiedostovälimuistista", "Could not find category \"%s\"" => "Luokkaa \"%s\" ei löytynyt", "seconds ago" => "sekuntia sitten", "_%n minute ago_::_%n minutes ago_" => array("%n minuutti sitten","%n minuuttia sitten"), diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index b13970c610d..f4e916aa9c2 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -56,6 +56,20 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Votre serveur web, n'est pas correctement configuré pour permettre la synchronisation des fichiers, car l'interface WebDav ne fonctionne pas comme il faut.", "Please double check the <a href='%s'>installation guides</a>." => "Veuillez vous référer au <a href='%s'>guide d'installation</a>.", "%s shared »%s« with you" => "%s partagé »%s« avec vous", +"Sharing %s failed, because the user %s is the item owner" => "Le partage de %s a échoué car l'utilisateur %s est le propriétaire de l'objet", +"Sharing %s failed, because the user %s does not exist" => "Le partage de %s a échoué car l'utilisateur %s n'existe pas", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Le partage de %s a échoué car l'utilisateur %s n'est membre d'aucun groupe auquel %s appartient", +"Sharing %s failed, because this item is already shared with %s" => "Le partage de %s a échoué car cet objet est déjà partagé avec %s", +"Sharing %s failed, because the group %s does not exist" => "Le partage de %s a échoué car le groupe %s n'existe pas", +"Sharing %s failed, because %s is not a member of the group %s" => "Le partage de %s a échoué car %s n'est pas membre du groupe %s", +"Sharing %s failed, because sharing with links is not allowed" => "Le partage de %s a échoué car un partage de lien n'est pas permis", +"Share type %s is not valid for %s" => "Le type de partage %s n'est pas valide pour %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Le réglage des permissions pour %s a échoué car les permissions dépassent celle accordée à %s", +"Setting permissions for %s failed, because the item was not found" => "Le réglage des permissions pour %s a échoué car l'objet n'a pas été trouvé", +"Sharing %s failed, because the user %s is the original sharer" => "Le partage de %s a échoué car l'utilisateur %s est déjà l'utilisateur à l'origine du partage.", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Le partage de %s a échoué car les permissions dépassent les permissions accordées à %s", +"Sharing %s failed, because resharing is not allowed" => "Le partage de %s a échoué car le repartage n'est pas autorisé", +"Sharing %s failed, because the file could not be found in the file cache" => "Le partage de %s a échoué car le fichier n'a pas été trouvé dans les fichiers mis en cache.", "Could not find category \"%s\"" => "Impossible de trouver la catégorie \"%s\"", "seconds ago" => "il y a quelques secondes", "_%n minute ago_::_%n minutes ago_" => array("","il y a %n minutes"), diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php index 2a62b41e22d..b61df49acc0 100644 --- a/lib/l10n/gl.php +++ b/lib/l10n/gl.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web non está aínda configurado adecuadamente para permitir a sincronización de ficheiros xa que semella que a interface WebDAV non está a funcionar.", "Please double check the <a href='%s'>installation guides</a>." => "Volva comprobar as <a href='%s'>guías de instalación</a>", "%s shared »%s« with you" => "%s compartiu «%s» con vostede", +"Sharing %s failed, because the user %s is the item owner" => "Fallou a compartición de %s, xa que o propietario do elemento é o usuario %s", +"Sharing %s failed, because the user %s does not exist" => "Fallou a compartición de %s, xa que o usuario %s non existe", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Fallou a compartición de %s, xa que o usuario %s non é membro de ningún grupo que sexa membro de %s", +"Sharing %s failed, because this item is already shared with %s" => "Fallou a compartición de %s, xa que este elemento xa está compartido con %s", +"Sharing %s failed, because the group %s does not exist" => "Fallou a compartición de %s, xa que o grupo %s non existe", +"Sharing %s failed, because %s is not a member of the group %s" => "Fallou a compartición de %s, xa que %s non é membro do grupo %s", +"Sharing %s failed, because sharing with links is not allowed" => "Fallou a compartición de %s, xa que non está permitido compartir con ligazóns", +"Share type %s is not valid for %s" => "Non se admite a compartición do tipo %s para %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Non é posíbel estabelecer permisos para %s, xa que os permisos superan os permisos concedidos a %s", +"Setting permissions for %s failed, because the item was not found" => "Non é posíbel estabelecer permisos para %s, xa que non se atopa o elemento", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "A infraestrutura de compartición %s ten que implementar a interface OCP\\Share_Backend", +"Sharing backend %s not found" => "Non se atopou a infraestrutura de compartición %s", +"Sharing backend for %s not found" => "Non se atopou a infraestrutura de compartición para %s", +"Sharing %s failed, because the user %s is the original sharer" => "Fallou a compartición de %s, xa que a compartición orixinal é do usuario %s", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Fallou a compartición de %s, xa que os permisos superan os permisos concedidos a %s", +"Sharing %s failed, because resharing is not allowed" => "Fallou a compartición de %s, xa que non está permitido repetir a compartción", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Fallou a compartición de %s, xa que a infraestrutura de compartición para %s non foi quen de atopar a orixe", +"Sharing %s failed, because the file could not be found in the file cache" => "Fallou a compartición de %s, xa que non foi posíbel atopar o ficheiro na caché de ficheiros", "Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»", "seconds ago" => "segundos atrás", "_%n minute ago_::_%n minutes ago_" => array("hai %n minuto","hai %n minutos"), diff --git a/lib/l10n/ia.php b/lib/l10n/ia.php index 34f43bc424a..1fb600d76b4 100644 --- a/lib/l10n/ia.php +++ b/lib/l10n/ia.php @@ -5,12 +5,20 @@ $TRANSLATIONS = array( "Settings" => "Configurationes", "Users" => "Usatores", "Admin" => "Administration", +"Unknown filetype" => "Typo de file incognite", +"Invalid image" => "Imagine invalide", "web services under your control" => "servicios web sub tu controlo", "Files" => "Files", "Text" => "Texto", -"_%n minute ago_::_%n minutes ago_" => array("",""), -"_%n hour ago_::_%n hours ago_" => array("",""), +"seconds ago" => "secundas passate", +"_%n minute ago_::_%n minutes ago_" => array("","%n minutas passate"), +"_%n hour ago_::_%n hours ago_" => array("","%n horas passate"), +"today" => "hodie", +"yesterday" => "heri", "_%n day go_::_%n days ago_" => array("",""), -"_%n month ago_::_%n months ago_" => array("","") +"last month" => "ultime mense", +"_%n month ago_::_%n months ago_" => array("",""), +"last year" => "ultime anno", +"years ago" => "annos passate" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/it.php b/lib/l10n/it.php index b76b5060a4d..e565b01fdf1 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -56,6 +56,22 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Il tuo server web non è configurato correttamente per consentire la sincronizzazione dei file poiché l'interfaccia WebDAV sembra essere danneggiata.", "Please double check the <a href='%s'>installation guides</a>." => "Leggi attentamente le <a href='%s'>guide d'installazione</a>.", "%s shared »%s« with you" => "%s ha condiviso «%s» con te", +"Sharing %s failed, because the user %s is the item owner" => "Condivisione di %s non riuscita, poiché l'utente %s è il proprietario dell'oggetto", +"Sharing %s failed, because the user %s does not exist" => "Condivisione di %s non riuscita, poiché l'utente %s non esiste", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Condivisione di %s non riuscita, poiché l'utente %s non appartiene ad alcun gruppo di cui %s è membro", +"Sharing %s failed, because this item is already shared with %s" => "Condivisione di %s non riuscita, poiché l'oggetto è già condiviso con %s", +"Sharing %s failed, because the group %s does not exist" => "Condivisione di %s non riuscita, poiché il gruppo %s non esiste", +"Sharing %s failed, because %s is not a member of the group %s" => "Condivisione di %s non riuscita, poiché %s non appartiene al gruppo %s", +"Sharing %s failed, because sharing with links is not allowed" => "Condivisione di %s non riuscita, poiché i link non sono ammessi", +"Share type %s is not valid for %s" => "Il tipo di condivisione %s non è valido per %s", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Il motore di condivisione %s deve implementare l'interfaccia OCP\\Share_Backend", +"Sharing backend %s not found" => "Motore di condivisione %s non trovato", +"Sharing backend for %s not found" => "Motore di condivisione di %s non trovato", +"Sharing %s failed, because the user %s is the original sharer" => "Condivisione di %s non riuscita, poiché l'utente %s l'ha condiviso precedentemente", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Condivisione di %s non riuscita, poiché i permessi sono superiori a quelli rilasciati a %s", +"Sharing %s failed, because resharing is not allowed" => "Condivisione di %s non riuscita, poiché la ri-condivisione non è ammessa", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Condivisione di %s non riuscita, poiché il motore di condivisione per %s non riesce a trovare la sua origine", +"Sharing %s failed, because the file could not be found in the file cache" => "Condivisione di %s non riuscita, poiché il file non risiede nella cache", "Could not find category \"%s\"" => "Impossibile trovare la categoria \"%s\"", "seconds ago" => "secondi fa", "_%n minute ago_::_%n minutes ago_" => array("%n minuto fa","%n minuti fa"), diff --git a/lib/l10n/or_IN.php b/lib/l10n/or_IN.php new file mode 100644 index 00000000000..15f78e0bce6 --- /dev/null +++ b/lib/l10n/or_IN.php @@ -0,0 +1,8 @@ +<?php +$TRANSLATIONS = array( +"_%n minute ago_::_%n minutes ago_" => array("",""), +"_%n hour ago_::_%n hours ago_" => array("",""), +"_%n day go_::_%n days ago_" => array("",""), +"_%n month ago_::_%n months ago_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php index f786e1832a2..66af696900e 100644 --- a/lib/l10n/pl.php +++ b/lib/l10n/pl.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serwer internetowy nie jest jeszcze poprawnie skonfigurowany, aby umożliwić synchronizację plików, ponieważ interfejs WebDAV wydaje się być uszkodzony.", "Please double check the <a href='%s'>installation guides</a>." => "Sprawdź ponownie <a href='%s'>przewodniki instalacji</a>.", "%s shared »%s« with you" => "%s Współdzielone »%s« z tobą", +"Sharing %s failed, because the user %s is the item owner" => "Współdzielenie %s nie powiodło się, ponieważ użytkownik %s jest właścicielem elementu", +"Sharing %s failed, because the user %s does not exist" => "Współdzielenie %s nie powiodło się, ponieważ użytkownik %s nie istnieje", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Współdzielenie %s nie powiodło się, ponieważ użytkownik %s nie jest członkiem żadnej grupy której członkiem jest %s", +"Sharing %s failed, because this item is already shared with %s" => "Współdzielenie %s nie powiodło się, ponieważ element jest już współdzielony z %s", +"Sharing %s failed, because the group %s does not exist" => "Współdzielenie %s nie powiodło się, ponieważ grupa %s nie istnieje", +"Sharing %s failed, because %s is not a member of the group %s" => "Współdzielenie %s nie powiodło się, ponieważ %s nie jest członkiem grupy %s", +"Sharing %s failed, because sharing with links is not allowed" => "Współdzielenie %s nie powiodło się, ponieważ współdzielenie z linkami nie jest dozwolone", +"Share type %s is not valid for %s" => "Typ udziału %s nie jest właściwy dla %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Ustawienie uprawnień dla %s nie powiodło się, ponieważ uprawnienia wykraczają poza przydzielone %s", +"Setting permissions for %s failed, because the item was not found" => "Ustawienie uprawnień dla %s nie powiodło się, ponieważ element nie został znaleziony", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Zaplecze do współdzielenia %s musi implementować interfejs OCP\\Share_Backend", +"Sharing backend %s not found" => "Zaplecze %s do współdzielenia nie zostało znalezione", +"Sharing backend for %s not found" => "Zaplecze do współdzielenia %s nie zostało znalezione", +"Sharing %s failed, because the user %s is the original sharer" => "Współdzielenie %s nie powiodło się, ponieważ użytkownik %s jest udostępniającym", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Współdzielenie %s nie powiodło się, ponieważ uprawnienia przekraczają te udzielone %s", +"Sharing %s failed, because resharing is not allowed" => "Współdzielenie %s nie powiodło się, ponieważ ponowne współdzielenie nie jest dozwolone", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Współdzielenie %s nie powiodło się, ponieważ zaplecze współdzielenia dla %s nie mogło znaleźć jego źródła", +"Sharing %s failed, because the file could not be found in the file cache" => "Współdzielenie %s nie powiodło się, ponieważ plik nie może zostać odnaleziony w buforze plików", "Could not find category \"%s\"" => "Nie można odnaleźć kategorii \"%s\"", "seconds ago" => "sekund temu", "_%n minute ago_::_%n minutes ago_" => array("%n minute temu","%n minut temu","%n minut temu"), diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php index 3cc02f76524..d86f7757ae1 100644 --- a/lib/l10n/pt_BR.php +++ b/lib/l10n/pt_BR.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Seu servidor web não está configurado corretamente para permitir sincronização de arquivos porque a interface WebDAV parece estar quebrada.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, confira os <a href='%s'>guias de instalação</a>.", "%s shared »%s« with you" => "%s compartilhou »%s« com você", +"Sharing %s failed, because the user %s is the item owner" => "Compartilhamento %s falhou, porque o usuário %s é o proprietário do item", +"Sharing %s failed, because the user %s does not exist" => "Compartilhamento %s falhou, porque o usuário %s não existe", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Compartilhamento %s falhou, porque o usuário %s não é membro de nenhum grupo que o usuário %s pertença", +"Sharing %s failed, because this item is already shared with %s" => "Compartilhamento %s falhou, porque este ítem já está compartilhado com %s", +"Sharing %s failed, because the group %s does not exist" => "Compartilhamento %s falhou, porque o grupo %s não existe", +"Sharing %s failed, because %s is not a member of the group %s" => "Compartilhamento %s falhou, porque %s não é membro do grupo %s", +"Sharing %s failed, because sharing with links is not allowed" => "Compartilhamento %s falhou, porque compartilhamento com links não é permitido", +"Share type %s is not valid for %s" => "Tipo de compartilhamento %s não é válido para %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Definir permissões para %s falhou, porque as permissões excedem as permissões concedidas a %s", +"Setting permissions for %s failed, because the item was not found" => "Definir permissões para %s falhou, porque o item não foi encontrado", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Compartilhando backend %s deve implementar a interface OCP\\Share_Backend", +"Sharing backend %s not found" => "Compartilhamento backend %s não encontrado", +"Sharing backend for %s not found" => "Compartilhamento backend para %s não encontrado", +"Sharing %s failed, because the user %s is the original sharer" => "Compartilhando %s falhou, porque o usuário %s é o compartilhador original", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Compartilhamento %s falhou, porque as permissões excedem as permissões concedidas a %s", +"Sharing %s failed, because resharing is not allowed" => "Compartilhamento %s falhou, porque recompartilhamentos não são permitidos", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Compartilhamento %s falhou, porque a infra-estrutura de compartilhamento para %s não conseguiu encontrar a sua fonte", +"Sharing %s failed, because the file could not be found in the file cache" => "Compartilhamento %s falhou, porque o arquivo não pôde ser encontrado no cache de arquivos", "Could not find category \"%s\"" => "Impossível localizar categoria \"%s\"", "seconds ago" => "segundos atrás", "_%n minute ago_::_%n minutes ago_" => array("","ha %n minutos"), diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php index 86172b5ab71..eeaa0ddf96b 100644 --- a/lib/l10n/sl.php +++ b/lib/l10n/sl.php @@ -56,6 +56,16 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Spletni stražnik še ni ustrezno nastavljen in ne omogoča usklajevanja, saj je nastavitev WebDAV okvarjena.", "Please double check the <a href='%s'>installation guides</a>." => "Preverite <a href='%s'>navodila namestitve</a>.", "%s shared »%s« with you" => "%s je omogočil souporabo »%s«", +"Sharing %s failed, because the user %s is the item owner" => "Nastavljanje souporabe %s je spodletelo, ker je uporabnik %s lastnik predmeta.", +"Sharing %s failed, because the user %s does not exist" => "Nastavljanje souporabe %s je spodletelo, ker uporabnik %s ne obstaja.", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Nastavljanje souporabe %s je spodletelo, ker uporabnik %s ni član nobene skupine, v kateri je tudi uporabnik %s.", +"Sharing %s failed, because this item is already shared with %s" => "Nastavljanje souporabe %s je spodletela, ker je ima uporabnik %s predmet že v souporabi.", +"Sharing %s failed, because the group %s does not exist" => "Nastavljanje souporabe %s je spodletelo, ker je skupina %s ne obstaja.", +"Sharing %s failed, because %s is not a member of the group %s" => "Nastavljanje souporabe %s je spodletelo, ker uporabnik %s ni član skupine %s.", +"Sharing %s failed, because sharing with links is not allowed" => "Nastavljanje souporabe %s je spodletelo, ker souporaba preko povezave ni dovoljena.", +"Share type %s is not valid for %s" => "Vrsta souporabe %s za %s ni veljavna.", +"Sharing backend %s not found" => "Ozadnjega programa %s za souporabo ni mogoče najti", +"Sharing backend for %s not found" => "Ozadnjega programa za souporabo za %s ni mogoče najti", "Could not find category \"%s\"" => "Kategorije \"%s\" ni mogoče najti.", "seconds ago" => "pred nekaj sekundami", "_%n minute ago_::_%n minutes ago_" => array("pred %n minuto","pred %n minutama","pred %n minutami","pred %n minutami"), diff --git a/lib/l10n/sv.php b/lib/l10n/sv.php index 70ca0bed383..ba63531ad76 100644 --- a/lib/l10n/sv.php +++ b/lib/l10n/sv.php @@ -56,6 +56,24 @@ $TRANSLATIONS = array( "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webbserver är inte korrekt konfigurerad för att tillåta filsynkronisering eftersom WebDAV inte verkar fungera.", "Please double check the <a href='%s'>installation guides</a>." => "Var god kontrollera <a href='%s'>installationsguiden</a>.", "%s shared »%s« with you" => "%s delade »%s« med dig", +"Sharing %s failed, because the user %s is the item owner" => "Delning %s misslyckades därför att användaren %s är den som äger objektet", +"Sharing %s failed, because the user %s does not exist" => "Delning %s misslyckades därför att användaren %s inte existerar", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "Delning %s misslyckades därför att användaren %s inte är medlem i någon utav de grupper som %s är medlem i", +"Sharing %s failed, because this item is already shared with %s" => "Delning %s misslyckades därför att objektet redan är delat med %s", +"Sharing %s failed, because the group %s does not exist" => "Delning %s misslyckades därför att gruppen %s inte existerar", +"Sharing %s failed, because %s is not a member of the group %s" => "Delning %s misslyckades därför att %s inte ingår i gruppen %s", +"Sharing %s failed, because sharing with links is not allowed" => "Delning %s misslyckades därför att delning utav länkar inte är tillåtet", +"Share type %s is not valid for %s" => "Delningstyp %s är inte giltig för %s", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "Misslyckades att sätta rättigheter för %s därför att rättigheterna överskrider de som är tillåtna för %s", +"Setting permissions for %s failed, because the item was not found" => "Att sätta rättigheterna för %s misslyckades därför att objektet inte hittades", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Delningsgränssnittet %s måste implementera gränssnittet OCP\\Share_Backend", +"Sharing backend %s not found" => "Delningsgränssnittet %s hittades inte", +"Sharing backend for %s not found" => "Delningsgränssnittet för %s hittades inte", +"Sharing %s failed, because the user %s is the original sharer" => "Delning %s misslyckades därför att användaren %s är den som delade objektet först", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "Delning %s misslyckades därför att rättigheterna överskrider de rättigheter som är tillåtna för %s", +"Sharing %s failed, because resharing is not allowed" => "Delning %s misslyckades därför att vidaredelning inte är tillåten", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "Delning %s misslyckades därför att delningsgränsnittet för %s inte kunde hitta sin källa", +"Sharing %s failed, because the file could not be found in the file cache" => "Delning %s misslyckades därför att filen inte kunde hittas i filcachen", "Could not find category \"%s\"" => "Kunde inte hitta kategorin \"%s\"", "seconds ago" => "sekunder sedan", "_%n minute ago_::_%n minutes ago_" => array("%n minut sedan","%n minuter sedan"), diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php index 0be1c4b186a..7cc1b155bcd 100644 --- a/lib/l10n/tr.php +++ b/lib/l10n/tr.php @@ -1,7 +1,7 @@ <?php $TRANSLATIONS = array( "App \"%s\" can't be installed because it is not compatible with this version of ownCloud." => "ownCloud yazılımının bu sürümü ile uyumlu olmadığı için \"%s\" uygulaması kurulamaz.", -"No app name specified" => "Uygulama adı belirtimedli", +"No app name specified" => "Uygulama adı belirtilmedi", "Help" => "Yardım", "Personal" => "Kişisel", "Settings" => "Ayarlar", @@ -12,8 +12,8 @@ $TRANSLATIONS = array( "Invalid image" => "Geçersiz resim", "web services under your control" => "kontrolünüzün altındaki web hizmetleri", "ZIP download is turned off." => "ZIP indirmeleri kapatıldı.", -"Files need to be downloaded one by one." => "Dosyaların birer birer indirilmesi gerekmektedir.", -"Back to Files" => "Dosyalara dön", +"Files need to be downloaded one by one." => "Dosyaların tek tek indirilmesi gerekmektedir.", +"Back to Files" => "Dosyalara Dön", "Selected files too large to generate zip file." => "Seçilen dosyalar bir zip dosyası oluşturmak için fazla büyük.", "Please download the files separately in smaller chunks or kindly ask your administrator." => "Dosyaları ayrı ayrı, küçük parçalar halinde indirin veya yöneticinizden yardım isteyin. ", "No source specified when installing app" => "Uygulama kurulurken bir kaynak belirtilmedi", @@ -39,23 +39,41 @@ $TRANSLATIONS = array( "%s enter the database name." => "%s veritabanı adını girin.", "%s you may not use dots in the database name" => "%s veritabanı adında nokta kullanamayabilirsiniz", "MS SQL username and/or password not valid: %s" => "MS SQL kullanıcı adı ve/veya parolası geçersiz: %s", -"You need to enter either an existing account or the administrator." => "Siz veya yönetici mevcut bir hesap girmeli.", +"You need to enter either an existing account or the administrator." => "Mevcut bit hesap ya da yönetici hesabını girmelisiniz.", "MySQL/MariaDB username and/or password not valid" => "MySQL/MariaDB kullanıcı adı ve/veya parolası geçersiz", "DB Error: \"%s\"" => "VT Hatası: \"%s\"", "Offending command was: \"%s\"" => "Saldırgan komut: \"%s\"", "MySQL/MariaDB user '%s'@'localhost' exists already." => "MySQL/MariaDB kullanıcı '%s'@'localhost' zaten mevcut.", "Drop this user from MySQL/MariaDB" => "Bu kullanıcıyı MySQL/MariaDB'dan at (drop)", "MySQL/MariaDB user '%s'@'%%' already exists" => "MySQL/MariaDB kullanıcısı '%s'@'%%' zaten mevcut", -"Drop this user from MySQL/MariaDB." => "Bu kullanıcıyı MySQL/MariaDB'dan at (drop)", +"Drop this user from MySQL/MariaDB." => "Bu kullanıcıyı MySQL/MariaDB'dan at (drop).", "Oracle connection could not be established" => "Oracle bağlantısı kurulamadı", "Oracle username and/or password not valid" => "Oracle kullanıcı adı ve/veya parolası geçerli değil", "Offending command was: \"%s\", name: %s, password: %s" => "Hatalı komut: \"%s\", ad: %s, parola: %s", "PostgreSQL username and/or password not valid" => "PostgreSQL kullanıcı adı ve/veya parolası geçerli değil", "Set an admin username." => "Bir yönetici kullanıcı adı ayarlayın.", "Set an admin password." => "Bir yönetici kullanıcı parolası ayarlayın.", -"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya aktarımı için düzgün bir şekilde yapılandırılmamış. WevDAV arayüzü sorunlu görünüyor.", +"Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya eşitlemesine izin vermek üzere düzgün bir şekilde yapılandırılmamış. WebDAV arayüzü sorunlu görünüyor.", "Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.", "%s shared »%s« with you" => "%s sizinle »%s« paylaşımında bulundu", +"Sharing %s failed, because the user %s is the item owner" => "%s paylaşımı, %s öge sahibi olduğundan başarısız oldu", +"Sharing %s failed, because the user %s does not exist" => "%s paylaşımı, %s kullanıcısı mevcut olmadığından başarısız oldu", +"Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" => "%s paylaşımı, %s kullanıcısının %s üyeliklerinden birine sahip olmadığından başarısız oldu", +"Sharing %s failed, because this item is already shared with %s" => "%s paylaşımı, %s ile zaten paylaşıldığından dolayı başarısız oldu", +"Sharing %s failed, because the group %s does not exist" => "%s paylaşımı, %s grubu mevcut olmadığından başarısız oldu", +"Sharing %s failed, because %s is not a member of the group %s" => "%s paylaşımı, %s kullanıcısı %s grup üyesi olmadığından başarısız oldu", +"Sharing %s failed, because sharing with links is not allowed" => "%s paylaşımı, bağlantılar ile paylaşım izin verilmediğinden başarısız oldu", +"Share type %s is not valid for %s" => "%s paylaşım türü %s için geçerli değil", +"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" => "%s için izinler, izinler %s için verilen izinleri aştığından dolayı ayarlanamadı", +"Setting permissions for %s failed, because the item was not found" => "%s için izinler öge bulunamadığından ayarlanamadı", +"Sharing backend %s must implement the interface OCP\\Share_Backend" => "Paylaşma arka ucu %s OCP\\Share_Backend arayüzünü desteklemeli", +"Sharing backend %s not found" => "Paylaşım arka ucu %s bulunamadı", +"Sharing backend for %s not found" => "%s için paylaşım arka ucu bulunamadı", +"Sharing %s failed, because the user %s is the original sharer" => "%s paylaşımı, %s kullanıcısı özgün paylaşan kişi olduğundan başarısız oldu", +"Sharing %s failed, because the permissions exceed permissions granted to %s" => "%s paylaşımı, izinler %s için verilen izinleri aştığından dolayı başarısız oldu", +"Sharing %s failed, because resharing is not allowed" => "%s paylaşımı, tekrar paylaşımın izin verilmemesinden dolayı başarısız oldu", +"Sharing %s failed, because the sharing backend for %s could not find its source" => "%s paylaşımı, %s için arka ucun kaynağını bulamamasından dolayı başarısız oldu", +"Sharing %s failed, because the file could not be found in the file cache" => "%s paylaşımı, dosyanın dosya önbelleğinde bulunamamasınndan dolayı başarısız oldu", "Could not find category \"%s\"" => "\"%s\" kategorisi bulunamadı", "seconds ago" => "saniyeler önce", "_%n minute ago_::_%n minutes ago_" => array("","%n dakika önce"), @@ -66,7 +84,7 @@ $TRANSLATIONS = array( "last month" => "geçen ay", "_%n month ago_::_%n months ago_" => array("","%n ay önce"), "last year" => "geçen yıl", -"years ago" => "yıl önce", +"years ago" => "yıllar önce", "Only the following characters are allowed in a username: \"a-z\", \"A-Z\", \"0-9\", and \"_.@-\"" => "Kullanıcı adında sadece bu karakterlere izin verilmektedir: \"a-z\", \"A-Z\", \"0-9\", ve \"_.@-\"", "A valid username must be provided" => "Geçerli bir kullanıcı adı mutlaka sağlanmalı", "A valid password must be provided" => "Geçerli bir parola mutlaka sağlanmalı", diff --git a/lib/private/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php index 545c1f95ac7..1bb526e451e 100644 --- a/lib/private/connector/sabre/directory.php +++ b/lib/private/connector/sabre/directory.php @@ -50,10 +50,6 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa */ public function createFile($name, $data = null) { - if (strtolower($name) === 'shared' && empty($this->path)) { - throw new \Sabre_DAV_Exception_Forbidden(); - } - // for chunked upload also updating a existing file is a "createFile" // because we create all the chunks before re-assemble them to the existing file. if (isset($_SERVER['HTTP_OC_CHUNKED'])) { @@ -87,11 +83,6 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa * @return void */ public function createDirectory($name) { - - if (strtolower($name) === 'shared' && empty($this->path)) { - throw new \Sabre_DAV_Exception_Forbidden(); - } - if (!$this->fileView->isCreatable($this->path)) { throw new \Sabre_DAV_Exception_Forbidden(); } @@ -196,10 +187,6 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa */ public function delete() { - if ($this->path === 'Shared') { - throw new \Sabre_DAV_Exception_Forbidden(); - } - if (!$this->info->isDeletable()) { throw new \Sabre_DAV_Exception_Forbidden(); } diff --git a/lib/private/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 1d5b3fce32f..66b50a87552 100644 --- a/lib/private/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -73,13 +73,6 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D // mark file as partial while uploading (ignored by the scanner) $partpath = $this->path . '.ocTransferId' . rand() . '.part'; - // if file is located in /Shared we write the part file to the users - // root folder because we can't create new files in /shared - // we extend the name with a random number to avoid overwriting a existing file - if (dirname($partpath) === 'Shared') { - $partpath = pathinfo($partpath, PATHINFO_FILENAME) . rand() . '.part'; - } - try { $putOkay = $this->fileView->file_put_contents($partpath, $data); if ($putOkay === false) { @@ -150,10 +143,6 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D * @throws Sabre_DAV_Exception_Forbidden */ public function delete() { - if ($this->path === 'Shared') { - throw new \Sabre_DAV_Exception_Forbidden(); - } - if (!$this->info->isDeletable()) { throw new \Sabre_DAV_Exception_Forbidden(); } diff --git a/lib/private/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php index 605684a7793..35cc1679ab6 100644 --- a/lib/private/connector/sabre/objecttree.php +++ b/lib/private/connector/sabre/objecttree.php @@ -115,13 +115,19 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { list($sourceDir,) = \Sabre_DAV_URLUtil::splitPath($sourcePath); list($destinationDir,) = \Sabre_DAV_URLUtil::splitPath($destinationPath); + $isShareMountPoint = false; + list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath( '/' . \OCP\User::getUser() . '/files/' . $sourcePath); + if ($storage instanceof \OC\Files\Storage\Shared && !$internalPath) { + $isShareMountPoint = true; + } + // check update privileges - if (!$this->fileView->isUpdatable($sourcePath)) { + if (!$this->fileView->isUpdatable($sourcePath) && !$isShareMountPoint) { throw new \Sabre_DAV_Exception_Forbidden(); } if ($sourceDir !== $destinationDir) { // for a full move we need update privileges on sourcePath and sourceDir as well as destinationDir - if (ltrim($destinationDir, '/') === '' && strtolower($sourceNode->getName()) === 'shared') { + if (ltrim($destinationDir, '/') === '') { throw new \Sabre_DAV_Exception_Forbidden(); } if (!$this->fileView->isUpdatable($sourceDir)) { diff --git a/lib/private/contactsmanager.php b/lib/private/contactsmanager.php index 1cb3da7098f..4299d88017a 100644 --- a/lib/private/contactsmanager.php +++ b/lib/private/contactsmanager.php @@ -37,7 +37,12 @@ namespace OC { $result = array(); foreach($this->address_books as $address_book) { $r = $address_book->search($pattern, $searchProperties, $options); - $result = array_merge($result, $r); + $contacts = array(); + foreach($r as $c){ + $c['addressbook-key'] = $address_book->getKey(); + $contacts[] = $c; + } + $result = array_merge($result, $contacts); } return $result; diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php index 7e27650c557..434ee495870 100644 --- a/lib/private/files/filesystem.php +++ b/lib/private/files/filesystem.php @@ -374,6 +374,9 @@ class Filesystem { * Returns path like /admin/files */ static public function getRoot() { + if (!self::$defaultInstance) { + return null; + } return self::$defaultInstance->getRoot(); } diff --git a/lib/private/files/mount/manager.php b/lib/private/files/mount/manager.php index ff4a336f347..91460b72730 100644 --- a/lib/private/files/mount/manager.php +++ b/lib/private/files/mount/manager.php @@ -24,6 +24,13 @@ class Manager { } /** + * @param string $mountPoint + */ + public function removeMount($mountPoint) { + unset($this->mounts[$mountPoint]); + } + + /** * Find the mount for $path * * @param $path diff --git a/lib/private/files/mount/mount.php b/lib/private/files/mount/mount.php index 0ce2f5975c7..08d5ddf348b 100644 --- a/lib/private/files/mount/mount.php +++ b/lib/private/files/mount/mount.php @@ -66,6 +66,13 @@ class Mount { } /** + * @param string $mountPoint new mount point + */ + public function setMountPoint($mountPoint) { + $this->mountPoint = $mountPoint; + } + + /** * create the storage that is mounted * * @return \OC\Files\Storage\Storage diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 519ed250b1f..58dfc73dcf3 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -348,7 +348,8 @@ class View { $postFix = (substr($path, -1, 1) === '/') ? '/' : ''; $absolutePath = Filesystem::normalizePath($this->getAbsolutePath($path)); list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix); - if (!$internalPath || $internalPath === '' || $internalPath === '/') { + if (!($storage instanceof \OC\Files\Storage\Shared) && + (!$internalPath || $internalPath === '' || $internalPath === '/')) { // do not allow deleting the storage's root / the mount point // because for some storages it might delete the whole contents // but isn't supposed to work that way @@ -404,11 +405,21 @@ class View { if ($run) { $mp1 = $this->getMountPoint($path1 . $postFix1); $mp2 = $this->getMountPoint($path2 . $postFix2); - if ($mp1 == $mp2) { - list($storage, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); - list(, $internalPath2) = Filesystem::resolvePath($absolutePath2 . $postFix2); - if ($storage) { - $result = $storage->rename($internalPath1, $internalPath2); + list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); + list(, $internalPath2) = Filesystem::resolvePath($absolutePath2 . $postFix2); + // if source and target are on the same storage we can call the rename operation from the + // storage. If it is a "Shared" file/folder we call always the rename operation of the + // shared storage to handle mount point renaming, etc correctly + if ($storage1 instanceof \OC\Files\Storage\Shared) { + if ($storage1) { + $result = $storage1->rename($absolutePath1, $absolutePath2); + \OC_FileProxy::runPostProxies('rename', $absolutePath1, $absolutePath2); + } else { + $result = false; + } + } elseif ($mp1 == $mp2) { + if ($storage1) { + $result = $storage1->rename($internalPath1, $internalPath2); \OC_FileProxy::runPostProxies('rename', $absolutePath1, $absolutePath2); } else { $result = false; @@ -417,7 +428,6 @@ class View { if ($this->is_dir($path1)) { $result = $this->copy($path1, $path2); if ($result === true) { - list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); $result = $storage1->unlink($internalPath1); } } else { @@ -431,7 +441,6 @@ class View { fclose($target); if ($result !== false) { - list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1); $storage1->unlink($internalPath1); } } @@ -972,8 +981,13 @@ class View { $permissions = $subStorage->getPermissions($rootEntry['path']); $subPermissionsCache->set($rootEntry['fileid'], $user, $permissions); } - // do not allow renaming/deleting the mount point - $rootEntry['permissions'] = $permissions & (\OCP\PERMISSION_ALL - (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE)); + // do not allow renaming/deleting the mount point if they are not shared files/folders + // for shared files/folders we use the permissions given by the owner + if ($subStorage instanceof \OC\Files\Storage\Shared) { + $rootEntry['permissions'] = $permissions; + } else { + $rootEntry['permissions'] = $permissions & (\OCP\PERMISSION_ALL - (\OCP\PERMISSION_UPDATE | \OCP\PERMISSION_DELETE)); + } //remove any existing entry with the same name foreach ($files as $i => $file) { @@ -1154,7 +1168,8 @@ class View { * @var \OC\Files\Mount\Mount $mount */ $cache = $mount->getStorage()->getCache(); - if ($internalPath = $cache->getPathById($id)) { + $internalPath = $cache->getPathById($id); + if (is_string($internalPath)) { $fullPath = $mount->getMountPoint() . $internalPath; if (!is_null($path = $this->getRelativePath($fullPath))) { return $path; diff --git a/lib/private/mimetypes.list.php b/lib/private/mimetypes.list.php index 07e2391c116..3fe454f41f1 100644 --- a/lib/private/mimetypes.list.php +++ b/lib/private/mimetypes.list.php @@ -60,6 +60,7 @@ return array( 'epub' => array('application/epub+zip', null), 'exe' => array('application/x-ms-dos-executable', null), 'flac' => array('audio/flac', null), + 'flv' => array('video/x-flv', null), 'gif' => array('image/gif', null), 'gz' => array('application/x-gzip', null), 'gzip' => array('application/x-gzip', null), diff --git a/lib/private/share/constants.php b/lib/private/share/constants.php index 7e4223d10fa..4c398c43c2d 100644 --- a/lib/private/share/constants.php +++ b/lib/private/share/constants.php @@ -26,13 +26,13 @@ class Constants { const SHARE_TYPE_USER = 0; const SHARE_TYPE_GROUP = 1; const SHARE_TYPE_LINK = 3; - const SHARE_TYPE_EMAIL = 4; - const SHARE_TYPE_CONTACT = 5; - const SHARE_TYPE_REMOTE = 6; + const SHARE_TYPE_EMAIL = 4; // ToDo Check if it is still in use otherwise remove it + const SHARE_TYPE_CONTACT = 5; // ToDo Check if it is still in use otherwise remove it + const SHARE_TYPE_REMOTE = 6; // ToDo Check if it is still in use otherwise remove it const FORMAT_NONE = -1; const FORMAT_STATUSES = -2; - const FORMAT_SOURCES = -3; + const FORMAT_SOURCES = -3; // ToDo Check if it is still in use otherwise remove it const TOKEN_LENGTH = 32; // see db_structure.xml diff --git a/lib/private/share/helper.php b/lib/private/share/helper.php index fde55667281..515ec85909a 100644 --- a/lib/private/share/helper.php +++ b/lib/private/share/helper.php @@ -199,4 +199,53 @@ class Helper extends \OC\Share\Constants { $query->execute(); } } + + /** + * @brief get default expire settings defined by the admin + * @return array contains 'defaultExpireDateSet', 'enforceExpireDate', 'expireAfterDays' + */ + public static function getDefaultExpireSetting() { + + $defaultExpireSettings = array('defaultExpireDateSet' => false); + + // get default expire settings + $defaultExpireDate = \OC_Appconfig::getValue('core', 'shareapi_default_expire_date', 'no'); + if ($defaultExpireDate === 'yes') { + $enforceExpireDate = \OC_Appconfig::getValue('core', 'shareapi_enforce_expire_date', 'no'); + $defaultExpireSettings['defaultExpireDateSet'] = true; + $defaultExpireSettings['expireAfterDays'] = (int)\OC_Appconfig::getValue('core', 'shareapi_expire_after_n_days', '7'); + $defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes' ? true : false; + } + + return $defaultExpireSettings; + } + + /** + * @brief calculate expire date + * @param array $defaultExpireSettings contains 'defaultExpireDateSet', 'enforceExpireDate', 'expireAfterDays' + * @param int $creationTime timestamp when the share was created + * @param int $userExpireDate expire timestamp set by the user + * @return mixed integer timestamp or False + */ + public static function calculateExpireDate($defaultExpireSettings, $creationTime, $userExpireDate = null) { + + $expires = false; + + if (isset($defaultExpireSettings['defaultExpireDateSet']) && $defaultExpireSettings['defaultExpireDateSet']) { + $expires = $creationTime + $defaultExpireSettings['expireAfterDays'] * 86400; + } + + + if (isset($userExpireDate)) { + // if the admin decided to enforce the default expire date then we only take + // the user defined expire date of it is before the default expire date + if ($expires && isset($defaultExpireSettings['enforceExpireDate']) && $defaultExpireSettings['enforceExpireDate']) { + $expires = ($userExpireDate < $expires) ? $userExpireDate : $expires; + } else { + $expires = $userExpireDate; + } + } + + return $expires; + } } diff --git a/lib/private/share/share.php b/lib/private/share/share.php index d4f08e8e016..c0ce3a1d8af 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -91,23 +91,25 @@ class Share extends \OC\Share\Constants { /** * Find which users can access a shared item - * @param $path to the file - * @param $user owner of the file - * @param include owner to the list of users with access to the file + * @param string $path to the file + * @param string $ownerUser owner of the file + * @param bool $includeOwner include owner to the list of users with access to the file + * @param bool $returnUserPaths Return an array with the user => path map * @return array * @note $path needs to be relative to user data dir, e.g. 'file.txt' * not '/admin/data/file.txt' */ - public static function getUsersSharingFile($path, $user, $includeOwner = false) { + public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false) { - $shares = array(); + $shares = $sharePaths = $fileTargets = array(); $publicShare = false; $source = -1; $cache = false; - $view = new \OC\Files\View('/' . $user . '/files'); + $view = new \OC\Files\View('/' . $ownerUser . '/files'); if ($view->file_exists($path)) { $meta = $view->getFileInfo($path); + $path = substr($meta->getPath(), strlen('/' . $ownerUser . '/files')); } else { // if the file doesn't exists yet we start with the parent folder $meta = $view->getFileInfo(dirname($path)); @@ -119,10 +121,9 @@ class Share extends \OC\Share\Constants { } while ($source !== -1) { - // Fetch all shares with another user $query = \OC_DB::prepare( - 'SELECT `share_with` + 'SELECT `share_with`, `file_source`, `file_target` FROM `*PREFIX*share` WHERE @@ -136,12 +137,15 @@ class Share extends \OC\Share\Constants { } else { while ($row = $result->fetchRow()) { $shares[] = $row['share_with']; + if ($returnUserPaths) { + $fileTargets[(int) $row['file_source']][$row['share_with']] = $row; + } } } - // We also need to take group shares into account + // We also need to take group shares into account $query = \OC_DB::prepare( - 'SELECT `share_with` + 'SELECT `share_with`, `file_source`, `file_target` FROM `*PREFIX*share` WHERE @@ -156,6 +160,11 @@ class Share extends \OC\Share\Constants { while ($row = $result->fetchRow()) { $usersInGroup = \OC_Group::usersInGroup($row['share_with']); $shares = array_merge($shares, $usersInGroup); + if ($returnUserPaths) { + foreach ($usersInGroup as $user) { + $fileTargets[(int) $row['file_source']][$user] = $row; + } + } } } @@ -188,9 +197,41 @@ class Share extends \OC\Share\Constants { $source = -1; } } + // Include owner in list of users, if requested if ($includeOwner) { - $shares[] = $user; + $shares[] = $ownerUser; + if ($returnUserPaths) { + $sharePaths[$ownerUser] = $path; + } + } + + if ($returnUserPaths) { + $fileTargetIDs = array_keys($fileTargets); + $fileTargetIDs = array_unique($fileTargetIDs); + + if (!empty($fileTargetIDs)) { + $query = \OC_DB::prepare( + 'SELECT `fileid`, `path` + FROM `*PREFIX*filecache` + WHERE `fileid` IN (' . implode(',', $fileTargetIDs) . ')' + ); + $result = $query->execute(); + + if (\OCP\DB::isError($result)) { + \OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR); + } else { + while ($row = $result->fetchRow()) { + foreach ($fileTargets[$row['fileid']] as $uid => $shareData) { + $sharedPath = $shareData['file_target']; + $sharedPath .= substr($path, strlen($row['path']) -5); + $sharePaths[$uid] = $sharedPath; + } + } + } + } + + return $sharePaths; } return array("users" => array_unique($shares), "public" => $publicShare); @@ -212,6 +253,22 @@ class Share extends \OC\Share\Constants { } /** + * Get the items of item type shared with a user + * @param string Item type + * @param sting user id for which user we want the shares + * @param int Format (optional) Format type must be defined by the backend + * @param mixed Parameters (optional) + * @param int Number of items to return (optional) Returns all by default + * @param bool include collections (optional) + * @return Return depends on format + */ + public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE, + $parameters = null, $limit = -1, $includeCollections = false) { + return self::getItems($itemType, null, self::$shareTypeUserAndGroups, $user, null, $format, + $parameters, $limit, $includeCollections); + } + + /** * Get the item of item type shared with the current user * @param string $itemType * @param string $itemTarget @@ -426,40 +483,61 @@ class Share extends \OC\Share\Constants { public static function shareItem($itemType, $itemSource, $shareType, $shareWith, $permissions, $itemSourceName = null) { $uidOwner = \OC_User::getUser(); $sharingPolicy = \OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global'); + $l = \OC_L10N::get('lib'); if (is_null($itemSourceName)) { $itemSourceName = $itemSource; } + // verify that the file exists before we try to share it if ($itemType === 'file' or $itemType === 'folder') { $path = \OC\Files\Filesystem::getPath($itemSource); if (!$path) { - $message = 'Sharing ' . $itemSourceName . ' failed, because the file does not exist'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the file does not exist'; + $message_t = $l->t('Sharing %s failed, because the file does not exist', array($itemSourceName)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + throw new \Exception($message_t); + } + } + + //verify that we don't share a folder which already contains a share mount point + if ($itemType === 'folder') { + $path = '/' . $uidOwner . '/files' . \OC\Files\Filesystem::getPath($itemSource) . '/'; + $mountManager = \OC\Files\Filesystem::getMountManager(); + $mounts = $mountManager->getAll(); + foreach ($mounts as $mountPoint => $mount) { + if ($mount->getStorage() instanceof \OC\Files\Storage\Shared && strpos($mountPoint, $path) === 0) { + $message = 'Sharing "' . $itemSourceName . '" failed, because it contains files shared with you!'; + \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); + throw new \Exception($message); + } + } } // Verify share type and sharing conditions are met if ($shareType === self::SHARE_TYPE_USER) { if ($shareWith == $uidOwner) { - $message = 'Sharing '.$itemSourceName.' failed, because the user '.$shareWith.' is the item owner'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the user %s is the item owner'; + $message_t = $l->t('Sharing %s failed, because the user %s is the item owner', array($itemSourceName, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } if (!\OC_User::userExists($shareWith)) { - $message = 'Sharing '.$itemSourceName.' failed, because the user '.$shareWith.' does not exist'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the user %s does not exist'; + $message_t = $l->t('Sharing %s failed, because the user %s does not exist', array($itemSourceName, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } if ($sharingPolicy == 'groups_only') { $inGroup = array_intersect(\OC_Group::getUserGroups($uidOwner), \OC_Group::getUserGroups($shareWith)); if (empty($inGroup)) { - $message = 'Sharing '.$itemSourceName.' failed, because the user ' - .$shareWith.' is not a member of any groups that '.$uidOwner.' is a member of'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the user ' + .'%s is not a member of any groups that %s is a member of'; + $message_t = $l->t('Sharing %s failed, because the user %s is not a member of any groups that %s is a member of', array($itemSourceName, $shareWith, $uidOwner)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith, $uidOwner), \OC_Log::ERROR); + throw new \Exception($message_t); } } // Check if the item source is already shared with the user, either from the same owner or a different user @@ -469,22 +547,25 @@ class Share extends \OC\Share\Constants { // owner and is not a user share, this use case is for increasing // permissions for a specific user if ($checkExists['uid_owner'] != $uidOwner || $checkExists['share_type'] == $shareType) { - $message = 'Sharing '.$itemSourceName.' failed, because this item is already shared with '.$shareWith; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because this item is already shared with %s'; + $message_t = $l->t('Sharing %s failed, because this item is already shared with %s', array($itemSourceName, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } } } else if ($shareType === self::SHARE_TYPE_GROUP) { if (!\OC_Group::groupExists($shareWith)) { - $message = 'Sharing '.$itemSourceName.' failed, because the group '.$shareWith.' does not exist'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the group %s does not exist'; + $message_t = $l->t('Sharing %s failed, because the group %s does not exist', array($itemSourceName, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } if ($sharingPolicy == 'groups_only' && !\OC_Group::inGroup($uidOwner, $shareWith)) { - $message = 'Sharing '.$itemSourceName.' failed, because ' - .$uidOwner.' is not a member of the group '.$shareWith; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because ' + .'%s is not a member of the group %s'; + $message_t = $l->t('Sharing %s failed, because %s is not a member of the group %s', array($itemSourceName, $uidOwner, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $uidOwner, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } // Check if the item source is already shared with the group, either from the same owner or a different user // The check for each user in the group is done inside the put() function @@ -494,9 +575,10 @@ class Share extends \OC\Share\Constants { // owner and is not a group share, this use case is for increasing // permissions for a specific user if ($checkExists['uid_owner'] != $uidOwner || $checkExists['share_type'] == $shareType) { - $message = 'Sharing '.$itemSourceName.' failed, because this item is already shared with '.$shareWith; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because this item is already shared with %s'; + $message_t = $l->t('Sharing %s failed, because this item is already shared with %s', array($itemSourceName, $shareWith)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } } // Convert share with into an array with the keys group and users @@ -543,15 +625,17 @@ class Share extends \OC\Share\Constants { return false; } } - $message = 'Sharing '.$itemSourceName.' failed, because sharing with links is not allowed'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because sharing with links is not allowed'; + $message_t = $l->t('Sharing %s failed, because sharing with links is not allowed', array($itemSourceName)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + throw new \Exception($message_t); return false; } else { // Future share types need to include their own conditions - $message = 'Share type '.$shareType.' is not valid for '.$itemSource; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Share type %s is not valid for %s'; + $message_t = $l->t('Share type %s is not valid for %s', array($shareType, $itemSource)); + \OC_Log::write('OCP\Share', sprintf($message, $shareType, $itemSource), \OC_Log::ERROR); + throw new \Exception($message_t); } // Put the item into the database return self::put($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, null, null, $itemSourceName); @@ -675,6 +759,7 @@ class Share extends \OC\Share\Constants { * @return Returns true on success or false on failure */ public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) { + $l = \OC_L10N::get('lib'); if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), self::FORMAT_NONE, null, 1, false)) { // Check if this item is a reshare and verify that the permissions @@ -683,10 +768,11 @@ class Share extends \OC\Share\Constants { $query = \OC_DB::prepare('SELECT `permissions` FROM `*PREFIX*share` WHERE `id` = ?', 1); $result = $query->execute(array($item['parent']))->fetchRow(); if (~(int)$result['permissions'] & $permissions) { - $message = 'Setting permissions for '.$itemSource.' failed,' - .' because the permissions exceed permissions granted to '.\OC_User::getUser(); - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Setting permissions for %s failed,' + .' because the permissions exceed permissions granted to %s'; + $message_t = $l->t('Setting permissions for %s failed, because the permissions exceed permissions granted to %s', array($itemSource, \OC_User::getUser())); + \OC_Log::write('OCP\Share', sprintf($message, $itemSource, \OC_User::getUser()), \OC_Log::ERROR); + throw new \Exception($message_t); } } $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?'); @@ -744,9 +830,11 @@ class Share extends \OC\Share\Constants { } return true; } - $message = 'Setting permissions for '.$itemSource.' failed, because the item was not found'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Setting permissions for %s failed, because the item was not found'; + $message_t = $l->t('Setting permissions for %s failed, because the item was not found', array($itemSource)); + + \OC_Log::write('OCP\Share', sprintf($message, $itemSource), \OC_Log::ERROR); + throw new \Exception($message_t); } /** @@ -788,9 +876,20 @@ class Share extends \OC\Share\Constants { * @return bool True if item was expired, false otherwise. */ protected static function expireItem(array $item) { + + // get default expire settings + $defaultSettings = Helper::getDefaultExpireSetting(); + // calculate expire date if (!empty($item['expiration'])) { - $now = new \DateTime(); - $expires = new \DateTime($item['expiration']); + $userDefinedExpire = new \DateTime($item['expiration']); + $userDefinedExpireTimestamp = $userDefinedExpire->getTimestamp(); + } else { + $userDefinedExpireTimestamp = null; + } + $expires = Helper::calculateExpireDate($defaultSettings, $item['stime'], $userDefinedExpireTimestamp); + + if (is_int($expires)) { + $now = time(); if ($now > $expires) { self::unshareItem($item); return true; @@ -809,6 +908,7 @@ class Share extends \OC\Share\Constants { $hookParams = array( 'itemType' => $item['item_type'], 'itemSource' => $item['item_source'], + 'fileSource' => $item['file_source'], 'shareType' => $item['share_type'], 'shareWith' => $item['share_with'], 'itemParent' => $item['parent'], @@ -828,6 +928,7 @@ class Share extends \OC\Share\Constants { * @return \OCP\Share_Backend */ public static function getBackend($itemType) { + $l = \OC_L10N::get('lib'); if (isset(self::$backends[$itemType])) { return self::$backends[$itemType]; } else if (isset(self::$backendTypes[$itemType]['class'])) { @@ -835,20 +936,23 @@ class Share extends \OC\Share\Constants { if (class_exists($class)) { self::$backends[$itemType] = new $class; if (!(self::$backends[$itemType] instanceof \OCP\Share_Backend)) { - $message = 'Sharing backend '.$class.' must implement the interface OCP\Share_Backend'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing backend %s must implement the interface OCP\Share_Backend'; + $message_t = $l->t('Sharing backend %s must implement the interface OCP\Share_Backend', array($class)); + \OC_Log::write('OCP\Share', sprintf($message, $class), \OC_Log::ERROR); + throw new \Exception($message_t); } return self::$backends[$itemType]; } else { - $message = 'Sharing backend '.$class.' not found'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing backend %s not found'; + $message_t = $l->t('Sharing backend %s not found', array($class)); + \OC_Log::write('OCP\Share', sprintf($message, $class), \OC_Log::ERROR); + throw new \Exception($message_t); } } - $message = 'Sharing backend for '.$itemType.' not found'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing backend for %s not found'; + $message_t = $l->t('Sharing backend for %s not found', array($itemType)); + \OC_Log::write('OCP\Share', sprintf($message, $itemType), \OC_Log::ERROR); + throw new \Exception($message_t); } /** @@ -1064,6 +1168,7 @@ class Share extends \OC\Share\Constants { // Filter out duplicate group shares for users with unique targets if ($row['share_type'] == self::$shareTypeGroupUserUnique && isset($items[$row['parent']])) { $row['share_type'] = self::SHARE_TYPE_GROUP; + $row['unique_name'] = true; // remember that we use a unique name for this user $row['share_with'] = $items[$row['parent']]['share_with']; // Remove the parent group share unset($items[$row['parent']]); @@ -1102,10 +1207,6 @@ class Share extends \OC\Share\Constants { // Remove root from file source paths if retrieving own shared items if (isset($uidOwner) && isset($row['path'])) { if (isset($row['parent'])) { - // FIXME: Doesn't always construct the correct path, example: - // Folder '/a/b', share '/a' and '/a/b' to user2 - // user2 reshares /Shared/b and ask for share status of /Shared/a/b - // expected result: path=/Shared/a/b; actual result /Shared/b because of the parent $query = \OC_DB::prepare('SELECT `file_target` FROM `*PREFIX*share` WHERE `id` = ?'); $parentResult = $query->execute(array($row['parent'])); if (\OC_DB::isError($result)) { @@ -1114,7 +1215,7 @@ class Share extends \OC\Share\Constants { \OC_Log::ERROR); } else { $parentRow = $parentResult->fetchRow(); - $tmpPath = '/Shared' . $parentRow['file_target']; + $tmpPath = $parentRow['file_target']; // find the right position where the row path continues from the target path $pos = strrpos($row['path'], $parentRow['file_target']); $subPath = substr($row['path'], $pos); @@ -1256,23 +1357,26 @@ class Share extends \OC\Share\Constants { private static function put($itemType, $itemSource, $shareType, $shareWith, $uidOwner, $permissions, $parentFolder = null, $token = null, $itemSourceName = null) { $backend = self::getBackend($itemType); - + $l = \OC_L10N::get('lib'); // Check if this is a reshare if ($checkReshare = self::getItemSharedWithBySource($itemType, $itemSource, self::FORMAT_NONE, null, true)) { // Check if attempting to share back to owner if ($checkReshare['uid_owner'] == $shareWith && $shareType == self::SHARE_TYPE_USER) { - $message = 'Sharing '.$itemSourceName.' failed, because the user '.$shareWith.' is the original sharer'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the user %s is the original sharer'; + $message_t = $l->t('Sharing %s failed, because the user %s is the original sharer', array($itemSourceName, $shareWith)); + + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $shareWith), \OC_Log::ERROR); + throw new \Exception($message_t); } // Check if share permissions is granted if (self::isResharingAllowed() && (int)$checkReshare['permissions'] & \OCP\PERMISSION_SHARE) { if (~(int)$checkReshare['permissions'] & $permissions) { - $message = 'Sharing '.$itemSourceName - .' failed, because the permissions exceed permissions granted to '.$uidOwner; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the permissions exceed permissions granted to %s'; + $message_t = $l->t('Sharing %s failed, because the permissions exceed permissions granted to %s', array($itemSourceName, $uidOwner)); + + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName, $uidOwner), \OC_Log::ERROR); + throw new \Exception($message_t); } else { // TODO Don't check if inside folder $parent = $checkReshare['id']; @@ -1283,19 +1387,22 @@ class Share extends \OC\Share\Constants { $filePath = $checkReshare['file_target']; } } else { - $message = 'Sharing '.$itemSourceName.' failed, because resharing is not allowed'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because resharing is not allowed'; + $message_t = $l->t('Sharing %s failed, because resharing is not allowed', array($itemSourceName)); + + \OC_Log::write('OCP\Share', sprintf($message, $itemSourceName), \OC_Log::ERROR); + throw new \Exception($message_t); } } else { $parent = null; $suggestedItemTarget = null; $suggestedFileTarget = null; if (!$backend->isValidSource($itemSource, $uidOwner)) { - $message = 'Sharing '.$itemSource.' failed, because the sharing backend for ' - .$itemType.' could not find its source'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the sharing backend for ' + .'%s could not find its source'; + $message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType)); + \OC_Log::write('OCP\Share', sprintf($message, $itemSource, $itemType), \OC_Log::ERROR); + throw new \Exception($message_t); } if ($backend instanceof \OCP\Share_Backend_File_Dependent) { $filePath = $backend->getFilePath($itemSource, $uidOwner); @@ -1306,9 +1413,11 @@ class Share extends \OC\Share\Constants { $fileSource = $meta['fileid']; } if ($fileSource == -1) { - $message = 'Sharing '.$itemSource.' failed, because the file could not be found in the file cache'; - \OC_Log::write('OCP\Share', $message, \OC_Log::ERROR); - throw new \Exception($message); + $message = 'Sharing %s failed, because the file could not be found in the file cache'; + $message_t = $l->t('Sharing %s failed, because the file could not be found in the file cache', array($itemSource)); + + \OC_Log::write('OCP\Share', sprintf($message, $itemSource), \OC_Log::ERROR); + throw new \Exception($message_t); } } else { $filePath = null; @@ -1316,8 +1425,8 @@ class Share extends \OC\Share\Constants { } } $query = \OC_DB::prepare('INSERT INTO `*PREFIX*share` (`item_type`, `item_source`, `item_target`,' - .' `parent`, `share_type`, `share_with`, `uid_owner`, `permissions`, `stime`, `file_source`,' - .' `file_target`, `token`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)'); + .' `share_type`, `share_with`, `uid_owner`, `permissions`, `stime`, `file_source`,' + .' `file_target`, `token`, `parent`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)'); // Share with a group if ($shareType == self::SHARE_TYPE_GROUP) { $groupItemTarget = Helper::generateTarget($itemType, $itemSource, $shareType, $shareWith['group'], @@ -1361,10 +1470,9 @@ class Share extends \OC\Share\Constants { } else { $groupFileTarget = null; } - $query->execute(array($itemType, $itemSource, $groupItemTarget, $parent, $shareType, - $shareWith['group'], $uidOwner, $permissions, time(), $fileSource, $groupFileTarget, $token)); - // Save this id, any extra rows for this group share will need to reference it - $parent = \OC_DB::insertid('*PREFIX*share'); + $queriesToExecute = array(); + $queriesToExecute['groupShare'] = array($itemType, $itemSource, $groupItemTarget, $shareType, + $shareWith['group'], $uidOwner, $permissions, time(), $fileSource, $groupFileTarget, $token, $parent); // Loop through all users of this group in case we need to add an extra row foreach ($shareWith['users'] as $uid) { $itemTarget = Helper::generateTarget($itemType, $itemSource, self::SHARE_TYPE_USER, $uid, @@ -1390,12 +1498,21 @@ class Share extends \OC\Share\Constants { } // Insert an extra row for the group share if the item or file target is unique for this user if ($itemTarget != $groupItemTarget || (isset($fileSource) && $fileTarget != $groupFileTarget)) { - $query->execute(array($itemType, $itemSource, $itemTarget, $parent, + $queriesToExecute[] = array($itemType, $itemSource, $itemTarget, self::$shareTypeGroupUserUnique, $uid, $uidOwner, $permissions, time(), - $fileSource, $fileTarget, $token)); + $fileSource, $fileTarget, $token); $id = \OC_DB::insertid('*PREFIX*share'); } } + $query->execute($queriesToExecute['groupShare']); + // Save this id, any extra rows for this group share will need to reference it + $parent = \OC_DB::insertid('*PREFIX*share'); + unset($queriesToExecute['groupShare']); + foreach ($queriesToExecute as $qe) { + $qe[] = $parent; + $query->execute($qe); + } + \OC_Hook::emit('OCP\Share', 'post_shared', array( 'itemType' => $itemType, 'itemSource' => $itemSource, @@ -1455,8 +1572,8 @@ class Share extends \OC\Share\Constants { } else { $fileTarget = null; } - $query->execute(array($itemType, $itemSource, $itemTarget, $parent, $shareType, $shareWith, $uidOwner, - $permissions, time(), $fileSource, $fileTarget, $token)); + $query->execute(array($itemType, $itemSource, $itemTarget, $shareType, $shareWith, $uidOwner, + $permissions, time(), $fileSource, $fileTarget, $token, $parent)); $id = \OC_DB::insertid('*PREFIX*share'); \OC_Hook::emit('OCP\Share', 'post_shared', array( 'itemType' => $itemType, @@ -1533,9 +1650,9 @@ class Share extends \OC\Share\Constants { $select = '*'; if ($format == self::FORMAT_STATUSES) { if ($fileDependent) { - $select = '`*PREFIX*share`.`id`, `*PREFIX*share`.`parent`, `share_type`, `path`, `storage`, `share_with`, `uid_owner` , `file_source`'; + $select = '`*PREFIX*share`.`id`, `*PREFIX*share`.`parent`, `share_type`, `path`, `storage`, `share_with`, `uid_owner` , `file_source`, `stime`'; } else { - $select = '`id`, `parent`, `share_type`, `share_with`, `uid_owner`, `item_source`'; + $select = '`id`, `parent`, `share_type`, `share_with`, `uid_owner`, `item_source`, `stime`'; } } else { if (isset($uidOwner)) { @@ -1551,7 +1668,7 @@ class Share extends \OC\Share\Constants { if ($fileDependent) { if ($format == \OC_Share_Backend_File::FORMAT_GET_FOLDER_CONTENTS || $format == \OC_Share_Backend_File::FORMAT_FILE_APP_ROOT) { $select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `*PREFIX*share`.`parent`, `uid_owner`, ' - . '`share_type`, `share_with`, `file_source`, `path`, `file_target`, ' + . '`share_type`, `share_with`, `file_source`, `path`, `file_target`, `stime`, ' . '`permissions`, `expiration`, `storage`, `*PREFIX*filecache`.`parent` as `file_parent`, ' . '`name`, `mtime`, `mimetype`, `mimepart`, `size`, `unencrypted_size`, `encrypted`, `etag`, `mail_send`'; } else { diff --git a/lib/private/user/database.php b/lib/private/user/database.php index 994a47011e6..681f03981f5 100644 --- a/lib/private/user/database.php +++ b/lib/private/user/database.php @@ -42,7 +42,9 @@ class OC_User_Database extends OC_User_Backend { /** * @var PasswordHash */ - static private $hasher = null; + private static $hasher = null; + + private $cache = array(); private function getHasher() { if (!self::$hasher) { @@ -51,7 +53,6 @@ class OC_User_Database extends OC_User_Backend { self::$hasher = new PasswordHash(8, $forcePortable); } return self::$hasher; - } /** @@ -64,9 +65,7 @@ class OC_User_Database extends OC_User_Backend { * itself, not in its subclasses. */ public function createUser($uid, $password) { - if ($this->userExists($uid)) { - return false; - } else { + if (!$this->userExists($uid)) { $hasher = $this->getHasher(); $hash = $hasher->HashPassword($password . OC_Config::getValue('passwordsalt', '')); $query = OC_DB::prepare('INSERT INTO `*PREFIX*users` ( `uid`, `password` ) VALUES( ?, ? )'); @@ -74,6 +73,8 @@ class OC_User_Database extends OC_User_Backend { return $result ? true : false; } + + return false; } /** @@ -86,8 +87,13 @@ class OC_User_Database extends OC_User_Backend { public function deleteUser($uid) { // Delete user-group-relation $query = OC_DB::prepare('DELETE FROM `*PREFIX*users` WHERE `uid` = ?'); - $query->execute(array($uid)); - return true; + $result = $query->execute(array($uid)); + + if (isset($this->cache[$uid])) { + unset($this->cache[$uid]); + } + + return $result ? true : false; } /** @@ -103,12 +109,12 @@ class OC_User_Database extends OC_User_Backend { $hasher = $this->getHasher(); $hash = $hasher->HashPassword($password . OC_Config::getValue('passwordsalt', '')); $query = OC_DB::prepare('UPDATE `*PREFIX*users` SET `password` = ? WHERE `uid` = ?'); - $query->execute(array($hash, $uid)); + $result = $query->execute(array($hash, $uid)); - return true; - } else { - return false; + return $result ? true : false; } + + return false; } /** @@ -123,10 +129,12 @@ class OC_User_Database extends OC_User_Backend { if ($this->userExists($uid)) { $query = OC_DB::prepare('UPDATE `*PREFIX*users` SET `displayname` = ? WHERE LOWER(`uid`) = LOWER(?)'); $query->execute(array($displayName, $uid)); + $this->cache[$uid]['displayname'] = $displayName; + return true; - } else { - return false; } + + return false; } /** @@ -135,14 +143,8 @@ class OC_User_Database extends OC_User_Backend { * @return string display name */ public function getDisplayName($uid) { - $query = OC_DB::prepare('SELECT `displayname` FROM `*PREFIX*users` WHERE `uid` = ?'); - $result = $query->execute(array($uid))->fetchAll(); - $displayName = trim($result[0]['displayname'], ' '); - if (!empty($displayName)) { - return $displayName; - } else { - return $uid; - } + $this->loadUser($uid); + return empty($this->cache[$uid]['displayname']) ? $uid : $this->cache[$uid]['displayname']; } /** @@ -185,21 +187,41 @@ class OC_User_Database extends OC_User_Backend { $hasher = $this->getHasher(); if ($hasher->CheckPassword($password . OC_Config::getValue('passwordsalt', ''), $storedHash)) { return $row['uid']; - } else { - return false; - } - } else { //old sha1 based hashing - if (sha1($password) == $storedHash) { - //upgrade to new hashing - $this->setPassword($row['uid'], $password); - return $row['uid']; - } else { - return false; } + + //old sha1 based hashing + } elseif (sha1($password) == $storedHash) { + //upgrade to new hashing + $this->setPassword($row['uid'], $password); + return $row['uid']; } - } else { - return false; } + + return false; + } + + /** + * @brief Load an user in the cache + * @param string $uid the username + * @returns boolean + */ + private function loadUser($uid) { + if (empty($this->cache[$uid])) { + $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)'); + $result = $query->execute(array($uid)); + + if (OC_DB::isError($result)) { + OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR); + return false; + } + + while ($row = $result->fetchRow()) { + $this->cache[$uid]['uid'] = $row['uid']; + $this->cache[$uid]['displayname'] = $row['displayname']; + } + } + + return true; } /** @@ -224,13 +246,8 @@ class OC_User_Database extends OC_User_Backend { * @return boolean */ public function userExists($uid) { - $query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users` WHERE LOWER(`uid`) = LOWER(?)'); - $result = $query->execute(array($uid)); - if (OC_DB::isError($result)) { - OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR); - return false; - } - return $result->fetchOne() > 0; + $this->loadUser($uid); + return !empty($this->cache[$uid]); } /** @@ -241,9 +258,9 @@ class OC_User_Database extends OC_User_Backend { public function getHome($uid) { if ($this->userExists($uid)) { return OC_Config::getValue("datadirectory", OC::$SERVERROOT . "/data") . '/' . $uid; - } else { - return false; } + + return false; } /** @@ -256,7 +273,7 @@ class OC_User_Database extends OC_User_Backend { /** * counts the users in the database * - * @return false|string | bool + * @return int | bool */ public function countUsers() { $query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`'); diff --git a/lib/public/share.php b/lib/public/share.php index 564839e86b6..230a517b5ee 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -64,14 +64,15 @@ class Share extends \OC\Share\Constants { /** * Find which users can access a shared item * @param string $path to the file - * @param string $user owner of the file + * @param string $ownerUser owner of the file * @param bool $includeOwner include owner to the list of users with access to the file + * @param bool $returnUserPaths Return an array with the user => path map * @return array * @note $path needs to be relative to user data dir, e.g. 'file.txt' * not '/admin/data/file.txt' */ - public static function getUsersSharingFile($path, $user, $includeOwner = false) { - return \OC\Share\Share::getUsersSharingFile($path, $user, $includeOwner); + public static function getUsersSharingFile($path, $ownerUser, $includeOwner = false, $returnUserPaths = false) { + return \OC\Share\Share::getUsersSharingFile($path, $ownerUser, $includeOwner, $returnUserPaths); } /** @@ -90,6 +91,22 @@ class Share extends \OC\Share\Constants { } /** + * Get the items of item type shared with a user + * @param string Item type + * @param sting user id for which user we want the shares + * @param int Format (optional) Format type must be defined by the backend + * @param mixed Parameters (optional) + * @param int Number of items to return (optional) Returns all by default + * @param bool include collections (optional) + * @return Return depends on format + */ + public static function getItemsSharedWithUser($itemType, $user, $format = self::FORMAT_NONE, + $parameters = null, $limit = -1, $includeCollections = false) { + + return \OC\Share\Share::getItemsSharedWithUser($itemType, $user, $format, $parameters, $limit, $includeCollections); + } + + /** * Get the item of item type shared with the current user * @param string $itemType * @param string $itemTarget |