]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame_incremental - channels/details.php
Show user agent in mail
[irc/unrealircd/unrealircd-webpanel.git] / channels / details.php
... / ...
CommitLineData
1<?php
2require_once "../common.php";
3require_once "../header.php";
4require_once "../misc/channel-lookup-misc.php";
5
6$title = "Channel Lookup";
7$channel = "";
8$channame = "";
9$nick = NULL;
10$channelObj = NULL;
11do_log($_GET);
12do_log($_POST);
13if (isset($_GET['chan']))
14{
15 $channel = $_GET['chan'];
16 $channelObj = $rpc->channel()->get($channel);
17 if (!$channelObj && strlen($channel))
18 {
19 Message::Fail("Could not find channel: \"$channel\"");
20 } elseif (strlen($channel)) {
21
22 $channame = $channelObj->name;
23 $title .= " for \"" . $channame . "\"";
24 do_log($channelObj);
25 }
26}
27$topicset = false;
28$del_ex = false;
29$del_inv = false;
30$del_ban = false;
31$checkboxes = [];
32if (isset($_POST))
33{
34 if (isset($_POST['update_topic']) && isset($_POST['set_topic']))
35 {
36 if (isset($channelObj))
37 {
38 if (!isset($channelObj->topic) || strcmp($channelObj->topic,$_POST['set_topic'])) // if the set topic is different
39 {
40 $user = (function_exists('unreal_get_current_user') && $u = unreal_get_current_user()) ? $u->username : NULL;
41 $topicset = $rpc->channel()->set_topic($channelObj->name, $_POST['set_topic'], $user);
42 $channelObj->topic = $_POST['set_topic'];
43 }
44 }
45 }
46 $checkboxes = (isset($_POST['ban_checkboxes'])) ? $_POST['ban_checkboxes'] : [];
47 if (isset($_POST['delete_sel_ex']))
48 {
49 foreach($_POST['ce_checkboxes'] as $c)
50 $checkboxes[] = $c;
51 $del_ex = true;
52 chlkup_autoload_modal("excepts_modal");
53 }
54 else if (isset($_POST['delete_sel_inv']))
55 {
56 foreach($_POST['ci_checkboxes'] as $c)
57 $checkboxes[] = $c;
58 $del_inv = true;
59 chlkup_autoload_modal("invites_modal");
60 }
61 else if (isset($_POST['delete_sel_ban']))
62 {
63 foreach($_POST['cb_checkboxes'] as $c)
64 $checkboxes[] = $c;
65 $del_ban = true;
66 chlkup_autoload_modal("bans_modal");
67 }
68
69}
70
71?>
72<title><?php echo $title; ?></title>
73<h4><?php echo $title; ?></h4>
74<br>
75<form method="get" action="details.php">
76<div class="container-xxl">
77 <div class="input-group">
78 <input class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
79 <div class="input-group-append">
80 <button type="submit" class="btn btn-primary">Go</button>
81 </div>
82 </div>
83</div>
84</form>
85
86<?php if (!$channelObj)
87 return; ?>
88
89<br>
90<h3>
91 Topic:<br></h3>
92 <form method="post" action="details.php?chan=<?php echo urlencode($channelObj->name); ?>">
93 <div class="input-group">
94 <input maxlength="360" type="text" class="input-group form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
95 <div class="input-group-append"><button type="submit" name="update_topic" value="true" class="btn btn-info">Update Topic</button></div></div>
96 </form>
97<?php
98if ($topicset)
99 Message::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic)."\"");
100?>
101<br>
102<div class="row">
103 <div class="col-sm-3">
104 <div class="btn btn-sm btn-danger" data-toggle="modal" data-target="#bans_modal">Bans</div>
105 <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#invites_modal">Invites</div>
106 <div class="btn btn-sm btn-warning" data-toggle="modal" data-target="#excepts_modal">Exceptions</div>
107 </div>
108</div>
109<br>
110
111<!-- Modal for Channel Bans -->
112<div class="modal fade" id="bans_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
113 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
114 <div class="modal-content">
115 <div class="modal-header">
116 <h5 class="modal-title" id="myModalLabel">Channel Bans</h5>
117 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
118 <span aria-hidden="true">&times;</span>
119 </button>
120 </div>
121 <div class="modal-body">
122 <?php if ($del_ban) do_delete_chanban($channelObj, $checkboxes); ?>
123 <form method="post">
124 <?php generate_chanbans_table($channelObj); ?>
125 </form>
126 </div>
127 </div>
128 </div>
129</div>
130<!-- Modal for Channel Invited -->
131<div class="modal fade" id="invites_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
132 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
133 <div class="modal-content">
134 <div class="modal-header">
135 <h5 class="modal-title" id="myModalLabel">Channel Invites</h5>
136 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
137 <span aria-hidden="true">&times;</span>
138 </button>
139 </div>
140 <div class="modal-body">
141 <?php if ($del_inv) do_delete_invite($channelObj, $checkboxes); ?>
142 <form method="post">
143 <?php generate_chaninvites_table($channelObj); ?>
144 </form>
145 </div>
146 </div>
147 </div>
148</div>
149
150<!-- Modal for Channel Exceptions -->
151<div class="modal fade" id="excepts_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
152 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
153 <div class="modal-content">
154 <div class="modal-header">
155 <h5 class="modal-title" id="myModalLabel">Channel Exceptions</h5>
156 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
157 <span aria-hidden="true">&times;</span>
158 </button>
159 </div>
160 <div class="modal-body">
161 <?php if ($del_ex) do_delete_chanex($channelObj, $checkboxes); ?>
162 <form method="post">
163 <?php generate_chanexcepts_table($channelObj); ?>
164 </form>
165 </div>
166 </div>
167 </div>
168</div>
169
170
171
172<div class="container-xxl">
173 <div class="accordion" id="accordionExample">
174 <div class="card">
175 <div class="card-header" id="headingOne">
176 <h2 class="mb-0">
177 <button class="btn" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
178 User List
179 </button>
180 </h2>
181 </div>
182
183 <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
184 <div class="card-body">
185 <?php generate_chan_occupants_table($channelObj); ?>
186 </div>
187 </div>
188 </div>
189 <div class="card">
190 <div class="card-header" id="headingTwo">
191 <h2 class="mb-0">
192 <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
193 Collapsible Group Item #2
194 </button>
195 </h2>
196 </div>
197 <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
198 <div class="card-body">
199 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.
200 </div>
201 </div>
202 </div>
203 <div class="card">
204 <div class="card-header" id="headingThree">
205 <h2 class="mb-0">
206 <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
207 Collapsible Group Item #3
208 </button>
209 </h2>
210 </div>
211 <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
212 <div class="card-body">
213 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.
214 </div>
215 </div>
216 </div>
217 </div>
218</div>
219<?php
220require_once("../footer.php");
221