diff options
author | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
---|---|---|
committer | Bart Visscher <bart@thisnet.nl> | 2011-09-18 19:37:54 +0200 |
commit | 82c7598861db175617694891bb9f21b426426225 (patch) | |
tree | fce8fb4717b4cc2a5dc6da8835bdb51b5fb40054 /apps | |
parent | d5656716f69caa6a1eb98706994ffcb9a08553a7 (diff) | |
download | nextcloud-server-82c7598861db175617694891bb9f21b426426225.tar.gz nextcloud-server-82c7598861db175617694891bb9f21b426426225.zip |
Remove global vars and use the OC static version.
Removed global vars are DOCUMENTROOT, SERVERROOT, SUBURI, WEBROOT and CONFIG_DATADIRECTORY
Diffstat (limited to 'apps')
-rw-r--r-- | apps/calendar/caldav.php | 2 | ||||
-rw-r--r-- | apps/contacts/carddav.php | 2 | ||||
-rw-r--r-- | apps/media/ajax/api.php | 3 | ||||
-rw-r--r-- | apps/media/lib_ampache.php | 3 | ||||
-rw-r--r-- | apps/media/server/xml.server.php | 1 | ||||
-rw-r--r-- | apps/unhosted/compat.php | 2 | ||||
-rw-r--r-- | apps/user_openid/appinfo/app.php | 3 | ||||
-rw-r--r-- | apps/user_openid/user.php | 3 | ||||
-rw-r--r-- | apps/user_openid/user_openid.php | 5 |
9 files changed, 9 insertions, 15 deletions
diff --git a/apps/calendar/caldav.php b/apps/calendar/caldav.php index 49fc9633365..15259ad4461 100644 --- a/apps/calendar/caldav.php +++ b/apps/calendar/caldav.php @@ -38,7 +38,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri($WEBROOT.'/apps/calendar/caldav.php'); +$server->setBaseUri(OC::$WEBROOT.'/apps/calendar/caldav.php'); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CalDAV_Plugin()); diff --git a/apps/contacts/carddav.php b/apps/contacts/carddav.php index 77b3c105deb..4bc215453c4 100644 --- a/apps/contacts/carddav.php +++ b/apps/contacts/carddav.php @@ -38,7 +38,7 @@ $nodes = array( // Fire up server $server = new Sabre_DAV_Server($nodes); -$server->setBaseUri($WEBROOT.'/apps/contacts/carddav.php'); +$server->setBaseUri(OC::$WEBROOT.'/apps/contacts/carddav.php'); // Add plugins $server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud')); $server->addPlugin(new Sabre_CardDAV_Plugin()); diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php index 3b4932728da..31ff33bf03a 100644 --- a/apps/media/ajax/api.php +++ b/apps/media/ajax/api.php @@ -41,7 +41,6 @@ if(!isset($_POST['action']) and isset($_GET['action'])){ foreach($arguments as &$argument){ $argument=stripslashes($argument); } -global $CONFIG_DATADIRECTORY; @ob_clean(); if(!isset($arguments['artist'])){ $arguments['artist']=0; @@ -155,4 +154,4 @@ function findMusic($path='/'){ return $music; } -?>
\ No newline at end of file +?> diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php index b3bd7b16189..dc88e35a697 100644 --- a/apps/media/lib_ampache.php +++ b/apps/media/lib_ampache.php @@ -157,7 +157,6 @@ class OC_MEDIA_AMPACHE{ } private static function printSong($song,$artistName=false,$albumName=false){ - global $WEBROOT; if(!$artistName){ $artistName=OC_MEDIA_COLLECTION::getArtistName($song['song_artist']); } @@ -363,4 +362,4 @@ class OC_MEDIA_AMPACHE{ } } -?>
\ No newline at end of file +?> diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 516ab740072..e61fadf234c 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -35,7 +35,6 @@ foreach($arguments as &$argument){ $argument=stripslashes($argument); } ob_clean(); -global $CONFIG_DATADIRECTORY; if(isset($arguments['action'])){ error_log($arguments['action']); switch($arguments['action']){ diff --git a/apps/unhosted/compat.php b/apps/unhosted/compat.php index 5034d04de31..00d6a7c2eeb 100644 --- a/apps/unhosted/compat.php +++ b/apps/unhosted/compat.php @@ -67,7 +67,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' $server = new Sabre_DAV_Server($publicDir); // Path to our script - $server->setBaseUri("$WEBROOT/apps/unhosted/compat.php/$ownCloudUser"); + $server->setBaseUri(OC::$WEBROOT."/apps/unhosted/compat.php/$ownCloudUser"); // Auth backend $authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_UnhostedWeb::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope)); diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php index e8e9fd2296b..578f8f4dade 100644 --- a/apps/user_openid/appinfo/app.php +++ b/apps/user_openid/appinfo/app.php @@ -32,13 +32,12 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ $openid_validation_result = $openid->ValidateWithServer(); if ($openid_validation_result == true){ // OK HERE KEY IS VALID error_log('auth sucessfull'); - global $WEBROOT; $identity=$openid->GetIdentity(); error_log("auth as $identity"); $user=OC_USER_OPENID::findUserForIdentity($identity); if($user){ $_SESSION['user_id']=$user; - header("Location: $WEBROOT"); + header("Location: ".OC::$WEBROOT); } }else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR $error = $openid->GetError(); diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php index 52fa1047344..60e12ed88e0 100644 --- a/apps/user_openid/user.php +++ b/apps/user_openid/user.php @@ -42,10 +42,9 @@ if(!OC_User::userExists($USERNAME)){ error_log($USERNAME.' doesn\'t exist'); $USERNAME=''; } -global $WEBROOT; $IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME; require_once 'phpmyid.php'; -?>
\ No newline at end of file +?> diff --git a/apps/user_openid/user_openid.php b/apps/user_openid/user_openid.php index d9af94dcafa..df050e908de 100644 --- a/apps/user_openid/user_openid.php +++ b/apps/user_openid/user_openid.php @@ -36,13 +36,12 @@ class OC_USER_OPENID extends OC_User_Backend { * Check if the password is correct without logging in the user */ public function checkPassword( $uid, $password ){ - global $WEBROOT; // Get identity from user and redirect browser to OpenID Server $openid = new SimpleOpenID; $openid->SetIdentity($uid); $openid->SetTrustRoot('http://' . $_SERVER["HTTP_HOST"]); if ($openid->GetOpenIDServer()){ - $openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . $WEBROOT); // Send Response from OpenID server to this script + $openid->SetApprovedURL('http://' . $_SERVER["HTTP_HOST"] . OC::$WEBROOT); // Send Response from OpenID server to this script $openid->Redirect(); // This will redirect user to OpenID Server exit; }else{ @@ -67,4 +66,4 @@ class OC_USER_OPENID extends OC_User_Backend { -?>
\ No newline at end of file +?> |