Respect coding style

This commit is contained in:
Thomas Müller 2012-09-04 15:34:09 +03:00
parent d14f8fa681
commit e4e0b5a822
1 changed files with 82 additions and 83 deletions

View File

@ -110,7 +110,7 @@ class OC{
$scriptName.='index.php';
//make sure suburi follows the same rules as scriptName
if(substr(OC::$SUBURI, -9)!='index.php') {
if(substr(OC::$SUBURI,-1)!='/'){
if(substr(OC::$SUBURI,-1)!='/' {
OC::$SUBURI=OC::$SUBURI.'/';
}
OC::$SUBURI=OC::$SUBURI.'index.php';
@ -298,16 +298,14 @@ class OC{
//set http auth headers for apache+php-cgi work around
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches))
{
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches)) {
list($name, $password) = explode(':', base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
}
//set http auth headers for apache+php-cgi work around if variable gets renamed by apache
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches))
{
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches)) {
list($name, $password) = explode(':', base64_decode($matches[1]));
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
@ -323,7 +321,7 @@ class OC{
}
// register the stream wrappers
require_once('streamwrappers.php');
require_once 'streamwrappers.php';
stream_wrapper_register("fakedir", "OC_FakeDirStream");
stream_wrapper_register('static', 'OC_StaticStreamWrapper');
stream_wrapper_register('close', 'OC_CloseStreamWrapper');
@ -413,13 +411,13 @@ class OC{
$autosetup_file = OC::$SERVERROOT."/config/autoconfig.php";
if( file_exists( $autosetup_file )) {
OC_Log::write('core', 'Autoconfig file found, setting up owncloud...', OC_Log::INFO);
include( $autosetup_file );
include $autosetup_file;
$_POST['install'] = 'true';
$_POST = array_merge ($_POST, $AUTOCONFIG);
unlink($autosetup_file);
}
OC_Util::addScript('setup');
require_once('setup.php');
require_once 'setup.php';
exit();
}
// Handle WebDAV
@ -446,8 +444,7 @@ class OC{
$file = 'index.php';
}
$file_ext = substr($file, -3);
if ($file_ext != 'php'
|| !self::loadAppScriptFile($app, $file)) {
if ($file_ext != 'php'|| !self::loadAppScriptFile($app, $file)) {
header('HTTP/1.0 404 Not Found');
}
}
@ -462,7 +459,7 @@ class OC{
$file = $app_path . '/' . $file;
unset($app, $app_path);
if (file_exists($file)) {
require_once($file);
require_once $file;
return true;
}
return false;
@ -503,7 +500,8 @@ class OC{
if(!isset($_COOKIE["oc_remember_login"])
|| !isset($_COOKIE["oc_token"])
|| !isset($_COOKIE["oc_username"])
|| !$_COOKIE["oc_remember_login"]) {
|| !$_COOKIE["oc_remember_login"])
{
return false;
}
OC_App::loadApps(array('authentication'));
@ -512,7 +510,8 @@ class OC{
}
// confirm credentials in cookie
if(isset($_COOKIE['oc_token']) && OC_User::userExists($_COOKIE['oc_username']) &&
OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") === $_COOKIE['oc_token']) {
OC_Preferences::getValue($_COOKIE['oc_username'], "login", "token") === $_COOKIE['oc_token'])
{
OC_User::setUserId($_COOKIE['oc_username']);
OC_Util::redirectToDefaultPage();
}