]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - users.php
2 require_once "common.php";
4 require_once "header.php";
9 $bantype = $_POST['bantype'];
10 if (isset($_POST['userch']))
12 foreach ($_POST["userch"] as $user)
14 $user = base64_decode($user);
15 $bantype = (isset($_POST['bantype'])) ? $_POST['bantype'] : NULL;
16 if (!$bantype) /* shouldn't happen? */
18 Message
::Fail("An error occured");
21 $banlen_w = (isset($_POST['banlen_w'])) ? $_POST['banlen_w'] : NULL;
22 $banlen_d = (isset($_POST['banlen_d'])) ? $_POST['banlen_d'] : NULL;
23 $banlen_h = (isset($_POST['banlen_h'])) ? $_POST['banlen_h'] : NULL;
26 if (!$banlen_d && !$banlen_h && !$banlen_w)
32 $duration .= $banlen_w;
34 $duration .= $banlen_d;
36 $duration .= $banlen_h;
39 $nick = $rpc->user()->get($user);
42 Message
::Fail("Could not find that user. Maybe they disconnected after you clicked this?");
46 $msg_msg = ($duration == "0" || $duration == "0w0d0h") ? "permanently" : "for ".rpc_convert_duration_string($duration);
47 $reason = (isset($_POST['ban_reason'])) ? $_POST['ban_reason'] : "No reason";
48 if ($rpc->serverban()->add($user, $bantype, $duration, $reason))
51 Message
::Success($c->name
. " (*@".$c->hostname
.") has been $bantype" . "d
$msg_msg: $reason");
57 /* Get the user list */
58 $users = $rpc->user()->getAll();
62 <table
class='users_filter'>
63 <th
class="thuf">Filter by
: </th
>
65 <form action
="users.php" method
="post">
66 Nick
: <input name
="uf_nick" id
="uf_nick" type
="text">
67 <input
class="cute_button2" type
="submit" value
="Search">
71 <form action
="" method
="post">
72 Hostname
: <input name
="uf_host" id
="uf_host" type
="text">
73 <input
class="cute_button2" type
="submit" value
="Search">
77 <form action
="" method
="post">
78 IP
: <input name
="uf_ip" id
="uf_ip" type
="text">
79 <input
class="cute_button2" type
="submit" value
="Search">
83 <form action
="" method
="post">
84 Account
: <input name
="uf_account" id
="uf_account" type
="text">
85 <input
class="cute_button2" type
="submit" value
="Search">
91 if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']))
92 Message
::Info("Listing users which match nick: \"" . $_POST['uf_nick'] . "\"");
94 if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']))
95 Message
::Info("Listing users which match IP: \"" . $_POST['uf_ip'] . "\"");
97 if (isset($_POST['uf_host']) && strlen($_POST['uf_host']))
98 Message
::Info("Listing users which match hostmask: \"" . $_POST['uf_host'] . "\"");
100 if (isset($_POST['uf_account']) && strlen($_POST['uf_account']))
101 Message
::Info("Listing users which match account: \"" . $_POST['uf_account'] . "\"");
104 <table
class='users_overview'>
105 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_user(this)" />Select all
</th
>
110 <th
>Usermodes
<a href
="https://www.unrealircd.org/docs/User_modes" target
="_blank">ℹ️
</a
></th
>
113 <th
>Connected to
</th
>
114 <th
>Reputation
<a href
="https://www.unrealircd.org/docs/Reputation_score" target
="_blank">ℹ️
</a
></th
>
116 <form action
="users.php" method
="post">
118 foreach($users as $user)
121 /* Some basic filtering for NICK */
122 if (isset($_POST['uf_nick']) && strlen($_POST['uf_nick']) &&
123 strpos(strtolower($user->name
), strtolower($_POST['uf_nick'])) !== 0 &&
124 strpos(strtolower($user->name
), strtolower($_POST['uf_nick'])) == false)
127 /* Some basic filtering for HOST */
128 if (isset($_POST['uf_host']) && strlen($_POST['uf_host']) &&
129 strpos(strtolower($user->hostname
), strtolower($_POST['uf_host'])) !== 0 &&
130 strpos(strtolower($user->hostname
), strtolower($_POST['uf_host'])) == false)
133 /* Some basic filtering for IP */
134 if (isset($_POST['uf_ip']) && strlen($_POST['uf_ip']) &&
135 strpos(strtolower($user->ip
), strtolower($_POST['uf_ip'])) !== 0 &&
136 strpos(strtolower($user->ip
), strtolower($_POST['uf_ip'])) == false)
139 /* Some basic filtering for ACCOUNT */
140 if (isset($_POST['uf_account']) && strlen($_POST['uf_account']) &&
141 strpos(strtolower($user->user
->account
), strtolower($_POST['uf_account'])) !== 0 &&
142 strpos(strtolower($user->user
->account
), strtolower($_POST['uf_account'])) == false)
146 echo "<td><input type=\"checkbox\" value='" . base64_encode($user->id
)."' name=\"userch[]\"></td>";
147 $isBot = (strpos($user->user
->modes
, "B") !== false) ? ' <span class="label">Bot</span>' : "";
148 echo "<td>".$user->name
.$isBot.'</td>';
149 echo "<td>".$user->id
."</td>";
150 echo "<td>".$user->hostname
." (".$user->ip
.")</td>";
151 $account = (isset($user->user
->account
)) ? $user->user
->account
: '<span class="label bluelabel ">None</span>';
152 echo "<td>".$account."</td>";
153 $modes = (isset($user->user
->modes
)) ? "+" . $user->user
->modes
: "<none>";
154 echo "<td>".$modes."</td>";
155 $oper = (isset($user->user
->operlogin
)) ? $user->user
->operlogin
." <span class=\"label bluelabel\">".$user->user
->operclass
."</span>" : "";
157 $oper = (strpos($user->user
->modes
, "S") !== false) ? '<span class="label secure-connection">Service</span>' : "";
158 echo "<td>".$oper."</td>";
159 $secure = (isset($user->tls
)) ? "<span class=\"label secure-connection\">Secure</span>" : "<span class=\"label redlabel\">Insecure</span>";
160 echo "<td>".$secure."</td>";
161 echo "<td>".$user->user
->servername
."</td>";
162 echo "<td>".$user->user
->reputation
."</td>";
165 <label
for="bantype">Apply action
: </label
><br
>
166 <select name
="bantype" id
="bantype">
167 <option value
=""></option
>
168 <optgroup label
="Bans">
169 <option value
="gline">GLine
</option
>
170 <option value
="gzline">GZLine
</option
>
174 <label
for="banlen_w">Duration
: </label
><br
>
175 <select name
="banlen_w" id
="banlen_w">
177 for ($i = 0; $i <= 56; $i++
)
180 echo "<option value=\"0w\"></option>";
183 $w = ($i == 1) ? "week" : "weeks";
184 echo "<option value=\"$i" . "w\"
>$i $w" . "</option>";
189 <select name
="banlen_d" id
="banlen_d">
191 for ($i = 0; $i <= 31; $i++
)
194 echo "<option value=\"0d\"></option>";
197 $d = ($i == 1) ? "day" : "days";
198 echo "<option value=\"$i" . "d\"
>$i $d" . "</option>";
203 <select name
="banlen_h" id
="banlen_h">
205 for ($i = 0; $i <= 24; $i++
)
208 echo "<option value=\"0d\"></option>";
211 $h = ($i == 1) ? "hour" : "hours";
212 echo "<option value=\"$i" . "h\"
>$i $h" . "</option>";
217 <br
><label
for="ban_reason">Reason
:<br
></label
>
218 <textarea name
="ban_reason" id
="ban_reason">No reason
</textarea
><br
>
219 <input
class="cute_button" type
="submit" value
="Apply">
225 <?php
require_once 'footer.php'; ?>