]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - settings/index.php
Move some PHP files from ./ to ./inc: common, connection, header, footer
[irc/unrealircd/unrealircd-webpanel.git] / settings / index.php
index ba3427d0a7f4643cbed9e5f30455b081cc2c408b..3798fea2b88e5bccb219d982ed609481631f1959 100644 (file)
@@ -1,15 +1,15 @@
 <?php
 $conn = NULL;
 
-require_once "../common.php";
-require_once "../header.php";
+require_once "../inc/common.php";
+require_once "../inc/header.php";
 do_log($_POST);
 
 
 
 
 ?>
-<h4>Panel Settings Overview</h4>
+<h4>Panel Accounts</h4>
 
 <?php
 
@@ -27,7 +27,7 @@ if (isset($_POST))
                        if ($us->id == $user->id) // if it's the current user
                        {
                                session_destroy();
-                               header("Location: " . BASE_URL . "plugins/sql_auth/login.php");
+                               header("Location: " . get_config("base_url") . "plugins/sql_auth/login.php");
                                die();
                        }
                        $msg = ($deleted = 1) ? "Message::Success" : "Message::Fail";
@@ -43,6 +43,7 @@ if (isset($_POST))
                $user['user_pass'] = $p['password'];
                $user['fname'] = $p['add_first_name'];
                $user['lname'] = $p['add_last_name'];
+               $user['user_email'] = $p['user_email'];
                $user['user_bio'] = $p['user_bio'];
                $user['err'] = "";
                if (!create_new_user($user))
@@ -59,13 +60,10 @@ if (isset($_POST))
                }
        }
 }
-
 $userlist = [];
 Hook::run(HOOKTYPE_GET_USER_LIST, $userlist);
 
 ?>
-<br>
-<h5>Panel Access</h5>
 Click on a username to view more information.
 <br><br>
 <div id="Users">
@@ -97,10 +95,15 @@ Click on a username to view more information.
                                <label for="password" id="user_add">Password
                                        <input style="width: 170%;" name="password" id="password" class="form-control curvy" type="password"></label>
                        </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>
+                       </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>
-                       </div><div class="input-group mb-3">
+                       </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>
                        </div>
@@ -128,6 +131,7 @@ Click on a username to view more information.
        <th scope="col">Username</th>
        <th scope="col">First Name</th>
        <th scope="col">Last Name</th>
+       <th scope="col">Email</th>
        <th scope="col">Created</th>
        <th scope="col">Bio</th>
        <th scope="col">Last login</th>
@@ -139,9 +143,10 @@ 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=\"".BASE_URL."settings/user-edit.php?id=$user->id\">$user->username</a></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\">".$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>";
                        echo "<td scope=\"col\"><code>".$user->created."</code></td>";
                        echo "<td scope=\"col\">".$user->bio."</td>";
                        $last = (isset($user->user_meta['last_login'])) ? "<code>".$user->user_meta['last_login'] . "</code> <span class=\"badge rounded-pill badge-dark\">".how_long_ago($user->user_meta['last_login'])."</span>" : "none";
@@ -176,4 +181,4 @@ Click on a username to view more information.
        </div>
        </div></form></div></div><br></div>
 <?php
-require_once '../footer.php'; ?>
+require_once '../inc/footer.php'; ?>