mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Add ability to turn on extension access (cookie)
This commit is contained in:
20
post.php
20
post.php
@@ -216,6 +216,9 @@ if(isset($_POST['edit_profile'])){
|
||||
$existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name'])));
|
||||
$logout = FALSE;
|
||||
|
||||
var_dump($_POST);
|
||||
exit();
|
||||
|
||||
//Check to see if a file is attached
|
||||
if($_FILES['file']['tmp_name'] != ''){
|
||||
|
||||
@@ -275,6 +278,23 @@ if(isset($_POST['edit_profile'])){
|
||||
$logout = TRUE;
|
||||
}
|
||||
|
||||
// Enable extension access, only if it isn't already setup (user doesn't have cookie)
|
||||
if(isset($_POST['extension']) && $_POST['extension'] == 'Yes'){
|
||||
if(!isset($_COOKIE['user_extension_key'])){
|
||||
$extension_key = keygen();
|
||||
mysqli_query($mysqli, "UPDATE users SET user_extension_key = '$extension_key' WHERE user_id = $user_id");
|
||||
|
||||
$extended_log_description .= ", extension access enabled";
|
||||
$logout = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// Disable extension access
|
||||
if(!isset($_POST['extension'])){
|
||||
mysqli_query($mysqli, "UPDATE users SET user_extension_key = '' WHERE user_id = $user_id");
|
||||
$extended_log_description .= ", extension access disabled";
|
||||
}
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'User Preferences', log_action = 'Modify', log_description = '$session_name modified their preferences$extended_log_description', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user