[xiph-commits] r14905 - in branches/dir.xiph.org: . inc

balbinus at svn.xiph.org balbinus at svn.xiph.org
Sat May 17 09:21:55 PDT 2008


Author: balbinus
Date: 2008-05-17 09:21:55 -0700 (Sat, 17 May 2008)
New Revision: 14905

Modified:
   branches/dir.xiph.org/inc/lib.apilog.php
   branches/dir.xiph.org/listen.php
Log:
More logging\!

Modified: branches/dir.xiph.org/inc/lib.apilog.php
===================================================================
--- branches/dir.xiph.org/inc/lib.apilog.php	2008-05-17 10:16:26 UTC (rev 14904)
+++ branches/dir.xiph.org/inc/lib.apilog.php	2008-05-17 16:21:55 UTC (rev 14905)
@@ -91,8 +91,8 @@
         $ip = utils::getRealIp();
         $ip = $ip !== false ? $ip : '127.0.0.1';
         
-        $sql = 'INSERT INTO `sid_log_%s` (`sid`, `server_id`, `mountpoint_id`, `listen_url`, `listen_url_hash`, `issed_for`) '
-          .'VALUES (%d, %d, %d, "%s", "%s", INET_ATON("%s"));';
+        $sql = 'INSERT INTO `sid_log_%s` (`sid`, `server_id`, `mountpoint_id`, `listen_url`, `listen_url_hash`, `issued_for`) '
+          .'VALUES ("%s", %d, %d, "%s", "%s", INET_ATON("%s"));';
         $sql = sprintf($sql, date('Ymd'),
                              $db->escape($sid),
                              intval($server_id),

Modified: branches/dir.xiph.org/listen.php
===================================================================
--- branches/dir.xiph.org/listen.php	2008-05-17 10:16:26 UTC (rev 14904)
+++ branches/dir.xiph.org/listen.php	2008-05-17 16:21:55 UTC (rev 14905)
@@ -101,6 +101,27 @@
 	}
 }
 
+// Logging
+try
+{
+	$mountpoint = Mountpoint::retrieveByPk($p_id);
+	if ($mountpoint instanceOf Mountpoint)
+	{
+		$sn = $mountpoint->getStreamName();
+		$db = DirXiphOrgLogDBC::getInstance();
+		$sql = "INSERT INTO `playlist_log_%s` (`mountpoint_id`, `stream_name_hash`, `accessed_by`) "
+		."VALUES (%d, '%s', INET_ATON('%s'));";
+		$sql = sprintf($sql, date('Ymd'), $p_id,
+				$db->escape(hash('md5', $sn)),
+				$db->escape(utils::getRealIp()));
+		$db->query($sql);
+	}
+}
+catch (SQLException $e)
+{
+	// Nothing to do, it's just logging after all...
+}
+
 /******************************************************************************/
 /*                                     VIEW                                   */
 /******************************************************************************/



More information about the commits mailing list