'', 'username' => '', 'email' => '', 'partnerhierarchy' => '', 'view' => 3, 'service' => 0, 'settings' => '', 'userkey' => 1, 'created' => '', 'lastlogin' => '', 'language' => 'US' ]; // ID param exists, edit an existing product //CALL TO API $api_url = '/v1/profile/userkey='.$_SESSION['authorization']['userkey']; $responses = ioServer($api_url,''); //Decode Payload if (!empty($responses)){$responses = decode_payload($responses);}else{$responses = null;} $user = json_decode(json_encode($responses[0]), true); if ($update_allowed === 1){ if (isset($_POST['submit'])) { //GET ALL POST DATA $data = json_encode($_POST, JSON_UNESCAPED_UNICODE); //Secure data $payload = generate_payload($data); //API call $responses = ioServer('/v1/profile', $payload); if ($responses === 'NOK'){ } else { header('Location: index.php?page=profile&success_msg=2'); exit; } } } if ($update_allowed === 1){ if (isset($_POST['reset'])) { //GET ALL POST DATA $data = json_encode($_POST, JSON_UNESCAPED_UNICODE); //Secure data $payload = generate_payload($data); //API call $responses = ioServer('/v1/profile', $payload); if ($responses === 'NOK'){ } else { header('Location: index.php?page=profile&success_msg=2'); exit; } } } //------------------------------------ //CHECK IF USER IS ALSO CREATOR OF RECORD THEN OVERRIDE UPDATE_ALLOWED_EDIT //------------------------------------ $update_allowed = (($user['username'] == $_SESSION['authorization']['clientID'])? 1 : 0); template_header('Profile', 'profile', 'manage'); $view ='
'; //Output echo $view; template_footer();