Fixed bug in deleted policies

This commit is contained in:
manuel.montes 2018-11-06 13:52:03 +01:00
parent 1435b196db
commit df8c5e8bf9
1 changed files with 5 additions and 1 deletions

View File

@ -1377,7 +1377,7 @@ function is_management_allowed($hkey = '') {
global $config; global $config;
return ( (is_metaconsole() && $config["centralized_management"]) return ( (is_metaconsole() && $config["centralized_management"])
|| (!is_metaconsole() && !$config["centralized_management"]) || (!is_metaconsole() && !$config["centralized_management"])
|| (!is_metaconsole() && $config["centralized_management"]) && $hkey == hash('sha256', db_get_value ('value', 'tupdate_settings', 'token', 'customer_key'))); || (!is_metaconsole() && $config["centralized_management"]) && $hkey == generate_hash_to_api());
} }
/** /**
@ -3388,4 +3388,8 @@ function validate_csrf_code() {
return isset($code) && isset($_SESSION['csrf_code']) return isset($code) && isset($_SESSION['csrf_code'])
&& $_SESSION['csrf_code'] == $code; && $_SESSION['csrf_code'] == $code;
} }
function generate_hash_to_api(){
hash('sha256', db_get_value ('value', 'tupdate_settings', '`key`', 'customer_key'));
}
?> ?>