[Phpfreechat-svn] SF.net SVN: phpfreechat: [703] trunk/src/proxys/log.class.php
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-08-25 19:52:20
|
Revision: 703 Author: kerphi Date: 2006-08-25 12:52:12 -0700 (Fri, 25 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=703&view=rev Log Message: ----------- Bug fix: the log proxy was broken Modified Paths: -------------- trunk/src/proxys/log.class.php Modified: trunk/src/proxys/log.class.php =================================================================== --- trunk/src/proxys/log.class.php 2006-08-25 19:40:39 UTC (rev 702) +++ trunk/src/proxys/log.class.php 2006-08-25 19:52:12 UTC (rev 703) @@ -31,7 +31,7 @@ class pfcProxyCommand_log extends pfcProxyCommand { function run(&$xml_reponse, $p) - { + { $cmdtocheck = array("send", "me", "notice"); if ( in_array($this->name, $cmdtocheck) ) { @@ -46,14 +46,15 @@ $logpath = ($c->proxys_cfg[$this->proxyname]["path"] == "" ? $c->data_public_path : $c->proxys_cfg[$this->proxyname]["path"]); $logfile = $logpath."/".$c->getId()."/chat.log"; - - if (!is_writable($logpath)) + if (is_writable($logpath)) { - if ((file_exists($logfile) && is_writable($logpath)) || - (!file_exists($logfile))) + $f_exists = file_exists($logfile); + if (($f_exists && is_writable($logpath)) || + !$f_exists) { - $fp = fopen($logfile, file_exists($logfile) ? 'a' : 'w'); - fwrite($fp, $recipient." -> ".$param."\n"); + $fp = fopen($logfile, $f_exists ? 'a' : 'w'); + // @todo write logs in a cleaner structured language (xml, html ... ?) + fwrite($fp, $recipient."\t".$sender."\t".$param."\n"); fclose($fp); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |