]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - channels/details.php
Update index.php
[irc/unrealircd/unrealircd-webpanel.git] / channels / details.php
1 <?php
2 require_once "../common.php";
3 require_once "../header.php";
4 require_once "../misc/channel-lookup-misc.php";
5
6 $title = "Channel Lookup";
7 $channel = "";
8 $channame = "";
9 $nick = NULL;
10 $channelObj = NULL;
11 do_log($_GET);
12 do_log($_POST);
13 if (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 if (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 }
51 }
52
53 ?>
54 <title><?php echo $title; ?></title>
55 <h4><?php echo $title; ?></h4>
56 <br>
57 <form method="get" action="details.php">
58 <div class="container-xxl">
59 <div class="input-group short-form-control">
60 <input class="short-form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
61 <div class="input-group-append">
62 <button type="submit" class="btn btn-primary">Go</button>
63 </div>
64 </div>
65 </div>
66 </form>
67
68 <?php if (!$channelObj)
69 return; ?>
70
71 <br>
72 <h3>
73 Topic:<br></h3><h4>
74 <form method="post" action="details.php?chan=<?php echo urlencode($channelObj->name); ?>">
75 <div class="input-group short-form-control">
76 <input maxlength="360" type="text" class="short-form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
77 <div class="input-group-append"><button type="submit" name="update_topic" value="true" class="btn btn-info">Update Topic</button></div></div>
78 </form>
79 </h4>
80 <?php
81 if ($topicset)
82 Message::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic)."\"");
83 ?>
84 <br>
85 <div class="row">
86 <div class="col-sm-3">
87 <div class="btn btn-sm btn-danger" data-toggle="modal" data-target="#bans_modal">Bans</div>
88 <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#invites_modal">Invites</div>
89 <div class="btn btn-sm btn-warning" data-toggle="modal" data-target="#excepts_modal">Exceptions</div>
90 </div>
91 </div>
92 <br>
93
94 <!-- Modal for Channel Bans -->
95 <div class="modal fade" id="bans_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
96 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
97 <div class="modal-content">
98 <div class="modal-header">
99 <h5 class="modal-title" id="myModalLabel">Channel Bans</h5>
100 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
101 <span aria-hidden="true">&times;</span>
102 </button>
103 </div>
104 <div class="modal-body">
105 <form method="post">
106 <?php generate_chanbans_table($channelObj); ?>
107 </form>
108 </div>
109 </div>
110 </div>
111 </div>
112 <!-- Modal for Channel Invited -->
113 <div class="modal fade" id="invites_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
114 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
115 <div class="modal-content">
116 <div class="modal-header">
117 <h5 class="modal-title" id="myModalLabel">Channel Invites</h5>
118 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
119 <span aria-hidden="true">&times;</span>
120 </button>
121 </div>
122 <div class="modal-body">
123 <form method="post">
124 <?php generate_chaninvites_table($channelObj); ?>
125 </form>
126 </div>
127 </div>
128 </div>
129 </div>
130
131 <!-- Modal for Channel Exceptions -->
132 <div class="modal fade" id="excepts_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
133 <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
134 <div class="modal-content">
135 <div class="modal-header">
136 <h5 class="modal-title" id="myModalLabel">Channel Exceptions</h5>
137 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
138 <span aria-hidden="true">&times;</span>
139 </button>
140 </div>
141 <div class="modal-body">
142 <form method="post">
143 <?php generate_chanexcepts_table($channelObj); ?>
144 </form>
145 </div>
146 </div>
147 </div>
148 </div>
149
150
151
152 <div class="container-xxl">
153 <div class="accordion" id="accordionExample">
154 <div class="card">
155 <div class="card-header" id="headingOne">
156 <h2 class="mb-0">
157 <button class="btn" type="button" data-toggle="collapse" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
158 Channel Occupants
159 </button>
160 </h2>
161 </div>
162
163 <div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionExample">
164 <div class="card-body">
165 <?php generate_chan_occupants_table($channelObj); ?>
166 </div>
167 </div>
168 </div>
169 <div class="card">
170 <div class="card-header" id="headingTwo">
171 <h2 class="mb-0">
172 <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
173 Collapsible Group Item #2
174 </button>
175 </h2>
176 </div>
177 <div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionExample">
178 <div class="card-body">
179 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.
180 </div>
181 </div>
182 </div>
183 <div class="card">
184 <div class="card-header" id="headingThree">
185 <h2 class="mb-0">
186 <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree">
187 Collapsible Group Item #3
188 </button>
189 </h2>
190 </div>
191 <div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-parent="#accordionExample">
192 <div class="card-body">
193 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.
194 </div>
195 </div>
196 </div>
197 </div>
198 </div>
199 <?php
200 require_once("../footer.php");
201