diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-02-22 07:02:51 -0800 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-02-22 07:02:51 -0800 |
commit | e8da90d0f45ab870e3d5da6c766159c87bbb1b68 (patch) | |
tree | 9010016688ef9b7d357b7cda8c047dc9340a2e1d | |
parent | 5c76fffc01cb01fca41863b9a35ea5f14175b861 (diff) | |
parent | 59582e0f3fb395378b88aec2a6d0689bb2ac039e (diff) | |
download | nextcloud-server-e8da90d0f45ab870e3d5da6c766159c87bbb1b68.tar.gz nextcloud-server-e8da90d0f45ab870e3d5da6c766159c87bbb1b68.zip |
Merge pull request #1711 from owncloud/style-cleanup
Codestyle cleanup
30 files changed, 308 insertions, 129 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 9031c729eff..5b697777e47 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -26,8 +26,7 @@ foreach ($_FILES['files']['error'] as $error) { UPLOAD_ERR_OK => $l->t('There is no error, the file uploaded with success'), UPLOAD_ERR_INI_SIZE => $l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ') . ini_get('upload_max_filesize'), - UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified' - . ' in the HTML form'), + UPLOAD_ERR_FORM_SIZE => $l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form'), UPLOAD_ERR_PARTIAL => $l->t('The uploaded file was only partially uploaded'), UPLOAD_ERR_NO_FILE => $l->t('No file was uploaded'), UPLOAD_ERR_NO_TMP_DIR => $l->t('Missing a temporary folder'), diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 1d22b32b503..48e41e93048 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -52,7 +52,10 @@ if (version_compare($installedVersion, '0.3', '<')) { } catch (Exception $e) { $update_error = true; - OCP\Util::writeLog('files_sharing', 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith.'" (error is "'.$e->getMessage().'")', OCP\Util::WARN); + OCP\Util::writeLog('files_sharing', + 'Upgrade Routine: Skipping sharing "'.$row['source'].'" to "'.$shareWith + .'" (error is "'.$e->getMessage().'")', + OCP\Util::WARN); } OC_Util::tearDownFS(); } diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 9655e447875..fb0f6c7b5a6 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -71,8 +71,9 @@ class Shared_Cache extends Cache { } } else { $query = \OC_DB::prepare( - 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`, `size`, `mtime`, `encrypted` - FROM `*PREFIX*filecache` WHERE `fileid` = ?'); + 'SELECT `fileid`, `storage`, `path`, `parent`, `name`, `mimetype`, `mimepart`,' + .' `size`, `mtime`, `encrypted`' + .' FROM `*PREFIX*filecache` WHERE `fileid` = ?'); $result = $query->execute(array($file)); $data = $result->fetchRow(); $data['fileid'] = (int)$data['fileid']; diff --git a/apps/files_sharing/lib/permissions.php b/apps/files_sharing/lib/permissions.php index 2b068ff9350..72c1ec96c46 100644 --- a/apps/files_sharing/lib/permissions.php +++ b/apps/files_sharing/lib/permissions.php @@ -33,7 +33,8 @@ class Shared_Permissions extends Permissions { if ($fileId == -1) { return \OCP\PERMISSION_READ; } - $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, null, true); + $source = \OCP\Share::getItemSharedWithBySource('file', $fileId, \OC_Share_Backend_File::FORMAT_SHARED_STORAGE, + null, true); if ($source) { return $source['permissions']; } else { diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 6d3c55a008f..0aeb763d89a 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -72,7 +72,11 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { public function formatItems($items, $format, $parameters = null) { if ($format == self::FORMAT_SHARED_STORAGE) { // Only 1 item should come through for this format call - return array('path' => $items[key($items)]['path'], 'permissions' => $items[key($items)]['permissions'], 'uid_owner' => $items[key($items)]['uid_owner']); + return array( + 'path' => $items[key($items)]['path'], + 'permissions' => $items[key($items)]['permissions'], + 'uid_owner' => $items[key($items)]['uid_owner'] + ); } else if ($format == self::FORMAT_GET_FOLDER_CONTENTS) { $files = array(); foreach ($items as $item) { @@ -99,7 +103,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { } $size += (int)$item['size']; } - return array('fileid' => -1, 'name' => 'Shared', 'mtime' => $mtime, 'mimetype' => 'httpd/unix-directory', 'size' => $size); + return array( + 'fileid' => -1, + 'name' => 'Shared', + 'mtime' => $mtime, + 'mimetype' => 'httpd/unix-directory', + 'size' => $size + ); } else if ($format == self::FORMAT_OPENDIR) { $files = array(); foreach ($items as $item) { diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php index 11c8c6b1e80..4426beec636 100644 --- a/apps/files_sharing/lib/share/folder.php +++ b/apps/files_sharing/lib/share/folder.php @@ -33,7 +33,8 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share } while (!empty($parents)) { $parents = "'".implode("','", $parents)."'"; - $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache` WHERE `parent` IN ('.$parents.')'); + $query = OC_DB::prepare('SELECT `fileid`, `name`, `mimetype` FROM `*PREFIX*filecache`' + .' WHERE `parent` IN ('.$parents.')'); $result = $query->execute(); $parents = array(); while ($file = $result->fetchRow()) { @@ -47,4 +48,4 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share return $children; } -}
\ No newline at end of file +} diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 65812b7e2fd..c7521949da1 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -240,7 +240,8 @@ class Shared extends \OC\Files\Storage\Common { public function file_put_contents($path, $data) { if ($source = $this->getSourcePath($path)) { // Check if permission is granted - if (($this->file_exists($path) && !$this->isUpdatable($path)) || ($this->is_dir($path) && !$this->isCreatable($path))) { + if (($this->file_exists($path) && !$this->isUpdatable($path)) + || ($this->is_dir($path) && !$this->isCreatable($path))) { return false; } $info = array( @@ -390,9 +391,12 @@ class Shared extends \OC\Files\Storage\Common { } public static function setup($options) { - if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] || \OCP\Share::getItemsSharedWith('file')) { + if (!\OCP\User::isLoggedIn() || \OCP\User::getUser() != $options['user'] + || \OCP\Share::getItemsSharedWith('file')) { $user_dir = $options['user_dir']; - \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', array('sharedFolder' => '/Shared'), $user_dir.'/Shared/'); + \OC\Files\Filesystem::mount('\OC\Files\Storage\Shared', + array('sharedFolder' => '/Shared'), + $user_dir.'/Shared/'); } } diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php index 38d598f7780..f265a7dd014 100644 --- a/apps/files_sharing/public.php +++ b/apps/files_sharing/public.php @@ -171,7 +171,9 @@ if (isset($path)) { $list->assign('files', $files, false); $list->assign('disableSharing', true); $list->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); - $list->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', false); + $list->assign('downloadURL', + OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=', + false); $breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', ''); $breadcrumbNav->assign('breadcrumb', $breadcrumb, false); $breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&path=', false); @@ -188,7 +190,8 @@ if (isset($path)) { $folder->assign('usedSpacePercent', 0); $tmpl->assign('folder', $folder->fetchPage(), false); $tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true))); - $tmpl->assign('downloadURL', OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); + $tmpl->assign('downloadURL', + OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath)); } else { $tmpl->assign('dir', $dir); diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index 7776fd63b3c..f9ff12679bc 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -3,15 +3,20 @@ <input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename"> <input type="hidden" name="mimetype" value="<?php echo $_['mimetype'] ?>" id="mimetype"> <header><div id="header"> - <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> + <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" + src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <div class="header-right"> <?php if (isset($_['folder'])): ?> - <span id="details"><?php echo $l->t('%s shared the folder %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> + <span id="details"><?php echo $l->t('%s shared the folder %s with you', + array($_['displayName'], $_['fileTarget'])) ?></span> <?php else: ?> - <span id="details"><?php echo $l->t('%s shared the file %s with you', array($_['displayName'], $_['fileTarget'])) ?></span> + <span id="details"><?php echo $l->t('%s shared the file %s with you', + array($_['displayName'], $_['fileTarget'])) ?></span> <?php endif; ?> <?php if (!isset($_['folder']) || $_['allowZipDownload']): ?> - <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + <a href="<?php echo $_['downloadURL']; ?>" class="button" id="download"><img + class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" + /><?php echo $l->t('Download')?></a> <?php endif; ?> </div> </div></header> @@ -27,9 +32,12 @@ <ul id="noPreview"> <li class="error"> <?php echo $l->t('No preview available for').' '.$_['fileTarget']; ?><br /> - <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" /><?php echo $l->t('Download')?></a> + <a href="<?php echo $_['downloadURL']; ?>" id="download"><img class="svg" alt="Download" + src="<?php echo OCP\image_path("core", "actions/download.svg"); ?>" + /><?php echo $l->t('Download')?></a> </li> </ul> <?php endif; ?> </div> -<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t('web services under your control'); ?></p></footer> +<footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – +<?php echo $l->t('web services under your control'); ?></p></footer> diff --git a/apps/files_trashbin/lib/trash.php b/apps/files_trashbin/lib/trash.php index 8d54a471b42..2b8b32c3a16 100644 --- a/apps/files_trashbin/lib/trash.php +++ b/apps/files_trashbin/lib/trash.php @@ -23,9 +23,11 @@ namespace OCA\Files_Trashbin;
class Trashbin { - - const DEFAULT_RETENTION_OBLIGATION=180; // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) - const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota + // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days) + const DEFAULT_RETENTION_OBLIGATION=180; + + // unit: percentage; 50% of available disk space/quota + const DEFAULTMAXSIZE=50; /** * move file to the trash bin @@ -60,7 +62,8 @@ class Trashbin { $trashbinSize += self::copy_recursive($file_path, 'files_trashbin/'.$deleted.'.d'.$timestamp, $view); if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) {
- $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user) VALUES (?,?,?,?,?,?)");
+ $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user)" + ." VALUES (?,?,?,?,?,?)"); $result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user)); if ( !$result ) { // if file couldn't be added to the database than also don't store it in the trash bin. $view->deleteAll('files_trashbin/'.$deleted.'.d'.$timestamp); @@ -70,12 +73,15 @@ class Trashbin { if ( \OCP\App::isEnabled('files_versions') ) {
if ( $view->is_dir('files_versions'.$file_path) ) { - $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path));
+ $trashbinSize += self::calculateSize( + new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path) + ); $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);
} else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {
foreach ($versions as $v) { $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']);
- $view->rename('files_versions'.$v['path'].'.v'.$v['version'], 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp);
+ $view->rename('files_versions'.$v['path'].'.v'.$v['version'], + 'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp); }
}
} @@ -121,7 +127,8 @@ class Trashbin { $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
} if ( $timestamp ) { - $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
+ $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash' + .' WHERE user=? AND id=? AND timestamp=?'); $result = $query->execute(array($user,$filename,$timestamp))->fetchAll(); if ( count($result) != 1 ) { \OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR); @@ -131,7 +138,7 @@ class Trashbin { // if location no longer exists, restore file in the root directory
$location = $result[0]['location'];
if ( $result[0]['location'] != '/' && - (!$view->is_dir('files'.$result[0]['location']) || + (!$view->is_dir('files'.$result[0]['location']) || !$view->isUpdatable('files'.$result[0]['location'])) ) {
$location = '';
} @@ -165,16 +172,21 @@ class Trashbin { $versionedFile = $file; }
if ( $result[0]['type'] == 'dir' ) { - $trashbinSize -= self::calculateSize(new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file));
- $view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file), \OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext));
+ $trashbinSize -= self::calculateSize( + new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file) + ); + $view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file), + \OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext)); } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) {
foreach ($versions as $v) { if ($timestamp ) { $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp); - $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); + $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp, + 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); } else { $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v); - $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v, 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); + $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v, + 'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v); }
}
}
@@ -280,7 +292,8 @@ class Trashbin { $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
$result = $query->execute(array($user))->fetchAll(); - $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', self::DEFAULT_RETENTION_OBLIGATION); + $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation', + self::DEFAULT_RETENTION_OBLIGATION); $limit = time() - ($retention_obligation * 86400); @@ -289,13 +302,17 @@ class Trashbin { $filename = $r['id']; if ( $r['timestamp'] < $limit ) { if ($view->is_dir('files_trashbin/'.$filename.'.d'.$timestamp)) { - $size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/files_trashbin/'.$filename.'.d'.$timestamp)); + $size += self::calculateSize( + new \OC_FilesystemView('/'.$user.'/files_trashbin/'.$filename.'.d'.$timestamp) + ); } else { $size += $view->filesize('files_trashbin/'.$filename.'.d'.$timestamp); } $view->unlink('files_trashbin/'.$filename.'.d'.$timestamp); if ($r['type'] == 'dir') { - $size += self::calculateSize(new \OC_FilesystemView('/'.$user.'/versions_trashbin/'.$filename.'.d'.$timestamp)); + $size += self::calculateSize( + new \OC_FilesystemView('/'.$user.'/versions_trashbin/'.$filename.'.d'.$timestamp) + ); $view->unlink('versions_trashbin/'.$filename.'.d'.$timestamp); } else if ( $versions = self::getVersionsFromTrash($filename, $timestamp) ) { foreach ($versions as $v) { @@ -312,7 +329,8 @@ class Trashbin { $availableSpace = $availableSpace + $size; // if size limit for trash bin reached, delete oldest files in trash bin if ($availableSpace < 0) { - $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=? ORDER BY timestamp ASC');
+ $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash' + .' WHERE user=? ORDER BY timestamp ASC'); $result = $query->execute(array($user))->fetchAll(); $length = count($result); $i = 0; @@ -418,7 +436,8 @@ class Trashbin { if (!file_exists($root)) { return 0; } - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), \RecursiveIteratorIterator::CHILD_FIRST);
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root), + \RecursiveIteratorIterator::CHILD_FIRST);
$size = 0;
foreach ($iterator as $path) { diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 95c7991bad6..8a67de04d83 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -21,19 +21,19 @@ class Storage { const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota private static $max_versions_per_interval = array( - 1 => array('intervalEndsAfter' => 10, //first 10sec, one version every 2sec - 'step' => 2), - 2 => array('intervalEndsAfter' => 60, //next minute, one version every 10sec - 'step' => 10), - 3 => array('intervalEndsAfter' => 3600, //next hour, one version every minute - 'step' => 60), - 4 => array('intervalEndsAfter' => 86400, //next 24h, one version every hour - 'step' => 3600), - 5 => array('intervalEndsAfter' => 2592000, //next 30days, one version per day - 'step' => 86400), - 6 => array('intervalEndsAfter' => -1, //until the end one version per week - 'step' => 604800), - ); + //first 10sec, one version every 2sec + 1 => array('intervalEndsAfter' => 10, 'step' => 2), + //next minute, one version every 10sec + 2 => array('intervalEndsAfter' => 60, 'step' => 10), + //next hour, one version every minute + 3 => array('intervalEndsAfter' => 3600, 'step' => 60), + //next 24h, one version every hour + 4 => array('intervalEndsAfter' => 86400, 'step' => 3600), + //next 30days, one version per day + 5 => array('intervalEndsAfter' => 2592000, 'step' => 86400), + //until the end one version per week + 6 => array('intervalEndsAfter' => -1, 'step' => 604800), + ); private static function getUidAndFilename($filename) { $uid = \OC\Files\Filesystem::getOwner($filename); @@ -239,7 +239,10 @@ class Storage { $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($versionsRoot), + \RecursiveIteratorIterator::CHILD_FIRST + ); $size = 0; @@ -264,7 +267,10 @@ class Storage { $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions'); $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath(''); - $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($versionsRoot), \RecursiveIteratorIterator::CHILD_FIRST); + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($versionsRoot), + \RecursiveIteratorIterator::CHILD_FIRST + ); $versions = array(); diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php index 850ece89c98..c450af66ad5 100644 --- a/apps/files_versions/templates/history.php +++ b/apps/files_versions/templates/history.php @@ -22,7 +22,8 @@ if( isset( $_['message'] ) ) { foreach ( $_['versions'] as $v ) { echo ' '; echo OCP\Util::formatDate( doubleval($v['version']) ); - echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; + echo ' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', + array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'; if ( $v['cur'] ) { echo ' (<b>Current</b>)'; } diff --git a/apps/files_versions/templates/settings.php b/apps/files_versions/templates/settings.php index bfca8366f5d..3b8e4baf119 100644 --- a/apps/files_versions/templates/settings.php +++ b/apps/files_versions/templates/settings.php @@ -1,6 +1,9 @@ <form id="versionssettings"> <fieldset class="personalblock"> <legend><strong><?php echo $l->t('Files Versioning');?></strong></legend> - <input type="checkbox" name="versions" id="versions" value="1" <?php if (OCP\Config::getSystemValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/> + <input type="checkbox" name="versions" id="versions" value="1" + <?php if (OCP\Config::getSystemValue('versions', 'true')=='true') + echo ' checked="checked"'; + ?> /> <label for="versions"><?php echo $l->t('Enable'); ?></label> <br/> </fieldset> </form> diff --git a/core/ajax/share.php b/core/ajax/share.php index 6704a00c5a2..332b6a0bed8 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -34,7 +34,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $shareWith = null; } - $token = OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], $shareType, $shareWith, $_POST['permissions']); + $token = OCP\Share::shareItem( + $_POST['itemType'], + $_POST['itemSource'], + $shareType, + $shareWith, + $_POST['permissions'] + ); if (is_string($token)) { OC_JSON::success(array('data' => array('token' => $token))); @@ -59,7 +65,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo break; case 'setPermissions': if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) { - $return = OCP\Share::setPermissions($_POST['itemType'], $_POST['itemSource'], $_POST['shareType'], $_POST['shareWith'], $_POST['permissions']); + $return = OCP\Share::setPermissions( + $_POST['itemType'], + $_POST['itemSource'], + $_POST['shareType'], + $_POST['shareWith'], + $_POST['permissions'] + ); ($return) ? OC_JSON::success() : OC_JSON::error(); } break; @@ -86,9 +98,11 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo if ($type === 'dir') $subject = (string)$l->t('User %s shared a folder with you', $displayName); - $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); + $text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', + array($displayName, $file, $link)); if ($type === 'dir') - $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($displayName, $file, $link)); + $text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', + array($displayName, $file, $link)); $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply'); @@ -112,14 +126,29 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } break; case 'getItem': - if (isset($_GET['itemType']) && isset($_GET['itemSource']) && isset($_GET['checkReshare']) && isset($_GET['checkShares'])) { + if (isset($_GET['itemType']) + && isset($_GET['itemSource']) + && isset($_GET['checkReshare']) + && isset($_GET['checkShares'])) { if ($_GET['checkReshare'] == 'true') { - $reshare = OCP\Share::getItemSharedWithBySource($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); + $reshare = OCP\Share::getItemSharedWithBySource( + $_GET['itemType'], + $_GET['itemSource'], + OCP\Share::FORMAT_NONE, + null, + true + ); } else { $reshare = false; } if ($_GET['checkShares'] == 'true') { - $shares = OCP\Share::getItemShared($_GET['itemType'], $_GET['itemSource'], OCP\Share::FORMAT_NONE, null, true); + $shares = OCP\Share::getItemShared( + $_GET['itemType'], + $_GET['itemSource'], + OCP\Share::FORMAT_NONE, + null, + true + ); } else { $shares = false; } @@ -165,8 +194,15 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo } $offset += $limit; foreach ($users as $uid => $displayName) { - if ((!isset($_GET['itemShares']) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) && $uid != OC_User::getUser()) { - $shareWith[] = array('label' => $displayName, 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, 'shareWith' => $uid)); + if ((!isset($_GET['itemShares']) + || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) + || !in_array($uid, $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) + && $uid != OC_User::getUser()) { + $shareWith[] = array( + 'label' => $displayName, + 'value' => array('shareType' => OCP\Share::SHARE_TYPE_USER, + 'shareWith' => $uid) + ); $count++; } } @@ -179,7 +215,13 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo || !isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) || !in_array($group, $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]))) { - $shareWith[] = array('label' => $group.' (group)', 'value' => array('shareType' => OCP\Share::SHARE_TYPE_GROUP, 'shareWith' => $group)); + $shareWith[] = array( + 'label' => $group.' (group)', + 'value' => array( + 'shareType' => OCP\Share::SHARE_TYPE_GROUP, + 'shareWith' => $group + ) + ); $count++; } } else { diff --git a/core/js/config.php b/core/js/config.php index 9069175ed6f..0aaa4482287 100644 --- a/core/js/config.php +++ b/core/js/config.php @@ -29,8 +29,33 @@ $array = array( "oc_current_user" => "\"".OC_User::getUser(). "\"", "oc_requesttoken" => "\"".OC_Util::callRegister(). "\"", "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')), - "dayNames" => json_encode(array((string)$l->t('Sunday'), (string)$l->t('Monday'), (string)$l->t('Tuesday'), (string)$l->t('Wednesday'), (string)$l->t('Thursday'), (string)$l->t('Friday'), (string)$l->t('Saturday'))), - "monthNames" => json_encode(array((string)$l->t('January'), (string)$l->t('February'), (string)$l->t('March'), (string)$l->t('April'), (string)$l->t('May'), (string)$l->t('June'), (string)$l->t('July'), (string)$l->t('August'), (string)$l->t('September'), (string)$l->t('October'), (string)$l->t('November'), (string)$l->t('December'))), + "dayNames" => json_encode( + array( + (string)$l->t('Sunday'), + (string)$l->t('Monday'), + (string)$l->t('Tuesday'), + (string)$l->t('Wednesday'), + (string)$l->t('Thursday'), + (string)$l->t('Friday'), + (string)$l->t('Saturday') + ) + ), + "monthNames" => json_encode( + array( + (string)$l->t('January'), + (string)$l->t('February'), + (string)$l->t('March'), + (string)$l->t('April'), + (string)$l->t('May'), + (string)$l->t('June'), + (string)$l->t('July'), + (string)$l->t('August'), + (string)$l->t('September'), + (string)$l->t('October'), + (string)$l->t('November'), + (string)$l->t('December') + ) + ), "firstDay" => json_encode($l->l('firstday', 'firstday')) , ); @@ -38,4 +63,3 @@ $array = array( foreach ($array as $setting => $value) { echo("var ". $setting ."=".$value.";\n"); } -?>
\ No newline at end of file diff --git a/core/templates/exception.php b/core/templates/exception.php index 62d6cf2ade5..4059c7e047d 100644 --- a/core/templates/exception.php +++ b/core/templates/exception.php @@ -5,7 +5,9 @@ <p class="exception"> <?php if($_['showsysinfo'] == true) { - echo 'If you would like to support ownCloud\'s developers and report this error in our <a href="https://github.com/owncloud/core">bug tracker</a>, please copy the following informations into the description. <br><br><textarea readonly>'; + echo 'If you would like to support ownCloud\'s developers and' + .' report this error in our <a href="https://github.com/owncloud/core">bug tracker</a>,' + .' please copy the following informations into the description. <br><br><textarea readonly>'; echo 'Message: ' . $_['message'] . "\n"; echo 'Error Code: ' . $_['code'] . "\n"; echo 'File: ' . $_['file'] . "\n"; diff --git a/core/templates/installation.php b/core/templates/installation.php index 9cb1d4600d5..c48d2f764e7 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -22,7 +22,7 @@ <fieldset class="warning"> <legend><strong><?php echo $l->t('Security Warning');?></strong></legend> <p><?php echo $l->t('No secure random number generator is available, please enable the PHP OpenSSL extension.');?><br/> - <?php echo $l->t('Without a secure random number generator an attacker may be able to predict password reset tokens and take over your account.');?></p> + <?php echo $l->t('Without a secure random number generator an attacker may be able to predict password reset tokens and take over your account.');?></p> </fieldset> <?php endif; ?> <?php if(!$_['htaccessWorking']): ?> @@ -35,12 +35,14 @@ <fieldset id="adminaccount"> <legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend> <p class="infield grouptop"> - <input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autocomplete="off" autofocus required /> + <input type="text" name="adminlogin" id="adminlogin" + value="<?php print OC_Helper::init_var('adminlogin'); ?>" autocomplete="off" autofocus required /> <label for="adminlogin" class="infield"><?php echo $l->t( 'Username' ); ?></label> <img class="svg" src="<?php echo image_path('', 'actions/user.svg'); ?>" alt="" /> </p> <p class="infield groupbottom"> - <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" /> + <input type="password" name="adminpass" data-typetoggle="#show" id="adminpass" + value="<?php print OC_Helper::init_var('adminpass'); ?>" /> <label for="adminpass" class="infield"><?php echo $l->t( 'Password' ); ?></label> <img class="svg" id="adminpass-icon" src="<?php echo image_path('', 'actions/password.svg'); ?>" alt="" /> <input type="checkbox" id="show" name="show" /> @@ -52,12 +54,14 @@ <legend><a id="showAdvanced"><?php echo $l->t( 'Advanced' ); ?> <img class="svg" src="<?php echo image_path('', 'actions/caret-dark.svg'); ?>" /></a></legend> <div id="datadirContent"> <label for="directory"><?php echo $l->t( 'Data folder' ); ?></label> - <input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" /> + <input type="text" name="directory" id="directory" + value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" /> </div> </fieldset> <fieldset id='databaseField'> - <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> + <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) + $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> <legend><?php echo $l->t( 'Configure the database' ); ?></legend> <div id="selectDbType"> <?php if($_['hasSQLite']): ?> @@ -66,7 +70,8 @@ <p>SQLite <?php echo $l->t( 'will be used' ); ?>.</p> <input type="hidden" id="dbtype" name="dbtype" value="sqlite" /> <?php else: ?> - <input type="radio" name="dbtype" value="sqlite" id="sqlite" <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/> + <input type="radio" name="dbtype" value="sqlite" id="sqlite" + <?php OC_Helper::init_radio('dbtype', 'sqlite', 'sqlite'); ?>/> <label class="sqlite" for="sqlite">SQLite</label> <?php endif; ?> <?php endif; ?> @@ -77,7 +82,8 @@ <p>MySQL <?php echo $l->t( 'will be used' ); ?>.</p> <input type="hidden" id="dbtype" name="dbtype" value="mysql" /> <?php else: ?> - <input type="radio" name="dbtype" value="mysql" id="mysql" <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/> + <input type="radio" name="dbtype" value="mysql" id="mysql" + <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/> <label class="mysql" for="mysql">MySQL</label> <?php endif; ?> <?php endif; ?> @@ -88,7 +94,8 @@ <input type="hidden" id="dbtype" name="dbtype" value="pgsql" /> <?php else: ?> <label class="pgsql" for="pgsql">PostgreSQL</label> - <input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype', 'pgsql', 'sqlite'); ?>/> + <input type="radio" name="dbtype" value='pgsql' id="pgsql" + <?php OC_Helper::init_radio('dbtype', 'pgsql', 'sqlite'); ?>/> <?php endif; ?> <?php endif; ?> @@ -98,7 +105,8 @@ <input type="hidden" id="dbtype" name="dbtype" value="oci" /> <?php else: ?> <label class="oci" for="oci">Oracle</label> - <input type="radio" name="dbtype" value='oci' id="oci" <?php OC_Helper::init_radio('dbtype', 'oci', 'sqlite'); ?>/> + <input type="radio" name="dbtype" value='oci' id="oci" + <?php OC_Helper::init_radio('dbtype', 'oci', 'sqlite'); ?>/> <?php endif; ?> <?php endif; ?> </div> @@ -107,15 +115,19 @@ <div id="use_other_db"> <p class="infield grouptop"> <label for="dbuser" class="infield"><?php echo $l->t( 'Database user' ); ?></label> - <input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" autocomplete="off" /> + <input type="text" name="dbuser" id="dbuser" + value="<?php print OC_Helper::init_var('dbuser'); ?>" autocomplete="off" /> </p> <p class="infield groupmiddle"> <label for="dbpass" class="infield"><?php echo $l->t( 'Database password' ); ?></label> - <input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" /> + <input type="password" name="dbpass" id="dbpass" + value="<?php print OC_Helper::init_var('dbpass'); ?>" /> </p> <p class="infield groupmiddle"> <label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label> - <input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" pattern="[0-9a-zA-Z$_-]+" /> + <input type="text" name="dbname" id="dbname" + value="<?php print OC_Helper::init_var('dbname'); ?>" + autocomplete="off" pattern="[0-9a-zA-Z$_-]+" /> </p> </div> <?php endif; ?> @@ -123,13 +135,15 @@ <div id="use_oracle_db"> <p class="infield groupmiddle"> <label for="dbtablespace" class="infield"><?php echo $l->t( 'Database tablespace' ); ?></label> - <input type="text" name="dbtablespace" id="dbtablespace" value="<?php print OC_Helper::init_var('dbtablespace'); ?>" autocomplete="off" /> + <input type="text" name="dbtablespace" id="dbtablespace" + value="<?php print OC_Helper::init_var('dbtablespace'); ?>" autocomplete="off" /> </p> </div> <?php endif; ?> <p class="infield groupbottom"> <label for="dbhost" class="infield" id="dbhostlabel"><?php echo $l->t( 'Database host' ); ?></label> - <input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" /> + <input type="text" name="dbhost" id="dbhost" + value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" /> </p> </fieldset> diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 2049bcb36da..4233fd8300e 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -3,7 +3,8 @@ <head> <title>ownCloud</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> + <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /> + <link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> <?php foreach ($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 69330aa9fce..b26020b766b 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -4,7 +4,8 @@ <title>ownCloud</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="apple-itunes-app" content="app-id=543672169"> - <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> + <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /> + <link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> @@ -30,6 +31,7 @@ </div></header> <?php echo $_['content']; ?> </div> - <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – <?php echo $l->t( 'web services under your control' ); ?></p></footer> + <footer><p class="info"><a href="http://owncloud.org/">ownCloud</a> – + <?php echo $l->t( 'web services under your control' ); ?></p></footer> </body> </html> diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2d00bdb5c8e..d0869cb8404 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -1,10 +1,12 @@ <!DOCTYPE html> <html> <head> - <title><?php echo !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud <?php echo !empty($_['user_displayname'])?' ('.$_['user_displayname'].') ':'' ?></title> + <title><?php echo !empty($_['application'])?$_['application'].' | ':'' ?>ownCloud + <?php echo !empty($_['user_displayname'])?' ('.$_['user_displayname'].') ':'' ?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="apple-itunes-app" content="app-id=543672169"> - <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /><link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> + <link rel="shortcut icon" href="<?php echo image_path('', 'favicon.png'); ?>" /> + <link rel="apple-touch-icon-precomposed" href="<?php echo image_path('', 'favicon-touch.png'); ?>" /> <?php foreach($_['cssfiles'] as $cssfile): ?> <link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" /> <?php endforeach; ?> @@ -27,7 +29,8 @@ <div id="notification"></div> </div> <header><div id="header"> - <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> + <a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" + src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a> <ul id="settings" class="svg"> <span id="expand"> @@ -37,7 +40,8 @@ <div id="expanddiv"> <?php foreach($_['settingsnavigation'] as $entry):?> <li> - <a href="<?php echo $entry['href']; ?>" title="" <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>> + <a href="<?php echo $entry['href']; ?>" title="" + <?php if( $entry["active"] ): ?> class="active"<?php endif; ?>> <img class="svg" alt="" src="<?php echo $entry['icon']; ?>"> <?php echo $entry['name'] ?> </a> @@ -45,14 +49,17 @@ <?php endforeach; ?> <li> <a id="logout" href="<?php echo link_to('', 'index.php'); ?>?logout=true"> - <img class="svg" alt="" src="<?php echo image_path('', 'actions/logout.svg'); ?>" /> <?php echo $l->t('Log out');?> + <img class="svg" alt="" src="<?php echo image_path('', 'actions/logout.svg'); ?>" /> + <?php echo $l->t('Log out');?> </a> </li> </div> </ul> <form class="searchbox" action="#" method="post"> - <input id="searchbox" class="svg" type="search" name="query" value="<?php if(isset($_POST['query'])) {echo OC_Util::sanitizeHTML($_POST['query']);};?>" autocomplete="off" x-webkit-speech /> + <input id="searchbox" class="svg" type="search" name="query" + value="<?php if(isset($_POST['query'])) {echo OC_Util::sanitizeHTML($_POST['query']);};?>" + autocomplete="off" x-webkit-speech /> </form> </div></header> @@ -60,7 +67,8 @@ <ul id="apps" class="svg"> <?php foreach($_['navigation'] as $entry): ?> <li data-id="<?php echo $entry['id']; ?>"> - <a href="<?php echo $entry['href']; ?>" title="" <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>> + <a href="<?php echo $entry['href']; ?>" title="" + <?php if( $entry['active'] ): ?> class="active"<?php endif; ?>> <img class="icon svg" src="<?php echo $entry['icon']; ?>"/> <?php echo $entry['name']; ?> </a> diff --git a/core/templates/update.php b/core/templates/update.php index ae714dcfb92..685a5536d06 100644 --- a/core/templates/update.php +++ b/core/templates/update.php @@ -1,5 +1,6 @@ <ul> <li class='update'> - <?php echo $l->t('Updating ownCloud to version %s, this may take a while.', array($_['version'])); ?><br /><br /> + <?php echo $l->t('Updating ownCloud to version %s, this may take a while.', + array($_['version'])); ?><br /><br /> </li> </ul> diff --git a/lib/setup.php b/lib/setup.php index 0c049841b2a..faf011fccb1 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -646,8 +646,7 @@ class OC_Setup { header("Location: ".OC::$WEBROOT.'/'); } else { - $error = $l->t('Your web server is not yet properly setup to allow files' - .' synchronization because the WebDAV interface seems to be broken.'); + $error = $l->t('Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.'); $hint = $l->t('Please double check the <a href=\'%s\'>installation guides</a>.', 'http://doc.owncloud.org/server/5.0/admin_manual/installation.html'); diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index 356466c0c00..cd8dc0e2796 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -10,7 +10,9 @@ OCP\JSON::callCheck(); $username = isset($_POST["username"])?$_POST["username"]:''; -if(($username == '' && !OC_User::isAdminUser(OC_User::getUser()))|| (!OC_User::isAdminUser(OC_User::getUser()) && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username))) { +if(($username == '' && !OC_User::isAdminUser(OC_User::getUser())) + || (!OC_User::isAdminUser(OC_User::getUser()) + && !OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username))) { $l = OC_L10N::get('core'); OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); diff --git a/settings/ajax/togglegroups.php b/settings/ajax/togglegroups.php index 9bba9c5269d..f6fd9aba6d9 100644 --- a/settings/ajax/togglegroups.php +++ b/settings/ajax/togglegroups.php @@ -13,7 +13,9 @@ if($username == OC_User::getUser() && $group == "admin" && OC_User::isAdminUser exit(); } -if(!OC_User::isAdminUser(OC_User::getUser()) && (!OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username) || !OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group))) { +if(!OC_User::isAdminUser(OC_User::getUser()) + && (!OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username) + || !OC_SubAdmin::isGroupAccessible(OC_User::getUser(), $group))) { $l = OC_L10N::get('core'); OC_JSON::error(array( 'data' => array( 'message' => $l->t('Authentication error') ))); exit(); diff --git a/settings/oauth.php b/settings/oauth.php index 07b7ae5c31d..8b4759f999e 100644 --- a/settings/oauth.php +++ b/settings/oauth.php @@ -5,7 +5,7 @@ * See the COPYING-README file. */ -require_once('../lib/base.php'); +require_once '../lib/base.php'; // Logic $operation = isset($_GET['operation']) ? $_GET['operation'] : ''; $server = OC_OAuth_server::init(); @@ -23,9 +23,10 @@ switch($operation){ $callbackfail = empty($_GET['callback_fail']) ? null : $_GET['callback_fail']; $consumer = OC_OAuth_Server::register_consumer($_GET['name'], $_GET['url'], $callbacksuccess, $callbackfail); - echo 'Registered consumer successfully! </br></br>Key: ' . $consumer->key . '</br>Secret: ' . $consumer->secret; + echo 'Registered consumer successfully! </br></br>Key: ' . $consumer->key + . '</br>Secret: ' . $consumer->secret; } - break; + break; case 'request_token': @@ -38,7 +39,7 @@ switch($operation){ echo $exception->getMessage(); } - break; + break; case 'authorise'; OC_API::checkLoggedIn(); @@ -61,9 +62,11 @@ switch($operation){ if(!empty($notfound)) { // We need more apps :( Show error if(count($notfound)==1) { - $message = 'requires that you have an extra app installed on your ownCloud. Please contact your ownCloud administrator and ask them to install the app below.'; + $message = 'requires that you have an extra app installed on your ownCloud.' + .' Please contact your ownCloud administrator and ask them to install the app below.'; } else { - $message = 'requires that you have some extra apps installed on your ownCloud. Please contract your ownCloud administrator and ask them to install the apps below.'; + $message = 'requires that you have some extra apps installed on your ownCloud.' + .' Please contract your ownCloud administrator and ask them to install the apps below.'; } $t = new OC_Template('settings', 'oauth-required-apps', 'guest'); OC_Util::addStyle('settings', 'oauth'); @@ -77,7 +80,7 @@ switch($operation){ $t->assign('consumer', $consumer); $t->printPage(); } - break; + break; case 'access_token'; try { @@ -89,10 +92,10 @@ switch($operation){ echo $exception->getMessage(); } - break; + break; default: // Something went wrong, we need an operation! OC_Response::setStatus(400); - break; + break; } diff --git a/settings/routes.php b/settings/routes.php index 0a8af0dde2b..26d933dba45 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -40,7 +40,7 @@ $this->create('settings_ajax_removegroup', '/settings/ajax/removegroup.php') $this->create('settings_ajax_changepassword', '/settings/ajax/changepassword.php') ->actionInclude('settings/ajax/changepassword.php'); $this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')
-->actionInclude('settings/ajax/changedisplayname.php'); + ->actionInclude('settings/ajax/changedisplayname.php'); // personel $this->create('settings_ajax_lostpassword', '/settings/ajax/lostpassword.php') ->actionInclude('settings/ajax/lostpassword.php'); diff --git a/settings/templates/apps.php b/settings/templates/apps.php index ed1232ac322..b6e98c41bd9 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -3,7 +3,8 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */?> - <script type="text/javascript" src="<?php echo OC_Helper::linkToRoute('apps_custom');?>?appid=<?php echo $_['appid']; ?>"></script> + <script type="text/javascript" + src="<?php echo OC_Helper::linkToRoute('apps_custom');?>?appid=<?php echo $_['appid']; ?>"></script> <script type="text/javascript" src="<?php echo OC_Helper::linkTo('settings/js', 'apps.js');?>"></script> <div id="controls"> @@ -12,21 +13,27 @@ </div> <ul id="leftcontent" class="applist hascontrols"> <?php foreach($_['apps'] as $app):?> - <li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>" <?php if ( isset( $app['ocs_id'] ) ) { echo "data-id-ocs=\"{$app['ocs_id']}\""; } ?> - data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1"> - <a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a> - <?php if(!$app['internal']) echo '<small class="'.$app['internalclass'].' list">'.$app['internallabel'].'</small>' ?> + <li <?php if($app['active']) echo 'class="active"'?> data-id="<?php echo $app['id'] ?>" + <?php if ( isset( $app['ocs_id'] ) ) { echo "data-id-ocs=\"{$app['ocs_id']}\""; } ?> + data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1"> + <a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" + href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a> + <?php if(!$app['internal']) + echo '<small class="'.$app['internalclass'].' list">'.$app['internallabel'].'</small>' ?> </li> <?php endforeach;?> </ul> <div id="rightcontent"> <div class="appinfo"> - <h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span class="version"></span><small class="externalapp" style="visibility:hidden;"></small></h3> + <h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span + class="version"></span><small class="externalapp" style="visibility:hidden;"></small></h3> <span class="score"></span> <p class="description"></p> <img src="" class="preview" /> - <p class="appslink hidden"><a href="#" target="_blank"><?php echo $l->t('See application page at apps.owncloud.com');?></a></p> - <p class="license hidden"><?php echo $l->t('<span class="licence"></span>-licensed by <span class="author"></span>');?></p> + <p class="appslink hidden"><a href="#" target="_blank"><?php + echo $l->t('See application page at apps.owncloud.com');?></a></p> + <p class="license hidden"><?php + echo $l->t('<span class="licence"></span>-licensed by <span class="author"></span>');?></p> <input class="enable hidden" type="submit" /> <input class="update hidden" type="submit" value="<?php echo($l->t('Update')); ?>" /> </div> diff --git a/settings/templates/help.php b/settings/templates/help.php index 315cbfdb9a2..7b2a3321c29 100644 --- a/settings/templates/help.php +++ b/settings/templates/help.php @@ -1,14 +1,20 @@ <div id="controls"> <?php if($_['admin']) { ?> - <a class="button newquestion <?php echo($_['style1']); ?>" href="<?php echo($_['url1']); ?>"><?php echo $l->t( 'User Documentation' ); ?></a> - <a class="button newquestion <?php echo($_['style2']); ?>" href="<?php echo($_['url2']); ?>"><?php echo $l->t( 'Administrator Documentation' ); ?></a> + <a class="button newquestion <?php echo($_['style1']); ?>" + href="<?php echo($_['url1']); ?>"><?php echo $l->t( 'User Documentation' ); ?></a> + <a class="button newquestion <?php echo($_['style2']); ?>" + href="<?php echo($_['url2']); ?>"><?php echo $l->t( 'Administrator Documentation' ); ?></a> <?php } ?> - <a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php echo $l->t( 'Online Documentation' ); ?></a> - <a class="button newquestion" href="http://forum.owncloud.org" target="_blank"><?php echo $l->t( 'Forum' ); ?></a> + <a class="button newquestion" href="http://owncloud.org/support" target="_blank"><?php + echo $l->t( 'Online Documentation' ); ?></a> + <a class="button newquestion" href="http://forum.owncloud.org" target="_blank"><?php + echo $l->t( 'Forum' ); ?></a> <?php if($_['admin']) { ?> - <a class="button newquestion" href="https://github.com/owncloud/core/issues" target="_blank"><?php echo $l->t( 'Bugtracker' ); ?></a> + <a class="button newquestion" href="https://github.com/owncloud/core/issues" target="_blank"><?php + echo $l->t( 'Bugtracker' ); ?></a> <?php } ?> - <a class="button newquestion" href="http://owncloud.com" target="_blank"><?php echo $l->t( 'Commercial Support' ); ?></a> + <a class="button newquestion" href="http://owncloud.com" target="_blank"><?php + echo $l->t( 'Commercial Support' ); ?></a> </div> <div class="help-includes"> <iframe src="<?php echo($_['url']); ?>" class="help-iframe">abc</iframe> diff --git a/settings/templates/personal.php b/settings/templates/personal.php index 6e9ad5e1acb..3a4a6093e77 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -5,7 +5,8 @@ */?> <div id="quota" class="personalblock"><div style="width:<?php echo $_['usage_relative'];?>%;"> - <p id="quotatext"><?php echo $l->t('You have used <strong>%s</strong> of the available <strong>%s</strong>', array($_['usage'], $_['total_space']));?></p> + <p id="quotatext"><?php echo $l->t('You have used <strong>%s</strong> of the available <strong>%s</strong>', + array($_['usage'], $_['total_space']));?></p> </div></div> @@ -37,7 +38,8 @@ if($_['passwordChangeSupported']) { <div id="passwordchanged"><?php echo $l->t('Your password was changed');?></div> <div id="passworderror"><?php echo $l->t('Unable to change your password');?></div> <input type="password" id="pass1" name="oldpassword" placeholder="<?php echo $l->t('Current password');?>" /> - <input type="password" id="pass2" name="password" placeholder="<?php echo $l->t('New password');?>" data-typetoggle="#personal-show" /> + <input type="password" id="pass2" name="password" + placeholder="<?php echo $l->t('New password');?>" data-typetoggle="#personal-show" /> <input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label> <input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" /> </fieldset> @@ -66,7 +68,8 @@ if($_['displayNameChangeSupported']) { <form id="lostpassword"> <fieldset class="personalblock"> <legend><strong><?php echo $l->t('Email');?></strong></legend> - <input type="text" name="email" id="email" value="<?php echo $_['email']; ?>" placeholder="<?php echo $l->t('Your email address');?>" /><span class="msg"></span><br /> + <input type="text" name="email" id="email" value="<?php echo $_['email']; ?>" + placeholder="<?php echo $l->t('Your email address');?>" /><span class="msg"></span><br /> <em><?php echo $l->t('Fill in an email address to enable password recovery');?></em> </fieldset> </form> @@ -79,7 +82,8 @@ if($_['displayNameChangeSupported']) { <option value="<?php echo $language['code'];?>"><?php echo $language['name'];?></option> <?php endforeach;?> </select> - <a href="https://www.transifex.net/projects/p/owncloud/team/<?php echo $_['languages'][0]['code'];?>/" target="_blank"><em><?php echo $l->t('Help translate');?></em></a> + <a href="https://www.transifex.net/projects/p/owncloud/team/<?php echo $_['languages'][0]['code'];?>/" + target="_blank"><em><?php echo $l->t('Help translate');?></em></a> </fieldset> </form> @@ -96,7 +100,8 @@ if($_['displayNameChangeSupported']) { <fieldset class="personalblock"> <legend><strong><?php echo $l->t('Version');?></strong></legend> - <strong>ownCloud</strong> <?php echo(OC_Util::getVersionString()); ?> <?php echo(OC_Util::getEditionString()); ?> <br /> + <strong>ownCloud</strong> <?php echo(OC_Util::getVersionString()); ?> + <?php echo(OC_Util::getEditionString()); ?> <br /> <?php echo $l->t('Developed by the <a href="http://ownCloud.org/contact" target="_blank">ownCloud community</a>, the <a href="https://github.com/owncloud" target="_blank">source code</a> is licensed under the <a href="http://www.gnu.org/licenses/agpl-3.0.html" target="_blank"><abbr title="Affero General Public License">AGPL</abbr></a>.'); ?> </fieldset> diff --git a/settings/users.php b/settings/users.php index 7fcd1d3ed02..94e6d0a9a10 100644 --- a/settings/users.php +++ b/settings/users.php @@ -40,12 +40,14 @@ foreach($quotaPreset as &$preset) { $quotaPreset=array_diff($quotaPreset, array('default', 'none')); $defaultQuota=OC_Appconfig::getValue('files', 'default_quota', 'none'); -$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false && array_search($defaultQuota, array('none', 'default'))===false; +$defaultQuotaIsUserDefined=array_search($defaultQuota, $quotaPreset)===false + && array_search($defaultQuota, array('none', 'default'))===false; // load users and quota foreach($accessibleusers as $uid => $displayName) { $quota=OC_Preferences::getValue($uid, 'files', 'quota', 'default'); - $isQuotaUserDefined=array_search($quota, $quotaPreset)===false && array_search($quota, array('none', 'default'))===false; + $isQuotaUserDefined=array_search($quota, $quotaPreset)===false + && array_search($quota, array('none', 'default'))===false; $name = $displayName; if ( $displayName != $uid ) { |