diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-02-28 20:03:06 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-02-28 20:03:06 +0100 |
commit | dee16deacd8a66c423d8b51ccfc23730823e4019 (patch) | |
tree | cc1de2c2ada6291366eb0a4db62fc9510f04cc9c /lib | |
parent | 5f8bd079272c3e568d80bb984a65d9835a6b4393 (diff) | |
parent | a86761e1e720af148da6cbc3fd641da6b57fab5b (diff) | |
download | nextcloud-server-dee16deacd8a66c423d8b51ccfc23730823e4019.tar.gz nextcloud-server-dee16deacd8a66c423d8b51ccfc23730823e4019.zip |
Merge master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/files/cache/cache.php | 3 | ||||
-rw-r--r-- | lib/files/cache/permissions.php | 25 | ||||
-rw-r--r-- | lib/l10n/es_AR.php | 1 | ||||
-rw-r--r-- | lib/l10n/fr.php | 1 | ||||
-rw-r--r-- | lib/l10n/it.php | 1 | ||||
-rw-r--r-- | lib/template.php | 2 | ||||
-rwxr-xr-x | lib/util.php | 11 |
7 files changed, 32 insertions, 12 deletions
diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php index 01e6e788263..f288919df74 100644 --- a/lib/files/cache/cache.php +++ b/lib/files/cache/cache.php @@ -313,6 +313,9 @@ class Cache { } $query = \OC_DB::prepare('DELETE FROM `*PREFIX*filecache` WHERE `fileid` = ?'); $query->execute(array($entry['fileid'])); + + $permissionsCache = new Permissions($this->storageId); + $permissionsCache->remove($entry['fileid']); } /** diff --git a/lib/files/cache/permissions.php b/lib/files/cache/permissions.php index e1735831b94..a5c9c144054 100644 --- a/lib/files/cache/permissions.php +++ b/lib/files/cache/permissions.php @@ -17,10 +17,10 @@ class Permissions { /** * @param \OC\Files\Storage\Storage|string $storage */ - public function __construct($storage){ - if($storage instanceof \OC\Files\Storage\Storage) { + public function __construct($storage) { + if ($storage instanceof \OC\Files\Storage\Storage) { $this->storageId = $storage->getId(); - }else{ + } else { $this->storageId = $storage; } } @@ -52,10 +52,10 @@ class Permissions { public function set($fileId, $user, $permissions) { if (self::get($fileId, $user) !== -1) { $query = \OC_DB::prepare('UPDATE `*PREFIX*permissions` SET `permissions` = ?' - .' WHERE `user` = ? AND `fileid` = ?'); + . ' WHERE `user` = ? AND `fileid` = ?'); } else { $query = \OC_DB::prepare('INSERT INTO `*PREFIX*permissions`(`permissions`, `user`, `fileid`)' - .' VALUES(?, ?,? )'); + . ' VALUES(?, ?,? )'); } $query->execute(array($permissions, $user, $fileId)); } @@ -76,7 +76,7 @@ class Permissions { $inPart = implode(', ', array_fill(0, count($fileIds), '?')); $query = \OC_DB::prepare('SELECT `fileid`, `permissions` FROM `*PREFIX*permissions`' - .' WHERE `fileid` IN (' . $inPart . ') AND `user` = ?'); + . ' WHERE `fileid` IN (' . $inPart . ') AND `user` = ?'); $result = $query->execute($params); $filePermissions = array(); while ($row = $result->fetchRow()) { @@ -91,14 +91,19 @@ class Permissions { * @param int $fileId * @param string $user */ - public function remove($fileId, $user) { - $query = \OC_DB::prepare('DELETE FROM `*PREFIX*permissions` WHERE `fileid` = ? AND `user` = ?'); - $query->execute(array($fileId, $user)); + public function remove($fileId, $user = null) { + if (is_null($user)) { + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*permissions` WHERE `fileid` = ?'); + $query->execute(array($fileId)); + } else { + $query = \OC_DB::prepare('DELETE FROM `*PREFIX*permissions` WHERE `fileid` = ? AND `user` = ?'); + $query->execute(array($fileId, $user)); + } } public function removeMultiple($fileIds, $user) { $query = \OC_DB::prepare('DELETE FROM `*PREFIX*permissions` WHERE `fileid` = ? AND `user` = ?'); - foreach($fileIds as $fileId){ + foreach ($fileIds as $fileId) { $query->execute(array($fileId, $user)); } } diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php index cfe90f6bc1b..ff3d47285fc 100644 --- a/lib/l10n/es_AR.php +++ b/lib/l10n/es_AR.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "Usuario MySQL '%s'@'%%' ya existente", "Drop this user from MySQL." => "Borrar este usuario de MySQL", "Offending command was: \"%s\", name: %s, password: %s" => "El comando no comprendido es: \"%s\", nombre: \"%s\", contraseña: \"%s\"", +"MS SQL username and/or password not valid: %s" => "Nombre de usuario y contraseña de MS SQL no son válidas: %s", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tu servidor web no está configurado todavía para permitir sincronización de archivos porque la interfaz WebDAV parece no funcionar.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, comprobá nuevamente la <a href='%s'>guía de instalación</a>.", "seconds ago" => "hace unos segundos", diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index fc44f976084..9448502df6a 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "L'utilisateur MySQL '%s'@'%%' existe déjà", "Drop this user from MySQL." => "Retirer cet utilisateur de la base MySQL.", "Offending command was: \"%s\", name: %s, password: %s" => "La requête en cause est : \"%s\", nom : %s, mot de passe : %s", +"MS SQL username and/or password not valid: %s" => "Le nom d'utilisateur et/ou le mot de passe de la base MS SQL est invalide : %s", "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>.", "seconds ago" => "à l'instant", diff --git a/lib/l10n/it.php b/lib/l10n/it.php index fa4bac8ec46..297f1efde05 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -34,6 +34,7 @@ "MySQL user '%s'@'%%' already exists" => "L'utente MySQL '%s'@'%%' esiste già", "Drop this user from MySQL." => "Elimina questo utente da MySQL.", "Offending command was: \"%s\", name: %s, password: %s" => "Il comando non consentito era: \"%s\", nome: %s, password: %s", +"MS SQL username and/or password not valid: %s" => "Nome utente e/o password MS SQL non validi: %s", "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>.", "seconds ago" => "secondi fa", diff --git a/lib/template.php b/lib/template.php index 08ad5764ba1..b2d1f0c0292 100644 --- a/lib/template.php +++ b/lib/template.php @@ -147,7 +147,7 @@ function html_select_options($options, $selected, $params=array()) { $label = $label[$label_name]; } $select = in_array($value, $selected) ? ' selected="selected"' : ''; - $html .= '<option value="' . $value . '"' . $select . '>' . $label . '</option>'."\n"; + $html .= '<option value="' . OC_Util::sanitizeHTML($value) . '"' . $select . '>' . OC_Util::sanitizeHTML($label) . '</option>'."\n"; } return $html; } diff --git a/lib/util.php b/lib/util.php index 060db73da00..2e32ee2e3c2 100755 --- a/lib/util.php +++ b/lib/util.php @@ -222,7 +222,16 @@ class OC_Util { 'hint'=>'Please ask your server administrator to install the module.'); $web_server_restart= false; } - + if(!class_exists('DOMDocument')) { + $errors[] = array('error' => 'PHP module dom not installed.<br/>', + 'hint' => 'Please ask your server administrator to install the module.'); + $web_server_restart = false; + } + if(!function_exists('xml_parser_create')) { + $errors[] = array('error' => 'PHP module libxml not installed.<br/>', + 'hint' => 'Please ask your server administrator to install the module.'); + $web_server_restart = false; + } if(!function_exists('mb_detect_encoding')) { $errors[]=array('error'=>'PHP module mb multibyte not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.'); |