diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-03-07 17:14:34 -0500 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-03-07 17:14:34 -0500 |
commit | 48265643446f71abc1bf903ae822c746d5938865 (patch) | |
tree | 8a66504c8dd0997a9cc8aa7631eea834667ee20a /apps | |
parent | 4cb5cb9693a2b5d13905079f2ba7c6300c26d9b2 (diff) | |
parent | 0aa6c1b163c582011f695510b0048e31479eb8a4 (diff) | |
download | nextcloud-server-48265643446f71abc1bf903ae822c746d5938865.tar.gz nextcloud-server-48265643446f71abc1bf903ae822c746d5938865.zip |
Merge branch 'master' into shared-folder-etags
Conflicts:
apps/files_sharing/lib/sharedstorage.php
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/ajax/download.php | 8 | ||||
-rw-r--r-- | apps/files/js/files.js | 5 | ||||
-rw-r--r-- | apps/files/l10n/es.php | 1 | ||||
-rw-r--r-- | apps/files/l10n/sv.php | 1 | ||||
-rw-r--r-- | apps/files/templates/admin.php | 2 | ||||
-rw-r--r-- | apps/files_encryption/l10n/nb_NO.php | 3 | ||||
-rw-r--r-- | apps/files_external/l10n/nb_NO.php | 14 | ||||
-rw-r--r-- | apps/files_external/l10n/sv.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/share/file.php | 23 | ||||
-rw-r--r-- | apps/files_sharing/lib/sharedstorage.php | 19 | ||||
-rw-r--r-- | apps/files_trashbin/index.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/templates/part.breadcrumb.php | 20 | ||||
-rw-r--r-- | apps/user_ldap/group_ldap.php | 17 | ||||
-rw-r--r-- | apps/user_ldap/group_proxy.php | 16 | ||||
-rw-r--r-- | apps/user_ldap/l10n/es.php | 7 | ||||
-rw-r--r-- | apps/user_ldap/l10n/nb_NO.php | 1 | ||||
-rw-r--r-- | apps/user_ldap/l10n/sv.php | 2 | ||||
-rw-r--r-- | apps/user_ldap/settings.php | 12 | ||||
-rw-r--r-- | apps/user_ldap/templates/settings.php | 15 |
19 files changed, 140 insertions, 32 deletions
diff --git a/apps/files/ajax/download.php b/apps/files/ajax/download.php index b9a4ddaf5e7..7c8dcb372e2 100644 --- a/apps/files/ajax/download.php +++ b/apps/files/ajax/download.php @@ -33,4 +33,10 @@ OCP\User::checkLoggedIn(); $files = $_GET["files"]; $dir = $_GET["dir"]; -OC_Files::get($dir, $files, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false); +$files_list = json_decode($files); +// in case we get only a single file +if ($files_list === NULL ) { + $files_list = array($files); +} + +OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 464f7703685..a4ef41c2803 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -220,14 +220,15 @@ $(document).ready(function() { }); $('.download').click('click',function(event) { - var files=getSelectedFiles('name').join(';'); + var files=getSelectedFiles('name'); + var fileslist = JSON.stringify(files); var dir=$('#dir').val()||'/'; OC.Notification.show(t('files','Your download is being prepared. This might take some time if the files are big.')); // use special download URL if provided, e.g. for public shared files if ( (downloadURL = document.getElementById("downloadURL")) ) { window.location=downloadURL.value+"&download&files="+files; } else { - window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: files }); + window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist }); } return false; }); diff --git a/apps/files/l10n/es.php b/apps/files/l10n/es.php index e70a1afd0ef..f702a5b513d 100644 --- a/apps/files/l10n/es.php +++ b/apps/files/l10n/es.php @@ -61,6 +61,7 @@ "From link" => "Desde el enlace", "Deleted files" => "Archivos eliminados", "Cancel upload" => "Cancelar subida", +"You don’t have write permissions here." => "No tienes permisos para escribir aquí.", "Nothing in here. Upload something!" => "Aquí no hay nada. ¡Sube algo!", "Download" => "Descargar", "Unshare" => "Dejar de compartir", diff --git a/apps/files/l10n/sv.php b/apps/files/l10n/sv.php index c02a7818707..ca9610a33c7 100644 --- a/apps/files/l10n/sv.php +++ b/apps/files/l10n/sv.php @@ -61,6 +61,7 @@ "From link" => "Från länk", "Deleted files" => "Raderade filer", "Cancel upload" => "Avbryt uppladdning", +"You don’t have write permissions here." => "Du saknar skrivbehörighet här.", "Nothing in here. Upload something!" => "Ingenting här. Ladda upp något!", "Download" => "Ladda ner", "Unshare" => "Sluta dela", diff --git a/apps/files/templates/admin.php b/apps/files/templates/admin.php index 0ab931a467c..e1ca6afc4ad 100644 --- a/apps/files/templates/admin.php +++ b/apps/files/templates/admin.php @@ -16,7 +16,7 @@ <?php if ($_['allowZipDownload']): ?> checked="checked"<?php endif; ?> /> <label for="allowZipDownload"><?php p($l->t( 'Enable ZIP-download' )); ?></label><br/> - <input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php p($_['maxZipInputSize']) ?>' + <input type="text" name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php p($_['maxZipInputSize']) ?>' title="<?php p($l->t( '0 is unlimited' )); ?>" <?php if (!$_['allowZipDownload']): ?> disabled="disabled"<?php endif; ?> /><br /> <em><?php p($l->t( 'Maximum input size for ZIP files' )); ?> </em><br /> diff --git a/apps/files_encryption/l10n/nb_NO.php b/apps/files_encryption/l10n/nb_NO.php index e52ecb868af..a5e16a03421 100644 --- a/apps/files_encryption/l10n/nb_NO.php +++ b/apps/files_encryption/l10n/nb_NO.php @@ -1,4 +1,7 @@ <?php $TRANSLATIONS = array( "Encryption" => "Kryptering", +"File encryption is enabled." => "Fil-kryptering er aktivert.", +"The following file types will not be encrypted:" => "Følgende filtyper vil ikke bli kryptert:", +"Exclude the following file types from encryption:" => "Ekskluder følgende filtyper fra kryptering:", "None" => "Ingen" ); diff --git a/apps/files_external/l10n/nb_NO.php b/apps/files_external/l10n/nb_NO.php index 65f9e9bbaf1..961ef2b1046 100644 --- a/apps/files_external/l10n/nb_NO.php +++ b/apps/files_external/l10n/nb_NO.php @@ -1,9 +1,21 @@ <?php $TRANSLATIONS = array( +"Access granted" => "Tilgang innvilget", +"Error configuring Dropbox storage" => "Feil ved konfigurering av Dropbox-lagring", +"Grant access" => "Gi tilgang", +"External Storage" => "Ekstern lagring", "Folder name" => "Mappenavn", +"External storage" => "Ekstern lagringsplass", "Configuration" => "Konfigurasjon", "Options" => "Innstillinger", +"Applicable" => "Anvendelig", +"Add storage" => "Legg til lagringsplass", +"None set" => "Ingen valgt", "All Users" => "Alle brukere", "Groups" => "Grupper", "Users" => "Brukere", -"Delete" => "Slett" +"Delete" => "Slett", +"Enable User External Storage" => "Aktiver ekstern lagring for bruker", +"Allow users to mount their own external storage" => "Tillat brukere å koble til egne eksterne lagringsmedium", +"SSL root certificates" => "SSL root-sertifikater", +"Import Root Certificate" => "Importer root-sertifikat" ); diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php index db0ed7a6af3..45d3589228f 100644 --- a/apps/files_external/l10n/sv.php +++ b/apps/files_external/l10n/sv.php @@ -8,9 +8,11 @@ "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varning:</b> Stöd för FTP i PHP är inte aktiverat eller installerat. Montering av FTP-delningar är inte möjligt. Kontakta din systemadministratör för att få det installerat.", "External Storage" => "Extern lagring", "Folder name" => "Mappnamn", +"External storage" => "Extern lagring", "Configuration" => "Konfiguration", "Options" => "Alternativ", "Applicable" => "Tillämplig", +"Add storage" => "Lägg till lagring", "None set" => "Ingen angiven", "All Users" => "Alla användare", "Groups" => "Grupper", diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index b5d506b173b..62948651806 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -73,7 +73,9 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { if ($format == self::FORMAT_SHARED_STORAGE) { // Only 1 item should come through for this format call return array( + 'parent' => $items[key($items)]['parent'], 'path' => $items[key($items)]['path'], + 'storage' => $items[key($items)]['storage'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner'] ); @@ -140,13 +142,28 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $source = \OCP\Share::getItemSharedWith('folder', $folder, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE); if ($source) { $source['path'] = $source['path'].substr($target, strlen($folder)); - return $source; } } else { $source = \OCP\Share::getItemSharedWith('file', $target, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE); - if ($source) { - return $source; + } + if ($source) { + if (isset($source['parent'])) { + $parent = $source['parent']; + while (isset($parent)) { + $query = \OC_DB::prepare('SELECT `parent`, `uid_owner` FROM `*PREFIX*share` WHERE `id` = ?', 1); + $item = $query->execute(array($parent))->fetchRow(); + if (isset($item['parent'])) { + $parent = $item['parent']; + } else { + $fileOwner = $item['uid_owner']; + break; + } + } + } else { + $fileOwner = $source['uid_owner']; } + $source['fileOwner'] = $fileOwner; + return $source; } \OCP\Util::writeLog('files_sharing', 'File source not found for: '.$target, \OCP\Util::ERROR); return false; diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index f1a371b1238..ffd4e5ced22 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -49,15 +49,12 @@ class Shared extends \OC\Files\Storage\Common { if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { $source = \OC_Share_Backend_File::getSource(substr($target, 0, -5)); if ($source) { - $source['path'] = '/'.$source['uid_owner'].'/'.$source['path'].'.part'; + $source['path'] .= '.part'; // All partial files have delete permission $source['permissions'] |= \OCP\PERMISSION_DELETE; } } else { $source = \OC_Share_Backend_File::getSource($target); - if ($source) { - $source['path'] = '/'.$source['uid_owner'].'/'.$source['path']; - } } $this->files[$target] = $source; } @@ -72,8 +69,16 @@ class Shared extends \OC\Files\Storage\Common { private function getSourcePath($target) { $source = $this->getFile($target); if ($source) { - \OC\Files\Filesystem::initMountPoints($source['uid_owner']); - return $source['path']; + if (!isset($source['fullPath'])) { + \OC\Files\Filesystem::initMountPoints($source['fileOwner']); + $mount = \OC\Files\Mount::findByNumericId($source['storage']); + if ($mount) { + $this->files[$target]['fullPath'] = $mount->getMountPoint().$source['path']; + } else { + $this->files[$target]['fullPath'] = false; + } + } + return $this->files[$target]['fullPath']; } return false; } @@ -449,7 +454,7 @@ class Shared extends \OC\Files\Storage\Common { } $source = $this->getFile($path); if ($source) { - return $source['uid_owner']; + return $source['fileOwner']; } return false; } diff --git a/apps/files_trashbin/index.php b/apps/files_trashbin/index.php index 779db9bc31c..24ccd8c4609 100644 --- a/apps/files_trashbin/index.php +++ b/apps/files_trashbin/index.php @@ -95,15 +95,17 @@ foreach (explode('/', $dir) as $i) { } } -$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); +$breadcrumbNav = new OCP\Template('files_trashbin', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb); $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir='); +$breadcrumbNav->assign('home', OCP\Util::linkTo('files', 'index.php')); $list = new OCP\Template('files_trashbin', 'part.list', ''); $list->assign('files', $files); $list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir); $list->assign('downloadURL', OCP\Util::linkTo('files_trashbin', 'download.php') . '?file='.$dir); $list->assign('disableSharing', true); +$list->assign('dirlisting', $dirlisting); $tmpl->assign('dirlisting', $dirlisting); $list->assign('disableDownloadActions', true); $tmpl->assign('breadcrumb', $breadcrumbNav->fetchPage()); diff --git a/apps/files_trashbin/templates/part.breadcrumb.php b/apps/files_trashbin/templates/part.breadcrumb.php new file mode 100644 index 00000000000..2801e04e9ad --- /dev/null +++ b/apps/files_trashbin/templates/part.breadcrumb.php @@ -0,0 +1,20 @@ +<div class="crumb"> + <a href="<?php print_unescaped($_['home']); ?>"> + <img src="<?php print_unescaped(OCP\image_path('core', 'places/home.svg'));?>" class="svg" /> + </a> +</div> +<?php if(count($_["breadcrumb"])):?> + <div class="crumb svg" + data-dir='<?php print_unescaped($_['baseURL']); ?>'> + <a href="<?php p($_['baseURL']); ?>"><?php p($l->t("Deleted Files")); ?></a> + </div> +<?php endif;?> +<?php for($i=0; $i<count($_["breadcrumb"]); $i++): + $crumb = $_["breadcrumb"][$i]; + $dir = str_replace('+', '%20', urlencode($crumb["dir"])); + $dir = str_replace('%2F', '/', $dir); ?> + <div class="crumb <?php if($i == count($_["breadcrumb"])-1) p('last');?> svg" + data-dir='<?php p($dir);?>'> + <a href="<?php p($_['baseURL'].$dir); ?>"><?php p($crumb["name"]); ?></a> + </div> +<?php endfor; diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 4fd4c636913..efa5f8b4fe3 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -210,6 +210,19 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { } /** + * @brief get a list of all display names in a group + * @returns array with display names (value) and user ids(key) + */ + public function displayNamesInGroup($gid, $search, $limit, $offset) { + $users = $this->usersInGroup($gid, $search, $limit, $offset); + $displayNames = array(); + foreach($users as $user) { + $displayNames[$user] = \OC_User::getDisplayName($user); + } + return $displayNames; + } + + /** * @brief get a list of all groups * @returns array with group names * @@ -287,8 +300,6 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface { * compared with OC_USER_BACKEND_CREATE_USER etc. */ public function implementsActions($actions) { - //always returns false, because possible actions are modifying - // actions. We do not write to LDAP, at least for now. - return false; + return (bool)(OC_GROUP_BACKEND_GET_DISPLAYNAME & $actions); } } diff --git a/apps/user_ldap/group_proxy.php b/apps/user_ldap/group_proxy.php index 5aa1aef0e0e..68d2efe3871 100644 --- a/apps/user_ldap/group_proxy.php +++ b/apps/user_ldap/group_proxy.php @@ -136,6 +136,22 @@ class Group_Proxy extends lib\Proxy implements \OCP\GroupInterface { } /** + * @brief get a list of all display names in a group + * @returns array with display names (value) and user ids(key) + */ + public function displayNamesInGroup($gid, $search, $limit, $offset) { + $displayNames = array(); + + foreach($this->backends as $backend) { + $backendUsers = $backend->displayNamesInGroup($gid, $search, $limit, $offset); + if (is_array($backendUsers)) { + $displayNames = array_merge($displayNames, $backendUsers); + } + } + return $displayNames; + } + + /** * @brief get a list of all groups * @returns array with group names * diff --git a/apps/user_ldap/l10n/es.php b/apps/user_ldap/l10n/es.php index c0a444c0c7d..1f0f92e7ac4 100644 --- a/apps/user_ldap/l10n/es.php +++ b/apps/user_ldap/l10n/es.php @@ -15,7 +15,7 @@ "<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it." => "<b>Advertencia:</b> El módulo LDAP de PHP no está instalado, el sistema no funcionará. Por favor consulte al administrador del sistema para instalarlo.", "Server configuration" => "Configuración del Servidor", "Add Server Configuration" => "Agregar configuracion del servidor", -"Host" => "Máquina", +"Host" => "Servidor", "You can omit the protocol, except you require SSL. Then start with ldaps://" => "Puede omitir el protocolo, excepto si requiere SSL. En ese caso, empiece con ldaps://", "Base DN" => "DN base", "One Base DN per line" => "Un DN Base por línea", @@ -48,6 +48,7 @@ "Turn off SSL certificate validation." => "Apagar la validación por certificado SSL.", "If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Si la conexión sólo funciona con esta opción, importe el certificado SSL del servidor LDAP en su servidor ownCloud.", "Not recommended, use for testing only." => "No recomendado, sólo para pruebas.", +"Cache Time-To-Live" => "Cache TTL", "in seconds. A change empties the cache." => "en segundos. Un cambio vacía la cache.", "Directory Settings" => "Configuracion de directorio", "User Display Name Field" => "Campo de nombre de usuario a mostrar", @@ -63,7 +64,11 @@ "Group Search Attributes" => "Atributos de busqueda de grupo", "Group-Member association" => "Asociación Grupo-Miembro", "Special Attributes" => "Atributos especiales", +"Quota Field" => "Cuota", +"Quota Default" => "Cuota por defecto", "in bytes" => "en bytes", +"Email Field" => "E-mail", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Vacío para el nombre de usuario (por defecto). En otro caso, especifique un atributo LDAP/AD.", +"Test Configuration" => "Configuración de prueba", "Help" => "Ayuda" ); diff --git a/apps/user_ldap/l10n/nb_NO.php b/apps/user_ldap/l10n/nb_NO.php index 8aab71354b0..2adab446cb4 100644 --- a/apps/user_ldap/l10n/nb_NO.php +++ b/apps/user_ldap/l10n/nb_NO.php @@ -1,5 +1,6 @@ <?php $TRANSLATIONS = array( "Deletion failed" => "Sletting feilet", +"Host" => "Tjener", "Password" => "Passord", "Group Filter" => "Gruppefilter", "Port" => "Port", diff --git a/apps/user_ldap/l10n/sv.php b/apps/user_ldap/l10n/sv.php index 702912f9c68..12ecc7b1633 100644 --- a/apps/user_ldap/l10n/sv.php +++ b/apps/user_ldap/l10n/sv.php @@ -63,7 +63,9 @@ "Group Search Attributes" => "Gruppsökningsattribut", "Group-Member association" => "Attribut för gruppmedlemmar", "Special Attributes" => "Specialattribut", +"Quota Field" => "Kvotfält", "in bytes" => "i bytes", +"Email Field" => "E-postfält", "Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Lämnas tomt för användarnamn (standard). Ange annars ett LDAP/AD-attribut.", "Help" => "Hjälp" ); diff --git a/apps/user_ldap/settings.php b/apps/user_ldap/settings.php index c55a718a82a..05497ae8a33 100644 --- a/apps/user_ldap/settings.php +++ b/apps/user_ldap/settings.php @@ -42,17 +42,7 @@ OCP\Util::addstyle('user_ldap', 'settings'); $tmpl = new OCP\Template('user_ldap', 'settings'); $prefixes = \OCA\user_ldap\lib\Helper::getServerConfigurationPrefixes(); -$scoHtml = ''; -$i = 1; -$sel = ' selected'; -foreach($prefixes as $prefix) { - $scoHtml .= '<option value="'.$prefix.'"'.$sel.'>'.$i++.'. Server</option>'; - $sel = ''; -} -if(count($prefixes) == 0) { - $scoHtml .= '<option value="" selected>1. Server</option>'; -} -$tmpl->assign('serverConfigurationOptions', $scoHtml); +$tmpl->assign('serverConfigurationPrefixes', $prefixes); // assign default values if(!isset($ldap)) { diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index cd004cec4b3..d3c2c298904 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -14,7 +14,20 @@ <fieldset id="ldapSettings-1"> <p><label for="ldap_serverconfig_chooser"><?php p($l->t('Server configuration'));?></label> <select id="ldap_serverconfig_chooser" name="ldap_serverconfig_chooser"> - <?php p($_['serverConfigurationOptions']); ?> + <?php if(count($_['serverConfigurationPrefixes']) == 0 ) { + ?> + <option value="" selected>1. Server</option>'); + <?php + } else { + $i = 1; + $sel = ' selected'; + foreach($_['serverConfigurationPrefixes'] as $prefix) { + ?> + <option value="<?php p($prefix); ?>"<?php p($sel); ?>><?php p($i++); ?>. Server</option> + <?php + } + } + ?> <option value="NEW"><?php p($l->t('Add Server Configuration'));?></option> </select> <button id="ldap_action_delete_configuration" |