diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-09-22 19:24:32 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-09-24 18:41:47 +0200 |
commit | 8648e3c43c26da898c17798f89d60c9505d149b3 (patch) | |
tree | 34e10780eca9ec004900163f958f79192a0f226c /apps/user_openid | |
parent | 9c550e8e9f52efa9c117ef1b577386e555010547 (diff) | |
download | nextcloud-server-8648e3c43c26da898c17798f89d60c9505d149b3.tar.gz nextcloud-server-8648e3c43c26da898c17798f89d60c9505d149b3.zip |
only call error_log() if DEBUG is true
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'apps/user_openid')
-rw-r--r-- | apps/user_openid/appinfo/app.php | 14 | ||||
-rw-r--r-- | apps/user_openid/phpmyid.php | 8 | ||||
-rw-r--r-- | apps/user_openid/user.php | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php index 578f8f4dade..546f9f4565a 100644 --- a/apps/user_openid/appinfo/app.php +++ b/apps/user_openid/appinfo/app.php @@ -26,14 +26,14 @@ OC_User::useBackend('openid'); //check for results from openid requests if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ - error_log('openid retured'); + if(defined("DEBUG") && DEBUG) {error_log('openid retured');} $openid = new SimpleOpenID; $openid->SetIdentity($_GET['openid_identity']); $openid_validation_result = $openid->ValidateWithServer(); if ($openid_validation_result == true){ // OK HERE KEY IS VALID - error_log('auth sucessfull'); + if(defined("DEBUG") && DEBUG) {error_log('auth sucessfull');} $identity=$openid->GetIdentity(); - error_log("auth as $identity"); + if(defined("DEBUG") && DEBUG) {error_log("auth as $identity");} $user=OC_USER_OPENID::findUserForIdentity($identity); if($user){ $_SESSION['user_id']=$user; @@ -41,13 +41,13 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ } }else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR $error = $openid->GetError(); - error_log("ERROR CODE: " . $error['code']); - error_log("ERROR DESCRIPTION: " . $error['description']); + if(defined("DEBUG") && DEBUG) {error_log("ERROR CODE: " . $error['code']);} + if(defined("DEBUG") && DEBUG) {error_log("ERROR DESCRIPTION: " . $error['description']);} }else{ // Signature Verification Failed - error_log("INVALID AUTHORIZATION"); + if(defined("DEBUG") && DEBUG) {error_log("INVALID AUTHORIZATION");} } }else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request - error_log("USER CANCELED REQUEST"); + if(defined("DEBUG") && DEBUG) {error_log("USER CANCELED REQUEST");} return false; } diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index 24fab44ca7a..09538b61ab1 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -1054,7 +1054,7 @@ function debug ($x, $m = null) { $x .= "\n"; } - error_log($x . "\n", 3, $profile['logfile']); + if(defined("DEBUG") && DEBUG) {error_log($x . "\n", 3, $profile['logfile']);} } @@ -1501,7 +1501,7 @@ function wrap_html ( $message ) { </body> </html> '; - error_log($html); + if(defined("DEBUG") && DEBUG) {error_log($html);} echo $html; exit(0); } @@ -1653,8 +1653,8 @@ $profile['req_url'] = sprintf("%s://%s%s", // $profile['req_url']=str_replace($incompleteId,$fullId,$profile['req_url']); // } -// error_log('inc id: '.$fullId); -// error_log('req url: '.$profile['req_url']); +// if(defined("DEBUG") && DEBUG) {error_log('inc id: '.$fullId);} +// if(defined("DEBUG") && DEBUG) {error_log('req url: '.$profile['req_url']);} // Set the default allowance for testing if (! array_key_exists('allow_test', $profile)) diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php index 60e12ed88e0..d90e0b71900 100644 --- a/apps/user_openid/user.php +++ b/apps/user_openid/user.php @@ -39,7 +39,7 @@ $RUNTIME_NOAPPS=false; require_once '../../lib/base.php'; if(!OC_User::userExists($USERNAME)){ - error_log($USERNAME.' doesn\'t exist'); + if(defined("DEBUG") && DEBUG) {error_log($USERNAME.' doesn\'t exist');} $USERNAME=''; } $IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME; |