1<?php
2
3require_once(dirname(__FILE__)."/../pfccommand.class.php");
4
5/**
6 * This command list the banished users on the given channel
7 *
8 * @author Stephane Gully <stephane.gully@gmail.com>
9 */
10class pfcCommand_banlist extends pfcCommand
11{
12  var $desc = "This command list the banished users on the given channel";
13
14  function run(&$xml_reponse, $p)
15  {
16    $c =& pfcGlobalConfig::Instance();
17    $u =& pfcUserConfig::Instance();
18
19    $ct =& pfcContainer::Instance();
20    $banlist = $ct->getChanMeta($p["recipient"], 'banlist_nickid');
21
22    if ($banlist == NULL) $banlist = array(); else $banlist = unserialize($banlist);
23    $msg  = "";
24    $msg .= "<p>"._pfc("The banished user list is:")."</p>";
25    if (count($banlist)>0)
26    {
27      $msg .= "<ul>";
28      foreach($banlist as $b)
29      {
30        $n = $ct->getNickname($b);
31        $msg .= "<li style=\"margin-left:50px\">".$n."</li>";
32      }
33      $msg .= "</ul>";
34    }
35    else
36    {
37      $msg .= "<p>("._pfc("Empty").")</p>";
38    }
39    $msg .= "<p>"._pfc("'/unban {nickname}' will unban the user identified by {nickname}")."</p>";
40    $msg .= "<p>"._pfc("'/unban all'  will unban all the users on this channel")."</p>";
41
42    $xml_reponse->script("pfc.handleResponse('".$this->name."', 'ok', '".addslashes($msg)."');");
43  }
44}
45
46?>