phpfreechat-svn Mailing List for phpFreeChat (Page 21)
Status: Beta
Brought to you by:
kerphi
You can subscribe to this list here.
2006 |
Jan
|
Feb
(2) |
Mar
|
Apr
(61) |
May
(56) |
Jun
(96) |
Jul
(23) |
Aug
(62) |
Sep
(76) |
Oct
(48) |
Nov
(28) |
Dec
(28) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(31) |
Feb
(40) |
Mar
(29) |
Apr
(11) |
May
(6) |
Jun
(18) |
Jul
(18) |
Aug
(108) |
Sep
(24) |
Oct
(6) |
Nov
(21) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(16) |
Apr
|
May
(3) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(3) |
Oct
|
Nov
(3) |
Dec
(2) |
2009 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ke...@us...> - 2006-09-17 20:51:45
|
Revision: 767 http://svn.sourceforge.net/phpfreechat/?rev=767&view=rev Author: kerphi Date: 2006-09-17 13:51:29 -0700 (Sun, 17 Sep 2006) Log Message: ----------- Work in progress: the disconnect by timeout process is buggy (don't checkout this revision) Modified Paths: -------------- trunk/src/commands/connect.class.php trunk/src/commands/getnewmsg.class.php trunk/src/commands/getonlinenick.class.php trunk/src/commands/join.class.php trunk/src/commands/privmsg.class.php trunk/src/commands/send.class.php trunk/src/containers/file.class.php trunk/src/pfcuserconfig.class.php Removed Paths: ------------- trunk/src/containers/memory.class.php Modified: trunk/src/commands/connect.class.php =================================================================== --- trunk/src/commands/connect.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/connect.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -30,11 +30,11 @@ $chanrecip = pfcCommand_join::GetRecipient($channame); $chanid = pfcCommand_join::GetRecipientId($channame); // reset the fromid flag - $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$chanid; + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$chanid; $from_id = $container->getLastId($chanrecip)-$c->max_msg; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; // reset the oldmsg flag - $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$chanid; + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$chanid; $_SESSION[$oldmsg_sid] = true; } Modified: trunk/src/commands/getnewmsg.class.php =================================================================== --- trunk/src/commands/getnewmsg.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/getnewmsg.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -19,21 +19,21 @@ //$xml_reponse->addScript("alert('getnewmsg: sender=".addslashes($sender)." param=".addslashes($param)." recipient=".addslashes($recipient)." recipientid=".addslashes($recipientid)."');"); // check this methode is not being called - if( isset($_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid]) ) + if( isset($_SESSION["pfc_lock_readnewmsg_".$c->getId()."_".$clientid]) ) { // kill the lock if it has been created more than 10 seconds ago $last_10sec = time()-10; - $last_lock = $_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid]; - if ($last_lock < $last_10sec) $_SESSION[$c->prefix."lock_".$c->getId()."_".$clientid] = 0; - if ( $_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid] != 0 ) exit; + $last_lock = $_SESSION["pfc_lock_readnewmsg_".$c->getId()."_".$clientid]; + if ($last_lock < $last_10sec) $_SESSION["pfc_lock_".$c->getId()."_".$clientid] = 0; + if ( $_SESSION["pfc_lock_readnewmsg_".$c->getId()."_".$clientid] != 0 ) exit; } // create a new lock - $_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid] = time(); + $_SESSION["pfc_lock_readnewmsg_".$c->getId()."_".$clientid] = time(); // read the last from_id value $container =& $c->getContainerInstance(); - $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$recipientid; + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$recipientid; $from_id = 0; if (isset($_SESSION[$from_id_sid])) $from_id = $_SESSION[$from_id_sid]; @@ -43,7 +43,7 @@ if ($from_id < 0) $from_id = 0; } // check if this is the first time you get messages - $oldmsg_sid = $c->prefix."oldmsg_".$c->getId()."_".$clientid."_".$recipientid; + $oldmsg_sid = "pfc_oldmsg_".$c->getId()."_".$clientid."_".$recipientid; $oldmsg = false; if (isset($_SESSION[$oldmsg_sid])) { @@ -91,7 +91,7 @@ } // remove the lock - $_SESSION[$c->prefix."lock_readnewmsg_".$c->getId()."_".$clientid] = 0; + $_SESSION["pfc_lock_readnewmsg_".$c->getId()."_".$clientid] = 0; } } Modified: trunk/src/commands/getonlinenick.class.php =================================================================== --- trunk/src/commands/getonlinenick.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/getonlinenick.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -16,7 +16,7 @@ $container =& $c->getContainerInstance(); // get the cached nickname list - $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$recipientid; + $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$recipientid; $oldnicklist = isset($_SESSION[$nicklist_sid]) ? $_SESSION[$nicklist_sid] : array(); // get the real nickname list Modified: trunk/src/commands/join.class.php =================================================================== --- trunk/src/commands/join.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/join.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -38,7 +38,7 @@ $u->saveInCache(); // clear the cached nicknames list for the given channel - $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$chanid; + $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$chanid; $_SESSION[$nicklist_sid] = NULL; } Modified: trunk/src/commands/privmsg.class.php =================================================================== --- trunk/src/commands/privmsg.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/privmsg.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -67,12 +67,12 @@ $u->saveInCache(); // clear the cached nicknames list for the given channel - $nicklist_sid = $c->prefix."nicklist_".$c->getId()."_".$clientid."_".$pvrecipientid; + $nicklist_sid = "pfc_nicklist_".$c->getId()."_".$clientid."_".$pvrecipientid; $_SESSION[$nicklist_sid] = NULL; // reset the message id indicator // i.e. be ready to re-get all last posted messages - $from_id_sid = $c->prefix."from_id_".$c->getId()."_".$clientid."_".$pvrecipientid; + $from_id_sid = "pfc_from_id_".$c->getId()."_".$clientid."_".$pvrecipientid; $from_id = $container->getLastId($pvrecipient)-$c->max_msg; $_SESSION[$from_id_sid] = ($from_id<0) ? 0 : $from_id; } Modified: trunk/src/commands/send.class.php =================================================================== --- trunk/src/commands/send.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/commands/send.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -57,8 +57,8 @@ // check the sent text is not empty and the user has a none empty nickname $errors = array(); - if ($text == "") $errors[$c->prefix."words"] = _pfc("Text cannot be empty"); - if ($nick == "") $errors[$c->prefix."handle"] = _pfc("Please enter your nickname"); + if ($text == "") $errors["pfc_words"] = _pfc("Text cannot be empty"); + if ($nick == "") $errors["pfc_handle"] = _pfc("Please enter your nickname"); if (count($errors) > 0) { // an error occured, just ignore the message and display errors @@ -68,8 +68,8 @@ $cmdp["param"] = $errors; $cmd =& pfcCommand::Factory("error"); $cmd->run($xml_reponse, $cmdp); - if (isset($errors[$c->prefix."handle"])) // the nick is empty so give it focus - $xml_reponse->addScript("$('".$c->prefix."handle').focus();"); + if (isset($errors["pfc_handle"])) // the nick is empty so give it focus + $xml_reponse->addScript("$('pfc_handle').focus();"); $can_send = false; } @@ -92,8 +92,8 @@ // a message has been posted so : // - clear errors // - give focus to "words" field - $xml_reponse->addScript("pfc.clearError(Array('".$c->prefix."words"."','".$c->prefix."handle"."'));"); - $xml_reponse->addScript("$('".$c->prefix."words').focus();"); + $xml_reponse->addScript("pfc.clearError(Array('pfc_words"."','pfc_handle"."'));"); + $xml_reponse->addScript("$('pfc_words').focus();"); } } } Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/containers/file.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -90,17 +90,25 @@ */ function createNick($chan, $nick, $nickid) { + $c =& $this->c; + // store nickid -> nickname and nickname -> nickid correspondance $this->setMeta($nick, "nickname", "fromnickid", $nickid); $this->setMeta($nickid, "nickid", "fromnickname", $nick); + $this->_registerUserMeta($nickid, $chan); + + if ($c->debug) pxlog("createNick - nickname metadata created: chan=".($chan==NULL?"SERVER":$chan)." nickid=".$nickid, "chat", $c->getId()); + + /* // increment the nick references (used to know when the nick is really disconnected) $nick_ref = $this->getMeta("references", $nickid); if ($nick_ref == NULL || !is_numeric($nick_ref)) $nick_ref = 0; $nick_ref++; $this->setMeta($nick_ref, "references", $nickid); + */ - + $c =& $this->c; $nick_dir = ($chan != NULL) ? $c->container_cfg_channel_dir."/".$this->_encode($chan)."/nicknames" : @@ -119,19 +127,16 @@ // check the if the file exists only in debug mode! if ($c->debug) { + /* if (file_exists($nickid_filename)) - pxlog("createNick(".$nick.", ".$nickid.") - Error: another nickname data file exists, we are overwriting it (nickname takeover)!", "chat", $c->getId()); + pxlog("createNick(".$nick.", ".$nickid.") - Error: another nickname data file exists, we are overwriting it (nickname takeover)!: ".$nickid_filename, "chat", $c->getId()); + else + pxlog("createNick - nickname file created: chan=".($chan==NULL?"SERVER":$chan)." nickid=".$nickid, "chat", $c->getId()); + */ } // trust the caller : this nick is not used touch($nickid_filename); - /* - $fp = fopen($nickid_filename, "w"); - flock ($fp, LOCK_EX); // lock - fwrite($fp, $nickid); - flock ($fp, LOCK_UN); // unlock - fclose($fp); - */ // append the nickname to the cached nickname list $id = $this->isNickOnline($chan, $nick); @@ -141,7 +146,7 @@ $this->_users[$_chan]["nickid"][] = $nickid; $this->_users[$_chan]["timestamp"][] = filemtime($nickid_filename); } - + return true; } @@ -170,13 +175,18 @@ // check the nickname file really exists if (!file_exists($nickid_filename)) - pxlog("removeNick(".$nick.") - Error: the nickname data file to remove doesn't exists", "chat", $c->getId()); + pxlog("removeNick(".$nick.") - Error: the nickname data file to remove doesn't exists: ".$nickid_filename, "chat", $c->getId()); + else + pxlog("removeNick - nickname file removed: chan=".($chan==NULL?"SERVER":$chan)." nickid=".$nickid, "chat", $c->getId()); } $ok = @unlink($nickid_filename); // remove the user metadata if he is disconnected from the server + $this->_unregisterUserMeta($nickid, $chan); + + /* // decrement the nick references and kill the metadata if not more references is found // (used to know when the nick is really disconnected) $nick_ref = $this->getMeta("references", $nickid); @@ -190,7 +200,7 @@ } else $this->setMeta($nick_ref, "references", $nickid); - + */ if ($c->debug) { @@ -222,6 +232,9 @@ // retrive the nickid to update $nickid = $this->getNickId($nick); if ($nickid == "undefined") return false; + + // update the user metadata + $this->_registerUserMeta($nickid, $chan); $c =& $this->c; $there = false; @@ -237,6 +250,8 @@ @touch($nickid_filename); @chmod($nickid_filename, 0700); + if ($c->debug) pxlog("updateNick - nickname file updated: chan=".($chan==NULL?"SERVER":$chan)." nickid=".$nickid, "chat", $c->getId()); + // append the nickname to the cache list $_chan = ($chan == NULL) ? "SERVER" : $chan; $id = $this->isNickOnline($chan, $nick); @@ -373,6 +388,9 @@ $du_nickid = $du_nid; $du_nickname = $this->getNickname($du_nid); + $this->_unregisterUserMeta($du_nickid, $chan); + + /* // decrement the nick references and kill the metadata if not more references is found // (used to know when the nick is really disconnected) $nick_ref = $this->getMeta("references", $du_nickid); @@ -386,7 +404,7 @@ } else $this->setMeta($nick_ref, "references", $du_nickid); - + */ } } @@ -725,6 +743,52 @@ $this->_users = array("nickid" => array(), "timestamp" => array()); } + + function _registerUserMeta($nickid, $chan) + { + $c =& $this->c; + // create or update the nickname references (used to know when the nick is really disconnected) + if ($chan == NULL) $chan = "SERVER"; + $ref = $this->getMeta("references", $nickid); + if ($ref == NULL) + $ref = array(); + else + $ref = explode(';',$ref); + if ($c->debug) pxlog("registerUserMeta -> ref=".implode(';',$ref), "chat", $c->getId()); + if (in_array($chan,$ref)) + return; + else + $ref[] = $chan; + $ref = implode(';',$ref); + $this->setMeta($ref, "references", $nickid); + } + + function _unregisterUserMeta($nickid, $chan) + { + $c =& $this->c; + // decrement the nick references and kill the metadata if not more references is found + // (used to know when the nick is really disconnected) + if ($chan == NULL) $chan = "SERVER"; + $nickname = $this->getNickname($nickid); + $ref = $this->getMeta("references", $nickid); + if ($ref == NULL) $ref = ''; + $ref = explode(';',$ref); + $ref = array_diff($ref, array($chan)); + if (count($ref) == 0) + { + $this->rmMeta("nickid", "fromnickname", $nickname); + $this->rmMeta("nickname", "fromnickid", $nickid); + $this->rmMeta("references", $nickid); // destroy also the reference counter + if ($c->debug) pxlog("_unregisterUserMeta -> destroy!", "chat", $c->getId()); + } + else + { + $ref = implode(';',$ref); + $this->setMeta($ref, "references", $nickid); + if ($c->debug) pxlog("_unregisterUserMeta -> ref=".$ref, "chat", $c->getId()); + } + } + /** * Return a unique id. Each time this function is called, the last id is incremented. Deleted: trunk/src/containers/memory.class.php =================================================================== --- trunk/src/containers/memory.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/containers/memory.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -1,344 +0,0 @@ -<?php -/** - * pfccontainer_memory.class.php - * - * Copyright \xA9 2006 Bernhard J. M. Gr\xFCn <Ber...@go...> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301 USA - */ - -require_once dirname(__FILE__)."/../pfccontainer.class.php"; -require_once dirname(__FILE__)."/../../lib/pear/System/SharedMemory.php"; - -/** - * pfcContainer_Memory is a concrete container which stores data into - * shared memory using a PEAR class. - * Version: 2006-02-28#01 - * - * @author Bernhard J. M. Gr\xFCn <Ber...@go...> - */ -class pfcContainer_Memory extends pfcContainer -{ - var $_users = NULL; - var $_cache_nickid = array(); - var $_memory = NULL; - - function _connect() - { - $c =& $this->c; - if ($c->container_cfg_sm_type=="auto") - $this->_memory =& System_SharedMemory::factory(); - else - $this->_memory =& System_SharedMemory::factory($c->container_cfg_sm_type, $c->container_cfg_sm_options); - } - - function getDefaultConfig() - { - $c =& $this->c; - - $cfg = array(); - $cfg['sm_type'] = ""; - $cfg['sm_options'] = array(); - $cfg['sm_messages'] = ""; - $cfg['sm_message_index'] = ""; - $cfg['sm_nicknames'] = ""; - $cfg['sm_nicknames_time'] = ""; - return $cfg; - } - - function init() - { - $c =& $this->c; - if ($c->container_cfg_sm_type=="") - $c->container_cfg_sm_type = "auto"; - if ($c->container_cfg_sm_options=="" || !is_array($c->container_cfg_sm_options)) - $c->container_cfg_sm_options = array(); - if ($c->container_cfg_sm_messages=="") - $c->container_cfg_sm_messages = $c->prefix.$c->serverid.'messages'; - if ($c->container_cfg_sm_message_index=="") - $c->container_cfg_sm_message_index = $c->prefix.$c->serverid.'message_index'; - if ($c->container_cfg_sm_nicknames=="") - $c->container_cfg_sm_nicknames = $c->prefix.$c->serverid.'nicknames'; - if ($c->container_cfg_sm_nicknames_time=="") - $c->container_cfg_sm_nicknames_time = $c->prefix.$c->serverid.'nicknames_time'; - - $this->_connect(); - $messages=$this->_memory->get - ($c->container_cfg_sm_messages); - $message_index=$this->_memory->get - ($c->container_cfg_sm_message_index); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames); - $nicktime_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - if (!isset($messages) || $messages==NULL || !is_array($messages)) - { - $this->_memory->rm($c->container_cfg_sm_messages); - $this->_memory->set - ($c->container_cfg_sm_messages, array()); - } - if (!isset($message_index) || $message_index==NULL || !is_numeric($message_index)) - $this->_memory->set - ($c->container_cfg_sm_message_index, 0); - if (!isset($nick_array) || $nick_array==NULL || !is_array($nick_array)) - { - $this->_memory->rm($c->container_cfg_sm_nicknames); - $this->_memory->set - ($c->container_cfg_sm_nicknames, array()); - } - if (!isset($nicktime_array) || $nicktime_array==NULL || !is_array($nicktime_array)) - { - $this->_memory->rm($c->container_cfg_sm_nicknames_time); - $this->_memory->set - ($c->container_cfg_sm_nicknames_time, array()); - } - return array(); - } - - function updateNick($nickname) - { - $c =& $this->c; - $this->_connect(); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - $nick_array[$c->nick]=time(); - $this->_memory->set - ($c->container_cfg_sm_nicknames_time, $nick_array); - return true; - } - - /** - * returns the id identifying the nickname's owner session - */ - function getNickId($nickname) - { - if (!isset($this->_cache_nickid[$nickname])) - { - $c =& $this->c; - $nickid = "undefined"; - $this->_connect(); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames); - if (isset($nick_array[$nickname])) - { - // write the nickid into the new nickname place - $nickid=$nick_array[$nickname]; - if ($nickid == "") - $nickid = "undefined"; - } - $this->_cache_nickid[$nickname] = $nickid; - } - return $this->_cache_nickid[$nickname]; - } - - /** - * create an array element containing the new nickname id - * and delete oldnickname array element if the nickname id match - */ - function changeNick($newnick) - { - $c =& $this->c; - $nickid = $c->sessionid; - $oldnickid = $this->getNickId($c->nick); - $this->_connect(); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames); - $nicktime_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - // delete the old nickname element only if the nickid match - if ($nickid == $oldnickid) - { - unset($nick_array[$c->nick]); - unset($nicktime_array[$c->nick]); - } - // write the nickid into the new nicknames element - $nick_array[$newnick]=$nickid; - $nicktime_array[$newnick]=time(); - $this->_memory->set - ($c->container_cfg_sm_nicknames, $nick_array); - $this->_memory->set - ($c->container_cfg_sm_nicknames_time, $nicktime_array); - return $newnick; - } - - function removeNick($nick) - { - $c =& $this->c; - $this->_connect(); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames); - $nicktime_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - $nickid = $this->getNickId($nick); - // don't allow to remove foreign nicknames - if ($c->sessionid == $nickid && isset($nick_array[$nick])) - { - unset($nick_array[$nick]); - unset($nicktime_array[$nick]); - $this->_memory->set - ($c->container_cfg_sm_nicknames, $nick_array); - $this->_memory->set - ($c->container_cfg_sm_nicknames_time, $nicktime_array); - return true; - } - else - return false; - } - - function removeObsoleteNick() - { - $c =& $this->c; - - $deleted_user = array(); - $users = array(); - $this->_connect(); - $nicktime_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - $nick_array=$this->_memory->get - ($c->container_cfg_sm_nicknames); - if (!isset($nicktime_array)) - return $deleted_user; - $deleted=false; - foreach ($nicktime_array as $key => $nick_time) - { - if (time() > ($nick_time+2+($c->refresh_delay/1000)*4) ) - { - $deleted_user[]=$key; - unset($nicktime_array[$key]); - unset($nick_array[$key]); - $deleted=true; - } - else - { - $users[]=$key; - } - } - $this->_users =& $users; // _users will be used by getOnlineUserList - if ($deleted) - { - $this->_memory->set - ($c->container_cfg_sm_nicknames_time, $nicktime_array); - $this->_memory->set - ($c->container_cfg_sm_nicknames, $nick_array); - } - return $deleted_user; - } - - function getOnlineNick() - { - if (is_array($this->_users) && count($this->_users)>0) - return $this->_users; - - $c =& $this->c; - $users = array(); - $this->_connect(); - $nicktime_array=$this->_memory->get - ($c->container_cfg_sm_nicknames_time); - if (!isset($nicktime_array)) - return $users; - foreach ($nicktime_array as $key => $nick_time) - { - $users[]=$key; - } - return $users; - } - - /** - * Returns the last posted message id - */ - function getLastMsgId() - { - // read last message id - $c =& $this->c; - $this->_connect(); - $msg_id=$this->_memory->get - ($c->container_cfg_sm_message_index); - return isset($msg_id) ? $msg_id : 0; - } - - function readNewMsg($from_id) - { - - $c =& $this->c; - $this->_connect(); - $content=$this->_memory->get - ($c->container_cfg_sm_messages); - - // remove old messages - $content = array_slice($content, -$c->max_msg); - $this->_memory->set - ($c->container_cfg_sm_messages, $content); - - // format content in order to extract only necessary information - $formated_content = array(); - $new_from_id = $from_id; - foreach ( $content as $line ) - { - if ($line != "" && $line != "\n") - { - $formated_line = explode( "\t", $line ); - if ($from_id < $formated_line[0]) - $formated_content[] = $formated_line; - if ($new_from_id < $formated_line[0]) - $new_from_id = $formated_line[0]; - } - } - return array("messages" => $formated_content, "new_from_id" => $new_from_id); - } - - function writeMsg($nickname, $message) - { - // format message - $msg_id = $this->_requestMsgId(); - $line = $msg_id."\t"; - $line .= date("d/m/Y")."\t"; - $line .= date("H:i:s")."\t"; - $line .= $nickname."\t"; - $line .= $message; - - // write it to message array - $c =& $this->c; - $this->_connect(); - $content=$this->_memory->get - ($c->container_cfg_sm_messages); - $count=count($content)+1; - $content[$count]=$line; - $this->_memory->set - ($c->container_cfg_sm_messages, $content); - return true; - } - - /** - * used internaly - */ - function _requestMsgId() - { - // read last message id - $c =& $this->c; - $this->_connect(); - $msg_id=$this->_memory->get - ($c->container_cfg_sm_message_index); - if (!is_numeric($msg_id)) - $msg_id = 0; - // increment message id and save it - $msg_id++; - $this->_memory->set - ($c->container_cfg_sm_message_index, $msg_id); - return $msg_id; - } -} - -?> Modified: trunk/src/pfcuserconfig.class.php =================================================================== --- trunk/src/pfcuserconfig.class.php 2006-09-17 09:51:46 UTC (rev 766) +++ trunk/src/pfcuserconfig.class.php 2006-09-17 20:51:29 UTC (rev 767) @@ -41,6 +41,17 @@ if (!isset($this->privmsg)) $this->_setParam("serverid",$c->serverid); } + function &Instance() + { + static $i; + + if (!isset($i)) + { + $i = new pfcUserConfig(); + } + return $i; + } + function &_getParam($p) { if (!isset($this->$p)) @@ -70,95 +81,7 @@ unset($this->$p); } - function &Instance() - { - static $i; - - if (!isset($i)) - { - $i = new pfcUserConfig(); - } - return $i; - } - /* - function init() - { - // echo "init()<br>"; - $ok = true; - - $c =& pfcGlobalConfig::Instance(); - if ($c) - { - $this->nick = $c->nick; - $this->timeout = $c->timeout; - } - else - { - $this->errors[] = "pfcGlobalConfig must be instanciated first"; - $ok = false; - } - - $this->is_init = $ok; - } - function isInit() - { - return $this->is_init; - } - - function &getErrors() - { - return $this->errors; - } - */ - - /* - function getCacheFile() - { - $c =& pfcGlobalConfig::Instance(); - $cachefile = ""; - if ($this->nick != "") - $cachefile = $c->data_private_path."/cache/".$c->prefix."userconfig_".$c->getId()."_".md5($this->nick); - // echo "getCacheFile() = '$cachefile'<br>"; - return $cachefile; - } - */ - /** - * save the pfcUserConfig object into cache if it doesn't exists yet - * else restore the old pfcConfig object - */ - /* - function synchronizeWithCache() - { - // echo "synchronizeWithCache()<br>"; - $c =& pfcGlobalConfig::Instance(); - $cachefile = $this->getCacheFile(); - if ($c->debug) pxlog("pfcUserConfig::synchronizeWithCache: cachefile=".$cachefile, "chatconfig", $c->getId()); - if (file_exists($cachefile)) - { - echo "synchronizeWithCache():exists<br>"; - $pfc_configvar = unserialize(file_get_contents($cachefile)); - foreach($pfc_configvar as $key => $val) - $this->$key = $val; - if ($c->debug) pxlog("pfcUserConfig::synchronizeWithCache: restore pfcUserConfig from cache", "chatconfig", $c->getId()); - } - else - { - // echo "synchronizeWithCache():!exists<br>"; - if (!$this->isInit()) - $this->init(); - $errors =& $this->getErrors(); - if (count($errors) > 0) - { - echo "<ul>"; foreach( $errors as $e ) echo "<li>".$e."</li>"; echo "</ul>"; - exit; - } - // save the validated config in cache - $this->saveInCache(); - } - } - */ - function destroy() { $this->_rmParam("nick"); @@ -181,27 +104,6 @@ $this->_setParam("channels",$this->channels); $this->_setParam("privmsg",$this->privmsg); $this->_setParam("serverid",$this->serverid); - - /* - - // save nickname and active status into sessions - $nickid = $c->prefix."pfcuserconfig_".$c->getId(); - $nickid_nick = $nickid."_nick"; - $nickid_active = $nickid."_active"; - $_SESSION[$nickid_nick] = $this->nick; - $_SESSION[$nickid_active] = $this->active; - */ - - - // @todo - // save the whole object into cache - /* - $cachefile = $this->getCacheFile(); - if ($cachefile == "") - die("Error: cachefile should not be null!"); - file_put_contents($cachefile, serialize(get_object_vars($this))); - if ($c->debug) pxlog("pfcUserConfig::saveInCache: nick=".$this->nick, "chatconfig", $c->getId()); - */ } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-17 09:51:55
|
Revision: 766 http://svn.sourceforge.net/phpfreechat/?rev=766&view=rev Author: kerphi Date: 2006-09-17 02:51:46 -0700 (Sun, 17 Sep 2006) Log Message: ----------- remove this useless file Removed Paths: ------------- trunk/ChangeLog Deleted: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-09-16 20:39:51 UTC (rev 765) +++ trunk/ChangeLog 2006-09-17 09:51:46 UTC (rev 766) @@ -1,2 +0,0 @@ -English : http://www.phpfreechat.net/changelog.en.html -Francais : http://www.phpfreechat.net/changelog.fr.html This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-16 20:40:00
|
Revision: 765 http://svn.sourceforge.net/phpfreechat/?rev=765&view=rev Author: kerphi Date: 2006-09-16 13:39:51 -0700 (Sat, 16 Sep 2006) Log Message: ----------- [en] Now the commands name are case unsensitive. [fr] Maintenant les nom des commandes ne sont plus sensible a la casse. Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/phpfreechat.class.php Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-16 20:32:44 UTC (rev 764) +++ trunk/src/client/pfcclient.js 2006-09-16 20:39:51 UTC (rev 765) @@ -450,7 +450,7 @@ this.cmdhistoryissearching = false; // send the string to the server - re = new RegExp("^(\/[a-z0-9]+)( (.*)|)"); + re = new RegExp("^(\/[a-zA-Z0-9]+)( (.*)|)"); if (wval.match(re)) { /* a user command */ Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-16 20:32:44 UTC (rev 764) +++ trunk/src/phpfreechat.class.php 2006-09-16 20:39:51 UTC (rev 765) @@ -318,10 +318,10 @@ $sender = ""; //if (preg_match("/^\/([a-z]*) ([0-9a-f]*) ([0-9a-f]*)( (.*)|)/", $request, $res)) //if (preg_match("/^\/([a-z]+) ([0-9a-f]+) ([0-9a-f]+) (.*)/", $request, $res)) - if (preg_match("/^\/([a-z0-9]+) ([0-9a-f]+) ([0-9a-f]+)( (.*)|)/", $request, $res)) + if (preg_match("/^\/([a-zA-Z0-9]+) ([0-9a-f]+) ([0-9a-f]+)( (.*)|)/", $request, $res)) { - $rawcmd = isset($res[1]) ? $res[1] : ""; + $rawcmd = strtolower(isset($res[1]) ? $res[1] : ""); $clientid = isset($res[2]) ? $res[2] : ""; $recipientid = isset($res[3]) ? $res[3] : ""; $param = isset($res[5]) ? $res[5] : ""; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-16 20:32:55
|
Revision: 764 http://svn.sourceforge.net/phpfreechat/?rev=764&view=rev Author: kerphi Date: 2006-09-16 13:32:44 -0700 (Sat, 16 Sep 2006) Log Message: ----------- [en] Proxies refactoring : I removed the 'proxy' parameter. I added 'skip_proxys' used to disable a system proxy (ex: censor). I added 'post_proxys' used to append your own proxy to the proxy chaine. I added 'pre_proxys' used to prepend your own proxy to the proxy chaine. I added 'proxys_path' used to define the location of your customized proxies. I also created demo48 to illustrate this powerfull proxy feature. [fr] Refonte des command proxies : J'ai retire les parametre 'proxy'. J'ai ajoute le parametre 'skip_proxys' utilise pour desactive un proxy systeme (ex: censor). J'ai ajoute le parametre 'post_proxys' utilise pour ajouter a la fin de la chaine son propre proxy. J'ai ajoute le parametre 'pre_proxys' utilise pour ajouter en debut de chaine son propre proxy. J'ai ajoute le parametre 'proxys_path' utilise pour indiquer le repertoire ou se trouve vos proxy. J'ai finalement ajoute la demo48 pour illustrer la puissance des proxy. Modified Paths: -------------- trunk/src/pfccommand.class.php trunk/src/pfcglobalconfig.class.php trunk/src/phpfreechat.class.php Added Paths: ----------- trunk/demo/demo48_custom_proxy/ trunk/demo/demo48_custom_proxy/myproxy.class.php trunk/demo/demo48_custom_proxy.php Added: trunk/demo/demo48_custom_proxy/myproxy.class.php =================================================================== --- trunk/demo/demo48_custom_proxy/myproxy.class.php (rev 0) +++ trunk/demo/demo48_custom_proxy/myproxy.class.php 2006-09-16 20:32:44 UTC (rev 764) @@ -0,0 +1,60 @@ +<?php +/** + * myproxy.class.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ +require_once dirname(__FILE__)."/../../src/pfci18n.class.php"; +require_once dirname(__FILE__)."/../../src/pfcuserconfig.class.php"; +require_once dirname(__FILE__)."/../../src/pfcproxycommand.class.php"; + +/** + * pfcProxyCommand_myproxy + * this proxy will do nothing + * @author Stephane Gully <ste...@gm...> + */ +class pfcProxyCommand_myproxy extends pfcProxyCommand +{ + function run(&$xml_reponse, $p) + { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + $c =& $this->c; + $u =& $this->u; + + $cmdtocheck = array("send", "me"); + if ( in_array($this->name, $cmdtocheck) ) + { + // Modify the text + $param = "[this text is prepend by 'demo48_custom_proxy/myproxy.class.php'] ".$param; + } + + // forward the command to the next proxy or to the final command + $p["clientid"] = $clientid; + $p["param"] = $param; + $p["sender"] = $sender; + $p["recipient"] = $recipient; + $p["recipientid"] = $recipientid; + $this->next->run($xml_reponse, $p); + } +} + +?> \ No newline at end of file Added: trunk/demo/demo48_custom_proxy.php =================================================================== --- trunk/demo/demo48_custom_proxy.php (rev 0) +++ trunk/demo/demo48_custom_proxy.php 2006-09-16 20:32:44 UTC (rev 764) @@ -0,0 +1,39 @@ +<?php + +require_once dirname(__FILE__)."/../src/phpfreechat.class.php"; + +$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat +$params["skip_proxys"] = array("censor"); // shows how to disable a proxy (try to write fuck in the chat, it should be possible) +$params["post_proxys"] = array("myproxy"); +$params["proxys_path"] = dirname(__FILE__).'/demo48_custom_proxy'; +$chat = new phpFreeChat( $params ); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8" /> + <title>phpFreeChat demo</title> + + <?php $chat->printJavascript(); ?> + <?php $chat->printStyle(); ?> + + </head> + + <body> + <p>This demo shows how to create your own command proxy. Each chained proxies receive every transmitted commands. Your proxy can block the command, alterate the command, store some statistics. For example: to write a bot, just write a proxy.</p> + <?php $chat->printChat(); ?> + +<?php + // print the current file + echo "<h2>The source code</h2>"; + $filename = __FILE__; + echo "<p><code>".$filename."</code></p>"; + echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; + $content = file_get_contents($filename); + echo htmlentities($content); + echo "</pre>"; +?> + + </body> +</html> Modified: trunk/src/pfccommand.class.php =================================================================== --- trunk/src/pfccommand.class.php 2006-09-15 18:13:17 UTC (rev 763) +++ trunk/src/pfccommand.class.php 2006-09-16 20:32:44 UTC (rev 764) @@ -81,15 +81,21 @@ // instanciate the proxys chaine $firstproxy =& $cmd; - for($i = count($c->proxys)-1; $i >= 0; $i--) + for($i = count($c->_proxys)-1; $i >= 0; $i--) { - $proxy_name = strtolower($c->proxys[$i]); + $proxy_name = strtolower($c->_proxys[$i]); $proxy_classname = "pfcProxyCommand_" . $proxy_name; if (!class_exists($proxy_classname)) { - // try to include the proxy class file - $proxy_filename = dirname(__FILE__)."/proxys/".$proxy_name.".class.php"; - if (file_exists($proxy_filename)) require_once($proxy_filename); + // try to include the proxy class file from the default path or from the customized path + $proxy_filename = $c->proxys_path_default.'/'.$proxy_name.".class.php"; + if (file_exists($proxy_filename)) + require_once($proxy_filename); + else + { + $proxy_filename = $c->proxys_path.'/'.$proxy_name.".class.php"; + if (file_exists($proxy_filename)) require_once($proxy_filename); + } } if (class_exists($proxy_classname)) { Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-15 18:13:17 UTC (rev 763) +++ trunk/src/pfcglobalconfig.class.php 2006-09-16 20:32:44 UTC (rev 764) @@ -41,14 +41,18 @@ var $lockurl = "http://www.phpfreechat.net"; // this is the url where the users must be redirected when the chat is locked // these parameters are static (cached) - var $proxys = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); + var $skip_proxys = array(); // these proxies will be skiped. ex: append "censor" to the list to disable words censoring + var $post_proxys = array(); // these proxies will be handled just before to process commands and just after system proxies + var $pre_proxys = array(); // these proxies will be handled before system proxies (at begining) var $proxys_cfg = array("auth" => array(), "noflood" => array("limit"=>10,"delay"=>5), "censor" => array("words"=>array("fuck","sex","bitch"),"replaceby"=>"*"), "log" => array("path"=>"")); + var $proxys_path = ""; // a custom proxies path + var $proxys_path_default = ""; // dirname(__FILE__).'/proxys' var $title = ""; // default is _pfc("My Chat") var $channels = array(); // the default joined channels when opening the chat - var $frozen_channels = array(); // by default allow users to create there own channels + var $frozen_channels = array(); // if empty, allows users to create there own channels var $frozen_nick = false; var $max_nick_len = 15; var $max_text_len = 400; @@ -96,7 +100,6 @@ var $smileys = array(); var $errors = array(); - var $prefix = "pfc_"; var $is_init = false; // used internaly to know if the chat config is initialized var $version = ""; // the phpfreechat version: taken from the 'version' file content var $debugurl = ""; @@ -104,6 +107,8 @@ var $debugxajax = false; // private parameters + var $_sys_proxys = array("lock", "checktimeout", "checknickchange", "auth", "noflood", "censor", "log"); + var $_proxys = array(); // will contains proxies to execute on each command (filled in the init step) var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels"); var $_params_type = array(); @@ -158,6 +163,9 @@ { if (!isset($this->$k)) $this->errors[] = _pfc("Error: undefined or obsolete parameter '%s', please correct or remove this parameter", $k); + if (preg_match('/^_/',$k)) + $this->errors[] = _pfc("Error: '%s' is a private parameter, you are not allowed to change it", $k); + if ($k == "proxys_cfg") { // don't replace all the proxy_cfg parameters, just replace the specified ones @@ -386,6 +394,33 @@ else @file_put_contents($proxyfile, $proxycontent); } + + + // calculate the proxies chaine + $this->_proxys = array(); + foreach($this->pre_proxys as $px) + { + if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) + $this->_proxys[] = $px; + + } + foreach($this->_sys_proxys as $px) + { + if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) + $this->_proxys[] = $px; + + } + foreach($this->post_proxys as $px) + { + if (!in_array($px,$this->skip_proxys) && !in_array($px,$this->_proxys)) + $this->_proxys[] = $px; + + } + // save the proxies path + $this->proxys_path_default = dirname(__FILE__).'/proxys'; + // check the customized proxies path + if ($this->proxys_path != '' && !is_dir($this->proxys_path)) + $this->errors[] = _pfc("'%s' directory doesn't exist", $this->proxys_path); // load smileys from file $this->loadSmileyTheme(); Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-15 18:13:17 UTC (rev 763) +++ trunk/src/phpfreechat.class.php 2006-09-16 20:32:44 UTC (rev 764) @@ -64,7 +64,7 @@ if (file_exists($c->xajaxpath."/xajax.inc.php")) { require_once $c->xajaxpath."/xajax.inc.php"; - $this->xajax = new xajax($c->server_script_url.(isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "" ? "?".$_SERVER["QUERY_STRING"] : ""), $c->prefix); + $this->xajax = new xajax($c->server_script_url.(isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "" ? "?".$_SERVER["QUERY_STRING"] : ""), 'pfc_'); if ($c->debugxajax) $this->xajax->debugOn(); $this->xajax->waitCursorOff(); // do not show a wait cursor during chat updates $this->xajax->cleanBufferOff(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-15 18:13:26
|
Revision: 763 http://svn.sourceforge.net/phpfreechat/?rev=763&view=rev Author: kerphi Date: 2006-09-15 11:13:17 -0700 (Fri, 15 Sep 2006) Log Message: ----------- [en] Make frozen_channels a dynamic parameter. So it's a way to allow/forbid channels depending on external users rights. [fr] Retire le parametre frozen_channels du cache. Il est ainsi possible d'autoriser ou pas de rejoindre des salons en fonction de parametres externes. Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-13 21:28:09 UTC (rev 762) +++ trunk/src/pfcglobalconfig.class.php 2006-09-15 18:13:17 UTC (rev 763) @@ -104,7 +104,7 @@ var $debugxajax = false; // private parameters - var $_dyn_params = array("nick","isadmin","islocked","admins"); + var $_dyn_params = array("nick","isadmin","islocked","admins","frozen_channels"); var $_params_type = array(); function pfcGlobalConfig( $params = array() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-13 21:28:18
|
Revision: 762 http://svn.sourceforge.net/phpfreechat/?rev=762&view=rev Author: kerphi Date: 2006-09-13 14:28:09 -0700 (Wed, 13 Sep 2006) Log Message: ----------- first steps to integrate webinstaller in the command line packager script Modified Paths: -------------- trunk/contrib/pfcInstaller/engene.inc.php trunk/misc/tarSource Added Paths: ----------- trunk/misc/createwebinstaller.php Modified: trunk/contrib/pfcInstaller/engene.inc.php =================================================================== --- trunk/contrib/pfcInstaller/engene.inc.php 2006-09-13 18:08:08 UTC (rev 761) +++ trunk/contrib/pfcInstaller/engene.inc.php 2006-09-13 21:28:09 UTC (rev 762) @@ -232,7 +232,7 @@ } - protected function addInstallerPage(){ + function addInstallerPage(){ $fc = file_get_contents($this->dataDir.'/step_installer.txt'); $this->installer_page = $this->addPage('Install',$fc); echo '<div>Page: '.$this->installer_page.'</div>'; Added: trunk/misc/createwebinstaller.php =================================================================== --- trunk/misc/createwebinstaller.php (rev 0) +++ trunk/misc/createwebinstaller.php 2006-09-13 21:28:09 UTC (rev 762) @@ -0,0 +1,18 @@ +<?php + +$version = isset($_SERVER["argv"][1]) ? $_SERVER["argv"][1] : file_get_contents(dirname(__FILE__)."/../version"); +$archivename = 'phpfreechat-'.$version.'-setup.php'; +$pfcpath = dirname(__FILE__).'/phpfreechat-'.$version; +if (!file_exists($pfcpath)) die("Dont find the directory $pfcpath"); + +include(dirname(__FILE__).'/../contrib/pfcInstaller/engene.inc.php'); +$phpi = new phpInstaller(); +$phpi->dataDir(realpath(dirname(__FILE__).'/../contrib/pfcInstaller/engene_data')); +$phpi->appName = 'phpFreeChat'; +$phpi->appVersion = $version; +$phpi->ignore[] = '.svn'; +$phpi->addInstallerPage(); +$phpi->addPath($pfcpath); +$phpi->generate($archivename); + +?> Modified: trunk/misc/tarSource =================================================================== --- trunk/misc/tarSource 2006-09-13 18:08:08 UTC (rev 761) +++ trunk/misc/tarSource 2006-09-13 21:28:09 UTC (rev 762) @@ -30,30 +30,32 @@ tar czfp $NAME.tar.gz ./$NAME echo "-> creating $NAME.zip" zip -Tq9r $NAME.zip ./$NAME +echo "-> creating $NAME-setup.php" +php ./createwebinstaller.php `cat ../version` > /dev/null -echo "-> creating $PFCSETUPNAME.tar.gz" -rm -rf ./$PFCSETUPNAME -svn export ../contrib/pfcInstaller2 $PFCSETUPNAME -rm -rf ./$PFCSETUPNAME/.registry -rm -rf ./$PFCSETUPNAME/.depdblock -rm -rf ./$PFCSETUPNAME/.lock -rm -rf ./$PFCSETUPNAME/.channels -rm -rf ./$PFCSETUPNAME/tmp -rm -rf ./$PFCSETUPNAME/bin -rm -rf ./$PFCSETUPNAME/PEAR -rm -rf ./$PFCSETUPNAME/System.php -rm -rf ./$PFCSETUPNAME/peclcmd.php -rm -rf ./$PFCSETUPNAME/pearcmd.php -rm -rf ./$PFCSETUPNAME/pear.sh -rm -rf ./$PFCSETUPNAME/pearrc -rm -rf ./$PFCSETUPNAME/OS -echo "$NAME.tar.gz" > $PFCSETUPNAME/archivename -echo `pwd` >> $PFCSETUPNAME/mirrors -tar czfp $PFCSETUPNAME.tar.gz ./$PFCSETUPNAME -echo "-> creating $PFCSETUPNAME.zip" -zip -Tq9r $PFCSETUPNAME.zip ./$PFCSETUPNAME +#echo "-> creating $PFCSETUPNAME.tar.gz" +#rm -rf ./$PFCSETUPNAME +#svn export ../contrib/pfcInstaller2 $PFCSETUPNAME +#rm -rf ./$PFCSETUPNAME/.registry +#rm -rf ./$PFCSETUPNAME/.depdblock +#rm -rf ./$PFCSETUPNAME/.lock +#rm -rf ./$PFCSETUPNAME/.channels +#rm -rf ./$PFCSETUPNAME/tmp +#rm -rf ./$PFCSETUPNAME/bin +#rm -rf ./$PFCSETUPNAME/PEAR +#rm -rf ./$PFCSETUPNAME/System.php +#rm -rf ./$PFCSETUPNAME/peclcmd.php +#rm -rf ./$PFCSETUPNAME/pearcmd.php +#rm -rf ./$PFCSETUPNAME/pear.sh +#rm -rf ./$PFCSETUPNAME/pearrc +#rm -rf ./$PFCSETUPNAME/OS +#echo "$NAME.tar.gz" > $PFCSETUPNAME/archivename +#echo `pwd` >> $PFCSETUPNAME/mirrors +#tar czfp $PFCSETUPNAME.tar.gz ./$PFCSETUPNAME +#echo "-> creating $PFCSETUPNAME.zip" +#zip -Tq9r $PFCSETUPNAME.zip ./$PFCSETUPNAME +#rm -rf ./$PFCSETUPNAME echo "-> removing temporary files" rm -rf ./$NAME -rm -rf ./$PFCSETUPNAME echo "-- creating archive $NAME, done --" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-13 18:08:15
|
Revision: 761 http://svn.sourceforge.net/phpfreechat/?rev=761&view=rev Author: kerphi Date: 2006-09-13 11:08:08 -0700 (Wed, 13 Sep 2006) Log Message: ----------- Fix demo34 source code listing Modified Paths: -------------- trunk/demo/demo34_add_a_link_on_nicknames.php Modified: trunk/demo/demo34_add_a_link_on_nicknames.php =================================================================== --- trunk/demo/demo34_add_a_link_on_nicknames.php 2006-09-13 17:58:11 UTC (rev 760) +++ trunk/demo/demo34_add_a_link_on_nicknames.php 2006-09-13 18:08:08 UTC (rev 761) @@ -33,7 +33,7 @@ ?> <?php - $filename = dirname(__FILE__)."/demo34_add_a_link_on_nicknames/mytheme/templates/pfcclient-custo.js.tpl.php"; + $filename = dirname(__FILE__)."/demo34_add_a_link_on_nicknames/mytheme/customize.js"; echo "<p><code>".$filename."</code></p>"; echo "<pre style=\"margin: 0 50px 0 50px; padding: 10px; background-color: #DDD;\">"; $content = file_get_contents($filename); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-13 17:58:21
|
Revision: 760 http://svn.sourceforge.net/phpfreechat/?rev=760&view=rev Author: kerphi Date: 2006-09-13 10:58:11 -0700 (Wed, 13 Sep 2006) Log Message: ----------- [en] Bug fix: no more blank screen on IE6. [fr] Bug fix : termine les ecrans blancs sous IE6. Modified Paths: -------------- trunk/src/client/pfcgui.js trunk/themes/default/style.css Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-13 07:09:16 UTC (rev 759) +++ trunk/src/client/pfcgui.js 2006-09-13 17:58:11 UTC (rev 760) @@ -256,10 +256,14 @@ var div_online = this.getOnlineContentFromTabId(tabid); div_content.appendChild(div_chat); div_content.appendChild(div_online); - + $('pfc_channels_list').appendChild(li_title); $('pfc_channels_content').appendChild(div_content); + // force the height of the chat/online zone in pixel in order fix blank screens on IE6 + div_chat.style.height = ($('pfc_channels_content').offsetHeight-1)+'px'; + div_online.style.height = ($('pfc_channels_content').offsetHeight-1)+'px'; + return tabid; }, Modified: trunk/themes/default/style.css =================================================================== --- trunk/themes/default/style.css 2006-09-13 07:09:16 UTC (rev 759) +++ trunk/themes/default/style.css 2006-09-13 17:58:11 UTC (rev 760) @@ -33,7 +33,6 @@ background-color: #FFF; margin-top: 5px; height: 300px; - font-family: serif; /* needed by IE6 in order to display correctly chinese characteres */ } div.pfc_content { } @@ -90,7 +89,8 @@ top: 0; left: 0; width: 80%; - height: 100%; +/* WARNING: do not fix height in % because it will display blank screens on IE6 */ +/* height: 100%;*/ overflow: auto; } @@ -101,7 +101,8 @@ padding: 0; overflow: auto; width: 20%; - height: 100%; +/* WARNING: do not fix height in % because it will display blank screens on IE6 */ +/* height: 100%;*/ color: #000; /* colors can be overriden by js nickname colorization */ background-color: #FFF; background-image: url("proxy.php?p=default/images/online-separator.gif"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-13 07:09:20
|
Revision: 759 http://svn.sourceforge.net/phpfreechat/?rev=759&view=rev Author: kerphi Date: 2006-09-13 00:09:16 -0700 (Wed, 13 Sep 2006) Log Message: ----------- [en] Remove the rm_r and copy_r verification because since refactoring I do not copy full directories anymore. [fr] Retire le teste de fonctionnement de rm_r et copy_r car depuis le refactoring, je ne copie plus de repertoires entiers. Modified Paths: -------------- trunk/src/pfcglobalconfig.class.php Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-12 16:53:44 UTC (rev 758) +++ trunk/src/pfcglobalconfig.class.php 2006-09-13 07:09:16 UTC (rev 759) @@ -288,43 +288,6 @@ $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path, "data_private_path")); // $this->errors = array_merge($this->errors, @install_dir($this->jspath, $this->data_public_path."/javascript")); $this->errors = array_merge($this->errors, @test_writable_dir($this->data_private_path."/cache", "data_private_path/cache")); - - // check the copy_r and rm_r function works - if (count($this->errors) == 0) - { - $copy_r_ok = true; - $dir1 = $this->data_private_path."/copy_r1"; - $file1 = $dir1."/dummy"; - $dir2 = $this->data_private_path."/copy_r2"; - $file2 = $dir2."/dummy"; - // create a dummy directory - @mkdir($dir1); - // check the directory exists - if (!file_exists($dir1) || !is_dir($dir1)) $copy_r_ok = false; - // create a dummy file - @touch($file1); - // check the file exists - if (!file_exists($file1)) $copy_r_ok = false; - // copy_r the dummy dir - @copy_r($dir1,$dir2); - // check the directory exists - if (!file_exists($dir2) || !is_dir($dir2)) $copy_r_ok = false; - // check the file exists - if (!file_exists($file2)) $copy_r_ok = false; - if (!$copy_r_ok) - $this->errors[] = _pfc("Recursive copy doesn't works"); - - // try to remove recursively the directory - $rm_r_ok = true; - @rm_r($dir2); - @rm_r($dir1); - // check the directory doesn't exists - if (file_exists($dir1) || file_exists($dir2)) $rm_r_ok = false; - // check the file doesn't exists - if (file_exists($file1) || file_exists($file2)) $rm_r_ok = false; - if (!$copy_r_ok) - $this->errors[] = _pfc("Recursive remove doesn't works"); - } // --- // test xajax lib existance This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 16:53:56
|
Revision: 758 http://svn.sourceforge.net/phpfreechat/?rev=758&view=rev Author: kerphi Date: 2006-09-12 09:53:44 -0700 (Tue, 12 Sep 2006) Log Message: ----------- [en] Bug fix: add a references counter in order to know when the user is really disconnecter (no more '* quit (timeout)'). [fr] Bug fix : ajout d'un compteur de references de facon a detecter precisement lorsqu'un utilisateur est vraiment deconnect (fini les '* quit (timeout)'). Modified Paths: -------------- trunk/src/commands/nick.class.php trunk/src/containers/file.class.php Modified: trunk/src/commands/nick.class.php =================================================================== --- trunk/src/commands/nick.class.php 2006-09-12 14:51:27 UTC (rev 757) +++ trunk/src/commands/nick.class.php 2006-09-12 16:53:44 UTC (rev 758) @@ -74,12 +74,15 @@ // -> this is a first connection if ($oldnickid != $u->nickid) { - // this is a first connection (create the nickname) + // this is a first connection : create the nickname on the server $container->createNick(NULL, $newnick, $u->nickid); + /* + // useless code, it's done in updatemynick command foreach($u->channels as $chan) $container->createNick($chan["recipient"], $newnick, $u->nickid); foreach($u->privmsg as $pv) $container->createNick($pv["recipient"], $newnick, $u->nickid); + */ $u->nick = $newnick; $u->active = true; $u->saveInCache(); Modified: trunk/src/containers/file.class.php =================================================================== --- trunk/src/containers/file.class.php 2006-09-12 14:51:27 UTC (rev 757) +++ trunk/src/containers/file.class.php 2006-09-12 16:53:44 UTC (rev 758) @@ -94,6 +94,13 @@ $this->setMeta($nick, "nickname", "fromnickid", $nickid); $this->setMeta($nickid, "nickid", "fromnickname", $nick); + // increment the nick references (used to know when the nick is really disconnected) + $nick_ref = $this->getMeta("references", $nickid); + if ($nick_ref == NULL || !is_numeric($nick_ref)) $nick_ref = 0; + $nick_ref++; + $this->setMeta($nick_ref, "references", $nickid); + + $c =& $this->c; $nick_dir = ($chan != NULL) ? $c->container_cfg_channel_dir."/".$this->_encode($chan)."/nicknames" : @@ -169,11 +176,21 @@ $ok = @unlink($nickid_filename); // remove the user metadata if he is disconnected from the server - if ($chan == NULL) + + // decrement the nick references and kill the metadata if not more references is found + // (used to know when the nick is really disconnected) + $nick_ref = $this->getMeta("references", $nickid); + if ($nick_ref == NULL || !is_numeric($nick_ref)) $nick_ref = 0; + $nick_ref--; + if ($nick_ref <= 0) { $this->rmMeta("nickid", "fromnickname", $nick); $this->rmMeta("nickname", "fromnickid", $nickid); + $this->rmMeta("references", $nickid); // destroy also the reference counter (by default its value is 0) } + else + $this->setMeta($nick_ref, "references", $nickid); + if ($c->debug) { @@ -349,12 +366,27 @@ } // remove the user metadata if he is disconnected from the server - if ($chan == NULL && isset($deleted_user["nickid"])) + if (isset($deleted_user["nickid"]) && count($deleted_user["nickid"])>0) { foreach($deleted_user["nickid"] as $du_nid) { - $this->rmMeta("nickid", "fromnickname", $this->getNickname($du_nid)); - $this->rmMeta("nickname", "fromnickid", $du_nid); + $du_nickid = $du_nid; + $du_nickname = $this->getNickname($du_nid); + + // decrement the nick references and kill the metadata if not more references is found + // (used to know when the nick is really disconnected) + $nick_ref = $this->getMeta("references", $du_nickid); + if ($nick_ref == NULL || !is_numeric($nick_ref)) $nick_ref = 0; + $nick_ref--; + if ($nick_ref <= 0) + { + $this->rmMeta("nickid", "fromnickname", $du_nickname); + $this->rmMeta("nickname", "fromnickid", $du_nickid); + $this->rmMeta("references", $du_nickid); // destroy also the reference counter (by default its value is 0) + } + else + $this->setMeta($nick_ref, "references", $du_nickid); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 14:51:31
|
Revision: 757 http://svn.sourceforge.net/phpfreechat/?rev=757&view=rev Author: kerphi Date: 2006-09-12 07:51:27 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Bug fix: the rehash command returned message was reversed. Modified Paths: -------------- trunk/src/commands/rehash.class.php Modified: trunk/src/commands/rehash.class.php =================================================================== --- trunk/src/commands/rehash.class.php 2006-09-12 14:23:29 UTC (rev 756) +++ trunk/src/commands/rehash.class.php 2006-09-12 14:51:27 UTC (rev 757) @@ -26,9 +26,9 @@ $destroyed = $c->destroyCache(); if ($destroyed) + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '');"); + else $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ko', '');"); - else - $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '');"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 14:23:41
|
Revision: 756 http://svn.sourceforge.net/phpfreechat/?rev=756&view=rev Author: kerphi Date: 2006-09-12 07:23:29 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Improve the max_text_len handeling Modified Paths: -------------- trunk/src/client/pfcgui.js trunk/src/phpfreechat.class.php Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-12 14:14:00 UTC (rev 755) +++ trunk/src/client/pfcgui.js 2006-09-12 14:23:29 UTC (rev 756) @@ -386,7 +386,7 @@ inputwords.setAttribute('id', 'pfc_words'); inputwords.setAttribute('type', 'text'); inputwords.setAttribute('title', pfc.res.getLabel("Enter your message here")); - inputwords.setAttribute('maxlength', pfc_max_text_len - 25); + inputwords.setAttribute('maxlength', pfc_max_text_len); inputcontainer.appendChild(inputwords); // command container : <div id="pfc_cmd_container"> Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-12 14:14:00 UTC (rev 755) +++ trunk/src/phpfreechat.class.php 2006-09-12 14:23:29 UTC (rev 756) @@ -270,7 +270,11 @@ function PreFilterMsg($msg) { $c =& pfcGlobalConfig::Instance(); - $msg = utf8_substr($msg, 0, $c->max_text_len); + if (preg_match("/^\[/i",$msg)) + // add 25 characteres if the message starts with [ : means there is a bbcode + $msg = utf8_substr($msg, 0, $c->max_text_len+25); + else + $msg = utf8_substr($msg, 0, $c->max_text_len); $msg = phpFreeChat::FilterSpecialChar($msg); // $msg = phpFreeChat::FilterSmiley($msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 14:17:19
|
Revision: 755 http://svn.sourceforge.net/phpfreechat/?rev=755&view=rev Author: kerphi Date: 2006-09-12 07:14:00 -0700 (Tue, 12 Sep 2006) Log Message: ----------- [en] Bug fix: the max_text_len parameter didn't work with utf8 (non us-ascii) strings. [fr] Bug fix : le parametre max_text_len ne fonctionnait pas avec des chaines utf8 (non us-ascii). Modified Paths: -------------- trunk/src/phpfreechat.class.php Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-12 13:12:59 UTC (rev 754) +++ trunk/src/phpfreechat.class.php 2006-09-12 14:14:00 UTC (rev 755) @@ -270,7 +270,7 @@ function PreFilterMsg($msg) { $c =& pfcGlobalConfig::Instance(); - $msg = substr($msg, 0, $c->max_text_len); + $msg = utf8_substr($msg, 0, $c->max_text_len); $msg = phpFreeChat::FilterSpecialChar($msg); // $msg = phpFreeChat::FilterSmiley($msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 13:13:08
|
Revision: 754 http://svn.sourceforge.net/phpfreechat/?rev=754&view=rev Author: kerphi Date: 2006-09-12 06:12:59 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Bug fix: the windows notifier counter was not reset when the window was reactivated Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-12 07:48:17 UTC (rev 753) +++ trunk/src/client/pfcclient.js 2006-09-12 13:12:59 UTC (rev 754) @@ -63,7 +63,7 @@ this.detectactivity = new DetectActivity(this.el_container); // restore the window title when user come back to the active zone - if (pfc_notify_window) this.detectactivity.onunactivate = this.gui.unnotifyWindow; + if (pfc_notify_window) this.detectactivity.onunactivate = this.gui.unnotifyWindow.bindAsEventListener(this.gui); /* the events callbacks */ Event.observe(this.el_words, 'keypress', this.callbackWords_OnKeypress.bindAsEventListener(this), false); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-12 07:48:26
|
Revision: 753 http://svn.sourceforge.net/phpfreechat/?rev=753&view=rev Author: kerphi Date: 2006-09-12 00:48:17 -0700 (Tue, 12 Sep 2006) Log Message: ----------- [en] New feature: when a new message is posted, the unactive window title is prefixed by the number of new messages (this can be disabled by setting to false the notify_window parameter). [fr] Nouvelle fonctionnalit?\195?\169 : lorsqu'un nouveau message est envoy?\195?\169 dans une fenetre de chat inactive, le titre de cette fenetre est prefixe par le nombre de nouveau messages envoyes (ce comportement peut etre desactive en mettant a false le parametre notify_window) Modified Paths: -------------- trunk/lib/javascript/activity.js trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js trunk/src/pfcglobalconfig.class.php Modified: trunk/lib/javascript/activity.js =================================================================== --- trunk/lib/javascript/activity.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/lib/javascript/activity.js 2006-09-12 07:48:17 UTC (rev 753) @@ -3,22 +3,21 @@ initialize: function(subject) { this.onunactivate = function() {}; - this.onactivate = function() {}; + this.onactivate = function() {}; + this.subject = subject; this.isactive = true; - Event.observe(subject, 'mousemove', this._OnFocus, false); - Event.observe(subject, 'mouseout', this._OnBlur, false); + Event.observe(subject, 'mousemove', this._OnFocus.bindAsEventListener(this), false); + Event.observe(subject, 'mouseout', this._OnBlur.bindAsEventListener(this), false); }, _OnFocus: function(e) { -// document.title = 'focus'; this.isactive = true; -// this.onactivate(); + if (this.onactivate) this.onactivate(); }, _OnBlur: function(e) { -// document.title = 'blur'; this.isactive = false; -// this.onunactivate(); + if (this.onunactivate) this.onunactivate(); }, isActive: function() { Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/chat.js.tpl.php 2006-09-12 07:48:17 UTC (rev 753) @@ -16,6 +16,7 @@ var pfc_btn_sh_smileys = <?php echo $btn_sh_smileys ? "true" : "false"; ?>; var pfc_btn_sh_whosonline = <?php echo $btn_sh_whosonline ? "true" : "false"; ?>; var pfc_connect_at_startup = <?php echo $connect_at_startup ? "true" : "false"; ?>; +var pfc_notify_window = <?php echo $notify_window ? "true" : "false"; ?>; var pfc_defaultchan = Array(<?php function quoteandescape($v) { return "'".addslashes($v)."'"; } $list = array(); foreach($c->channels as $ch) {$list[] = $ch; } Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/pfcclient.js 2006-09-12 07:48:17 UTC (rev 753) @@ -62,19 +62,19 @@ this.el_errors = $('pfc_errors'); this.detectactivity = new DetectActivity(this.el_container); -// this.detectactivity.onunactivate = this.gui.unnotifyWindow; + // restore the window title when user come back to the active zone + if (pfc_notify_window) this.detectactivity.onunactivate = this.gui.unnotifyWindow; /* the events callbacks */ - this.el_words.onkeypress = this.callbackWords_OnKeypress.bindAsEventListener(this); - this.el_words.onkeydown = this.callbackWords_OnKeydown.bindAsEventListener(this); - this.el_words.onfocus = this.callbackWords_OnFocus.bindAsEventListener(this); - this.el_handle.onkeydown = this.callbackHandle_OnKeydown.bindAsEventListener(this); - this.el_handle.onchange = this.callbackHandle_OnChange.bindAsEventListener(this); - this.el_container.onmousemove = this.callbackContainer_OnMousemove.bindAsEventListener(this); - this.el_container.onmousedown = this.callbackContainer_OnMousedown.bindAsEventListener(this); - this.el_container.onmouseup = this.callbackContainer_OnMouseup.bindAsEventListener(this); - document.body.onunload = this.callback_OnUnload.bindAsEventListener(this); - + Event.observe(this.el_words, 'keypress', this.callbackWords_OnKeypress.bindAsEventListener(this), false); + Event.observe(this.el_words, 'keydown', this.callbackWords_OnKeydown.bindAsEventListener(this), false); + Event.observe(this.el_words, 'focus', this.callbackWords_OnFocus.bindAsEventListener(this), false); + Event.observe(this.el_handle, 'keydown', this.callbackHandle_OnKeydown.bindAsEventListener(this), false); + Event.observe(this.el_handle, 'change', this.callbackHandle_OnChange.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mousemove', this.callbackContainer_OnMousemove.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mousedown', this.callbackContainer_OnMousedown.bindAsEventListener(this), false); + Event.observe(this.el_container, 'mouseup', this.callbackContainer_OnMouseup.bindAsEventListener(this), false); + Event.observe(document.body, 'unload', this.callback_OnUnload.bindAsEventListener(this), false); }, refreshGUI: function() @@ -703,7 +703,7 @@ if (this.gui.getTabId() != tabid) this.gui.notifyTab(tabid); // notify the window (change the title) - if (!this.detectactivity.isActive()) + if (!this.detectactivity.isActive() && pfc_notify_window) this.gui.notifyWindow(); } Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/client/pfcgui.js 2006-09-12 07:48:17 UTC (rev 753) @@ -268,7 +268,6 @@ */ notifyWindow: function() { -//alert(this.windownotifynb); this.windownotifynb += 1; var rx = new RegExp('^\\[[0-9]+\\](.*)','ig'); document.title = document.title.replace(rx,'$1'); Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-11 21:20:26 UTC (rev 752) +++ trunk/src/pfcglobalconfig.class.php 2006-09-12 07:48:17 UTC (rev 753) @@ -65,6 +65,7 @@ var $nickmarker = true; // show/hide nicknames colors var $clock = true; // show/hide dates and hours var $openlinknewwindow = true; // used to open the links in a new window + var $notify_window = true; // true : appends a prefix to the window title with the number of new posted messages var $showwhosonline = true; var $showsmileys = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-11 21:20:42
|
Revision: 752 http://svn.sourceforge.net/phpfreechat/?rev=752&view=rev Author: kerphi Date: 2006-09-11 14:20:26 -0700 (Mon, 11 Sep 2006) Log Message: ----------- Work in progress: window notifications Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js trunk/src/phpfreechat.class.php Added Paths: ----------- trunk/lib/javascript/activity.js Added: trunk/lib/javascript/activity.js =================================================================== --- trunk/lib/javascript/activity.js (rev 0) +++ trunk/lib/javascript/activity.js 2006-09-11 21:20:26 UTC (rev 752) @@ -0,0 +1,68 @@ +var DetectActivity = Class.create(); +DetectActivity.prototype = { + initialize: function(subject) + { + this.onunactivate = function() {}; + this.onactivate = function() {}; + this.isactive = true; + Event.observe(subject, 'mousemove', this._OnFocus, false); + Event.observe(subject, 'mouseout', this._OnBlur, false); + }, + _OnFocus: function(e) + { +// document.title = 'focus'; + this.isactive = true; +// this.onactivate(); + }, + _OnBlur: function(e) + { +// document.title = 'blur'; + this.isactive = false; +// this.onunactivate(); + }, + isActive: function() + { + return this.isactive; + } +} + + + +/* +// Unused code, by usefull for further auto idle features + + _launchTimeout: function(myself) + { +var oldisactive = this.isactive; + if (this.oldposx == this.posx && + this.oldposy == this.posy) + this.isactive = false; + else + this.isactive = true; +this.oldposx = this.posx; +this.oldposy = this.posy; +if (oldisactive != this.isactive) alert("switch"); + setTimeout(function() { myself._launchTimeout(myself); }, 1000); + }, + + _OnMouseMove: function(e) + { + var posx = 0; + var posy = 0; + if (!e) var e = window.event; + if (e.pageX || e.pageY) + { + posx = e.pageX; + posy = e.pageY; + } + else if (e.clientX || e.clientY) + { + posx = e.clientX + document.body.scrollLeft + + document.documentElement.scrollLeft; + posy = e.clientY + document.body.scrollTop + + document.documentElement.scrollTop; + } + this.posx = posx; + this.posy = posy; + }, +*/ Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-11 16:36:33 UTC (rev 751) +++ trunk/src/client/pfcclient.js 2006-09-11 21:20:26 UTC (rev 752) @@ -28,6 +28,7 @@ this.cmdhistoryid = -1; this.cmdhistoryissearching = false; + /* this.channels = Array(); this.channelids = Array(); @@ -50,7 +51,6 @@ this.blinktmp = Array(); this.blinkloop = Array(); this.blinktimeout = Array(); - }, connectListener: function() @@ -61,6 +61,9 @@ // this.el_online = $('pfc_online'); this.el_errors = $('pfc_errors'); + this.detectactivity = new DetectActivity(this.el_container); +// this.detectactivity.onunactivate = this.gui.unnotifyWindow; + /* the events callbacks */ this.el_words.onkeypress = this.callbackWords_OnKeypress.bindAsEventListener(this); this.el_words.onkeydown = this.callbackWords_OnKeydown.bindAsEventListener(this); @@ -71,6 +74,7 @@ this.el_container.onmousedown = this.callbackContainer_OnMousedown.bindAsEventListener(this); this.el_container.onmouseup = this.callbackContainer_OnMouseup.bindAsEventListener(this); document.body.onunload = this.callback_OnUnload.bindAsEventListener(this); + }, refreshGUI: function() @@ -699,7 +703,8 @@ if (this.gui.getTabId() != tabid) this.gui.notifyTab(tabid); // notify the window (change the title) - this.gui.notifyWindow(); + if (!this.detectactivity.isActive()) + this.gui.notifyWindow(); } if (msg_html[recipientid] == null) Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-11 16:36:33 UTC (rev 751) +++ trunk/src/client/pfcgui.js 2006-09-11 21:20:26 UTC (rev 752) @@ -17,6 +17,7 @@ this.onlinecontent = $H(); this.scrollpos = $H(); this.elttoscroll = $H(); + this.windownotifynb = 0; }, /** @@ -267,11 +268,19 @@ */ notifyWindow: function() { - var el_title = document.getElementsByTagName('title'); -// el_title[0].innerHTML = '[*]'; +//alert(this.windownotifynb); + this.windownotifynb += 1; + var rx = new RegExp('^\\[[0-9]+\\](.*)','ig'); + document.title = document.title.replace(rx,'$1'); + document.title = '['+this.windownotifynb+']'+document.title; }, + unnotifyWindow: function() + { + this.windownotifynb = 0; + var rx = new RegExp('^\\[[0-9]+\\](.*)','ig'); + document.title = document.title.replace(rx,'$1'); + }, - /** * This function change the tab icon in order to catch the attention */ Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-11 16:36:33 UTC (rev 751) +++ trunk/src/phpfreechat.class.php 2006-09-11 21:20:26 UTC (rev 752) @@ -109,6 +109,7 @@ $js[] = "javascript/regex.js"; $js[] = "javascript/utf8.js"; $js[] = "javascript/sprintf2.js"; + $js[] = "javascript/activity.js"; $js[] = "pfcclient.js"; $js[] = "pfcgui.js"; $js[] = "pfcresource.js"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-11 16:36:41
|
Revision: 751 http://svn.sourceforge.net/phpfreechat/?rev=751&view=rev Author: kerphi Date: 2006-09-11 09:36:33 -0700 (Mon, 11 Sep 2006) Log Message: ----------- working progress : window notifier Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/client/pfcgui.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-11 11:55:53 UTC (rev 750) +++ trunk/src/client/pfcclient.js 2006-09-11 16:36:33 UTC (rev 751) @@ -690,14 +690,16 @@ line += '<span class="pfc_words">'+ this.parseMessage(param) +'</span> '; line += '</div>'; - // notify the hidden tab a message has been received - // don't notify anything if this is old messages if (oldmsg == 0) if (cmd == 'send' || cmd == 'me') { + // notify the hidden tab a message has been received + // don't notify anything if this is old messages var tabid = recipientid; if (this.gui.getTabId() != tabid) this.gui.notifyTab(tabid); + // notify the window (change the title) + this.gui.notifyWindow(); } if (msg_html[recipientid] == null) Modified: trunk/src/client/pfcgui.js =================================================================== --- trunk/src/client/pfcgui.js 2006-09-11 11:55:53 UTC (rev 750) +++ trunk/src/client/pfcgui.js 2006-09-11 16:36:33 UTC (rev 751) @@ -263,6 +263,16 @@ }, /** + * This function change the window title in order to catch the attention + */ + notifyWindow: function() + { + var el_title = document.getElementsByTagName('title'); +// el_title[0].innerHTML = '[*]'; + }, + + + /** * This function change the tab icon in order to catch the attention */ notifyTab: function(tabid) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-11 11:55:58
|
Revision: 750 http://svn.sourceforge.net/phpfreechat/?rev=750&view=rev Author: kerphi Date: 2006-09-11 04:55:53 -0700 (Mon, 11 Sep 2006) Log Message: ----------- add a check for missing parameters Modified Paths: -------------- trunk/src/commands/me.class.php Modified: trunk/src/commands/me.class.php =================================================================== --- trunk/src/commands/me.class.php 2006-09-11 11:17:57 UTC (rev 749) +++ trunk/src/commands/me.class.php 2006-09-11 11:55:53 UTC (rev 750) @@ -4,6 +4,8 @@ class pfcCommand_me extends pfcCommand { + var $usage = "/me {message}"; + function run(&$xml_reponse, $p) { $clientid = $p["clientid"]; @@ -15,6 +17,17 @@ $c =& $this->c; $u =& $this->u; + if (trim($param) == "") + { + // error + $cmdp = $p; + $cmdp["param"] = _pfc("Missing parameter"); + $cmdp["param"] .= " (".$this->usage.")"; + $cmd =& pfcCommand::Factory("error"); + $cmd->run($xml_reponse, $cmdp); + return; + } + $container =& $c->getContainerInstance(); $msg = phpFreeChat::PreFilterMsg($param); $container->write($recipient, "*me*", $this->name, $u->nick." ".$msg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-11 11:18:03
|
Revision: 749 http://svn.sourceforge.net/phpfreechat/?rev=749&view=rev Author: kerphi Date: 2006-09-11 04:17:57 -0700 (Mon, 11 Sep 2006) Log Message: ----------- [en] Bug fix: on some servers (free.fr) the realpath() php function is not returning FALSE when the file is missing. [fr] Bug fix: sur certains serveurs (free.fr) la fonction php realpath() ne retourne pas FALSE lorsque le fichier cible n'existe pas. Modified Paths: -------------- trunk/src/client/proxy.php.tpl Modified: trunk/src/client/proxy.php.tpl =================================================================== --- trunk/src/client/proxy.php.tpl 2006-09-10 20:47:57 UTC (rev 748) +++ trunk/src/client/proxy.php.tpl 2006-09-11 11:17:57 UTC (rev 749) @@ -13,7 +13,7 @@ foreach($allowedpath as $ap) { $f = realpath($ap."/".$page); - if ($f !== FALSE) $files[] = $f; + if ($f !== FALSE && file_exists($f)) $files[] = $f; } $found = ""; for( $i = 0; $i < count($allowedpath) && $found == ""; $i++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-10 20:48:10
|
Revision: 748 http://svn.sourceforge.net/phpfreechat/?rev=748&view=rev Author: kerphi Date: 2006-09-10 13:47:57 -0700 (Sun, 10 Sep 2006) Log Message: ----------- [en] Bug fix: two users with same nick at same time (thanks to wjwlsn, SF bug 1555160). [fr] Bug fix : Deux utilisateurs avec le m?\195?\170me pseudo pouvaient parler ensemble (merci ?\195?\160 wjwlsn, SF bug 1555160). Modified Paths: -------------- trunk/src/client/pfcclient.js trunk/src/proxys/checknickchange.class.php Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-10 19:18:38 UTC (rev 747) +++ trunk/src/client/pfcclient.js 2006-09-10 20:47:57 UTC (rev 748) @@ -303,10 +303,14 @@ { this.el_handle.innerHTML = param; this.nickname = param; + + // clear the possible error box generated by the bellow displayMsg(...) function + this.clearError(Array(this.el_words)); } else if (resp == "isused") { - this.displayMsg( cmd, this.res.getLabel('Choosen nickname is allready used') ); + this.setError(this.res.getLabel('Choosen nickname is allready used'), Array()); + this.askNick(param); } else alert(cmd + "-"+resp+"-"+param); @@ -620,7 +624,7 @@ displayMsg: function( cmd, msg ) { - this.setError(msg); + this.setError(msg, Array()); // @todo find a better crossbrowser way to display messages /* Modified: trunk/src/proxys/checknickchange.class.php =================================================================== --- trunk/src/proxys/checknickchange.class.php 2006-09-10 19:18:38 UTC (rev 747) +++ trunk/src/proxys/checknickchange.class.php 2006-09-10 20:47:57 UTC (rev 748) @@ -46,14 +46,6 @@ $newnick = phpFreeChat::FilterNickname($param); $oldnick = $u->nick; - if ($newnick == $oldnick) - { - $xml_reponse->addScript("pfc.handleResponse('nick', 'notchanged', '".addslashes($newnick)."');"); - if ($c->debug) - pxlog("/nick ".$newnick." (user just reloded the page so let him keep his nickname without any warnings)", "chat", $c->getId()); - return; - } - // if the user want to change his nickname but the frozen_nick is enable // then send him a warning if ( $this->name == "nick" && @@ -69,8 +61,17 @@ $container =& $c->getContainerInstance(); $newnickid = $container->getNickId($newnick); - $oldnickid = $container->getNickId($oldnick); + $oldnickid = $u->nickid; + if ($newnick == $oldnick && + $newnickid == $oldnickid) + { + $xml_reponse->addScript("pfc.handleResponse('nick', 'notchanged', '".addslashes($newnick)."');"); + if ($c->debug) + pxlog("/nick ".$newnick." (user just reloded the page so let him keep his nickname without any warnings)", "chat", $c->getId()); + return; + } + // now check the nickname is not yet used (unsensitive case) // 'BoB' and 'bob' must be considered same nicknames $nick_in_use = false; @@ -86,20 +87,13 @@ $nick_in_use = true; } } - if ($nick_in_use) + if ($nick_in_use || $newnickid != "undefined") { $xml_reponse->addScript("pfc.handleResponse('nick', 'isused', '".addslashes($newnick)."');"); if ($c->debug) pxlog("/nick ".$newnick." (wanted nick is allready in use -> wantednickid=".$newnickid.")", "chat", $c->getId()); return; } - - if ( $newnickid != "undefined" ) - { - // @todo notify the user ? - return; - } - } // allow nick changes only from the parameters array (server side) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-10 19:18:45
|
Revision: 747 http://svn.sourceforge.net/phpfreechat/?rev=747&view=rev Author: kerphi Date: 2006-09-10 12:18:38 -0700 (Sun, 10 Sep 2006) Log Message: ----------- [en] New /help command use to list available commands (in future, it's planned to display command syntax/description). [fr] Nouvelle commande /help permettan de lister les commandes disponibles (dans le future elle permettra egalement de donner une description de chaque commandes) Modified Paths: -------------- trunk/src/client/pfcclient.js Added Paths: ----------- trunk/src/commands/help.class.php Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-10 17:27:25 UTC (rev 746) +++ trunk/src/client/pfcclient.js 2006-09-10 19:18:38 UTC (rev 747) @@ -324,6 +324,13 @@ this.displayMsg( cmd, this.res.getLabel('phpfreechat current version is %s',param) ); } } + else if (cmd == "help") + { + if (resp == "ok") + { + this.displayMsg( cmd, param); + } + } else if (cmd == "rehash") { if (resp == "ok") Added: trunk/src/commands/help.class.php =================================================================== --- trunk/src/commands/help.class.php (rev 0) +++ trunk/src/commands/help.class.php 2006-09-10 19:18:38 UTC (rev 747) @@ -0,0 +1,38 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_help extends pfcCommand +{ + var $usage = "/help"; + + function run(&$xml_reponse, $p) + { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + + $c =& $this->c; + $u =& $this->u; + + $ignore = array("updatemynick", "getnewmsg", "notice", "getonlinenick", "error", "update", "asknick"); + + $cmdlist = array(); + $dh = opendir(dirname(__FILE__)); + while (false !== ($file = readdir($dh))) + { + if (!preg_match("/^([a-z]+).class.php$/i",$file,$res)) continue; + if (!in_array($res[1],$ignore)) $cmdlist[] = $res[1]; + } + sort($cmdlist); + + $str = _pfc("Here is the command list:")."<br/>"; + $str .= implode("<br/>", $cmdlist); + + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '".$str."');"); + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-10 17:27:33
|
Revision: 746 http://svn.sourceforge.net/phpfreechat/?rev=746&view=rev Author: kerphi Date: 2006-09-10 10:27:25 -0700 (Sun, 10 Sep 2006) Log Message: ----------- [en] Add a new /version command used to get the current phpfreechat version. [fr] Ajoute une nouvelle commande /version permettant d'afficher le num?\195?\169ro de version de la version courante de phpfreechat Modified Paths: -------------- trunk/src/client/chat.js.tpl.php trunk/src/client/pfcclient.js Added Paths: ----------- trunk/src/commands/version.class.php Modified: trunk/src/client/chat.js.tpl.php =================================================================== --- trunk/src/client/chat.js.tpl.php 2006-09-10 16:11:02 UTC (rev 745) +++ trunk/src/client/chat.js.tpl.php 2006-09-10 17:27:25 UTC (rev 746) @@ -79,7 +79,8 @@ "Enter the text to format", // _pfc "Configuration has been rehashed", // _pfc "A problem occurs during rehash", // _pfc - "Choosen nickname is allready used", //_pfc + "Choosen nickname is allready used", // _pfc + "phpfreechat current version is %s", // _pfc ); foreach($labels_to_load as $l) { Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-10 16:11:02 UTC (rev 745) +++ trunk/src/client/pfcclient.js 2006-09-10 17:27:25 UTC (rev 746) @@ -317,6 +317,13 @@ { } } + else if (cmd == "version") + { + if (resp == "ok") + { + this.displayMsg( cmd, this.res.getLabel('phpfreechat current version is %s',param) ); + } + } else if (cmd == "rehash") { if (resp == "ok") Added: trunk/src/commands/version.class.php =================================================================== --- trunk/src/commands/version.class.php (rev 0) +++ trunk/src/commands/version.class.php 2006-09-10 17:27:25 UTC (rev 746) @@ -0,0 +1,24 @@ +<?php + +require_once(dirname(__FILE__)."/../pfccommand.class.php"); + +class pfcCommand_version extends pfcCommand +{ + var $usage = "/version"; + + function run(&$xml_reponse, $p) + { + $clientid = $p["clientid"]; + $param = $p["param"]; + $sender = $p["sender"]; + $recipient = $p["recipient"]; + $recipientid = $p["recipientid"]; + + $c =& $this->c; + $u =& $this->u; + + $xml_reponse->addScript("pfc.handleResponse('".$this->name."', 'ok', '".$c->version."');"); + } +} + +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-10 16:11:08
|
Revision: 745 http://svn.sourceforge.net/phpfreechat/?rev=745&view=rev Author: kerphi Date: 2006-09-10 09:11:02 -0700 (Sun, 10 Sep 2006) Log Message: ----------- [en] Bug fix: the % charactere was not allowed in the url format. [fr] Bug fix : le caractere % n'?\195?\169tait pas authoris?\195?\169 dans les urls ecrites sur le chat. Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-10 16:10:16 UTC (rev 744) +++ trunk/src/client/pfcclient.js 2006-09-10 16:11:02 UTC (rev 745) @@ -845,7 +845,7 @@ var rx = null; // parse urls - var rx_url = new RegExp('(^|[^\\"])([a-z]+\:\/\/[a-z0-9.\\/\\?\\=\\&\\-\\_\\#:;]*)([^\\"]|$)','ig'); + var rx_url = new RegExp('(^|[^\\"])([a-z]+\:\/\/[a-z0-9.\\/\\?\\=\\&\\-\\_\\#:;%]*)([^\\"]|$)','ig'); var ttt = msg.split(rx_url); if (ttt.length > 1 && !navigator.appName.match("Explorer|Konqueror") && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-10 16:10:28
|
Revision: 744 http://svn.sourceforge.net/phpfreechat/?rev=744&view=rev Author: kerphi Date: 2006-09-10 09:10:16 -0700 (Sun, 10 Sep 2006) Log Message: ----------- [en] Bug fix: the proxy allowed path check was broken. [fr] Bug fix: les chemins a authoriser dans le proxy ?\195?\169taient mal calcul?\195?\169s. Modified Paths: -------------- trunk/misc/sendSource trunk/src/client/proxy.php.tpl trunk/src/pfcglobalconfig.class.php trunk/src/phpfreechat.class.php Modified: trunk/misc/sendSource =================================================================== --- trunk/misc/sendSource 2006-09-08 21:46:42 UTC (rev 743) +++ trunk/misc/sendSource 2006-09-10 16:10:16 UTC (rev 744) @@ -5,7 +5,8 @@ PFCSETUP_TGZ=pfcsetup-`cat ../version`.tar.gz PFCSETUP_ZIP=pfcsetup-`cat ../version`.zip +scp ./$NAME_ZIP ./$NAME_TGZ mic...@ph...:/home/micropolia/svn/phpfreechat/prod/www/download/ lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $NAME_TGZ" lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $NAME_ZIP" -lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $PFCSETUP_TGZ" -lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $PFCSETUP_ZIP" +#lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $PFCSETUP_TGZ" +#lftp -c "mput -O ftp://upload.sourceforge.net/incoming/ $PFCSETUP_ZIP" Modified: trunk/src/client/proxy.php.tpl =================================================================== --- trunk/src/client/proxy.php.tpl 2006-09-08 21:46:42 UTC (rev 743) +++ trunk/src/client/proxy.php.tpl 2006-09-10 16:10:16 UTC (rev 744) @@ -10,18 +10,11 @@ $page = isset($_GET["p"]) ? $_GET["p"] : ""; if ($page == "") die(); $files = array(); -if (strpos($page, "/") > 0 ) +foreach($allowedpath as $ap) { - foreach($allowedpath as $ap) - { - $f = realpath($ap."/".$page); - if ($f !== FALSE) $files[] = $f; - } + $f = realpath($ap."/".$page); + if ($f !== FALSE) $files[] = $f; } -else -{ - $files = array(realpath($page)); -} $found = ""; for( $i = 0; $i < count($allowedpath) && $found == ""; $i++) { Modified: trunk/src/pfcglobalconfig.class.php =================================================================== --- trunk/src/pfcglobalconfig.class.php 2006-09-08 21:46:42 UTC (rev 743) +++ trunk/src/pfcglobalconfig.class.php 2006-09-10 16:10:16 UTC (rev 744) @@ -410,9 +410,7 @@ $allowedpath_string = ""; $allowedpath_string .= "\$allowedpath[] = '".realpath(dirname(__FILE__)."/../lib")."';\n"; $allowedpath_string .= "\$allowedpath[] = '".realpath(dirname(__FILE__)."/../src/client")."';\n"; - $allowedpath_string .= "\$allowedpath[] = '".realpath($this->themepath_default)."/..';\n"; $allowedpath_string .= "\$allowedpath[] = '".realpath($this->themepath_default)."';\n"; - $allowedpath_string .= "\$allowedpath[] = '".realpath($this->themepath)."/..';\n"; $allowedpath_string .= "\$allowedpath[] = '".realpath($this->themepath)."';\n"; $proxycontent = file_get_contents(dirname(__FILE__)."/client/proxy.php.tpl"); $proxycontent = str_replace("//%allowedpath%", $allowedpath_string, $proxycontent); Modified: trunk/src/phpfreechat.class.php =================================================================== --- trunk/src/phpfreechat.class.php 2006-09-08 21:46:42 UTC (rev 743) +++ trunk/src/phpfreechat.class.php 2006-09-10 16:10:16 UTC (rev 744) @@ -101,17 +101,17 @@ // include javascript libraries $js = array(); - $js[] = "lib/xajax_0.2.3/xajax_js/xajax.js"; - $js[] = "lib/javascript/md5.js"; - $js[] = "lib/javascript/cookie.js"; - $js[] = "lib/javascript/image_preloader.js"; - $js[] = "lib/javascript/myprototype.js"; - $js[] = "lib/javascript/regex.js"; - $js[] = "lib/javascript/utf8.js"; - $js[] = "lib/javascript/sprintf2.js"; - $js[] = "src/client/pfcclient.js"; - $js[] = "src/client/pfcgui.js"; - $js[] = "src/client/pfcresource.js"; + $js[] = "xajax_0.2.3/xajax_js/xajax.js"; + $js[] = "javascript/md5.js"; + $js[] = "javascript/cookie.js"; + $js[] = "javascript/image_preloader.js"; + $js[] = "javascript/myprototype.js"; + $js[] = "javascript/regex.js"; + $js[] = "javascript/utf8.js"; + $js[] = "javascript/sprintf2.js"; + $js[] = "pfcclient.js"; + $js[] = "pfcgui.js"; + $js[] = "pfcresource.js"; foreach( $js as $j ) { $output .= "<script type=\"text/javascript\" src=\"".$c->data_public_url."/".$c->getId()."/proxy.php?p=".$j."\"></script>\n"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ke...@us...> - 2006-09-08 21:46:48
|
Revision: 743 http://svn.sourceforge.net/phpfreechat/?rev=743&view=rev Author: kerphi Date: 2006-09-08 14:46:42 -0700 (Fri, 08 Sep 2006) Log Message: ----------- Bug fix: the nickname TAB completion was broken. [fr] Bug fix : la completion a l'aide de la touche TAB des pseudonymes ne fonctionnait plus. Modified Paths: -------------- trunk/src/client/pfcclient.js Modified: trunk/src/client/pfcclient.js =================================================================== --- trunk/src/client/pfcclient.js 2006-09-08 21:23:04 UTC (rev 742) +++ trunk/src/client/pfcclient.js 2006-09-08 21:46:42 UTC (rev 743) @@ -58,7 +58,7 @@ this.el_words = $('pfc_words'); this.el_handle = $('pfc_handle'); this.el_container = $('pfc_container'); - this.el_online = $('pfc_online'); +// this.el_online = $('pfc_online'); this.el_errors = $('pfc_errors'); /* the events callbacks */ @@ -392,11 +392,12 @@ var nick_src = w.value.substring(w.value.lastIndexOf(' ')+1,w.value.length); if (nick_src != '') { - var ul_online = this.el_online.firstChild; - for (var i=0; i<ul_online.childNodes.length; i++) + var tabid = this.gui.getTabId(); + var n_list = this.nicklist[tabid]; + for (var i=0; i<n_list.length; i++) { - var nick = ul_online.childNodes[i].innerHTML; - if (indexOf(nick, nick_src) == 0) + var nick = n_list[i]; + if (nick.indexOf(nick_src) == 0) w.value = w.value.replace(nick_src, nick); } } @@ -497,7 +498,7 @@ { if (!this.isconnected) return false; this.clearError(Array(this.el_words)); - var code = (evt.which) ? evt.which : event.keyCode + var code = (evt.which) ? evt.which : evt.keyCode if (code == 9) /* tab key */ { /* IE workaround : ignore TAB key here */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |