зеркало из https://github.com/nextcloud/server.git
Fix SpaceBeforeOpenBrace errors
This commit is contained in:
Родитель
bfe6334cd9
Коммит
5c4a804ddb
|
@ -14,7 +14,7 @@ fclose($fh);
|
|||
$filename = $_FILES['rootcert_import']['name'];
|
||||
|
||||
$view = new \OC\Files\View('/'.\OCP\User::getUser().'/files_external/uploads');
|
||||
if (!$view->file_exists('')){
|
||||
if (!$view->file_exists('')) {
|
||||
$view->mkdir('');
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ abstract class StreamWrapper extends \OC\Files\Storage\Common{
|
|||
private $ready = false;
|
||||
|
||||
protected function init(){
|
||||
if($this->ready){
|
||||
if($this->ready) {
|
||||
return;
|
||||
}
|
||||
$this->ready = true;
|
||||
|
|
|
@ -290,7 +290,7 @@ class SWIFT extends \OC\Files\Storage\Common{
|
|||
}
|
||||
|
||||
private function init(){
|
||||
if($this->ready){
|
||||
if($this->ready) {
|
||||
return;
|
||||
}
|
||||
$this->ready = true;
|
||||
|
|
|
@ -49,7 +49,7 @@ class DAV extends \OC\Files\Storage\Common{
|
|||
}
|
||||
|
||||
private function init(){
|
||||
if($this->ready){
|
||||
if($this->ready) {
|
||||
return;
|
||||
}
|
||||
$this->ready = true;
|
||||
|
|
|
@ -94,7 +94,7 @@ class Storage {
|
|||
// expire old revisions if necessary
|
||||
$newSize = self::expire($filename, $versionsSize);
|
||||
|
||||
if ( $newSize != $versionsSize ) {
|
||||
if ( $newSize != $versionsSize ) {
|
||||
\OCP\Config::setAppValue('files_versions', 'size', $versionsSize);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ OCP\JSON::checkAppEnabled('user_ldap');
|
|||
OCP\JSON::callCheck();
|
||||
|
||||
$prefix = $_POST['ldap_serverconfig_chooser'];
|
||||
if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)){
|
||||
if(\OCA\user_ldap\lib\Helper::deleteServerConfiguration($prefix)) {
|
||||
OCP\JSON::success();
|
||||
} else {
|
||||
$l=OC_L10N::get('user_ldap');
|
||||
|
|
|
@ -192,7 +192,7 @@ class Connection {
|
|||
|
||||
private function getValue($varname) {
|
||||
static $defaults;
|
||||
if(is_null($defaults)){
|
||||
if(is_null($defaults)) {
|
||||
$defaults = $this->getDefaults();
|
||||
}
|
||||
return \OCP\Config::getAppValue($this->configID,
|
||||
|
@ -336,7 +336,7 @@ class Connection {
|
|||
case 'ldapBaseGroups':
|
||||
case 'ldapAttributesForUserSearch':
|
||||
case 'ldapAttributesForGroupSearch':
|
||||
if(is_array($value)){
|
||||
if(is_array($value)) {
|
||||
$value = implode("\n", $value);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -82,7 +82,7 @@ class OC_API {
|
|||
// Prepare the request variables
|
||||
if($_SERVER['REQUEST_METHOD'] == 'PUT') {
|
||||
parse_str(file_get_contents("php://input"), $parameters['_put']);
|
||||
} else if($_SERVER['REQUEST_METHOD'] == 'DELETE'){
|
||||
} else if($_SERVER['REQUEST_METHOD'] == 'DELETE') {
|
||||
parse_str(file_get_contents("php://input"), $parameters['_delete']);
|
||||
}
|
||||
$name = $parameters['_route'];
|
||||
|
|
|
@ -157,7 +157,7 @@ class OC_App{
|
|||
*/
|
||||
public static function isShipped($appid){
|
||||
$info = self::getAppInfo($appid);
|
||||
if(isset($info['shipped']) && $info['shipped']=='true'){
|
||||
if(isset($info['shipped']) && $info['shipped']=='true') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -247,7 +247,7 @@ class OC_App{
|
|||
OC_Appconfig::setValue( $app, 'enabled', 'no' );
|
||||
|
||||
// check if app is a shipped app or not. if not delete
|
||||
if(!OC_App::isShipped( $app )){
|
||||
if(!OC_App::isShipped( $app )) {
|
||||
OC_Installer::removeApp( $app );
|
||||
}
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ class OC_App{
|
|||
$app1[$i]['ocs_id'] = $app['id'];
|
||||
$app1[$i]['internal'] = $app1[$i]['active'] = 0;
|
||||
$app1[$i]['update'] = false;
|
||||
if($app['label']=='recommended'){
|
||||
if($app['label']=='recommended') {
|
||||
$app1[$i]['internallabel'] = 'Recommended';
|
||||
$app1[$i]['internalclass'] = 'recommendedapp';
|
||||
}else{
|
||||
|
|
|
@ -550,7 +550,7 @@ class OC {
|
|||
}
|
||||
|
||||
$request = OC_Request::getPathInfo();
|
||||
if(substr($request, -3) !== '.js'){// we need these files during the upgrade
|
||||
if(substr($request, -3) !== '.js') {// we need these files during the upgrade
|
||||
self::checkMaintenanceMode();
|
||||
self::checkUpgrade();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class OC_Connector_Sabre_Request extends Sabre_HTTP_Request {
|
|||
* @return string
|
||||
*/
|
||||
public function getRawServerValue($field) {
|
||||
if($field == 'REQUEST_URI'){
|
||||
if($field == 'REQUEST_URI') {
|
||||
return $this->getUri();
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -28,7 +28,7 @@ class OC_FileProxy_FileOperations extends OC_FileProxy{
|
|||
static $rootView;
|
||||
|
||||
public function premkdir($path) {
|
||||
if(!self::$rootView){
|
||||
if(!self::$rootView) {
|
||||
self::$rootView = new \OC\Files\View('');
|
||||
}
|
||||
return !self::$rootView->file_exists($path);
|
||||
|
|
|
@ -95,7 +95,7 @@ class OC_FileProxy_Quota extends OC_FileProxy{
|
|||
}
|
||||
|
||||
public function preCopy($path1, $path2) {
|
||||
if(!self::$rootView){
|
||||
if(!self::$rootView) {
|
||||
self::$rootView = new \OC\Files\View('');
|
||||
}
|
||||
return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==-1);
|
||||
|
|
|
@ -18,7 +18,7 @@ class Permissions {
|
|||
* @param \OC\Files\Storage\Storage|string $storage
|
||||
*/
|
||||
public function __construct($storage){
|
||||
if($storage instanceof \OC\Files\Storage\Storage){
|
||||
if($storage instanceof \OC\Files\Storage\Storage) {
|
||||
$this->storageId = $storage->getId();
|
||||
}else{
|
||||
$this->storageId = $storage;
|
||||
|
|
|
@ -51,19 +51,19 @@ abstract class Common implements \OC\Files\Storage\Storage {
|
|||
}
|
||||
public function getPermissions($path){
|
||||
$permissions = 0;
|
||||
if($this->isCreatable($path)){
|
||||
if($this->isCreatable($path)) {
|
||||
$permissions |= \OCP\PERMISSION_CREATE;
|
||||
}
|
||||
if($this->isReadable($path)){
|
||||
if($this->isReadable($path)) {
|
||||
$permissions |= \OCP\PERMISSION_READ;
|
||||
}
|
||||
if($this->isUpdatable($path)){
|
||||
if($this->isUpdatable($path)) {
|
||||
$permissions |= \OCP\PERMISSION_UPDATE;
|
||||
}
|
||||
if($this->isDeletable($path)){
|
||||
if($this->isDeletable($path)) {
|
||||
$permissions |= \OCP\PERMISSION_DELETE;
|
||||
}
|
||||
if($this->isSharable($path)){
|
||||
if($this->isSharable($path)) {
|
||||
$permissions |= \OCP\PERMISSION_SHARE;
|
||||
}
|
||||
return $permissions;
|
||||
|
|
|
@ -270,12 +270,12 @@ class OC_Installer{
|
|||
public static function isUpdateAvailable( $app ) {
|
||||
$ocsid=OC_Appconfig::getValue( $app, 'ocsid', '');
|
||||
|
||||
if($ocsid<>''){
|
||||
if($ocsid<>'') {
|
||||
|
||||
$ocsdata=OC_OCSClient::getApplication($ocsid);
|
||||
$ocsversion= (string) $ocsdata['version'];
|
||||
$currentversion=OC_App::getAppVersion($app);
|
||||
if($ocsversion<>$currentversion){
|
||||
if($ocsversion<>$currentversion) {
|
||||
return($ocsversion);
|
||||
|
||||
}else{
|
||||
|
@ -326,22 +326,22 @@ class OC_Installer{
|
|||
*/
|
||||
public static function removeApp( $name, $options = array()) {
|
||||
|
||||
if(isset($options['keeppreferences']) and $options['keeppreferences']==false ){
|
||||
if(isset($options['keeppreferences']) and $options['keeppreferences']==false ) {
|
||||
// todo
|
||||
// remove preferences
|
||||
}
|
||||
|
||||
if(isset($options['keepappconfig']) and $options['keepappconfig']==false ){
|
||||
if(isset($options['keepappconfig']) and $options['keepappconfig']==false ) {
|
||||
// todo
|
||||
// remove app config
|
||||
}
|
||||
|
||||
if(isset($options['keeptables']) and $options['keeptables']==false ){
|
||||
if(isset($options['keeptables']) and $options['keeptables']==false ) {
|
||||
// todo
|
||||
// remove app database tables
|
||||
}
|
||||
|
||||
if(isset($options['keepfiles']) and $options['keepfiles']==false ){
|
||||
if(isset($options['keepfiles']) and $options['keepfiles']==false ) {
|
||||
// todo
|
||||
// remove user files
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ class OC_OCS_Privatedata {
|
|||
$app = addslashes(strip_tags($parameters['app']));
|
||||
$key = addslashes(strip_tags($parameters['key']));
|
||||
$value = OC_OCS::readData('post', 'value', 'text');
|
||||
if(OC_Preferences::setValue($user, $app, $key, $value)){
|
||||
if(OC_Preferences::setValue($user, $app, $key, $value)) {
|
||||
return new OC_OCS_Result(null, 100);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,8 +246,8 @@ class OC_Util {
|
|||
$handler = ini_get("session.save_handler");
|
||||
if($handler == "files") {
|
||||
$tmpDir = session_save_path();
|
||||
if($tmpDir != ""){
|
||||
if(!@is_writable($tmpDir)){
|
||||
if($tmpDir != "") {
|
||||
if(!@is_writable($tmpDir)) {
|
||||
$errors[]=array('error' => 'The temporary folder used by PHP to save the session data is either incorrect or not writable! Please check : '.session_save_path().'<br/>',
|
||||
'hint'=>'Please ask your server administrator to grant write access or define another temporary folder.');
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ switch($operation){
|
|||
case 'register':
|
||||
|
||||
// Here external apps can register with an ownCloud
|
||||
if(empty($_GET['name']) || empty($_GET['url'])){
|
||||
if(empty($_GET['name']) || empty($_GET['url'])) {
|
||||
// Invalid request
|
||||
echo 401;
|
||||
} else {
|
||||
|
@ -54,13 +54,13 @@ switch($operation){
|
|||
foreach($consumer['scopes'] as $requiredapp){
|
||||
// App scopes are in this format: app_$appname
|
||||
$requiredapp = end(explode('_', $requiredapp));
|
||||
if(!in_array($requiredapp, $apps)){
|
||||
if(!in_array($requiredapp, $apps)) {
|
||||
$notfound[] = $requiredapp;
|
||||
}
|
||||
}
|
||||
if(!empty($notfound)){
|
||||
if(!empty($notfound)) {
|
||||
// We need more apps :( Show error
|
||||
if(count($notfound)==1){
|
||||
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.';
|
||||
} 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.';
|
||||
|
|
Загрузка…
Ссылка в новой задаче