created user_list
This commit is contained in:
@@ -18,66 +18,8 @@ if($perms[0]!=="1"){
|
|||||||
}else{
|
}else{
|
||||||
$block=0;
|
$block=0;
|
||||||
}
|
}
|
||||||
|
//for the get_perms_str() function
|
||||||
function get_perm_str(){
|
include "perms_functions.php";
|
||||||
//ge tthe set permissions of the form
|
|
||||||
$p1 = isset($_POST["add_user"]);
|
|
||||||
$p2 = isset($_POST["delete_user"]);
|
|
||||||
$p3 = isset($_POST["view_log"]);
|
|
||||||
$p4 = isset($_POST["delete_log"]);
|
|
||||||
$p5 = isset($_POST["server_settings"]);
|
|
||||||
$p6 = isset($_POST["client_settings"]);
|
|
||||||
$p7 = isset( $_POST["database_settings"]);
|
|
||||||
$p8 = isset($_POST["add_clients"]);
|
|
||||||
$p9 = isset($_POST["delete_clients"]);
|
|
||||||
$p10 = "0";
|
|
||||||
|
|
||||||
//init the permission string
|
|
||||||
$perms_str="";
|
|
||||||
//copy the perms into permission string)
|
|
||||||
if($p1==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p2==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p3==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p4==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p5==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p6==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p7==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p8==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p9==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
if($p10==1)
|
|
||||||
$perms_str.="1";
|
|
||||||
else
|
|
||||||
$perms_str.="0";
|
|
||||||
return $perms_str;
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
//get perms string from post request (like a uzser creation form)
|
||||||
|
function get_perm_str(){
|
||||||
|
//ge tthe set permissions of the form
|
||||||
|
$p1 = isset($_POST["add_user"]);
|
||||||
|
$p2 = isset($_POST["delete_user"]);
|
||||||
|
$p3 = isset($_POST["view_log"]);
|
||||||
|
$p4 = isset($_POST["delete_log"]);
|
||||||
|
$p5 = isset($_POST["server_settings"]);
|
||||||
|
$p6 = isset($_POST["client_settings"]);
|
||||||
|
$p7 = isset( $_POST["database_settings"]);
|
||||||
|
$p8 = isset($_POST["add_clients"]);
|
||||||
|
$p9 = isset($_POST["delete_clients"]);
|
||||||
|
$p10 = "0";
|
||||||
|
|
||||||
|
//init the permission string
|
||||||
|
$perms_str="";
|
||||||
|
//copy the perms into permission string)
|
||||||
|
if($p1==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p2==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p3==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p4==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p5==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p6==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p7==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p8==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p9==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
if($p10==1)
|
||||||
|
$perms_str.="1";
|
||||||
|
else
|
||||||
|
$perms_str.="0";
|
||||||
|
return $perms_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
// Check if the user is logged in
|
||||||
|
if (!isset($_SESSION['username']) or !isset($_SESSION["login"])) {
|
||||||
|
// Redirect to the login page or handle unauthorized access
|
||||||
|
header("Location: /login.php");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
$username = $_SESSION['username'];
|
||||||
|
$perms = $_SESSION["perms"];
|
||||||
|
$email = $_SESSION["email"];
|
||||||
|
if($perms[1]!=="1"){
|
||||||
|
header("location:/system/insecure_zone/php/no_access.php");
|
||||||
|
$block=1;
|
||||||
|
exit();
|
||||||
|
}else{
|
||||||
|
$block=0;
|
||||||
|
}
|
||||||
|
//for the get_perms_str() function
|
||||||
|
include "perms_functions.php";
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
|
||||||
|
<title>Change Password</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="container mt-5">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-10">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4>Add a user</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user