• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pfcGlobalConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pfcGlobalConfig的典型用法代码示例。如果您正苦于以下问题:PHP pfcGlobalConfig类的具体用法?PHP pfcGlobalConfig怎么用?PHP pfcGlobalConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了pfcGlobalConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     if ($param != "") {
         require_once dirname(__FILE__) . "/join.class.php";
         $recipient = pfcCommand_join::GetRecipient($param);
         $recipientid = pfcCommand_join::GetRecipientId($param);
     }
     $chanmeta = $this->_getChanMeta($recipient, $recipientid);
     //if (preg_match("/^pv_/", $recipient))
     //$this->trace($xml_reponse, 'who2', $recipient);
     // check if info didn't change since last call
     $sid = "pfc_who2_" . $c->getId() . "_" . $clientid . "_" . $recipientid;
     if (isset($_SESSION[$sid]) && $chanmeta == $_SESSION[$sid]) {
         // do not send the response to save bandwidth
         //$xml_reponse->script("pfc.handleResponse('".$this->name."', 'unchanged', '');");
     } else {
         $_SESSION[$sid] = $chanmeta;
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', " . $chanmeta . ");");
     }
 }
开发者ID:danielheyman,项目名称:EazySubs,代码行数:27,代码来源:who2.class.php


示例2: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     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;
     }
     // just change the "isadmin" meta flag
     $nicktoop = trim($param);
     $nicktoopid = $ct->getNickId($nicktoop);
     $ct->setUserMeta($nicktoopid, 'isadmin', true);
     $this->forceWhoisReload($nicktoopid);
 }
开发者ID:danielheyman,项目名称:EazySubs,代码行数:25,代码来源:op.class.php


示例3: run

 function run(&$xml_reponse, $p)
 {
     $cmdtocheck = array("send", "me", "notice");
     if (in_array($this->name, $cmdtocheck)) {
         $clientid = $p["clientid"];
         $param = $p["param"];
         $sender = $p["sender"];
         $recipient = $p["recipient"];
         $recipientid = $p["recipientid"];
         $c =& pfcGlobalConfig::Instance();
         $u =& pfcUserConfig::Instance();
         $logpath = $c->proxies_cfg[$this->proxyname]["path"] == "" ? $c->data_private_path . "/logs" : $c->proxies_cfg[$this->proxyname]["path"];
         $logpath .= "/" . $c->getId();
         if (!file_exists($logpath)) {
             @mkdir_r($logpath);
         }
         if (file_exists($logpath) && is_writable($logpath)) {
             $logfile = $logpath . "/chat.log";
             if (is_writable($logpath)) {
                 // @todo write logs in a cleaner structured language (xml, html ... ?)
                 $log = $recipient . "\t";
                 $log .= date("d/m/Y") . "\t";
                 $log .= date("H:i:s") . "\t";
                 $log .= $sender . "\t";
                 $log .= $param . "\n";
                 file_put_contents($logfile, $log, FILE_APPEND | LOCK_EX);
             }
         }
     }
     // forward the command to the next proxy or to the final command
     return $this->next->run($xml_reponse, $p);
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:32,代码来源:log.class.php


示例4: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     /**
      * fixes some anoying issues with noflood not detecting user flooding the chat
      * those are notice and invite
      */
     $cmdtocheck = array("send", "nick", "me", "notice", "invite");
     // fixes the count of noflood even if the text posted was empty (Neumann Valle (UTAN))
     if (in_array($this->name, $cmdtocheck) && $param != "") {
         $container =& pfcContainer::Instance();
         $nickid = $u->nickid;
         $isadmin = $container->getUserMeta($nickid, 'isadmin');
         $lastfloodtime = $container->getUserMeta($nickid, 'floodtime');
         $flood_nbmsg = $container->getUserMeta($nickid, 'flood_nbmsg');
         $flood_nbchar = $container->getUserMeta($nickid, 'flood_nbchar');
         $floodtime = time();
         if ($floodtime - $lastfloodtime <= $c->proxies_cfg[$this->proxyname]["delay"]) {
             // update the number of posted message indicator
             $flood_nbmsg++;
             // update the number of posted characteres indicator
             $flood_nbchar += utf8_strlen($param);
         } else {
             $flood_nbmsg = 0;
             $flood_nbchar = 0;
         }
         if (!$isadmin && ($flood_nbmsg > $c->proxies_cfg[$this->proxyname]["msglimit"] || $flood_nbchar > $c->proxies_cfg[$this->proxyname]["charlimit"])) {
             // warn the flooder
             $msg = _pfc("Please don't post so many message, flood is not tolerated");
             $xml_reponse->script("alert('" . addslashes($msg) . "');");
             // kick the flooder
             $cmdp = $p;
             $cmdp["param"] = null;
             $cmdp["params"][0] = "ch";
             $cmdp["params"][1] = $u->channels[$recipientid]["name"];
             $cmdp["params"][2] .= _pfc("kicked from %s by %s", $u->channels[$recipientid]["name"], "noflood");
             $cmd =& pfcCommand::Factory("leave");
             $cmd->run($xml_reponse, $cmdp);
             return false;
         }
         if ($flood_nbmsg == 0) {
             $container->setUserMeta($nickid, 'floodtime', $floodtime);
         }
         $container->setUserMeta($nickid, 'flood_nbmsg', $flood_nbmsg);
         $container->setUserMeta($nickid, 'flood_nbchar', $flood_nbchar);
     }
     // 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;
     return $this->next->run($xml_reponse, $p);
 }
