mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Fix temporary permissions
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
//add the missing email templates
|
||||
if (!empty($array['email_templates'])) {
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("email_template_add", 'temp');
|
||||
$p->add("email_template_edit", 'temp');
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ class plugin_database {
|
||||
$array['user_groups'][0]['user_uuid'] = $this->user_uuid;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_edit', 'temp');
|
||||
|
||||
//execute insert
|
||||
|
||||
@@ -258,7 +258,7 @@ class plugin_email {
|
||||
$hostname = gethostname();
|
||||
|
||||
//add the temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("email_queue_add", 'temp');
|
||||
$p->add("email_queue_edit", 'temp');
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class plugin_ldap {
|
||||
$array['user_groups'][0]['user_uuid'] = $this->user_uuid;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_add', 'temp');
|
||||
$p->add('user_group_add', 'temp');
|
||||
|
||||
|
||||
@@ -224,7 +224,7 @@ class plugin_totp {
|
||||
$array['users'][$x]['user_totp_secret'] = $this->user_totp_secret;
|
||||
|
||||
//add the user_edit permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("user_edit", "temp");
|
||||
|
||||
//save the data
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -543,7 +543,7 @@
|
||||
//save the data
|
||||
if (!empty($array)) {
|
||||
//add the permission object
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_add', 'temp');
|
||||
$p->add('contact_phone_add', 'temp');
|
||||
$p->add('contact_address_add', 'temp');
|
||||
|
||||
@@ -112,7 +112,7 @@ if (!empty($_GET["contact_uuid"]) && is_uuid($_GET["contact_uuid"])) {
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -107,7 +107,7 @@ if ($_POST['a'] == 'import') {
|
||||
unset($duplicate_contact_uuid);
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_delete', 'temp');
|
||||
|
||||
//delete duplicate contact
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
$array['contacts'][0]['last_mod_date'] = 'now()';
|
||||
$array['contacts'][0]['last_mod_user'] = $_SESSION['username'];
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('contact_edit', 'temp');
|
||||
|
||||
$database = new database;
|
||||
|
||||
@@ -108,7 +108,7 @@ if (!class_exists('contacts')) {
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
|
||||
//grant temp permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$database = new database;
|
||||
foreach ($this->tables as $table) {
|
||||
$p->add(database::singular($table).'_delete', 'temp');
|
||||
|
||||
@@ -98,7 +98,7 @@ if ($domains_processed == 1) {
|
||||
}
|
||||
|
||||
//add the temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dashboard_add', 'temp');
|
||||
$p->add('dashboard_group_add', 'temp');
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
unset($sql, $parameters);
|
||||
|
||||
//update the timezone
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
if ($detail_action == "update") {
|
||||
$array['dialplan_details'][0]['dialplan_detail_uuid'] = $dialplan_detail_uuid;
|
||||
$array['dialplan_details'][0]['dialplan_detail_data'] = 'timezone='.$default_setting_value;
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
unset($sql, $parameters);
|
||||
|
||||
//update the timezone
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
if ($detail_action == "update") {
|
||||
$array['dialplan_details'][0]['dialplan_detail_uuid'] = $dialplan_detail_uuid;
|
||||
$array['dialplan_details'][0]['dialplan_detail_data'] = 'timezone='.$domain_setting_value;
|
||||
@@ -280,7 +280,7 @@
|
||||
$array['dialplan_details'][0]['dialplan_detail_group'] = $dialplan_detail_group;
|
||||
$array['dialplan_details'][0]['dialplan_detail_order'] = '15';
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
$array['dialplan_details'][0]['dialplan_detail_uuid'] = $dialplan_detail_uuid;
|
||||
$array['dialplan_details'][0]['dialplan_detail_data'] = 'timezone='.$domain_setting_value;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_edit', 'temp');
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
$array['user_groups'][0]['group_name'] = $group_name;
|
||||
$array['user_groups'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_group_add', 'temp');
|
||||
|
||||
$database->app_name = 'groups';
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
}
|
||||
if (is_array($array) && sizeof($array) != 0) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('group_permission_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('group_permission_delete', 'temp');
|
||||
//execute delete
|
||||
$database = new database;
|
||||
@@ -185,7 +185,7 @@
|
||||
|
||||
if (is_array($array) && @sizeof($array)) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('group_permission_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
//if the domain name does not exist then add the domain name
|
||||
if (!$domain_exists) {
|
||||
//add the domain permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("domain_add", "temp");
|
||||
|
||||
//prepare the array
|
||||
@@ -271,7 +271,7 @@
|
||||
unset($parameters);
|
||||
|
||||
//add the user permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("user_add", "temp");
|
||||
$p->add("user_edit", "temp");
|
||||
$p->add("user_group_add", "temp");
|
||||
|
||||
@@ -36,7 +36,7 @@ if ($domains_processed == 1) {
|
||||
// $array['notifications'][0]['notification_uuid'] = uuid();
|
||||
// $array['notifications'][0]['project_notifications'] = 'false';
|
||||
// //grant temporary permissions
|
||||
// $p = new permissions;
|
||||
// $p = permissions::new();
|
||||
// $p->add('notification_add', 'temp');
|
||||
// //execute insert
|
||||
// $database->app_name = 'notifications';
|
||||
|
||||
@@ -45,7 +45,7 @@ if ($domains_processed == 1) {
|
||||
//save the data to the database
|
||||
if (!empty($array)) {
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('permission_add', 'temp');
|
||||
|
||||
//execute insert
|
||||
|
||||
@@ -46,7 +46,7 @@ if ($domains_processed == 1) {
|
||||
//save the data in the array
|
||||
if (!empty($array)) {
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("software_add", 'temp');
|
||||
$p->add("software_edit", 'temp');
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ if (!class_exists('user_logs')) {
|
||||
}
|
||||
|
||||
//add the dialplan permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("user_log_add", 'temp');
|
||||
|
||||
//save to the data
|
||||
|
||||
@@ -156,14 +156,14 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
|
||||
//update the timezone
|
||||
if ($detail_action == "update") {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_edit', 'temp');
|
||||
|
||||
$array['dialplan_details'][0]['dialplan_detail_uuid'] = $dialplan_detail_uuid;
|
||||
$array['dialplan_details'][0]['dialplan_detail_data'] = 'timezone='.$user_setting_value;
|
||||
}
|
||||
else {
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
|
||||
$array['dialplan_details'][0]['domain_uuid'] = $domain_uuid;
|
||||
@@ -266,7 +266,7 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
$array['dialplan_details'][0]['dialplan_detail_group'] = !empty($dialplan_detail_group) ? $dialplan_detail_group : 'null';
|
||||
$array['dialplan_details'][0]['dialplan_detail_order'] = '15';
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_add', 'temp');
|
||||
|
||||
$database->app_name = 'user_settings';
|
||||
@@ -284,7 +284,7 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
$array['dialplan_details'][0]['domain_uuid'] = $_SESSION["domain_uuid"];
|
||||
$array['dialplan_details'][0]['dialplan_uuid'] = $dialplan_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('dialplan_detail_edit', 'temp');
|
||||
|
||||
$database->app_name = 'user_settings';
|
||||
|
||||
@@ -97,7 +97,7 @@ Mark J Crane <markjcrane@fusionpbx.com>
|
||||
$array['user_settings'][0]['user_uuid'] = $_SESSION['user_uuid'];
|
||||
$array['user_settings'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_delete', 'temp');
|
||||
//execute
|
||||
$database->app_name = 'user_settings';
|
||||
@@ -132,7 +132,7 @@ Mark J Crane <markjcrane@fusionpbx.com>
|
||||
$array['user_settings'][0]['user_setting_enabled'] = $user_setting_enabled;
|
||||
|
||||
//grant temporary permissions
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_add', 'temp');
|
||||
$p->add('user_setting_edit', 'temp');
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ if ($domains_processed == 1) {
|
||||
$array['default_settings'][$x]['default_setting_subcategory'] = "password_special";
|
||||
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("default_setting_edit", 'temp');
|
||||
|
||||
//save to the data
|
||||
@@ -200,7 +200,7 @@ if ($domains_processed == 1) {
|
||||
$x++;
|
||||
|
||||
//add the temporary permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("email_template_add", 'temp');
|
||||
$p->add("email_template_edit", 'temp');
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ if (!class_exists('users')) {
|
||||
//delete the checked rows
|
||||
if (is_array($array) && @sizeof($array) != 0) {
|
||||
//execute
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_delete', 'temp');
|
||||
$p->add('user_group_delete', 'temp');
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
$array['user_groups'][0]['group_uuid'] = $group_uuid;
|
||||
$array['user_groups'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_group_delete', 'temp');
|
||||
|
||||
$database->delete($array);
|
||||
@@ -297,7 +297,7 @@
|
||||
$array_delete['user_settings'][0]['user_setting_subcategory'] = 'language';
|
||||
$array_delete['user_settings'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_delete', 'temp');
|
||||
|
||||
$database->delete($array_delete);
|
||||
@@ -345,7 +345,7 @@
|
||||
$array_delete['user_settings'][0]['user_setting_subcategory'] = 'time_zone';
|
||||
$array_delete['user_settings'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_delete', 'temp');
|
||||
|
||||
$database->delete($array_delete);
|
||||
@@ -394,7 +394,7 @@
|
||||
$array_delete['user_settings'][0]['user_setting_subcategory'] = 'key';
|
||||
$array_delete['user_settings'][0]['user_uuid'] = $user_uuid;
|
||||
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add('user_setting_delete', 'temp');
|
||||
|
||||
$database->delete($array_delete);
|
||||
@@ -555,7 +555,7 @@
|
||||
$x++;
|
||||
|
||||
//add the user_edit permission
|
||||
$p = new permissions;
|
||||
$p = permissions::new();
|
||||
$p->add("user_setting_add", "temp");
|
||||
$p->add("user_setting_edit", "temp");
|
||||
$p->add("user_edit", "temp");
|
||||
|
||||
Reference in New Issue
Block a user