示例#1
0
 }
 $online_uid = $_SESSION['userdata']['id'];
 // check this user is online
 if (!Container_users::checkUserExists($online_uid)) {
     $res->status(400);
     // User is not connected
     return;
 }
 // check this user has joined the channel
 if (!Container_channels::checkChannelUser($cid, $online_uid)) {
     $res->status(403);
     // You have to join channel
     return;
 }
 // check this user is an operator on this channel
 if (!Container_channels_op::isOp($cid, $online_uid)) {
     $res->status(403);
     // You have to be an operator to unban a user
     return;
 }
 // removes name64 from the ban list
 $banlist = Container_channels_ban::getBanList($cid);
 $ok = Container_channels_ban::rmBan($cid, $name64);
 if ($ok) {
     // check if the user is in the ban list
     $name = base64_decode($name64);
     if (!isset($banlist[$name])) {
         $res->status(404);
         return;
     }
     // notification to other connected user of this removed ban