开发者ID:ho96,项目名称:yii2-phpfreechat,代码行数:60,代码来源:noflood.class.php


示例5: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $msg = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $flag = isset($p["flag"]) ? $p["flag"] : 7;
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     if ($c->shownotice > 0 && ($c->shownotice & $flag) == $flag) {
         $msg = phpFreeChat::FilterSpecialChar($msg);
         $msg = $flag == 7 ? '(' . $sender . ') ' . $msg : $msg;
         $nick = $ct->getNickname($u->nickid);
         $res = $ct->write($recipient, $nick, "notice", $msg);
         if (is_array($res)) {
             $cmdp = $p;
             $cmdp["param"] = implode(",", $res);
             $cmd =& pfcCommand::Factory("error");
             $cmd->run($xml_reponse, $cmdp);
             return;
         }
     }
 }
开发者ID:ho96,项目名称:yii2-phpfreechat,代码行数:25,代码来源:notice.class.php


示例6: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $nicktochange = phpFreeChat::FilterNickname($param);
     if ($c->frozen_nick) {
         // assign a random nick
         $cmdp = $p;
         $cmdp["param"] = $nicktochange . "" . rand(1, 1000);
         $cmd =& pfcCommand::Factory("nick");
         $cmd->run($xml_reponse, $cmdp);
     } else {
         if ($nicktochange == "") {
             $nicktochange = $u->nick;
             $msg = _pfc("Please enter your nickname");
         } else {
             $msg = "'" . $nicktochange . "' is used, please choose another nickname.";
         }
         $xml_reponse->script("var newnick = prompt('" . addslashes($msg) . "', '" . addslashes($nicktochange) . "'); if (newnick) pfc.sendRequest('/nick \"'+newnick+'\"');");
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:26,代码来源:asknick.class.php


示例7: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     // check the user has not been disconnected from the server by timeout
     // if he has been disconnected, then I reconnect him with /connect command
     if ($u->nick != '' && !$u->isOnline()) {
         $cmd =& pfcCommand::Factory("connect");
         $cmdp = $p;
         $cmdp['params'] = array($u->nick);
         $cmdp['getoldmsg'] = false;
         $cmdp['joinoldchan'] = false;
         $cmd->run($xml_reponse, $cmdp);
     }
     // do not update if user isn't active (didn't connect)
     if ($u->isOnline()) {
         $cmdp = $p;
         // update the user nickname timestamp on the server
         $cmd =& pfcCommand::Factory("updatemynick");
         $cmdp["recipient"] = NULL;
         $cmdp["recipientid"] = NULL;
         $cmd->run($xml_reponse, $cmdp);
         // get other online users on each channels
         $cmd =& pfcCommand::Factory("who2");
         foreach ($u->channels as $id => $chan) {
             $cmdp["recipient"] = $chan["recipient"];
             $cmdp["recipientid"] = $id;
             $cmdp["param"] = '';
             // don't forward the parameter because it will be interpreted as a channel name
             $cmd->run($xml_reponse, $cmdp);
         }
         foreach ($u->privmsg as $id => $pv) {
             $cmdp["recipient"] = $pv["recipient"];
             $cmdp["recipientid"] = $id;
             $cmdp["param"] = '';
             // don't forward the parameter because it will be interpreted as a channel name
             $cmd->run($xml_reponse, $cmdp);
         }
         // get new message posted on each channels
         $cmd =& pfcCommand::Factory("getnewmsg");
         foreach ($u->channels as $id => $chan) {
             $cmdp["recipient"] = $chan["recipient"];
             $cmdp["recipientid"] = $id;
             $cmd->run($xml_reponse, $cmdp);
         }
         foreach ($u->privmsg as $id => $pv) {
             $cmdp["recipient"] = $pv["recipient"];
             $cmdp["recipientid"] = $id;
             $cmd->run($xml_reponse, $cmdp);
         }
         $xml_reponse->script("pfc.handleResponse('update', 'ok', '');");
     } else {
         $xml_reponse->script("pfc.handleResponse('update', 'ko', '');");
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:60,代码来源:update.class.php


示例8: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $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];
         }
     }
     closedir($dh);
     sort($cmdlist);
     $str = _pfc("Here is the command list:") . "<br/>";
     $str .= implode("<br/>", $cmdlist);
     $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', '" . $str . "');");
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:26,代码来源:help.class.php


