CMXX - Include updated/by on multiple tables and views

This commit is contained in:
“VeLiTi”
2024-12-12 16:19:16 +01:00
parent 5e858fb785
commit e55c7c271d
19 changed files with 102 additions and 53 deletions

View File

@@ -46,6 +46,8 @@ $clause = '';
$clause_insert ='';
$input_insert = '';
$post_content['updatedby'] = $username;
//GET EXISTING USER DATA
if ($id != '' && $command != 'reset'){
//Define Query
@@ -130,9 +132,9 @@ $location_new = (($post_content['location'] != '' && $post_content['location'] !
$payload = array('username'=>$user_data['username'], 'exp'=>(time() + 1800));
$resetkey = generate_jwt($headers, $payload);
//STEP 2- Store resetkey
$sql = 'UPDATE users SET resetkey = ? WHERE id = ? '.$whereclause.'';
$sql = 'UPDATE users SET resetkey = ?, updatedby = ? WHERE id = ? '.$whereclause.'';
$stmt = $pdo->prepare($sql);
$stmt->execute([$resetkey,$id]);
$stmt->execute([$resetkey,$username,$id]);
//STEP 3 - Send to user
include_once './assets/mail/email_template_reset.php';
send_mail($user_data['email'],$subject,$message,'','');