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