+ if ((isset($_POST['kickban']) || isset($_POST['muteban'])) && current_user_can(PERMISSION_EDIT_CHANNEL_USER))
+ {
+ $mute = (isset($_POST['muteban'])) ? true : false;
+ $mutestr = ($mute) ? "~quiet:" : "";
+ $user = (!$mute) ? $_POST['kickban'] : $_POST['muteban'];
+
+ $kbuser = $rpc->user()->get($user);
+
+ if (!$kbuser)
+ Message::Fail("Could not kickban user: User does not exist");
+ else
+ {
+ $rpc->channel()->set_mode($channelObj->name, "+b", "~time:".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME.":".$mutestr."*!*@".$kbuser->user->cloakedhost);
+ if (!$mute)
+ $rpc->channel()->kick($channelObj->name, $kbuser->name, DEFAULT_CHAN_DETAIL_QUICK_BAN_REASON);
+
+ $msgbox_str = ($mute)
+ ?
+ "User \"$kbuser->name\" has been muted for ".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME." minutes."
+ :
+ "User \"$kbuser->name\" has been banned for ".DEFAULT_CHAN_DETAIL_QUICK_ACTION_TIME." minutes."
+ ;
+ Message::Success($msgbox_str);
+ }
+ }
+
+ if (isset($_POST['newmodes']) && isset($_POST['paramed_modes']) && $can_edit)
+ {
+ $m = $_POST['newmodes'];
+ $p = $_POST['paramed_modes'];
+
+ do_log($p,$m);
+ $addmodestring = "+";
+ $addparamstring = "";
+ $delmodestring = "-";
+ $delparamstring = "";
+ foreach ($m as $mode)
+ {
+ strcat($addmodestring, $mode);
+ if (isset($p[$mode]) && strlen($p[$mode]))
+ strcat($addparamstring, $p[$mode]." ");
+ }
+
+ $fmodes = $channelObj->modes;
+ $tok = split($fmodes);
+ $modes = $tok[0];
+ $params = rparv($fmodes);
+ $paramed_modes = sort_paramed_modes($modes, $params);
+ for ($i = 0; isset($modes[$i]) && $mode = $modes[$i]; $i++)
+ {
+ if (!strstr($addmodestring, $mode))
+ {
+ $req = IRCList::lookup($mode)['requires'];
+ if ($req == "Server")
+ continue;
+ strcat($delmodestring, $mode);
+ $grp = get_chmode_group($mode);
+ if ($grp == 2)
+ strcat($delparamstring, $paramed_modes[$mode]." ");
+ }
+
+ }
+
+
+ if ($rpc->channel()->set_mode($channel, $delmodestring.$addmodestring, $delparamstring." ".$addparamstring))
+ Message::Success("Channel settings have been successfully updated");
+ else
+ Message::Fail("Could not change channel settings: $rpc->error");
+ }