]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blame - channels/details.php
Add the start of listing users (unfinished)
[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 61 <div class="input-group-append">
be0009e1 62 <button type="submit" class="btn btn-primary">Go</button>
ce9cf366 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); ?>">
be0009e1 75 <div class="input-group short-form-control">
b3c83a04 76 <input maxlength="360" type="text" class="short-form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
be0009e1 77 <div class="input-group-append"><button type="submit" name="update_topic" value="true" class="btn btn-info">Update Topic</button></div></div>
b3c83a04
VP
78 </form>
79</h4>
de8c8a1c
VP
80<?php
81if ($topicset)
82 Message::Success("The topic for $channelObj->name has been updated to be: \"".htmlspecialchars($channelObj->topic)."\"");
83?>
604aac30 84<br>
d9a581b9
VP
85<div class="row">
86 <div class="col-sm-3">
dd07c6d5 87 <div class="btn btn-sm btn-danger" data-toggle="modal" data-target="#bans_modal">Bans</div>
d9a581b9 88 <div class="btn btn-sm btn-info" data-toggle="modal" data-target="#invites_modal">Invites</div>
dd07c6d5 89 <div class="btn btn-sm btn-warning" data-toggle="modal" data-target="#excepts_modal">Exceptions</div>
d9a581b9
VP
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>
b3c83a04
VP
149
150
151
d9a581b9
VP
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">
b3c83a04 158 Channel Occupants
d9a581b9
VP
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">
be0009e1 165 <?php generate_chan_occupants_table($channelObj); ?>
d9a581b9
VP
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>
354f4b85
VP
195 </div>
196 </div>
354f4b85 197 </div>
604aac30
VP
198</div>
199<?php
ce9cf366 200require_once("../footer.php");
604aac30 201