]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - channels/details.php
Show user agent in mail
[irc/unrealircd/unrealircd-webpanel.git] / channels / details.php
index 4859c86a474c0f55f6474d25236c4076d2df6553..6f87ca5e475967df40a198e0bf0e8327e92876aa 100644 (file)
@@ -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");
+       }
+
+}
+
 ?>
 <title><?php echo $title; ?></title>
 <h4><?php echo $title; ?></h4>
 <br>
-
 <form method="get" action="details.php">
 <div class="container-xxl">
-       <div class="input-group short-form-control">
-               <input style="margin: 0%; height: 24px;" class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
+       <div class="input-group">
+               <input  class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
                <div class="input-group-append">
-                       <br><button type="submit" class="btn btn-primary">Go</button>
+                       <button type="submit" class="btn btn-primary">Go</button>
                </div>
        </div>
 </div>
@@ -42,12 +86,24 @@ if (isset($_GET['chan']))
 <?php if (!$channelObj)
                return; ?>
 
+<br>
+<h3>
+       Topic:<br></h3>
+       <form method="post" action="details.php?chan=<?php echo urlencode($channelObj->name); ?>">
+       <div class="input-group">
+       <input maxlength="360" type="text" class="input-group form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
+       <div class="input-group-append"><button type="submit" name="update_topic" value="true" class="btn btn-info">Update Topic</button></div></div>
+       </form>
+<?php 
+if ($topicset)
+       Message::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic)."\"");
+?>
 <br>
 <div class="row">
        <div class="col-sm-3">
-               <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#bans_modal">Bans</div>
+               <div class="btn btn-sm btn-danger" data-toggle="modal" data-target="#bans_modal">Bans</div>
                <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#invites_modal">Invites</div>
-               <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#excepts_modal">Exceptions</div>
+               <div class="btn btn-sm btn-warning" data-toggle="modal" data-target="#excepts_modal">Exceptions</div>
        </div>
 </div>
 <br>
@@ -63,6 +119,7 @@ if (isset($_GET['chan']))
                        </button>
                </div>
                <div class="modal-body">
+                       <?php if ($del_ban) do_delete_chanban($channelObj, $checkboxes); ?>
                        <form method="post">
                        <?php generate_chanbans_table($channelObj); ?>          
                        </form>
@@ -81,6 +138,7 @@ if (isset($_GET['chan']))
                        </button>
                </div>
                <div class="modal-body">
+                       <?php if ($del_inv) do_delete_invite($channelObj, $checkboxes); ?>
                        <form method="post">
                        <?php generate_chaninvites_table($channelObj); ?>               
                        </form>
@@ -100,6 +158,7 @@ if (isset($_GET['chan']))
                        </button>
                </div>
                <div class="modal-body">
+                       <?php if ($del_ex) do_delete_chanex($channelObj, $checkboxes); ?>
                        <form method="post">
                        <?php generate_chanexcepts_table($channelObj); ?>               
                        </form>
@@ -107,51 +166,54 @@ if (isset($_GET['chan']))
                </div>
        </div>
 </div>
+
+
+
 <div class="container-xxl">
        <div class="accordion" id="accordionExample">
-       <div class="card">
-               <div class="card-header" id="headingOne">
-               <h2 class="mb-0">
-                       <button class="btn" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
-                       Collapsible Group Item #1
-                       </button>
-               </h2>
-               </div>
+               <div class="card">
+                       <div class="card-header" id="headingOne">
+                       <h2 class="mb-0">
+                               <button class="btn" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
+                               User List
+                               </button>
+                       </h2>
+                       </div>
 
-               <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
-               <div class="card-body">
-                       Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
-               </div>
-               </div>
-       </div>
-       <div class="card">
-               <div class="card-header" id="headingTwo">
-               <h2 class="mb-0">
-                       <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
-                       Collapsible Group Item #2
-                       </button>
-               </h2>
+                       <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
+                       <div class="card-body">
+                               <?php generate_chan_occupants_table($channelObj); ?>
+                       </div>
+                       </div>
+               </div>
+               <div class="card">
+                       <div class="card-header" id="headingTwo">
+                       <h2 class="mb-0">
+                               <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
+                               Collapsible Group Item #2
+                               </button>
+                       </h2>
+                       </div>
+                       <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
+                       <div class="card-body">
+                               Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
+                       </div>
+                       </div>
+               </div>
+               <div class="card">
+                       <div class="card-header" id="headingThree">
+                       <h2 class="mb-0">
+                               <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
+                               Collapsible Group Item #3
+                               </button>
+                       </h2>
+                       </div>
+                       <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
+                       <div class="card-body">
+                               Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
+                       </div>
+                       </div>
                </div>
-               <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
-               <div class="card-body">
-                       Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
-               </div>
-               </div>
-       </div>
-       <div class="card">
-               <div class="card-header" id="headingThree">
-               <h2 class="mb-0">
-                       <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
-                       Collapsible Group Item #3
-                       </button>
-               </h2>
-               </div>
-               <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
-               <div class="card-body">
-                       Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
-               </div>
-               </div>
-       </div>
        </div>
 </div>
 <?php