]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - channels/details.php
Try to be helpful if someone mixes wrong secrets::key with (old) DB unrealircd::rpc_p...
[irc/unrealircd/unrealircd-webpanel.git] / channels / details.php
index a006abaa83acf1dc135993c6f4a7e53f671f2ff2..dc5510c012761079f263b046c6bb23aa9889998d 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 require_once "../common.php";
+require_once "../connection.php";
 require_once "../header.php";
 
 if ($uplink = $rpc->server()->get())
@@ -9,6 +10,8 @@ $channel = "";
 $channame = "";
 $nick = NULL;
 $channelObj = NULL;
+
+$can_edit = current_user_can(PERMISSION_EDIT_CHANNEL);
 do_log($_GET);
 do_log($_POST);
 if (isset($_GET['chan']))
@@ -154,7 +157,7 @@ if (!empty($_POST))
                }
        }
 
-       if (isset($_POST['newmodes']) && isset($_POST['paramed_modes']))
+       if (isset($_POST['newmodes']) && isset($_POST['paramed_modes']) && $can_edit)
        {
                $m = $_POST['newmodes'];
                $p = $_POST['paramed_modes'];
@@ -205,7 +208,6 @@ if (!empty($_POST))
 ?>
 <title><?php echo $title; ?></title>
 <h6><?php echo $title; ?></h6>
-<br>
 
 
 <form method="get" action="details.php">
@@ -252,7 +254,7 @@ if (!empty($_POST))
                                </label>
                        </div>
                        <div class="input-group mb-3">
-                               <label for="bantype_sel_type">Ban Type
+                               <label for="bantype_sel_type">Ban Type <small>Leave this blank for a "normal" ban</small>
                                        <select class="form-control" name="bantype_sel_type" id="bantype_sel_type">
                                                <option></option>
                                                <option>Match Account</option>
@@ -398,11 +400,7 @@ if (!empty($_POST))
                </div>
                <div class="modal-body">
                        <form method="post">
-                       
                        <?php generate_edit_chmodes($channelObj); ?>
-
-               </div>
-               <div class="modal-footer">
                        <input type="hidden" id="server" name="add_chex" value="e"></input>
                        <button id="CloseButton" type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
                        <button type="submit" action="post" class="btn btn-danger">Update</button>
@@ -512,7 +510,7 @@ if ($topicset)
                <div class="tab-content">
                        <br>
                        <div class="tab-pane fade in" id="chanmodes">
-                               <button id="editlol" class="btn btn-sm btn-primary">Change Settings</button>
+                               <button id="editlol" class="btn btn-sm btn-primary" <?php echo ($can_edit) ? "" : "disabled"; ?>>Change Settings</button>
                                <p class="card-text"><?php generate_html_chansettings($channelObj); ?></p>
                        </div><form id="editchanmodes" method="post" name="editchanmodes">
                        <div class="tab-pane" style="display: none" id="chanmodes_edit">