diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/admin_export/settings.php | 28 | ||||
-rw-r--r-- | apps/media/ajax/autoupdate.php | 2 | ||||
-rw-r--r-- | apps/media/lib_ampache.php | 1 | ||||
-rw-r--r-- | apps/media/lib_media.php | 2 | ||||
-rw-r--r-- | apps/media/lib_scanner.php | 8 | ||||
-rw-r--r-- | apps/media/server/xml.server.php | 2 | ||||
-rw-r--r-- | apps/remoteStorage/lib_remoteStorage.php | 8 | ||||
-rw-r--r-- | apps/user_openid/appinfo/app.php | 14 | ||||
-rw-r--r-- | apps/user_openid/phpmyid.php | 12 | ||||
-rw-r--r-- | apps/user_openid/user.php | 2 |
10 files changed, 31 insertions, 48 deletions
diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php index 8308a2b89b5..1685e5c0ca1 100644 --- a/apps/admin_export/settings.php +++ b/apps/admin_export/settings.php @@ -26,14 +26,14 @@ if (isset($_POST['admin_export'])) { $root = OC::$SERVERROOT . "/"; $zip = new ZipArchive(); $filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; - error_log("Creating export file at: " . $filename); + OC_Log::write('admin_export',"Creating export file at: " . $filename,OC_Log::INFO); if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) { exit("Cannot open <$filename>\n"); } if (isset($_POST['owncloud_system'])) { // adding owncloud system files - error_log("Adding owncloud system files to export"); + OC_Log::write('admin_export',"Adding owncloud system files to export",OC_Log::INFO); zipAddDir($root, $zip, false); foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dirname) { zipAddDir($root . $dirname, $zip, true, basename($root) . "/"); @@ -43,7 +43,7 @@ if (isset($_POST['admin_export'])) { if (isset($_POST['owncloud_config'])) { // adding owncloud config // todo: add database export - error_log("Adding owncloud config to export"); + OC_Log::write('admin_export',"Adding owncloud config to export",OC_Log::INFO); zipAddDir($root . "config/", $zip, true, basename($root) . "/"); $zip->addFile($root . '/data/.htaccess', basename($root) . "/data/owncloud.db"); } @@ -53,7 +53,7 @@ if (isset($_POST['admin_export'])) { $zip->addFile($root . '/data/.htaccess', basename($root) . "/data/.htaccess"); $zip->addFile($root . '/data/index.html', basename($root) . "/data/index.html"); foreach (OC_User::getUsers() as $i) { - error_log("Adding owncloud user files of $i to export"); + OC_Log::write('admin_export',"Adding owncloud user files of $i to export",OC_Log::INFO); zipAddDir($root . "data/" . $i, $zip, true, basename($root) . "/data/"); } } @@ -78,19 +78,19 @@ function zipAddDir($dir, $zip, $recursive=true, $internalDir='') { $internalDir.=$dirname.='/'; if ($dirhandle = opendir($dir)) { - while (false !== ( $file = readdir($dirhandle))) { + while (false !== ( $file = readdir($dirhandle))) { - if (( $file != '.' ) && ( $file != '..' )) { + if (( $file != '.' ) && ( $file != '..' )) { - if (is_dir($dir . '/' . $file) && $recursive) { - zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir); - } elseif (is_file($dir . '/' . $file)) { - $zip->addFile($dir . '/' . $file, $internalDir . $file); + if (is_dir($dir . '/' . $file) && $recursive) { + zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir); + } elseif (is_file($dir . '/' . $file)) { + $zip->addFile($dir . '/' . $file, $internalDir . $file); + } + } } - } - } - closedir($dirhandle); + closedir($dirhandle); } else { - error_log("Was not able to open directory: " . $dir); + OC_Log::write('admin_export',"Was not able to open directory: " . $dir,OC_Log::ERROR); } } diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php index ff0923ca032..a78b5e25dd1 100644 --- a/apps/media/ajax/autoupdate.php +++ b/apps/media/ajax/autoupdate.php @@ -30,9 +30,7 @@ $RUNTIME_NOSETUPFS=true; require_once('../../../lib/base.php'); OC_JSON::checkAppEnabled('media'); -if(defined("DEBUG") && DEBUG) {error_log($_GET['autoupdate']);} $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true'); -if(defined("DEBUG") && DEBUG) {error_log((integer)$autoUpdate);} OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate); diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php index 87291958af3..0ad84d66809 100644 --- a/apps/media/lib_ampache.php +++ b/apps/media/lib_ampache.php @@ -195,7 +195,6 @@ class OC_MEDIA_AMPACHE{ $filter=isset($params['filter'])?$params['filter']:''; $exact=isset($params['exact'])?($params['exact']=='true'):false; $artists=OC_MEDIA_COLLECTION::getArtists($filter,$exact); - if(defined("DEBUG") && DEBUG) {error_log('artists found: '.print_r($artists,true));} echo('<root>'); foreach($artists as $artist){ self::printArtist($artist); diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php index 7a666be8c27..485d616e1aa 100644 --- a/apps/media/lib_media.php +++ b/apps/media/lib_media.php @@ -40,7 +40,6 @@ class OC_MEDIA{ */ public static function loginListener($params){ if(isset($_POST['user']) and $_POST['password']){ - if(defined("DEBUG") && DEBUG) {error_log('postlogin');} $name=$_POST['user']; $query=OC_DB::prepare("SELECT user_id from *PREFIX*media_users WHERE user_id LIKE ?"); $uid=$query->execute(array($name))->fetchAll(); @@ -64,7 +63,6 @@ class OC_MEDIA{ $path=substr($path,1); } $path='/'.$path; - error_log("$path was updated"); OC_MEDIA_SCANNER::scanFile($path); } diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php index 9bf9397b19a..ef63cea45df 100644 --- a/apps/media/lib_scanner.php +++ b/apps/media/lib_scanner.php @@ -97,25 +97,25 @@ class OC_MEDIA_SCANNER{ $data=@self::$getID3->analyze($file); getid3_lib::CopyTagsToComments($data); if(!isset($data['comments'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading id3 tags in '$file'");} + OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN); return; } if(!isset($data['comments']['artist'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading artist tag in '$file'");} + OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN); $artist='unknown'; }else{ $artist=stripslashes($data['comments']['artist'][0]); $artist=utf8_encode($artist); } if(!isset($data['comments']['album'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading album tag in '$file'");} + OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN); $album='unknown'; }else{ $album=stripslashes($data['comments']['album'][0]); $album=utf8_encode($album); } if(!isset($data['comments']['title'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading title tag in '$file'");} + OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN); $title='unknown'; }else{ $title=stripslashes($data['comments']['title'][0]); diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 44a16793bf2..2d54c863c79 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -37,7 +37,7 @@ foreach($arguments as &$argument){ } ob_clean(); if(isset($arguments['action'])){ - if(defined("DEBUG") && DEBUG) {error_log($arguments['action']);} + OC_Log::write('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG); switch($arguments['action']){ case 'url_to_song': OC_MEDIA_AMPACHE::url_to_song($arguments); diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php index 5677ab3c6e0..f10a72870a4 100644 --- a/apps/remoteStorage/lib_remoteStorage.php +++ b/apps/remoteStorage/lib_remoteStorage.php @@ -7,7 +7,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"<br />'; $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } $ret = array(); @@ -24,7 +24,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"<br />'; $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } $ret = array(); @@ -45,7 +45,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"<br />'; $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } } @@ -56,7 +56,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"<br />'; $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } } 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; |