summaryrefslogtreecommitdiffstats
path: root/apps/user_openid
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-10-16 21:42:24 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-10-16 21:42:24 +0200
commitb0127e39188f2268dbd74714e5d2f0e1a2b6ce7b (patch)
tree63b365930c0232613f28ffbd477202f857fdabee /apps/user_openid
parentd9372ac76606cd10e680852dde090171f04f5dee (diff)
downloadnextcloud-server-b0127e39188f2268dbd74714e5d2f0e1a2b6ce7b.tar.gz
nextcloud-server-b0127e39188f2268dbd74714e5d2f0e1a2b6ce7b.zip
use OC_Log instead of error_log
Diffstat (limited to 'apps/user_openid')
-rw-r--r--apps/user_openid/appinfo/app.php14
-rw-r--r--apps/user_openid/phpmyid.php12
-rw-r--r--apps/user_openid/user.php2
3 files changed, 8 insertions, 20 deletions
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index 546f9f4565a..912019a9700 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'){
- if(defined("DEBUG") && DEBUG) {error_log('openid retured');}
+ OC_Log::write('user_openid','openid retured',OC_Log::DEBUG);
$openid = new SimpleOpenID;
$openid->SetIdentity($_GET['openid_identity']);
$openid_validation_result = $openid->ValidateWithServer();
if ($openid_validation_result == true){ // OK HERE KEY IS VALID
- if(defined("DEBUG") && DEBUG) {error_log('auth sucessfull');}
+ OC_Log::write('user_openid','auth sucessfull',OC_Log::DEBUG);
$identity=$openid->GetIdentity();
- if(defined("DEBUG") && DEBUG) {error_log("auth as $identity");}
+ OC_Log::write('user_openid','auth as '.$identity,OC_Log::DEBUG);
$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();
- if(defined("DEBUG") && DEBUG) {error_log("ERROR CODE: " . $error['code']);}
- if(defined("DEBUG") && DEBUG) {error_log("ERROR DESCRIPTION: " . $error['description']);}
+ OC_Log::write('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR);
+ OC_Log::write('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR);
}else{ // Signature Verification Failed
- if(defined("DEBUG") && DEBUG) {error_log("INVALID AUTHORIZATION");}
+ OC_Log::write('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR);
}
}else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request
- if(defined("DEBUG") && DEBUG) {error_log("USER CANCELED REQUEST");}
+ OC_Log::write('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG);
return false;
}
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index 5009fa410aa..d8168c9a10d 100644
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -1053,8 +1053,6 @@ function debug ($x, $m = null) {
} else {
$x .= "\n";
}
-
- if(defined("DEBUG") && DEBUG) {error_log($x . "\n", 3, $profile['logfile']);}
}
@@ -1513,7 +1511,6 @@ function wrap_html ( $message ) {
</body>
</html>
';
- if(defined("DEBUG") && DEBUG) {error_log($html);}
echo $html;
exit(0);
}
@@ -1658,15 +1655,6 @@ $profile['req_url'] = sprintf("%s://%s%s",
// $port,//host already includes the path
$_SERVER["REQUEST_URI"]);
-// $fullId='user.php/'.$USERNAME.'/';
-// $incompleteId='user.php/';
-
-// if(!strpos($profile['req_url'],$fullId)){
-// $profile['req_url']=str_replace($incompleteId,$fullId,$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 3cbc38491ca..a267e020507 100644
--- a/apps/user_openid/user.php
+++ b/apps/user_openid/user.php
@@ -40,7 +40,7 @@ require_once '../../lib/base.php';
OC_Util::checkAppEnabled('user_openid');
if(!OC_User::userExists($USERNAME)){
- if(defined("DEBUG") && DEBUG) {error_log($USERNAME.' doesn\'t exist');}
+ OC_Log::write('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN);
$USERNAME='';
}
$IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME;