diff options
-rw-r--r-- | lib/batch.lib.php | 9 | ||||
-rw-r--r-- | lib/class/stream.class.php | 8 | ||||
-rw-r--r-- | lib/stream.lib.php | 6 | ||||
-rw-r--r-- | lib/xmlrpc.php | 6 | ||||
-rw-r--r-- | modules/amazon/AmazonSearchEngine.class.php | 6 | ||||
-rw-r--r-- | modules/localplay/icecast.controller.php | 10 | ||||
-rw-r--r-- | server/xmlrpc.server.php | 6 |
7 files changed, 21 insertions, 30 deletions
diff --git a/lib/batch.lib.php b/lib/batch.lib.php index af4ed80a..867956a9 100644 --- a/lib/batch.lib.php +++ b/lib/batch.lib.php @@ -64,16 +64,11 @@ function send_zip( $name, $song_files ) { $arc->set_options( $options ); $arc->add_files( $song_files ); if (count($arc->error)) { - if (conf('debug')) { - log_event($GLOBALS['user']->username,'archive',"Error: unable to add songs"); - - } + debug_event('archive',"Error: unable to add songs",'3'); } // if failed to add songs if (!$arc->create_archive()) { - if (conf('debug')) { - log_event($GLOBALS['user']->username,'archive',"Error: unable to create archive"); - } + debug_event('archive',"Error: unable to create archive",'3'); } // if failed to create archive $arc->download_file(); diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 73892615..25f3707f 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -232,7 +232,7 @@ class Stream { /* Open the file for writing */ if (!$handle = @fopen($filename, "w")) { - log_event($_SESSION['userdata']['username'],"icecast","Fopen: $filename Failed"); + debug_event("icecast","Fopen: $filename Failed",'3'); echo _("Error, cannot write") . " $filename<br>\n"; exit; } @@ -243,7 +243,7 @@ class Stream { echo "$song->file<br>\n"; $line = "$song->file\n"; if (!fwrite($handle, $line)) { - log_event($_SESSION['userdata']['username'],"icecast","Fwrite: Unabled to write $line into $filename"); + debug_event("icecast","Fwrite: Unabled to write $line into $filename",'3'); echo _("Error, cannot write song in file") . " $song->file --> $filename"; exit; } // if write fails @@ -254,9 +254,7 @@ class Stream { fclose($handle); $cmd = conf('icecast_command'); $cmd = str_replace("%FILE%", $filename, $cmd); - if (conf('debug')) { - log_event($_SESSION['userdata']['username'],"icecast","Exec: $cmd"); - } + debug_event("icecast","Exec: $cmd",'3'); exec($cmd); exit; diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 852df28a..bc30d7cb 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -254,10 +254,8 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { $downsample_command = str_replace("%SAMPLE%",$sample_rate,$downsample_command); // If we are debugging log this event - if (conf('debug')) { - $message = "Start Downsample: $downsample_command"; - log_event($GLOBALS['user']->username,' downsample ',$message); - } // if debug + $message = "Start Downsample: $downsample_command"; + debug_event('downsample',$message,'3'); $fp = @popen($downsample_command, 'rb'); diff --git a/lib/xmlrpc.php b/lib/xmlrpc.php index 5c47c377..8e016f60 100644 --- a/lib/xmlrpc.php +++ b/lib/xmlrpc.php @@ -165,7 +165,9 @@ function remote_session_verify($params) { } $encoded_data = php_xmlrpc_encode($data); - if (conf('debug')) { log_event($_SESSION['userdata']['username'],' xmlrpc-server ',"Encoded Session Verify: $data Recieved: $sid"); } + + debug_event('xmlrpc-server',"Encoded Session Verify: $data Recieved: $sid",'3'); + return new xmlrpcresp($encoded_data); } // remote_session_verify @@ -185,7 +187,7 @@ function remote_server_denied() { $encoded_array = php_xmlrpc_encode($result); - if (conf('debug')) { log_event($_SESSION['userdata']['username'], 'xmlrpc-server',"Access Denied: " . $_SERVER['REMOTE_ADDR']); } + debug_event('xmlrpc-server',"Access Denied: " . $_SERVER['REMOTE_ADDR'],'3'); return new xmlrpcresp($encoded_array); diff --git a/modules/amazon/AmazonSearchEngine.class.php b/modules/amazon/AmazonSearchEngine.class.php index f909b9ff..700d4e95 100644 --- a/modules/amazon/AmazonSearchEngine.class.php +++ b/modules/amazon/AmazonSearchEngine.class.php @@ -120,7 +120,7 @@ class AmazonSearch { "&Operation=ItemSearch&Artist=" . urlencode($terms['artist']) . "&Title=" . urlencode($terms['album']) .
"&Keywords=" . urlencode($terms['keywords']) . "&SearchIndex=" . $type;
- log_event($GLOBALS['user']->username,'amazon-search-results',"_currentPage = " . $this->_currentPage);
+ debug_event('amazon-search-results',"_currentPage = " . $this->_currentPage,'3');
if($this->_currentPage != 0){
$url = $url . "&ItemPage=" . ($this->_currentPage+1);
}
@@ -197,9 +197,7 @@ class AmazonSearch { $this->_sourceTag = trim($cdata);
break;
case 'TotalPages':
- if(conf('debug')){
- log_event($GLOBALS['user']->username,'amazon-search-results',"TotalPages= ". trim($cdata));
- }
+ debug_event('amazon-search-results',"TotalPages= ". trim($cdata),'5');
$this->_maxPage = trim($cdata);
break;
default:
diff --git a/modules/localplay/icecast.controller.php b/modules/localplay/icecast.controller.php index e792549e..c95fd96a 100644 --- a/modules/localplay/icecast.controller.php +++ b/modules/localplay/icecast.controller.php @@ -113,8 +113,7 @@ class AmpacheIcecast { /* Open the file for writing */ if (!$handle = @fopen($filename, "w")) { - log_event($_SESSION['userdata']['username'],"icecast","Fopen: $filename Failed"); - //echo _("Error, cannot write") . " $filename<br>\n"; + debug_event('icecast',"Fopen: $filename Failed",'3'); return false; } @@ -125,8 +124,7 @@ class AmpacheIcecast { //echo "$song->file<br>\n"; $line = "$song->file\n"; if (!fwrite($handle, $line)) { - log_event($_SESSION['userdata']['username'],"icecast","Fwrite: Unabled to write $line into $filename"); - //echo _("Error, cannot write song in file") . " $song->file --> $filename"; + debug_event('icecast',"Fwrite: Unabled to write $line into $filename",'3'); return false; } // if write fails @@ -197,9 +195,7 @@ class AmpacheIcecast { //echo "Starting Server...\n"; $cmd = conf('localplay_icecast_command') . " -c " . conf('localplay_icecast_config') . " -F " . conf('localplay_icecast_tracklist') . " -B"; - if (conf('debug')) { - log_event($_SESSION['userdata']['username'],"icecast","Exec: $cmd"); - } + debug_event('icecast',"Exec: $cmd",'5'); exec($cmd); } diff --git a/server/xmlrpc.server.php b/server/xmlrpc.server.php index 99226262..817af171 100644 --- a/server/xmlrpc.server.php +++ b/server/xmlrpc.server.php @@ -45,7 +45,11 @@ if ($access->check('init-xml-rpc',$_SERVER['REMOTE_ADDR'],'','5','')) { } else { // Access Denied... Sucka!! - $s = new xmlrpc_server( array( "remote_catalog_query" => array("function" => "remote_server_denied"))); + $methods['remote_catalog_query'] = array('function' => 'remote_server_denied'); + $methods['remote_song_query'] = array('function' => 'remote_server_denied'); + $methods['remote_session_verify'] = array('function' => 'remote_server_denied'); + + $s = new xmlrpc_server($methods); } ?> |