Remove unneeded semicolon and parentheses
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
9be6050cc4
commit
a661f043e1
|
@ -193,7 +193,7 @@ class Backend {
|
||||||
'href' => "principal:${row['principaluri']}",
|
'href' => "principal:${row['principaluri']}",
|
||||||
'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '',
|
'commonName' => isset($p['{DAV:}displayname']) ? $p['{DAV:}displayname'] : '',
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'readOnly' => ((int) $row['access'] === self::ACCESS_READ),
|
'readOnly' => (int) $row['access'] === self::ACCESS_READ,
|
||||||
'{http://owncloud.org/ns}principal' => $row['principaluri'],
|
'{http://owncloud.org/ns}principal' => $row['principaluri'],
|
||||||
'{http://owncloud.org/ns}group-share' => is_null($p)
|
'{http://owncloud.org/ns}group-share' => is_null($p)
|
||||||
];
|
];
|
||||||
|
|
|
@ -147,7 +147,7 @@ class SystemTagsObjectMappingCollection implements ICollection {
|
||||||
|
|
||||||
function childExists($tagId) {
|
function childExists($tagId) {
|
||||||
try {
|
try {
|
||||||
$result = ($this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true));
|
$result = $this->tagMapper->haveTag([$this->objectId], $this->objectType, $tagId, true);
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$tags = $this->tagManager->getTagsByIds([$tagId]);
|
$tags = $this->tagManager->getTagsByIds([$tagId]);
|
||||||
|
|
|
@ -211,7 +211,7 @@ class KeyManager {
|
||||||
*/
|
*/
|
||||||
public function recoveryKeyExists() {
|
public function recoveryKeyExists() {
|
||||||
$key = $this->getRecoveryKey();
|
$key = $this->getRecoveryKey();
|
||||||
return (!empty($key));
|
return !empty($key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,7 +57,7 @@ class App {
|
||||||
public static function extendJsConfig($settings) {
|
public static function extendJsConfig($settings) {
|
||||||
$appConfig = json_decode($settings['array']['oc_appconfig'], true);
|
$appConfig = json_decode($settings['array']['oc_appconfig'], true);
|
||||||
|
|
||||||
$maxChunkSize = (int)(\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', (10 * 1024 * 1024)));
|
$maxChunkSize = (int)\OC::$server->getConfig()->getAppValue('files', 'max_chunk_size', 10 * 1024 * 1024);
|
||||||
$appConfig['files'] = [
|
$appConfig['files'] = [
|
||||||
'max_chunk_size' => $maxChunkSize
|
'max_chunk_size' => $maxChunkSize
|
||||||
];
|
];
|
||||||
|
|
|
@ -322,7 +322,7 @@ class Scan extends Base {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function formatExecTime() {
|
protected function formatExecTime() {
|
||||||
list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
|
list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
|
||||||
|
|
||||||
# if you want to have microseconds add this: . '.' . $tens;
|
# if you want to have microseconds add this: . '.' . $tens;
|
||||||
return date('H:i:s', $secs);
|
return date('H:i:s', $secs);
|
||||||
|
|
|
@ -260,7 +260,7 @@ class ScanAppData extends Base {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function formatExecTime() {
|
protected function formatExecTime() {
|
||||||
list($secs, ) = explode('.', sprintf("%.1f", ($this->execTime)));
|
list($secs, ) = explode('.', sprintf("%.1f", $this->execTime));
|
||||||
|
|
||||||
# if you want to have microseconds add this: . '.' . $tens;
|
# if you want to have microseconds add this: . '.' . $tens;
|
||||||
return date('H:i:s', $secs);
|
return date('H:i:s', $secs);
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Admin implements ISettings {
|
||||||
$maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size));
|
$maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size));
|
||||||
|
|
||||||
$parameters = [
|
$parameters = [
|
||||||
'uploadChangable' => (($htaccessWorking and $htaccessWritable) or $userIniWritable ),
|
'uploadChangable' => ($htaccessWorking and $htaccessWritable) or $userIniWritable,
|
||||||
'uploadMaxFilesize' => $maxUploadFilesize,
|
'uploadMaxFilesize' => $maxUploadFilesize,
|
||||||
// max possible makes only sense on a 32 bit system
|
// max possible makes only sense on a 32 bit system
|
||||||
'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4,
|
'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4,
|
||||||
|
|
|
@ -39,7 +39,7 @@ class AccessKey extends AuthMechanism {
|
||||||
->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
|
->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
|
||||||
->setText($l->t('Access key'))
|
->setText($l->t('Access key'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('key', $l->t('Access key'))),
|
new DefinitionParameter('key', $l->t('Access key')),
|
||||||
(new DefinitionParameter('secret', $l->t('Secret key')))
|
(new DefinitionParameter('secret', $l->t('Secret key')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -39,7 +39,7 @@ class OAuth1 extends AuthMechanism {
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('configured', 'configured'))
|
(new DefinitionParameter('configured', 'configured'))
|
||||||
->setType(DefinitionParameter::VALUE_HIDDEN),
|
->setType(DefinitionParameter::VALUE_HIDDEN),
|
||||||
(new DefinitionParameter('app_key', $l->t('App key'))),
|
new DefinitionParameter('app_key', $l->t('App key')),
|
||||||
(new DefinitionParameter('app_secret', $l->t('App secret')))
|
(new DefinitionParameter('app_secret', $l->t('App secret')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
(new DefinitionParameter('token', 'token'))
|
(new DefinitionParameter('token', 'token'))
|
||||||
|
|
|
@ -39,7 +39,7 @@ class OAuth2 extends AuthMechanism {
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('configured', 'configured'))
|
(new DefinitionParameter('configured', 'configured'))
|
||||||
->setType(DefinitionParameter::VALUE_HIDDEN),
|
->setType(DefinitionParameter::VALUE_HIDDEN),
|
||||||
(new DefinitionParameter('client_id', $l->t('Client ID'))),
|
new DefinitionParameter('client_id', $l->t('Client ID')),
|
||||||
(new DefinitionParameter('client_secret', $l->t('Client secret')))
|
(new DefinitionParameter('client_secret', $l->t('Client secret')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
(new DefinitionParameter('token', 'token'))
|
(new DefinitionParameter('token', 'token'))
|
||||||
|
|
|
@ -37,11 +37,11 @@ class OpenStack extends AuthMechanism {
|
||||||
->setScheme(self::SCHEME_OPENSTACK)
|
->setScheme(self::SCHEME_OPENSTACK)
|
||||||
->setText($l->t('OpenStack'))
|
->setText($l->t('OpenStack'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('user', $l->t('Username'))),
|
new DefinitionParameter('user', $l->t('Username')),
|
||||||
(new DefinitionParameter('password', $l->t('Password')))
|
(new DefinitionParameter('password', $l->t('Password')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
(new DefinitionParameter('tenant', $l->t('Tenant name'))),
|
new DefinitionParameter('tenant', $l->t('Tenant name')),
|
||||||
(new DefinitionParameter('url', $l->t('Identity endpoint URL'))),
|
new DefinitionParameter('url', $l->t('Identity endpoint URL')),
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Rackspace extends AuthMechanism {
|
||||||
->setScheme(self::SCHEME_OPENSTACK)
|
->setScheme(self::SCHEME_OPENSTACK)
|
||||||
->setText($l->t('Rackspace'))
|
->setText($l->t('Rackspace'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('user', $l->t('Username'))),
|
new DefinitionParameter('user', $l->t('Username')),
|
||||||
(new DefinitionParameter('key', $l->t('API key')))
|
(new DefinitionParameter('key', $l->t('API key')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
])
|
])
|
||||||
|
|
|
@ -37,7 +37,7 @@ class Password extends AuthMechanism {
|
||||||
->setScheme(self::SCHEME_PASSWORD)
|
->setScheme(self::SCHEME_PASSWORD)
|
||||||
->setText($l->t('Username and password'))
|
->setText($l->t('Username and password'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('user', $l->t('Username'))),
|
new DefinitionParameter('user', $l->t('Username')),
|
||||||
(new DefinitionParameter('password', $l->t('Password')))
|
(new DefinitionParameter('password', $l->t('Password')))
|
||||||
->setType(DefinitionParameter::VALUE_PASSWORD),
|
->setType(DefinitionParameter::VALUE_PASSWORD),
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -47,8 +47,8 @@ class RSA extends AuthMechanism {
|
||||||
->setScheme(self::SCHEME_PUBLICKEY)
|
->setScheme(self::SCHEME_PUBLICKEY)
|
||||||
->setText($l->t('RSA public key'))
|
->setText($l->t('RSA public key'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('user', $l->t('Username'))),
|
new DefinitionParameter('user', $l->t('Username')),
|
||||||
(new DefinitionParameter('public_key', $l->t('Public key'))),
|
new DefinitionParameter('public_key', $l->t('Public key')),
|
||||||
(new DefinitionParameter('private_key', 'private_key'))
|
(new DefinitionParameter('private_key', 'private_key'))
|
||||||
->setType(DefinitionParameter::VALUE_HIDDEN),
|
->setType(DefinitionParameter::VALUE_HIDDEN),
|
||||||
])
|
])
|
||||||
|
|
|
@ -42,7 +42,7 @@ class AmazonS3 extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\AmazonS3')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\AmazonS3')
|
||||||
->setText($l->t('Amazon S3'))
|
->setText($l->t('Amazon S3'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('bucket', $l->t('Bucket'))),
|
new DefinitionParameter('bucket', $l->t('Bucket')),
|
||||||
(new DefinitionParameter('hostname', $l->t('Hostname')))
|
(new DefinitionParameter('hostname', $l->t('Hostname')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('port', $l->t('Port')))
|
(new DefinitionParameter('port', $l->t('Port')))
|
||||||
|
|
|
@ -42,7 +42,7 @@ class DAV extends Backend {
|
||||||
->setStorageClass('\OC\Files\Storage\DAV')
|
->setStorageClass('\OC\Files\Storage\DAV')
|
||||||
->setText($l->t('WebDAV'))
|
->setText($l->t('WebDAV'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('URL'))),
|
new DefinitionParameter('host', $l->t('URL')),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('secure', $l->t('Secure https://')))
|
(new DefinitionParameter('secure', $l->t('Secure https://')))
|
||||||
|
|
|
@ -42,7 +42,7 @@ class FTP extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
|
||||||
->setText($l->t('FTP'))
|
->setText($l->t('FTP'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('Host'))),
|
new DefinitionParameter('host', $l->t('Host')),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('secure', $l->t('Secure ftps://')))
|
(new DefinitionParameter('secure', $l->t('Secure ftps://')))
|
||||||
|
|
|
@ -38,7 +38,7 @@ class Local extends Backend {
|
||||||
->setStorageClass('\OC\Files\Storage\Local')
|
->setStorageClass('\OC\Files\Storage\Local')
|
||||||
->setText($l->t('Local'))
|
->setText($l->t('Local'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('datadir', $l->t('Location'))),
|
new DefinitionParameter('datadir', $l->t('Location')),
|
||||||
])
|
])
|
||||||
->setAllowedVisibility(BackendService::VISIBILITY_ADMIN)
|
->setAllowedVisibility(BackendService::VISIBILITY_ADMIN)
|
||||||
->setPriority(BackendService::PRIORITY_DEFAULT + 50)
|
->setPriority(BackendService::PRIORITY_DEFAULT + 50)
|
||||||
|
|
|
@ -40,7 +40,7 @@ class OwnCloud extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
|
||||||
->setText($l->t('Nextcloud'))
|
->setText($l->t('Nextcloud'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('URL'))),
|
new DefinitionParameter('host', $l->t('URL')),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('secure', $l->t('Secure https://')))
|
(new DefinitionParameter('secure', $l->t('Secure https://')))
|
||||||
|
|
|
@ -36,7 +36,7 @@ class SFTP extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
|
||||||
->setText($l->t('SFTP'))
|
->setText($l->t('SFTP'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('Host'))),
|
new DefinitionParameter('host', $l->t('Host')),
|
||||||
(new DefinitionParameter('root', $l->t('Root')))
|
(new DefinitionParameter('root', $l->t('Root')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
])
|
])
|
||||||
|
|
|
@ -38,7 +38,7 @@ class SFTP_Key extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
|
||||||
->setText($l->t('SFTP with secret key login'))
|
->setText($l->t('SFTP with secret key login'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('Host'))),
|
new DefinitionParameter('host', $l->t('Host')),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
])
|
])
|
||||||
|
|
|
@ -44,8 +44,8 @@ class SMB extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
|
||||||
->setText($l->t('SMB / CIFS'))
|
->setText($l->t('SMB / CIFS'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('Host'))),
|
new DefinitionParameter('host', $l->t('Host')),
|
||||||
(new DefinitionParameter('share', $l->t('Share'))),
|
new DefinitionParameter('share', $l->t('Share')),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('domain', $l->t('Domain')))
|
(new DefinitionParameter('domain', $l->t('Domain')))
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SMB_OC extends Backend {
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
|
||||||
->setText($l->t('SMB / CIFS using OC login'))
|
->setText($l->t('SMB / CIFS using OC login'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('Host'))),
|
new DefinitionParameter('host', $l->t('Host')),
|
||||||
(new DefinitionParameter('username_as_share', $l->t('Username as share')))
|
(new DefinitionParameter('username_as_share', $l->t('Username as share')))
|
||||||
->setType(DefinitionParameter::VALUE_BOOLEAN),
|
->setType(DefinitionParameter::VALUE_BOOLEAN),
|
||||||
(new DefinitionParameter('share', $l->t('Share')))
|
(new DefinitionParameter('share', $l->t('Share')))
|
||||||
|
|
|
@ -46,7 +46,7 @@ class Swift extends Backend {
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('region', $l->t('Region')))
|
(new DefinitionParameter('region', $l->t('Region')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
(new DefinitionParameter('bucket', $l->t('Bucket'))),
|
new DefinitionParameter('bucket', $l->t('Bucket')),
|
||||||
(new DefinitionParameter('timeout', $l->t('Request timeout (seconds)')))
|
(new DefinitionParameter('timeout', $l->t('Request timeout (seconds)')))
|
||||||
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
->setFlag(DefinitionParameter::FLAG_OPTIONAL),
|
||||||
])
|
])
|
||||||
|
|
|
@ -150,7 +150,7 @@ class FTP extends StreamWrapper{
|
||||||
*/
|
*/
|
||||||
public static function checkDependencies() {
|
public static function checkDependencies() {
|
||||||
if (function_exists('ftp_login')) {
|
if (function_exists('ftp_login')) {
|
||||||
return(true);
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return array('ftp');
|
return array('ftp');
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,7 @@ class Swift extends \OC\Files\Storage\Common {
|
||||||
|
|
||||||
$bucketUrl = Url::factory($params['bucket']);
|
$bucketUrl = Url::factory($params['bucket']);
|
||||||
if ($bucketUrl->isAbsolute()) {
|
if ($bucketUrl->isAbsolute()) {
|
||||||
$this->bucket = end(($bucketUrl->getPathSegments()));
|
$this->bucket = end($bucketUrl->getPathSegments());
|
||||||
$params['endpoint_url'] = $bucketUrl->addPath('..')->normalizePath();
|
$params['endpoint_url'] = $bucketUrl->addPath('..')->normalizePath();
|
||||||
} else {
|
} else {
|
||||||
$this->bucket = $params['bucket'];
|
$this->bucket = $params['bucket'];
|
||||||
|
|
|
@ -194,7 +194,7 @@ class BackendService {
|
||||||
*/
|
*/
|
||||||
public function getAvailableBackends() {
|
public function getAvailableBackends() {
|
||||||
return array_filter($this->getBackends(), function($backend) {
|
return array_filter($this->getBackends(), function($backend) {
|
||||||
return !($backend->checkDependencies());
|
return !$backend->checkDependencies();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ class Helper {
|
||||||
*/
|
*/
|
||||||
public static function generateUniqueTarget($path, $excludeList, $view) {
|
public static function generateUniqueTarget($path, $excludeList, $view) {
|
||||||
$pathinfo = pathinfo($path);
|
$pathinfo = pathinfo($path);
|
||||||
$ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';
|
$ext = isset($pathinfo['extension']) ? '.'.$pathinfo['extension'] : '';
|
||||||
$name = $pathinfo['filename'];
|
$name = $pathinfo['filename'];
|
||||||
$dir = $pathinfo['dirname'];
|
$dir = $pathinfo['dirname'];
|
||||||
$i = 2;
|
$i = 2;
|
||||||
|
|
|
@ -117,7 +117,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$excludeList = (is_array($exclude)) ? $exclude : array();
|
$excludeList = is_array($exclude) ? $exclude : array();
|
||||||
|
|
||||||
return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
|
return \OCA\Files_Sharing\Helper::generateUniqueTarget($target, $excludeList, $view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ class SharedMount extends MountPoint implements MoveableMount {
|
||||||
*/
|
*/
|
||||||
private function generateUniqueTarget($path, $view, array $mountpoints) {
|
private function generateUniqueTarget($path, $view, array $mountpoints) {
|
||||||
$pathinfo = pathinfo($path);
|
$pathinfo = pathinfo($path);
|
||||||
$ext = (isset($pathinfo['extension'])) ? '.' . $pathinfo['extension'] : '';
|
$ext = isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '';
|
||||||
$name = $pathinfo['filename'];
|
$name = $pathinfo['filename'];
|
||||||
$dir = $pathinfo['dirname'];
|
$dir = $pathinfo['dirname'];
|
||||||
|
|
||||||
|
|
|
@ -873,10 +873,10 @@ class Trashbin {
|
||||||
foreach ($matches as $ma) {
|
foreach ($matches as $ma) {
|
||||||
if ($timestamp) {
|
if ($timestamp) {
|
||||||
$parts = explode('.v', substr($ma['path'], 0, $offset));
|
$parts = explode('.v', substr($ma['path'], 0, $offset));
|
||||||
$versions[] = (end($parts));
|
$versions[] = end($parts);
|
||||||
} else {
|
} else {
|
||||||
$parts = explode('.v', $ma);
|
$parts = explode('.v', $ma);
|
||||||
$versions[] = (end($parts));
|
$versions[] = end($parts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -746,7 +746,7 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
*/
|
*/
|
||||||
private function _createAltInternalOwnCloudNameForGroups($name) {
|
private function _createAltInternalOwnCloudNameForGroups($name) {
|
||||||
$usedNames = $this->groupMapper->getNamesBySearch($name, "", '_%');
|
$usedNames = $this->groupMapper->getNamesBySearch($name, "", '_%');
|
||||||
if(!($usedNames) || count($usedNames) === 0) {
|
if(!$usedNames || count($usedNames) === 0) {
|
||||||
$lastNo = 1; //will become name_2
|
$lastNo = 1; //will become name_2
|
||||||
} else {
|
} else {
|
||||||
natsort($usedNames);
|
natsort($usedNames);
|
||||||
|
@ -842,7 +842,7 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$this->batchApplyUserAttributes($recordsToUpdate);
|
$this->batchApplyUserAttributes($recordsToUpdate);
|
||||||
return $this->fetchList($ldapRecords, (count($attr) > 1));
|
return $this->fetchList($ldapRecords, count($attr) > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -886,7 +886,7 @@ class Access extends LDAPUtility implements IUserTools {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
|
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
|
||||||
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1));
|
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Connection extends LDAPUtility {
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
if(!$this->dontDestruct && $this->ldap->isResource($this->ldapConnectionRes)) {
|
if(!$this->dontDestruct && $this->ldap->isResource($this->ldapConnectionRes)) {
|
||||||
@$this->ldap->unbind($this->ldapConnectionRes);
|
@$this->ldap->unbind($this->ldapConnectionRes);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -73,7 +73,7 @@ class Group_Proxy extends Proxy implements \OCP\GroupInterface, IGroupLDAP {
|
||||||
* @return mixed, the result of the method or false
|
* @return mixed, the result of the method or false
|
||||||
*/
|
*/
|
||||||
protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) {
|
protected function callOnLastSeenOn($gid, $method, $parameters, $passOnWhen) {
|
||||||
$cacheKey = $this->getGroupCacheKey($gid);;
|
$cacheKey = $this->getGroupCacheKey($gid);
|
||||||
$prefix = $this->getFromCache($cacheKey);
|
$prefix = $this->getFromCache($cacheKey);
|
||||||
//in case the uid has been found in the past, try this stored connection first
|
//in case the uid has been found in the past, try this stored connection first
|
||||||
if(!is_null($prefix)) {
|
if(!is_null($prefix)) {
|
||||||
|
|
|
@ -549,7 +549,7 @@ class User_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
|
||||||
| Backend::GET_DISPLAYNAME
|
| Backend::GET_DISPLAYNAME
|
||||||
| Backend::PROVIDE_AVATAR
|
| Backend::PROVIDE_AVATAR
|
||||||
| Backend::COUNT_USERS
|
| Backend::COUNT_USERS
|
||||||
| (((int)$this->access->connection->turnOnPasswordChange === 1)?(Backend::SET_PASSWORD):0)
|
| (((int)$this->access->connection->turnOnPasswordChange === 1)? Backend::SET_PASSWORD :0)
|
||||||
| $this->userPluginManager->getImplementedActions())
|
| $this->userPluginManager->getImplementedActions())
|
||||||
& $actions);
|
& $actions);
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ class Wizard extends LDAPUtility {
|
||||||
$this->applyFind('ldap_display_name', $attr);
|
$this->applyFind('ldap_display_name', $attr);
|
||||||
return $this->result;
|
return $this->result;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced LDAP settings.'));
|
throw new \Exception(self::$l->t('Could not detect user display name attribute. Please specify it yourself in advanced LDAP settings.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ style('user_ldap', 'renewPassword');
|
||||||
<?php p($message); ?><br>
|
<?php p($message); ?><br>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
|
<?php if (isset($_['internalexception']) && $_['internalexception']): ?>
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
<?php p($l->t('An internal error occurred.')); ?><br>
|
<?php p($l->t('An internal error occurred.')); ?><br>
|
||||||
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
|
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
|
||||||
|
|
|
@ -71,10 +71,10 @@ style('user_ldap', 'settings');
|
||||||
print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
|
print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>');
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php require_once(__DIR__ . '/part.wizard-server.php'); ?>
|
<?php require_once __DIR__ . '/part.wizard-server.php'; ?>
|
||||||
<?php require_once(__DIR__ . '/part.wizard-userfilter.php'); ?>
|
<?php require_once __DIR__ . '/part.wizard-userfilter.php'; ?>
|
||||||
<?php require_once(__DIR__ . '/part.wizard-loginfilter.php'); ?>
|
<?php require_once __DIR__ . '/part.wizard-loginfilter.php'; ?>
|
||||||
<?php require_once(__DIR__ . '/part.wizard-groupfilter.php'); ?>
|
<?php require_once __DIR__ . '/part.wizard-groupfilter.php'; ?>
|
||||||
<fieldset id="ldapSettings-1">
|
<fieldset id="ldapSettings-1">
|
||||||
<div id="ldapAdvancedAccordion">
|
<div id="ldapAdvancedAccordion">
|
||||||
<h3><?php p($l->t('Connection Settings'));?></h3>
|
<h3><?php p($l->t('Connection Settings'));?></h3>
|
||||||
|
|
|
@ -87,7 +87,7 @@ class ListApps extends Base {
|
||||||
|
|
||||||
sort($enabledApps);
|
sort($enabledApps);
|
||||||
foreach ($enabledApps as $app) {
|
foreach ($enabledApps as $app) {
|
||||||
$apps['enabled'][$app] = (isset($versions[$app])) ? $versions[$app] : true;
|
$apps['enabled'][$app] = isset($versions[$app]) ? $versions[$app] : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
sort($disabledApps);
|
sort($disabledApps);
|
||||||
|
|
|
@ -121,7 +121,7 @@ class Base extends Command implements CompletionAwareInterface {
|
||||||
} else if ($value === true) {
|
} else if ($value === true) {
|
||||||
return 'true';
|
return 'true';
|
||||||
} else if ($value === null) {
|
} else if ($value === null) {
|
||||||
return ($returnNull) ? null : 'null';
|
return $returnNull ? null : 'null';
|
||||||
} else {
|
} else {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ class ChangeKeyStorageRoot extends Command {
|
||||||
|
|
||||||
$output->writeln("Start to move keys:");
|
$output->writeln("Start to move keys:");
|
||||||
|
|
||||||
if ($this->rootView->is_dir(($oldRoot)) === false) {
|
if ($this->rootView->is_dir($oldRoot) === false) {
|
||||||
$output->writeln("No old keys found: Nothing needs to be moved");
|
$output->writeln("No old keys found: Nothing needs to be moved");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,7 +90,7 @@ class Install extends Command {
|
||||||
|
|
||||||
// ignore the OS X setup warning
|
// ignore the OS X setup warning
|
||||||
if(count($errors) !== 1 ||
|
if(count($errors) !== 1 ||
|
||||||
(string)($errors[0]['error']) !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') {
|
(string)$errors[0]['error'] !== 'Mac OS X is not supported and Nextcloud will not work properly on this platform. Use it at your own risk! ') {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Info extends Base {
|
||||||
$data = [
|
$data = [
|
||||||
'user_id' => $user->getUID(),
|
'user_id' => $user->getUID(),
|
||||||
'display_name' => $user->getDisplayName(),
|
'display_name' => $user->getDisplayName(),
|
||||||
'email' => ($user->getEMailAddress()) ? $user->getEMailAddress() : '',
|
'email' => $user->getEMailAddress() ? $user->getEMailAddress() : '',
|
||||||
'cloud_id' => $user->getCloudId(),
|
'cloud_id' => $user->getCloudId(),
|
||||||
'enabled' => $user->isEnabled(),
|
'enabled' => $user->isEnabled(),
|
||||||
'groups' => $groups,
|
'groups' => $groups,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<?php print_unescaped($_['headers']); ?>
|
<?php print_unescaped($_['headers']); ?>
|
||||||
</head>
|
</head>
|
||||||
<body id="body-public">
|
<body id="body-public">
|
||||||
<?php include('layout.noscript.warning.php'); ?>
|
<?php include 'layout.noscript.warning.php'; ?>
|
||||||
<?php print_unescaped($_['content']); ?>
|
<?php print_unescaped($_['content']); ?>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<?php print_unescaped($_['headers']); ?>
|
<?php print_unescaped($_['headers']); ?>
|
||||||
</head>
|
</head>
|
||||||
<body id="<?php p($_['bodyid']);?>">
|
<body id="<?php p($_['bodyid']);?>">
|
||||||
<?php include('layout.noscript.warning.php'); ?>
|
<?php include 'layout.noscript.warning.php'; ?>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<div class="v-align">
|
<div class="v-align">
|
||||||
<?php if ($_['bodyid'] === 'body-login' ): ?>
|
<?php if ($_['bodyid'] === 'body-login' ): ?>
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
<?php print_unescaped($_['headers']); ?>
|
<?php print_unescaped($_['headers']); ?>
|
||||||
</head>
|
</head>
|
||||||
<body id="<?php p($_['bodyid']);?>">
|
<body id="<?php p($_['bodyid']);?>">
|
||||||
<?php include('layout.noscript.warning.php'); ?>
|
<?php include 'layout.noscript.warning.php'; ?>
|
||||||
<div id="notification-container">
|
<div id="notification-container">
|
||||||
<div id="notification"></div>
|
<div id="notification"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,7 +10,7 @@ script('core', 'merged-login');
|
||||||
<?php if (!empty($_['redirect_url'])) {
|
<?php if (!empty($_['redirect_url'])) {
|
||||||
print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
|
print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
|
||||||
} ?>
|
} ?>
|
||||||
<?php if (isset($_['apacheauthfailed']) && ($_['apacheauthfailed'])): ?>
|
<?php if (isset($_['apacheauthfailed']) && $_['apacheauthfailed']): ?>
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
<?php p($l->t('Server side authentication failed!')); ?><br>
|
<?php p($l->t('Server side authentication failed!')); ?><br>
|
||||||
<small><?php p($l->t('Please contact your administrator.')); ?></small>
|
<small><?php p($l->t('Please contact your administrator.')); ?></small>
|
||||||
|
@ -21,7 +21,7 @@ script('core', 'merged-login');
|
||||||
<?php p($message); ?><br>
|
<?php p($message); ?><br>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if (isset($_['internalexception']) && ($_['internalexception'])): ?>
|
<?php if (isset($_['internalexception']) && $_['internalexception']): ?>
|
||||||
<div class="warning">
|
<div class="warning">
|
||||||
<?php p($l->t('An internal error occurred.')); ?><br>
|
<?php p($l->t('An internal error occurred.')); ?><br>
|
||||||
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
|
<small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
|
||||||
|
|
|
@ -352,7 +352,7 @@ class OC {
|
||||||
$currentVersion = implode('.', \OCP\Util::getVersion());
|
$currentVersion = implode('.', \OCP\Util::getVersion());
|
||||||
|
|
||||||
// if not a core upgrade, then it's apps upgrade
|
// if not a core upgrade, then it's apps upgrade
|
||||||
$isAppsOnlyUpgrade = (version_compare($currentVersion, $installedVersion, '='));
|
$isAppsOnlyUpgrade = version_compare($currentVersion, $installedVersion, '=');
|
||||||
|
|
||||||
$oldTheme = $systemConfig->getValue('theme');
|
$oldTheme = $systemConfig->getValue('theme');
|
||||||
$systemConfig->setValue('theme', '');
|
$systemConfig->setValue('theme', '');
|
||||||
|
@ -603,7 +603,7 @@ class OC {
|
||||||
|
|
||||||
if(!date_default_timezone_set('UTC')) {
|
if(!date_default_timezone_set('UTC')) {
|
||||||
throw new \RuntimeException('Could not set timezone to UTC');
|
throw new \RuntimeException('Could not set timezone to UTC');
|
||||||
};
|
}
|
||||||
|
|
||||||
//try to configure php to enable big file uploads.
|
//try to configure php to enable big file uploads.
|
||||||
//this doesn´t work always depending on the webserver and php configuration.
|
//this doesn´t work always depending on the webserver and php configuration.
|
||||||
|
@ -837,7 +837,7 @@ class OC {
|
||||||
/** @var \OCP\App\ManagerEvent $event */
|
/** @var \OCP\App\ManagerEvent $event */
|
||||||
$jobList = \OC::$server->getJobList();
|
$jobList = \OC::$server->getJobList();
|
||||||
$job = 'OC\\Settings\\RemoveOrphaned';
|
$job = 'OC\\Settings\\RemoveOrphaned';
|
||||||
if(!($jobList->has($job, null))) {
|
if(!$jobList->has($job, null)) {
|
||||||
$jobList->add($job);
|
$jobList->add($job);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -55,7 +55,7 @@ class SQLiteSessionInit implements EventSubscriber {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function postConnect(ConnectionEventArgs $args) {
|
public function postConnect(ConnectionEventArgs $args) {
|
||||||
$sensitive = ($this->caseSensitiveLike) ? 'true' : 'false';
|
$sensitive = $this->caseSensitiveLike ? 'true' : 'false';
|
||||||
$args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive);
|
$args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive);
|
||||||
$args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode);
|
$args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode);
|
||||||
/** @var \PDO $pdo */
|
/** @var \PDO $pdo */
|
||||||
|
|
|
@ -206,7 +206,7 @@ class Cache implements ICache {
|
||||||
$result = $this->connection->executeQuery($sql, [$fileId]);
|
$result = $this->connection->executeQuery($sql, [$fileId]);
|
||||||
$files = $result->fetchAll();
|
$files = $result->fetchAll();
|
||||||
return array_map(function (array $data) {
|
return array_map(function (array $data) {
|
||||||
return self::cacheEntryFromData($data, $this->mimetypeLoader);;
|
return self::cacheEntryFromData($data, $this->mimetypeLoader);
|
||||||
}, $files);
|
}, $files);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -428,7 +428,7 @@ class Scanner extends BasicEmitter implements IScanner {
|
||||||
$exceptionOccurred = false;
|
$exceptionOccurred = false;
|
||||||
$childQueue = [];
|
$childQueue = [];
|
||||||
foreach ($newChildren as $file) {
|
foreach ($newChildren as $file) {
|
||||||
$child = ($path) ? $path . '/' . $file : $file;
|
$child = $path ? $path . '/' . $file : $file;
|
||||||
try {
|
try {
|
||||||
$existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : null;
|
$existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : null;
|
||||||
$data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock);
|
$data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock);
|
||||||
|
@ -467,7 +467,7 @@ class Scanner extends BasicEmitter implements IScanner {
|
||||||
}
|
}
|
||||||
$removedChildren = \array_diff(array_keys($existingChildren), $newChildren);
|
$removedChildren = \array_diff(array_keys($existingChildren), $newChildren);
|
||||||
foreach ($removedChildren as $childName) {
|
foreach ($removedChildren as $childName) {
|
||||||
$child = ($path) ? $path . '/' . $childName : $childName;
|
$child = $path ? $path . '/' . $childName : $childName;
|
||||||
$this->removeFromCache($child);
|
$this->removeFromCache($child);
|
||||||
}
|
}
|
||||||
if ($this->useTransactions) {
|
if ($this->useTransactions) {
|
||||||
|
|
|
@ -154,7 +154,7 @@ class Storage {
|
||||||
public function getAvailability() {
|
public function getAvailability() {
|
||||||
if ($row = self::getStorageById($this->storageId)) {
|
if ($row = self::getStorageById($this->storageId)) {
|
||||||
return [
|
return [
|
||||||
'available' => ((int)$row['available'] === 1),
|
'available' => (int)$row['available'] === 1,
|
||||||
'last_checked' => $row['last_checked']
|
'last_checked' => $row['last_checked']
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -55,7 +55,7 @@ trait S3ConnectionTrait {
|
||||||
|
|
||||||
$this->test = isset($params['test']);
|
$this->test = isset($params['test']);
|
||||||
$this->bucket = $params['bucket'];
|
$this->bucket = $params['bucket'];
|
||||||
$this->timeout = (!isset($params['timeout'])) ? 15 : $params['timeout'];
|
$this->timeout = !isset($params['timeout']) ? 15 : $params['timeout'];
|
||||||
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
|
$params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region'];
|
||||||
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
|
$params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname'];
|
||||||
if (!isset($params['port']) || $params['port'] === '') {
|
if (!isset($params['port']) || $params['port'] === '') {
|
||||||
|
|
|
@ -329,7 +329,7 @@ class Encryption extends Wrapper {
|
||||||
$resultFseek = $this->parentStreamSeek($positionInFile);
|
$resultFseek = $this->parentStreamSeek($positionInFile);
|
||||||
|
|
||||||
// only allow writes on seekable streams, or at the end of the encrypted stream
|
// only allow writes on seekable streams, or at the end of the encrypted stream
|
||||||
if (!($this->readOnly) && ($resultFseek || $positionInFile === $this->size)) {
|
if (!$this->readOnly && ($resultFseek || $positionInFile === $this->size)) {
|
||||||
|
|
||||||
// switch the writeFlag so flush() will write the block
|
// switch the writeFlag so flush() will write the block
|
||||||
$this->writeFlag = true;
|
$this->writeFlag = true;
|
||||||
|
|
|
@ -682,7 +682,7 @@ class View {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$hooks = ($this->file_exists($path)) ? array('update', 'write') : array('create', 'write');
|
$hooks = $this->file_exists($path) ? array('update', 'write') : array('create', 'write');
|
||||||
return $this->basicOperation('file_put_contents', $path, $hooks, $data);
|
return $this->basicOperation('file_put_contents', $path, $hooks, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1245,7 +1245,7 @@ class View {
|
||||||
private function runHooks($hooks, $path, $post = false) {
|
private function runHooks($hooks, $path, $post = false) {
|
||||||
$relativePath = $path;
|
$relativePath = $path;
|
||||||
$path = $this->getHookPath($path);
|
$path = $this->getHookPath($path);
|
||||||
$prefix = ($post) ? 'post_' : '';
|
$prefix = $post ? 'post_' : '';
|
||||||
$run = true;
|
$run = true;
|
||||||
if ($this->shouldEmitHooks($relativePath)) {
|
if ($this->shouldEmitHooks($relativePath)) {
|
||||||
foreach ($hooks as $hook) {
|
foreach ($hooks as $hook) {
|
||||||
|
|
|
@ -149,7 +149,7 @@ class Installer {
|
||||||
}
|
}
|
||||||
|
|
||||||
//run appinfo/install.php
|
//run appinfo/install.php
|
||||||
if((!isset($data['noinstall']) or $data['noinstall']==false)) {
|
if(!isset($data['noinstall']) or $data['noinstall']==false) {
|
||||||
self::includeAppScript($basedir . '/appinfo/install.php');
|
self::includeAppScript($basedir . '/appinfo/install.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class File {
|
||||||
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
|
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
|
||||||
$method = is_string($request->getMethod()) ? $request->getMethod() : '--';
|
$method = is_string($request->getMethod()) ? $request->getMethod() : '--';
|
||||||
if($config->getValue('installed', false)) {
|
if($config->getValue('installed', false)) {
|
||||||
$user = (\OC_User::getUser()) ? \OC_User::getUser() : '--';
|
$user = \OC_User::getUser() ? \OC_User::getUser() : '--';
|
||||||
} else {
|
} else {
|
||||||
$user = '--';
|
$user = '--';
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,7 @@ class ArrayCache extends Cache implements IMemcache {
|
||||||
return $oldValue + $step;
|
return $oldValue + $step;
|
||||||
} else {
|
} else {
|
||||||
$success = $this->add($key, $step);
|
$success = $this->add($key, $step);
|
||||||
return ($success) ? $step : false;
|
return $success ? $step : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class TXT extends Provider {
|
||||||
|
|
||||||
$lines = preg_split("/\r\n|\n|\r/", $content);
|
$lines = preg_split("/\r\n|\n|\r/", $content);
|
||||||
|
|
||||||
$fontSize = ($maxX) ? (int) ((5 / 32) * $maxX) : 5; //5px
|
$fontSize = $maxX ? (int) ((5 / 32) * $maxX) : 5; //5px
|
||||||
$lineSize = ceil($fontSize * 1.25);
|
$lineSize = ceil($fontSize * 1.25);
|
||||||
|
|
||||||
$image = imagecreate($maxX, $maxY);
|
$image = imagecreate($maxX, $maxY);
|
||||||
|
|
|
@ -411,7 +411,7 @@ class PreviewManager implements IPreview {
|
||||||
// Video requires avconv or ffmpeg
|
// Video requires avconv or ffmpeg
|
||||||
if (in_array('OC\Preview\Movie', $this->getEnabledDefaultProvider())) {
|
if (in_array('OC\Preview\Movie', $this->getEnabledDefaultProvider())) {
|
||||||
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
|
$avconvBinary = \OC_Helper::findBinaryPath('avconv');
|
||||||
$ffmpegBinary = ($avconvBinary) ? null : \OC_Helper::findBinaryPath('ffmpeg');
|
$ffmpegBinary = $avconvBinary ? null : \OC_Helper::findBinaryPath('ffmpeg');
|
||||||
|
|
||||||
if ($avconvBinary || $ffmpegBinary) {
|
if ($avconvBinary || $ffmpegBinary) {
|
||||||
// FIXME // a bit hacky but didn't want to use subclasses
|
// FIXME // a bit hacky but didn't want to use subclasses
|
||||||
|
|
|
@ -157,7 +157,7 @@ class MySQL extends AbstractDatabase {
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
$this->logger->logException($ex, [
|
$this->logger->logException($ex, [
|
||||||
|
|
|
@ -154,7 +154,7 @@ class PostgreSQL extends AbstractDatabase {
|
||||||
while ($this->userExists($connection)) {
|
while ($this->userExists($connection)) {
|
||||||
$i++;
|
$i++;
|
||||||
$this->dbUser = $dbUser . $i;
|
$this->dbUser = $dbUser . $i;
|
||||||
};
|
}
|
||||||
|
|
||||||
// create the user
|
// create the user
|
||||||
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
|
$query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'");
|
||||||
|
|
|
@ -168,7 +168,7 @@ class Helper extends \OC\Share\Constants {
|
||||||
if ($defaultExpireDate === 'yes') {
|
if ($defaultExpireDate === 'yes') {
|
||||||
$enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
|
$enforceExpireDate = $config->getAppValue('core', 'shareapi_enforce_expire_date', 'no');
|
||||||
$defaultExpireSettings['defaultExpireDateSet'] = true;
|
$defaultExpireSettings['defaultExpireDateSet'] = true;
|
||||||
$defaultExpireSettings['expireAfterDays'] = (int)($config->getAppValue('core', 'shareapi_expire_after_n_days', '7'));
|
$defaultExpireSettings['expireAfterDays'] = (int)$config->getAppValue('core', 'shareapi_expire_after_n_days', '7');
|
||||||
$defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes';
|
$defaultExpireSettings['enforceExpireDate'] = $enforceExpireDate === 'yes';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1546,8 +1546,8 @@ class Share extends Constants {
|
||||||
'error' => &$error
|
'error' => &$error
|
||||||
);
|
);
|
||||||
|
|
||||||
$preHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget;
|
$preHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
|
||||||
$preHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith;
|
$preHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
|
||||||
|
|
||||||
\OC_Hook::emit('OCP\Share', 'pre_shared', $preHookData);
|
\OC_Hook::emit('OCP\Share', 'pre_shared', $preHookData);
|
||||||
|
|
||||||
|
@ -1559,7 +1559,7 @@ class Share extends Constants {
|
||||||
$sourceId = ($itemType === 'file' || $itemType === 'folder') ? $fileSource : $itemSource;
|
$sourceId = ($itemType === 'file' || $itemType === 'folder') ? $fileSource : $itemSource;
|
||||||
$sourceExists = self::getItemSharedWithBySource($itemType, $sourceId, self::FORMAT_NONE, null, true, $user);
|
$sourceExists = self::getItemSharedWithBySource($itemType, $sourceId, self::FORMAT_NONE, null, true, $user);
|
||||||
|
|
||||||
$userShareType = ($isGroupShare) ? self::$shareTypeGroupUserUnique : $shareType;
|
$userShareType = $isGroupShare ? self::$shareTypeGroupUserUnique : $shareType;
|
||||||
|
|
||||||
if ($sourceExists && $sourceExists['item_source'] === $itemSource) {
|
if ($sourceExists && $sourceExists['item_source'] === $itemSource) {
|
||||||
$fileTarget = $sourceExists['file_target'];
|
$fileTarget = $sourceExists['file_target'];
|
||||||
|
@ -1659,9 +1659,9 @@ class Share extends Constants {
|
||||||
'expirationDate' => $expirationDate,
|
'expirationDate' => $expirationDate,
|
||||||
);
|
);
|
||||||
|
|
||||||
$postHookData['shareWith'] = ($isGroupShare) ? $shareWith['group'] : $shareWith;
|
$postHookData['shareWith'] = $isGroupShare ? $shareWith['group'] : $shareWith;
|
||||||
$postHookData['itemTarget'] = ($isGroupShare) ? $groupItemTarget : $itemTarget;
|
$postHookData['itemTarget'] = $isGroupShare ? $groupItemTarget : $itemTarget;
|
||||||
$postHookData['fileTarget'] = ($isGroupShare) ? $groupFileTarget : $fileTarget;
|
$postHookData['fileTarget'] = $isGroupShare ? $groupFileTarget : $fileTarget;
|
||||||
|
|
||||||
\OC_Hook::emit('OCP\Share', 'post_shared', $postHookData);
|
\OC_Hook::emit('OCP\Share', 'post_shared', $postHookData);
|
||||||
|
|
||||||
|
|
|
@ -536,7 +536,7 @@ class Manager implements IManager {
|
||||||
/** @var \OCA\Files_Sharing\SharedStorage $storage */
|
/** @var \OCA\Files_Sharing\SharedStorage $storage */
|
||||||
$share->setParent($storage->getShareId());
|
$share->setParent($storage->getShareId());
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -219,7 +219,7 @@ class JSConfigHelper {
|
||||||
'versionstring' => \OC_Util::getVersionString(),
|
'versionstring' => \OC_Util::getVersionString(),
|
||||||
'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
|
'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
|
||||||
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
|
'lost_password_link'=> $this->config->getSystemValue('lost_password_link', null),
|
||||||
'modRewriteWorking' => ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true'),
|
'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true',
|
||||||
'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0),
|
'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0),
|
||||||
'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0),
|
'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0),
|
||||||
'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
|
'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
|
||||||
|
|
|
@ -352,7 +352,7 @@ class User implements IUser {
|
||||||
public function setEnabled($enabled) {
|
public function setEnabled($enabled) {
|
||||||
$oldStatus = $this->isEnabled();
|
$oldStatus = $this->isEnabled();
|
||||||
$this->enabled = $enabled;
|
$this->enabled = $enabled;
|
||||||
$enabled = ($enabled) ? 'true' : 'false';
|
$enabled = $enabled ? 'true' : 'false';
|
||||||
if ($oldStatus !== $this->enabled) {
|
if ($oldStatus !== $this->enabled) {
|
||||||
$this->triggerChange('enabled', $enabled);
|
$this->triggerChange('enabled', $enabled);
|
||||||
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled);
|
$this->config->setUserValue($this->uid, 'core', 'enabled', $enabled);
|
||||||
|
|
|
@ -81,7 +81,7 @@ class OC_EventSource implements \OCP\IEventSource {
|
||||||
header('Location: '.\OC::$WEBROOT);
|
header('Location: '.\OC::$WEBROOT);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
if (!(\OC::$server->getRequest()->passesCSRFCheck())) {
|
if (!\OC::$server->getRequest()->passesCSRFCheck()) {
|
||||||
$this->send('error', 'Possible CSRF attack. Connection will be closed.');
|
$this->send('error', 'Possible CSRF attack. Connection will be closed.');
|
||||||
$this->close();
|
$this->close();
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -408,7 +408,7 @@ class OC_Helper {
|
||||||
$it = new RecursiveIteratorIterator($aIt);
|
$it = new RecursiveIteratorIterator($aIt);
|
||||||
|
|
||||||
while ($it->valid()) {
|
while ($it->valid()) {
|
||||||
if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND ($it->current() == $needle)) {
|
if (((isset($index) AND ($it->key() == $index)) OR !isset($index)) AND ($it->current() == $needle)) {
|
||||||
return $aIt->key();
|
return $aIt->key();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -785,12 +785,12 @@ class OC_Image implements \OCP\IImage {
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
$color = @unpack('n', $vide . ($data[$p] ?? ''));
|
$color = @unpack('n', $vide . ($data[$p] ?? ''));
|
||||||
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
|
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
|
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
|
||||||
$color[1] = ($p * 2) % 2 == 0 ? $color[1] >> 4 : $color[1] & 0x0F;
|
$color[1] = ($p * 2) % 2 == 0 ? $color[1] >> 4 : $color[1] & 0x0F;
|
||||||
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
|
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
|
$color = @unpack('n', $vide . ($data[floor($p)] ?? ''));
|
||||||
|
@ -820,7 +820,7 @@ class OC_Image implements \OCP\IImage {
|
||||||
$color[1] = ($color[1] & 0x1);
|
$color[1] = ($color[1] & 0x1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$color[1] = (isset($palette[$color[1] + 1])) ? $palette[$color[1] + 1] : $palette[1];
|
$color[1] = isset($palette[$color[1] + 1]) ? $palette[$color[1] + 1] : $palette[1];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
|
|
|
@ -91,7 +91,7 @@ class OC_JSON{
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(\OC::$server->getRequest()->passesCSRFCheck())) {
|
if( !\OC::$server->getRequest()->passesCSRFCheck()) {
|
||||||
$l = \OC::$server->getL10N('lib');
|
$l = \OC::$server->getL10N('lib');
|
||||||
self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' )));
|
self::error(array( 'data' => array( 'message' => $l->t('Token expired. Please reload page.'), 'error' => 'token_expired' )));
|
||||||
exit();
|
exit();
|
||||||
|
|
|
@ -894,7 +894,7 @@ class OC_Util {
|
||||||
}
|
}
|
||||||
foreach($invalidIniSettings as $setting) {
|
foreach($invalidIniSettings as $setting) {
|
||||||
if(is_bool($setting[1])) {
|
if(is_bool($setting[1])) {
|
||||||
$setting[1] = ($setting[1]) ? 'on' : 'off';
|
$setting[1] = $setting[1] ? 'on' : 'off';
|
||||||
}
|
}
|
||||||
$errors[] = [
|
$errors[] = [
|
||||||
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),
|
'error' => $l->t('PHP setting "%s" is not set to "%s".', [$setting[0], var_export($setting[1], true)]),
|
||||||
|
|
|
@ -101,7 +101,7 @@ class MailSettingsController extends Controller {
|
||||||
$params = get_defined_vars();
|
$params = get_defined_vars();
|
||||||
$configs = [];
|
$configs = [];
|
||||||
foreach($params as $key => $value) {
|
foreach($params as $key => $value) {
|
||||||
$configs[$key] = (empty($value)) ? null : $value;
|
$configs[$key] = empty($value) ? null : $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete passwords from config in case no auth is specified
|
// Delete passwords from config in case no auth is specified
|
||||||
|
|
|
@ -254,7 +254,7 @@ class UsersController extends Controller {
|
||||||
return [
|
return [
|
||||||
'name' => $user->getUID(),
|
'name' => $user->getUID(),
|
||||||
'displayname' => $user->getDisplayName(),
|
'displayname' => $user->getDisplayName(),
|
||||||
'groups' => (empty($userGroups)) ? $this->groupManager->getUserGroupIds($user) : $userGroups,
|
'groups' => empty($userGroups) ? $this->groupManager->getUserGroupIds($user) : $userGroups,
|
||||||
'subadmin' => $subAdminGroups,
|
'subadmin' => $subAdminGroups,
|
||||||
'quota' => $user->getQuota(),
|
'quota' => $user->getQuota(),
|
||||||
'quota_bytes' => Util::computerFileSize($user->getQuota()),
|
'quota_bytes' => Util::computerFileSize($user->getQuota()),
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($_['certs'] as $rootCert): /**@var \OCP\ICertificate $rootCert */ ?>
|
<?php foreach ($_['certs'] as $rootCert): /**@var \OCP\ICertificate $rootCert */ ?>
|
||||||
<tr class="<?php echo ($rootCert->isExpired()) ? 'expired' : 'valid' ?>"
|
<tr class="<?php echo $rootCert->isExpired() ? 'expired' : 'valid' ?>"
|
||||||
data-name="<?php p($rootCert->getName()) ?>">
|
data-name="<?php p($rootCert->getName()) ?>">
|
||||||
<td class="rootCert"
|
<td class="rootCert"
|
||||||
title="<?php p($rootCert->getOrganization()) ?>">
|
title="<?php p($rootCert->getOrganization()) ?>">
|
||||||
|
|
|
@ -6,4 +6,4 @@
|
||||||
|
|
||||||
<?php foreach($_['forms'] as $form) {
|
<?php foreach($_['forms'] as $form) {
|
||||||
print_unescaped($form);
|
print_unescaped($form);
|
||||||
};
|
}
|
||||||
|
|
|
@ -30,4 +30,4 @@
|
||||||
if (isset($form['form'])) {?>
|
if (isset($form['form'])) {?>
|
||||||
<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
|
<div id="<?php isset($form['anchor']) ? p($form['anchor']) : p('');?>"><?php print_unescaped($form['form']);?></div>
|
||||||
<?php }
|
<?php }
|
||||||
};?>
|
} ?>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<div class="section">
|
<div class="section">
|
||||||
<p><?php include(__DIR__ . '/../../settings.development.notice.php'); ?></p>
|
<p><?php include __DIR__ . '/../../settings.development.notice.php'; ?></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -132,7 +132,7 @@
|
||||||
<ol>
|
<ol>
|
||||||
<?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
|
<?php foreach(json_decode($_['cronErrors']) as $error) { if(isset($error->error)) {?>
|
||||||
<li><?php p($error->error) ?> <?php p($error->hint) ?></li>
|
<li><?php p($error->error) ?> <?php p($error->hint) ?></li>
|
||||||
<?php }};?>
|
<?php }} ?>
|
||||||
</ol>
|
</ol>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue