X-Git-Url: https://jfr.im/git/irc/unrealircd/unrealircd-webpanel.git/blobdiff_plain/d9a581b918313cf961a6131a7c45e67a0a2289f9..226d9858edad88b02df499d90fade31bcaab83d6:/channels/details.php diff --git a/channels/details.php b/channels/details.php index 4859c86..6f87ca5 100644 --- a/channels/details.php +++ b/channels/details.php @@ -7,6 +7,7 @@ $title = "Channel Lookup"; $channel = ""; $channame = ""; $nick = NULL; +$channelObj = NULL; do_log($_GET); do_log($_POST); if (isset($_GET['chan'])) @@ -23,17 +24,60 @@ if (isset($_GET['chan'])) do_log($channelObj); } } +$topicset = false; +$del_ex = false; +$del_inv = false; +$del_ban = false; +$checkboxes = []; +if (isset($_POST)) +{ + if (isset($_POST['update_topic']) && isset($_POST['set_topic'])) + { + if (isset($channelObj)) + { + if (!isset($channelObj->topic) || strcmp($channelObj->topic,$_POST['set_topic'])) // if the set topic is different + { + $user = (function_exists('unreal_get_current_user') && $u = unreal_get_current_user()) ? $u->username : NULL; + $topicset = $rpc->channel()->set_topic($channelObj->name, $_POST['set_topic'], $user); + $channelObj->topic = $_POST['set_topic']; + } + } + } + $checkboxes = (isset($_POST['ban_checkboxes'])) ? $_POST['ban_checkboxes'] : []; + if (isset($_POST['delete_sel_ex'])) + { + foreach($_POST['ce_checkboxes'] as $c) + $checkboxes[] = $c; + $del_ex = true; + chlkup_autoload_modal("excepts_modal"); + } + else if (isset($_POST['delete_sel_inv'])) + { + foreach($_POST['ci_checkboxes'] as $c) + $checkboxes[] = $c; + $del_inv = true; + chlkup_autoload_modal("invites_modal"); + } + else if (isset($_POST['delete_sel_ban'])) + { + foreach($_POST['cb_checkboxes'] as $c) + $checkboxes[] = $c; + $del_ban = true; + chlkup_autoload_modal("bans_modal"); + } + +} + ?>