Example #1
0
 }
 // 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
     $unban_body = $banlist[$name];
     $unban_body = array_merge($unban_body, array('name' => $name));
     Container_messages::postMsgToChannel($cid, $online_uid, $unban_body, 'unban');
     $res->status(200);
 } else {
     $res->status(500);
 }