mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Update user_edit.php
This commit is contained in:
@@ -29,17 +29,18 @@
|
|||||||
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
||||||
require_once "resources/check_auth.php";
|
require_once "resources/check_auth.php";
|
||||||
|
|
||||||
|
//check permissions
|
||||||
|
if (!permission_exists('user_view') && !permission_exists('user_add') && !permission_exists('user_edit')) {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
//create a single database object
|
|
||||||
$database = new database;
|
|
||||||
$database->app_name = 'users';
|
|
||||||
$database->app_uuid = '112124b3-95c2-5352-7e9d-d14c0b88f207';
|
|
||||||
|
|
||||||
//get user uuid
|
//get user uuid
|
||||||
if (!empty($_REQUEST["id"]) && ((is_uuid($_REQUEST["id"]) && permission_exists('user_edit')) || (is_uuid($_REQUEST["id"]) && $_REQUEST["id"] == $_SESSION['user_uuid']))) {
|
if (permission_exists('user_edit') && !empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
||||||
$user_uuid = $_REQUEST["id"];
|
$user_uuid = $_REQUEST["id"];
|
||||||
$action = 'edit';
|
$action = 'edit';
|
||||||
}
|
}
|
||||||
@@ -47,11 +48,6 @@
|
|||||||
$user_uuid = uuid();
|
$user_uuid = uuid();
|
||||||
$action = 'add';
|
$action = 'add';
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// load users own account
|
|
||||||
header("Location: user_edit.php?id=".urlencode($_SESSION['user_uuid']));
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
//get total user count from the database, check limit, if defined
|
//get total user count from the database, check limit, if defined
|
||||||
if (permission_exists('user_add') && $action == 'add' && !empty($_SESSION['limit']['users']['numeric'])) {
|
if (permission_exists('user_add') && $action == 'add' && !empty($_SESSION['limit']['users']['numeric'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user