]> source.dussan.org Git - nextcloud-server.git/commitdiff
port some of the log call to the new public api
authorFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 12:29:34 +0000 (14:29 +0200)
committerFrank Karlitschek <frank@owncloud.org>
Tue, 1 May 2012 12:29:34 +0000 (14:29 +0200)
more to come

apps/gallery/lib/hooks_handlers.php
apps/media/lib_scanner.php
apps/media/server/xml.server.php
apps/user_migrate/admin.php
apps/user_openid/appinfo/app.php
apps/user_openid/user.php

index 178d8f3da155af6ddc680c0711425bef3da2d8f6..737c38c0593464da303aa65d06887e1d7df9182d 100644 (file)
@@ -52,7 +52,7 @@ class OC_Gallery_Hooks_Handlers {
     if ($new_album_name == '')
       $new_album_name = 'main';
 
-    OC_Log::write(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG);
+    OCP\Util::writeLog(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG);
     OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path);
 
     return OC_Gallery_Album::find(OC_User::getUser(), null, $path);
@@ -110,7 +110,7 @@ class OC_Gallery_Hooks_Handlers {
       if ($olddir == '') $olddir = '/';
       if ($newdir == '') $newdir = '/';
       if (!self::isPhoto($newpath)) return;
-      OC_Log::write(self::$APP_TAG, 'Moving photo from '.$oldpath.' to '.$newpath, OC_Log::DEBUG);
+      OCP\Util::writeLog(self::$APP_TAG, 'Moving photo from '.$oldpath.' to '.$newpath, OC_Log::DEBUG);
       $album;
       $newAlbumId;
       $oldAlbumId;
index 78c6ad491da32c648e213616dd0d8a072146f59b..5d652c1b39de60c0df7d1df256d49e6be246958f 100644 (file)
@@ -72,23 +72,23 @@ class OC_MEDIA_SCANNER{
                $data=@self::$getID3->analyze($file);
                getid3_lib::CopyTagsToComments($data);
                if(!isset($data['comments'])){
-                       OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN);
+                       OCP\Util::writeLog('media',"error reading id3 tags in '$file'",OC_Log::WARN);
                        return;
                }
                if(!isset($data['comments']['artist'])){
-                       OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN);
+                       OCP\Util::writeLog('media',"error reading artist tag in '$file'",OC_Log::WARN);
                        $artist='unknown';
                }else{
                        $artist=stripslashes($data['comments']['artist'][0]);
                }
                if(!isset($data['comments']['album'])){
-                       OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
+                       OCP\Util::writeLog('media',"error reading album tag in '$file'",OC_Log::WARN);
                        $album='unknown';
                }else{
                        $album=stripslashes($data['comments']['album'][0]);
                }
                if(!isset($data['comments']['title'])){
-                       OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
+                       OCP\Util::writeLog('media',"error reading title tag in '$file'",OC_Log::WARN);
                        $title='unknown';
                }else{
                        $title=stripslashes($data['comments']['title'][0]);
index 529783830141a6a9b7b8140b3a7671086887cd4c..1ef48d551b5675f7ee7c3d6e26724e8b2e56f89c 100644 (file)
@@ -37,7 +37,7 @@ foreach($arguments as &$argument){
 }
 @ob_clean();
 if(isset($arguments['action'])){
-       OC_Log::write('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG);
+       OCP\Util::writeLog('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG);
        switch($arguments['action']){
                case 'songs':
                        OC_MEDIA_AMPACHE::songs($arguments);
index 0160753af22ed8db7241c1eb5b43061c719f8b94..643d58867efd9d3e07ae86e6d2b5593a9dffb0cf 100644 (file)
@@ -37,7 +37,7 @@ if (isset($_POST['user_import'])) {
        $to = get_temp_dir().'/'.$importname.'.zip';
        if( !move_uploaded_file( $from, $to ) ){
                $error = array('error'=>'Failed to move the uploaded file','hint'=>'Try checking the permissions of the '.get_temp_dir().' dir.');
-               OC_Log::write( 'user_migrate', "Failed to copy the uploaded file", OC_Log::ERROR );
+               OCP\Util::writeLog( 'user_migrate', "Failed to copy the uploaded file", OC_Log::ERROR );
                $tmpl = new OC_Template('user_migrate', 'admin');
                $tmpl->assign('error',$error);
        return $tmpl->fetchPage();
@@ -84,4 +84,4 @@ if (isset($_POST['user_import'])) {
 // fill template
     $tmpl = new OC_Template('user_migrate', 'admin');
     return $tmpl->fetchPage();
-}
\ No newline at end of file
+}
index cbcbe5442210a5b46a612785ee1cd73b3479d020..730039570a07972cbf647ba854dd0263494bf503 100644 (file)
@@ -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'){
-       OC_Log::write('user_openid','openid retured',OC_Log::DEBUG);
+       OCP\Util::writeLog('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
-               OC_Log::write('user_openid','auth sucessfull',OC_Log::DEBUG);
+               OCP\Util::writeLog('user_openid','auth sucessfull',OC_Log::DEBUG);
                $identity=$openid->GetIdentity();
-               OC_Log::write('user_openid','auth as '.$identity,OC_Log::DEBUG);
+               OCP\Util::writeLog('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();
-               OC_Log::write('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR);
-               OC_Log::write('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR);
+               OCP\Util::writeLog('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR);
+               OCP\Util::writeLog('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR);
        }else{                                            // Signature Verification Failed
-               OC_Log::write('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR);
+               OCP\Util::writeLog('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR);
        }
 }else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request
-       OC_Log::write('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG);
+       OCP\Util::writeLog('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG);
        return false;
 }
 
index 8fec713aa7120c75b65b9fe74a98e8a152945be4..edaa825baf7cfb700eab2ad2345f6f7fdca16881 100644 (file)
@@ -40,7 +40,7 @@ require_once '../../lib/base.php';
 OC_Util::checkAppEnabled('user_openid');
 
 if(!OC_User::userExists($USERNAME)){
-       OC_Log::write('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN);
+       OCP\Util::writeLog('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN);
        $USERNAME='';
 }
 $IDENTITY=OC_Helper::linkToAbsolute( "user_openid", "user.php" ).'/'.$USERNAME;