mirror of
https://github.com/nextcloud/server.git
synced 2024-08-28 17:55:03 +02:00
Merge branch 'master' into quota-space-root
This commit is contained in:
commit
e6df86f4cb
@ -139,7 +139,8 @@ if (strpos($dir, '..') === false) {
|
||||
'originalname' => $files['tmp_name'][$i],
|
||||
'uploadMaxFilesize' => $maxUploadFileSize,
|
||||
'maxHumanFilesize' => $maxHumanFileSize,
|
||||
'permissions' => $meta['permissions'] & $allowedPermissions
|
||||
'permissions' => $meta['permissions'] & $allowedPermissions,
|
||||
'directory' => \OC\Files\Filesystem::normalizePath(stripslashes($dir)),
|
||||
);
|
||||
}
|
||||
|
||||
@ -166,7 +167,8 @@ if (strpos($dir, '..') === false) {
|
||||
'originalname' => $files['tmp_name'][$i],
|
||||
'uploadMaxFilesize' => $maxUploadFileSize,
|
||||
'maxHumanFilesize' => $maxHumanFileSize,
|
||||
'permissions' => $meta['permissions'] & $allowedPermissions
|
||||
'permissions' => $meta['permissions'] & $allowedPermissions,
|
||||
'directory' => \OC\Files\Filesystem::normalizePath(stripslashes($dir)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -435,10 +435,9 @@ window.FileList={
|
||||
tr.attr('data-file', newname);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(oldname), encodeURIComponent(newname)));
|
||||
var basename = newname;
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') {
|
||||
var basename=newname.substr(0,newname.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename=newname;
|
||||
basename = newname.substr(0,newname.lastIndexOf('.'));
|
||||
}
|
||||
td.find('a.name span.nametext').text(basename);
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') !== 'dir') {
|
||||
@ -544,10 +543,9 @@ window.FileList={
|
||||
td.children('a.name .span').text(newName);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(oldName), encodeURIComponent(newName)));
|
||||
var basename = newName;
|
||||
if (newName.indexOf('.') > 0) {
|
||||
var basename = newName.substr(0, newName.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename = newName;
|
||||
basename = newName.substr(0, newName.lastIndexOf('.'));
|
||||
}
|
||||
td.children('a.name').empty();
|
||||
var span = $('<span class="nametext"></span>');
|
||||
@ -924,8 +922,8 @@ $(document).ready(function() {
|
||||
data.context.find('td.filesize').text(humanFileSize(size));
|
||||
|
||||
} else {
|
||||
// only append new file if dragged onto current dir's crumb (last)
|
||||
if (data.context && data.context.hasClass('crumb') && !data.context.hasClass('last')) {
|
||||
// only append new file if uploaded into the current folder
|
||||
if (file.directory !== FileList.getCurrentDirectory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -405,7 +405,7 @@ $(document).ready(function() {
|
||||
Files.resizeBreadcrumbs(width, true);
|
||||
|
||||
// display storage warnings
|
||||
setTimeout ( "Files.displayStorageWarnings()", 100 );
|
||||
setTimeout(Files.displayStorageWarnings, 100);
|
||||
OC.Notification.setDefault(Files.displayStorageWarnings);
|
||||
|
||||
// only possible at the moment if user is logged in
|
||||
|
@ -80,8 +80,15 @@ class Hooks {
|
||||
|
||||
// Check if first-run file migration has already been performed
|
||||
$ready = false;
|
||||
if ($util->getMigrationStatus() === Util::MIGRATION_OPEN) {
|
||||
$migrationStatus = $util->getMigrationStatus();
|
||||
if ($migrationStatus === Util::MIGRATION_OPEN) {
|
||||
$ready = $util->beginMigration();
|
||||
} elseif ($migrationStatus === Util::MIGRATION_IN_PROGRESS) {
|
||||
// refuse login as long as the initial encryption is running
|
||||
while ($migrationStatus === Util::MIGRATION_IN_PROGRESS) {
|
||||
sleep(60);
|
||||
$migrationStatus = $util->getMigrationStatus();
|
||||
}
|
||||
}
|
||||
|
||||
// If migration not yet done
|
||||
|
@ -14,4 +14,7 @@
|
||||
<types>
|
||||
<authentication/>
|
||||
</types>
|
||||
<documentation>
|
||||
<admin>http://doc.owncloud.org/server/6.0/go.php?to=admin-ldap</admin>
|
||||
</documentation>
|
||||
</info>
|
||||
|
@ -240,6 +240,7 @@ var LdapWizard = {
|
||||
LdapWizard.hideSpinner('#ldap_base');
|
||||
LdapWizard.showInfoBox('Please specify a Base DN');
|
||||
LdapWizard.showInfoBox('Could not determine Base DN');
|
||||
$('#ldap_base').prop('disabled', false);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
@ -729,7 +729,7 @@ class Access extends LDAPUtility {
|
||||
}
|
||||
} else {
|
||||
if(!is_null($limit)) {
|
||||
\OCP\Util::writeLog('user_ldap', 'Paged search failed :(', \OCP\Util::INFO);
|
||||
\OCP\Util::writeLog('user_ldap', 'Paged search was not available', \OCP\Util::INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,9 +145,11 @@ interface ILDAPWrapper {
|
||||
* @param $baseDN The DN of the entry to read from
|
||||
* @param $filter An LDAP filter
|
||||
* @param $attr array of the attributes to read
|
||||
* @param $attrsonly optional, 1 if only attribute types shall be returned
|
||||
* @param $limit optional, limits the result entries
|
||||
* @return an LDAP search result resource, false on error
|
||||
*/
|
||||
public function search($link, $baseDN, $filter, $attr);
|
||||
public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0);
|
||||
|
||||
/**
|
||||
* @brief Sets the value of the specified option to be $value
|
||||
|
@ -85,9 +85,9 @@ class LDAP implements ILDAPWrapper {
|
||||
return $this->invokeLDAPMethod('read', $link, $baseDN, $filter, $attr);
|
||||
}
|
||||
|
||||
public function search($link, $baseDN, $filter, $attr) {
|
||||
return $this->invokeLDAPMethod('search', $link, $baseDN,
|
||||
$filter, $attr);
|
||||
public function search($link, $baseDN, $filter, $attr, $attrsonly = 0, $limit = 0) {
|
||||
return $this->invokeLDAPMethod('search', $link, $baseDN, $filter,
|
||||
$attr, $attrsonly, $limit);
|
||||
}
|
||||
|
||||
public function setOption($link, $option, $value) {
|
||||
|
@ -567,6 +567,10 @@ class Wizard extends LDAPUtility {
|
||||
//get a result set > 0 on a proper base
|
||||
$rr = $this->ldap->search($cr, $base, 'objectClass=*', array('dn'), 0, 1);
|
||||
if(!$this->ldap->isResource($rr)) {
|
||||
$errorNo = $this->ldap->errno($cr);
|
||||
$errorMsg = $this->ldap->error($cr);
|
||||
\OCP\Util::writeLog('user_ldap', 'Wiz: Could not search base '.$base.
|
||||
' Error '.$errorNo.': '.$errorMsg, \OCP\Util::INFO);
|
||||
return false;
|
||||
}
|
||||
$entries = $this->ldap->countEntries($cr, $rr);
|
||||
@ -1010,6 +1014,7 @@ class Wizard extends LDAPUtility {
|
||||
$this->configuration->ldapPort);
|
||||
|
||||
$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
$this->ldap->setOption($cr, LDAP_OPT_REFERRALS, 0);
|
||||
$this->ldap->setOption($cr, LDAP_OPT_NETWORK_TIMEOUT, self::LDAP_NW_TIMEOUT);
|
||||
if($this->configuration->ldapTLS === 1) {
|
||||
$this->ldap->startTls($cr);
|
||||
|
@ -120,8 +120,14 @@ $CONFIG = array(
|
||||
/* Password to use for sendmail mail, depends on mail_smtpauth if this is used */
|
||||
"mail_smtppassword" => "",
|
||||
|
||||
/* memcached hostname and port (Only used when xCache, APC and APCu are absent.) */
|
||||
"memcached_server" => array('localhost', 11211),
|
||||
/* memcached servers (Only used when xCache, APC and APCu are absent.) */
|
||||
"memcached_servers" => array(
|
||||
// hostname, port and optional weight. Also see:
|
||||
// http://www.php.net/manual/en/memcached.addservers.php
|
||||
// http://www.php.net/manual/en/memcached.addserver.php
|
||||
array('localhost', 11211),
|
||||
//array('other.host.local', 11211),
|
||||
),
|
||||
|
||||
/* How long should ownCloud keep deleted files in the trash bin, default value: 30 days */
|
||||
'trashbin_retention_obligation' => 30,
|
||||
|
@ -91,7 +91,7 @@ class Controller {
|
||||
$databases['sqlite'] = 'SQLite';
|
||||
}
|
||||
if ($hasMySQL) {
|
||||
$databases['mysql'] = 'MySQL';
|
||||
$databases['mysql'] = 'MySQL/MariaDB';
|
||||
}
|
||||
if ($hasPostgreSQL) {
|
||||
$databases['pgsql'] = 'PostgreSQL';
|
||||
|
@ -72,11 +72,12 @@ class Detection {
|
||||
and function_exists('finfo_file') and $finfo = finfo_open(FILEINFO_MIME)
|
||||
) {
|
||||
$info = @strtolower(finfo_file($finfo, $path));
|
||||
finfo_close($finfo);
|
||||
if ($info) {
|
||||
$mimeType = substr($info, 0, strpos($info, ';'));
|
||||
return empty($mimeType) ? 'application/octet-stream' : $mimeType;
|
||||
}
|
||||
finfo_close($finfo);
|
||||
|
||||
}
|
||||
$isWrapped = (strpos($path, '://') !== false) and (substr($path, 0, 7) === 'file://');
|
||||
if (!$isWrapped and $mimeType === 'application/octet-stream' && function_exists("mime_content_type")) {
|
||||
|
@ -18,8 +18,16 @@ class Memcached extends Cache {
|
||||
parent::__construct($prefix);
|
||||
if (is_null(self::$cache)) {
|
||||
self::$cache = new \Memcached();
|
||||
list($host, $port) = \OC_Config::getValue('memcached_server', array('localhost', 11211));
|
||||
self::$cache->addServer($host, $port);
|
||||
$servers = \OC_Config::getValue('memcached_servers');
|
||||
if (!$servers) {
|
||||
$server = \OC_Config::getValue('memcached_server');
|
||||
if ($server) {
|
||||
$servers = array($server);
|
||||
} else {
|
||||
$servers = array(array('localhost', 11211));
|
||||
}
|
||||
}
|
||||
self::$cache->addServers($servers);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See the COPYING-README file.
|
||||
*/
|
||||
//both, libreoffice backend and php fallback, need imagick
|
||||
if (extension_loaded('imagick')) {
|
||||
if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
|
||||
$isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
|
||||
|
||||
// LibreOffice preview is currently not supported on Windows
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
namespace OC\Preview;
|
||||
|
||||
if (extension_loaded('imagick')) {
|
||||
if (extension_loaded('imagick') && count(\Imagick::queryFormats("PDF")) === 1) {
|
||||
|
||||
class PDF extends Provider {
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
namespace OC\Preview;
|
||||
|
||||
if (extension_loaded('imagick')) {
|
||||
if (extension_loaded('imagick') && count(\Imagick::queryFormats("SVG")) === 1) {
|
||||
|
||||
class SVG extends Provider {
|
||||
|
||||
|
@ -22,7 +22,7 @@ class Unknown extends Provider {
|
||||
|
||||
$svgPath = substr_replace($path, 'svg', -3);
|
||||
|
||||
if (extension_loaded('imagick') && file_exists($svgPath)) {
|
||||
if (extension_loaded('imagick') && file_exists($svgPath) && count(\Imagick::queryFormats("SVG")) === 1) {
|
||||
|
||||
// http://www.php.net/manual/de/imagick.setresolution.php#85284
|
||||
$svg = new \Imagick();
|
||||
|
@ -3,13 +3,13 @@
|
||||
namespace OC\Setup;
|
||||
|
||||
class MySQL extends AbstractDatabase {
|
||||
public $dbprettyname = 'MySQL';
|
||||
public $dbprettyname = 'MySQL/MariaDB';
|
||||
|
||||
public function setupDatabase($username) {
|
||||
//check if the database user has admin right
|
||||
$connection = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword);
|
||||
if(!$connection) {
|
||||
throw new \DatabaseSetupException($this->trans->t('MySQL username and/or password not valid'),
|
||||
throw new \DatabaseSetupException($this->trans->t('MySQL/MariaDB username and/or password not valid'),
|
||||
$this->trans->t('You need to enter either an existing account or the administrator.'));
|
||||
}
|
||||
$oldUser=\OC_Config::getValue('dbuser', false);
|
||||
@ -82,14 +82,14 @@ class MySQL extends AbstractDatabase {
|
||||
$query = "CREATE USER '$name'@'localhost' IDENTIFIED BY '$password'";
|
||||
$result = mysql_query($query, $connection);
|
||||
if (!$result) {
|
||||
throw new \DatabaseSetupException($this->trans->t("MySQL user '%s'@'localhost' exists already.", array($name)),
|
||||
$this->trans->t("Drop this user from MySQL", array($name)));
|
||||
throw new \DatabaseSetupException($this->trans->t("MySQL/MariaDB user '%s'@'localhost' exists already.", array($name)),
|
||||
$this->trans->t("Drop this user from MySQL/MariaDB", array($name)));
|
||||
}
|
||||
$query = "CREATE USER '$name'@'%' IDENTIFIED BY '$password'";
|
||||
$result = mysql_query($query, $connection);
|
||||
if (!$result) {
|
||||
throw new \DatabaseSetupException($this->trans->t("MySQL user '%s'@'%%' already exists", array($name)),
|
||||
$this->trans->t("Drop this user from MySQL."));
|
||||
throw new \DatabaseSetupException($this->trans->t("MySQL/MariaDB user '%s'@'%%' already exists", array($name)),
|
||||
$this->trans->t("Drop this user from MySQL/MariaDB."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ $(document).ready(function(){
|
||||
if(typeof timeout !== 'undefined'){
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
timeout = setTimeout('changeDisplayName()',1000);
|
||||
timeout = setTimeout(changeDisplayName, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
@ -173,7 +173,7 @@ $(document).ready(function(){
|
||||
if(typeof timeout !== 'undefined'){
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
timeout = setTimeout('changeEmailAddress()',1000);
|
||||
timeout = setTimeout(changeEmailAddress, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user