示例9: run

 function run(&$xml_reponse, $p)
 {
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     $banlist = $ct->getChanMeta($p["recipient"], 'banlist_nickid');
     if ($banlist == NULL) {
         $banlist = array();
     } else {
         $banlist = unserialize($banlist);
     }
     $msg = "";
     $msg .= "<p>" . _pfc("The banished user list is:") . "</p>";
     if (count($banlist) > 0) {
         $msg .= "<ul>";
         foreach ($banlist as $b) {
             $n = $ct->getNickname($b);
             $msg .= "<li style=\"margin-left:50px\">" . $n . "</li>";
         }
         $msg .= "</ul>";
     } else {
         $msg .= "<p>(" . _pfc("Empty") . ")</p>";
     }
     $msg .= "<p>" . _pfc("'/unban {nickname}' will unban the user identified by {nickname}") . "</p>";
     $msg .= "<p>" . _pfc("'/unban all'  will unban all the users on this channel") . "</p>";
     $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', '" . addslashes($msg) . "');");
 }
开发者ID:danielheyman,项目名称:EazySubs,代码行数:27,代码来源:banlist.class.php


示例10: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $nick = $c->nick;
     $ct =& pfcContainer::Instance();
     $text = trim($param);
     // Call parse roll
     require_once dirname(__FILE__) . '/demo27_dice.class.php';
     $dice = new Dice();
     if (!$dice->check($text)) {
         $result = $dice->error_get();
         $cmdp = $p;
         $cmdp["param"] = "Cmd_roll failed: " . $result;
         $cmd =& pfcCommand::Factory("error", $c);
         $cmd->run($xml_reponse, $cmdp);
     } else {
         $result = $dice->roll();
         $ct->write($recipient, $nick, "send", $result);
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:25,代码来源:demo27_customized_command.php


示例11: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $password = trim($param);
     $isadmin = false;
     //     $xml_reponse->script("alert('sender=".$sender."');");
     //     $xml_reponse->script("alert('password=".$password."');");
     //     $xml_reponse->script("alert('admins=".var_export($c->admins, true)."');");
     if (isset($c->admins[$sender]) && $c->admins[$sender] == $password) {
         $isadmin = true;
     }
     $msg = "";
     if ($isadmin) {
         // ok the current user is an admin, just save the isadmin flag in the metadata
         $ct =& pfcContainer::Instance();
         $ct->setUserMeta($u->nickid, 'isadmin', $isadmin);
         $this->forceWhoisReload($u->nickid);
         $msg .= _pfc("Succesfully identified");
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', '" . $msg . "');");
     } else {
         $msg .= _pfc("Identification failure");
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ko', '" . $msg . "');");
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:30,代码来源:identify.class.php


示例12: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $params = $p["params"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $nick = isset($params[0]) ? $params[0] : '';
     $reason = isset($params[1]) ? $params[1] : '';
     if ($reason == '') {
         $reason = _pfc("no reason");
     }
     // to allow unquotted reason
     if (count($params) > 2) {
         for ($x = 2; $x < count($params); $x++) {
             $reason .= " " . $params[$x];
         }
     }
     $channame = $u->channels[$recipientid]["name"];
     if ($nick == '') {
         // error
         $cmdp = $p;
         $cmdp["param"] = _pfc("Missing parameter");
         $cmdp["param"] .= " (" . $this->usage . ")";
         $cmd =& pfcCommand::Factory("error");
         $cmd->run($xml_reponse, $cmdp);
         return;
     }
     $ct =& pfcContainer::Instance();
     $nickidtoban = $ct->getNickId($nick);
     // notify all the channel
     $cmdp = $p;
     $cmdp["param"] = _pfc("%s banished from %s by %s", $nick, $channame, $sender);
     $cmdp["flag"] = 1;
     $cmd =& pfcCommand::Factory("notice");
     $cmd->run($xml_reponse, $cmdp);
     // kick the user (maybe in the future, it will be dissociate in a /kickban command)
     $cmdp = $p;
     $cmdp["params"] = array();
     $cmdp["params"][] = $nick;
     // nickname to kick
     $cmdp["params"][] = $reason;
     // reason
     $cmd =& pfcCommand::Factory("kick");
     $cmd->run($xml_reponse, $cmdp);
     // update the recipient banlist
     $banlist = $ct->getChanMeta($recipient, 'banlist_nickid');
     if ($banlist == NULL) {
         $banlist = array();
     } else {
         $banlist = unserialize($banlist);
     }
     $banlist[] = $nickidtoban;
     // append the nickid to the banlist
     $ct->setChanMeta($recipient, 'banlist_nickid', serialize($banlist));
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:59,代码来源:ban.class.php


示例13: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', '" . $c->version . "');");
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:11,代码来源:version.class.php


示例14: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $params = $p["params"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     // pfcGlobalConfig
     $u =& pfcUserConfig::Instance();
     // pfcUserConfig
     $ct =& pfcContainer::Instance();
     // Connection to the chatbackend
     $nicktoinvite = isset($params[0]) ? $params[0] : '';
     $channeltarget = isset($params[1]) ? $params[1] : $u->channels[$recipientid]["name"];
     // Default: current channel
     if ($nicktoinvite == '' || $channeltarget == '') {
         // Parameters are not ok
         $cmdp = $p;
         $cmdp["params"] = array();
         $cmdp["param"] = _pfc("Missing parameter");
         $cmdp["param"] .= " (" . $this->usage . ")";
         $cmd =& pfcCommand::Factory("error");
         $cmd->run($xml_reponse, $cmdp);
         return;
     }
     // check that the inviter is already in the channeltarget
     if (!$ct->isNickOnline(pfcCommand_join::GetRecipient($channeltarget), $u->nickid)) {
         $cmdp = $p;
         $cmdp["params"] = array();
         $cmdp["param"] = _pfc("You must join %s to invite users in this channel", $channeltarget);
         $cmd =& pfcCommand::Factory("error");
         $cmd->run($xml_reponse, $cmdp);
         return;
     }
     // inviting a user: just add a join command to play to the aimed user metadata.
     $nicktoinvite_id = $ct->getNickId($nicktoinvite);
     $cmdstr = 'join2';
     $cmdp = array();
     $cmdp['param'] = $channeltarget;
     // channel target name
     $cmdp['params'][] = $channeltarget;
     // channel target name
     pfcCommand::AppendCmdToPlay($nicktoinvite_id, $cmdstr, $cmdp);
     // notify the aimed channel that a user has been invited
     $cmdp = array();
     $cmdp["param"] = _pfc("%s was invited by %s", $nicktoinvite, $sender);
     $cmdp["flag"] = 1;
     $cmdp["recipient"] = pfcCommand_join::GetRecipient($channeltarget);
     $cmdp["recipientid"] = pfcCommand_join::GetRecipientId($channeltarget);
     $cmd =& pfcCommand::Factory("notice");
     $cmd->run($xml_reponse, $cmdp);
 }
开发者ID:danielheyman,项目名称:EazySubs,代码行数:54,代码来源:invite.class.php


示例15: setUp

 function setUp()
 {
     //    echo "setUp<br>";
     require_once dirname(__FILE__) . "/../src/pfcglobalconfig.class.php";
     $params = array();
     $params["title"] = "testcase -> pfccontainer_" . $this->type;
     $params["serverid"] = md5(__FILE__ . time());
     $params["container_type"] = $this->type;
     $this->c = pfcGlobalConfig::Instance($params);
     $this->ct = pfcContainer::Instance();
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:11,代码来源:container_generic.php


示例16: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     $ct->updateNick($u->nickid);
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:12,代码来源:updatemynick.class.php


示例17: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $cmd =& pfcCommand::Factory("quit");
     $cmd->run($xml_reponse, $p);
     $u->destroy();
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:13,代码来源:init.class.php


示例18: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $params = $p["params"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     $nick = isset($params[0]) ? $params[0] : '';
     $nickid = $ct->getNickId($nick);
     if ($nick == "") {
         // error
         $cmdp = $p;
         $cmdp["param"] = _pfc("Missing parameter");
         $cmdp["param"] .= " (" . $this->usage . ")";
         $cmd =& pfcCommand::Factory("error");
         $cmd->run($xml_reponse, $cmdp);
         return;
     }
     $updated = false;
     $msg = "<p>" . _pfc("Nobody has been unbanished") . "</p>";
     // update the recipient banlist
     $banlist = $ct->getChanMeta($recipient, 'banlist_nickid');
     if ($banlist == NULL) {
         $banlist = array();
     } else {
         $banlist = unserialize($banlist);
     }
     $nb = count($banlist);
     if (in_array($nickid, $banlist)) {
         $banlist = array_diff($banlist, array($nickid));
         $ct->setChanMeta($recipient, 'banlist_nickid', serialize($banlist));
         $updated = true;
         $msg = "<p>" . _pfc("%s has been unbanished", $nick) . "</p>";
     } else {
         if ($nick == "all") {
             $banlist = array();
             $ct->setChanMeta($recipient, 'banlist_nickid', serialize($banlist));
             $updated = true;
             $msg = "<p>" . _pfc("%s users have been unbanished", $nb) . "</p>";
         }
     }
     if ($updated) {
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', '" . $msg . "');");
     } else {
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ko', '" . $msg . "');");
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:51,代码来源:unban.class.php


示例19: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $params = $p["params"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $ct =& pfcContainer::Instance();
     //    $xml_reponse->script("trace('".implode(',',$params)."');");
     //    return;
     // get the nickid from the parameters
     // if the run command is whois2 then the parameter is a nickid
     $nickid = '';
     if ($this->name == 'whois2') {
         $nickid = $params[0];
     } else {
         $nickid = $ct->getNickId($params[0]);
     }
     if ($nickid) {
         $usermeta = $ct->getAllUserMeta($nickid);
         $usermeta['nickid'] = $nickid;
         unset($usermeta['cmdtoplay']);
         // used internaly
         // remove private usermeta from the list if the client is not admin
         $isadmin = $ct->getUserMeta($u->nickid, 'isadmin');
         if (!$isadmin) {
             foreach ($c->nickmeta_private as $nmp) {
                 unset($usermeta[$nmp]);
             }
         }
         // sort the list
         $nickmeta_sorted = array();
         $order = array_merge(array_diff(array_keys($usermeta), array_keys($c->nickmeta)), array_keys($c->nickmeta));
         foreach ($order as $o) {
             $nickmeta_sorted[$o] = $usermeta[$o];
         }
         $usermeta = $nickmeta_sorted;
         require_once dirname(__FILE__) . '/../pfcjson.class.php';
         $json = new pfcJSON();
         $js = $json->encode($usermeta);
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', " . $js . ");");
     } else {
         $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ko','" . $param . "');");
     }
 }
开发者ID:danielheyman,项目名称:EazySubs,代码行数:48,代码来源:whois.class.php


示例20: run

 function run(&$xml_reponse, $p)
 {
     $clientid = $p["clientid"];
     $param = $p["param"];
     $sender = $p["sender"];
     $recipient = $p["recipient"];
     $recipientid = $p["recipientid"];
     $c =& pfcGlobalConfig::Instance();
     $u =& pfcUserConfig::Instance();
     $channame = trim($param);
     $chanrecip = pfcCommand_join::GetRecipient($channame);
     $chanid = pfcCommand_join::GetRecipientId($channame);
     if ($channame == "") {
         $cmdp = $p;
         $cmdp["param"] = _pfc("Missing parameter");
         $cmdp["param"] .= " (" . $this->usage . ")";
         $cmd =& pfcCommand::Factory("error");
         $cmd->run($xml_reponse, $cmdp);
         return;
     }
     if (!isset($u->channels[$chanid])) {
         if ($c->max_channels <= count($u->channels)) {
             // the maximum number of joined channels has been reached
             $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'max_channels', Array());");
             return;
         }
         $u->channels[$chanid]["recipient"] = $chanrecip;
         $u->channels[$chanid]["name"] = $channame;
         $u->saveInCache();
         // show a join message
         $cmdp = $p;
         $cmdp["param"] = _pfc("%s joins %s", $u->getNickname(), $channame);
         $cmdp["recipient"] = $chanrecip;
         $cmdp["recipientid"] = $chanid;
         $cmdp["flag"] = 2;
         $cmd =& pfcCommand::Factory("notice");
         $cmd->run($xml_reponse, $cmdp);
     }
     // register the user (and his metadata) in the channel
     $ct =& pfcContainer::Instance();
     //    $ct->createNick($chanrecip, $u->nick, $u->nickid);
     $ct->joinChan($u->nickid, $chanrecip);
     $this->forceWhoisReload($u->nickid);
     // return ok to the client
     // then the client will create a new tab
     $xml_reponse->script("pfc.handleResponse('" . $this->name . "', 'ok', Array('" . $chanid . "','" . addslashes($channame) . "'));");
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:47,代码来源:join.class.php



注:本文中的pfcGlobalConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP phemplate类代码示例发布时间:2022-05-23
下一篇:
PHP person类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap