]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - settings/index.php
Fix linkage in server-bans/spamfilter.php lol
[irc/unrealircd/unrealircd-webpanel.git] / settings / index.php
index a3ca2f2cd3a0669b4b0077614c2ccca503b9757f..e6bb0d1f757125a0ada291dec66965304debe83e 100644 (file)
@@ -52,6 +52,7 @@ if (isset($_POST))
                }
                else if (($usr_obj = new PanelUser($user['user_name'])) && isset($usr_obj->id))
                {
+                       $usr_obj->add_meta("role", $p['user_role']);
                        Message::Success("Successfully created user \"" . $user['user_name'] . "\"");
                }
                else
@@ -89,27 +90,36 @@ Click on a username to view more information.
                <div class="modal-body">
                        <div class="input-group mb-3">
                                <label for="name_add"  name="user_add" id="user_add">Username
-                                       <input style="width: 170%;" name="user_add" id="user_add" class="form-control curvy" type="text"></label>
+                                       <input name="user_add" id="user_add" class="form-control curvy" type="text"></label>
                        </div>
                        <div class="input-group mb-3">
                                <label for="password" id="user_add">Password
-                                       <input style="width: 170%;" name="password" id="password" class="form-control curvy" type="password"></label>
+                                       <input name="password" id="password" class="form-control curvy" type="password"></label>
+                       </div>
+                       <div class="input-group mb-3">
+                               <label for="user_role" id="user_add">Role
+                               <select name="user_role" class="custom-select form-control" id="user_role" style="width:170%">
+                                       <?php
+                                               foreach(get_panel_user_roles_list() as $s => $l)
+                                                       echo "<option value=\"$s\">$s</option>";
+                                       ?>
+                               </select>
                        </div>
                        <div class="input-group mb-3">
                                <label for="user_email" id="user_add">Email
-                                       <input style="width: 170%;" name="user_email" id="user_email" class="form-control curvy" type="text"></label>
+                                       <input name="user_email" id="user_email" class="form-control curvy" type="text"></label>
                        </div>
                        <div class="input-group mb-3">
                                <label for="add_first_name" id="user_add">First Name
-                                       <input style="width: 170%;" name="add_first_name" id="add_first_name" class="form-control curvy" type="text"></label>
+                                       <input name="add_first_name" id="add_first_name" class="form-control curvy" type="text"></label>
                        </div>
                        <div class="input-group mb-3">
                                <label for="password" id="user_add">Last Name
-                                       <input style="width: 170%;" name="add_last_name" id="add_last_name" class="form-control curvy" type="text"></label>
+                                       <input name="add_last_name" id="add_last_name" class="form-control curvy" type="text"></label>
                        </div>
                        <div class="input-group mb-3">
                                <label for="password" id="user_add">Info /Bio
-                                       <textarea style="width: 170%;" name="user_bio" class="form-control curvy" aria-label="With textarea"></textarea></label>
+                                       <textarea name="user_bio" class="form-control curvy" aria-label="With textarea"></textarea></label>
                        </div>
                </div>
                                                
@@ -129,6 +139,7 @@ Click on a username to view more information.
        <form method="post">
        <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_tkl(this)" /></th>
        <th scope="col">Username</th>
+       <th scope="col">Role</th>
        <th scope="col">First Name</th>
        <th scope="col">Last Name</th>
        <th scope="col">Email</th>
@@ -144,6 +155,7 @@ Click on a username to view more information.
                        
                        echo "<td scope=\"col\"><input type=\"checkbox\" value='" .$user->id . "' name=\"userch[]\"></td>";
                        echo "<td scope=\"col\"><a href=\"".get_config("base_url")."settings/user-edit.php?id=$user->id\">$user->username</a></td>";
+                       echo "<td scope=\"col\"><code>".((isset($user->user_meta['role'])) ? $user->user_meta['role'] : "")."</code></td>";
                        echo "<td scope=\"col\">".$user->first_name."</td>";
                        echo "<td scope=\"col\">".$user->last_name."</td>";
                        echo "<td scope=\"col\"><a href=\"mailto:$user->email\">$user->email</a></td>";