$dbh_citizen->add($arr_form_data); $citizen_id = $dbh_citizen->auto_id; require_once 'subclasses/validate.php'; $dbh_citizen = new validate(); for ($a = 0; $a < $validate_count; $a++) { $param = array('proof_of_id' => $cf_validate_proof_of_id[$a], 'proof_of_address' => $cf_validate_proof_of_address[$a], 'citizen_id' => $citizen_id, 'status' => $cf_validate_status[$a]); $dbh_citizen->add($param); } require_once 'subclasses/person.php'; $dbh_person = new person(); $dbh_person->add($arr_form_data); $person_id = $dbh_person->auto_id; $arr_form_data['person_id'] = $person_id; require 'password_crypto.php'; //Hash the password using default Cobalt password hashing technique $hashed_password = cobalt_password_hash('NEW', $password, $username, $new_salt, $new_iteration, $new_method); $arr_form_data['password'] = $hashed_password; $arr_form_data['salt'] = $new_salt; $arr_form_data['iteration'] = $new_iteration; $arr_form_data['method'] = $new_method; $arr_form_data['role_id'] = 3; $arr_form_data['skin_id'] = 1; require_once 'subclasses/user.php'; $dbh_user = new user(); $dbh_user->add($arr_form_data); //Permissions from role, if role was chosen if ($arr_form_data['role_id'] != '') { $db = new data_abstraction(); $db->execute_query("INSERT `user_passport` SELECT '" . quote_smart($username) . "', `link_id` FROM user_role_links WHERE role_id='" . quote_smart($arr_form_data['role_id']) . "'"); } redirect("notification.php");
$data_con->set_table('user'); $data_con->set_where("username='******'user']) . "'"); $result = $data_con->make_query()->result; $data_con->close_db(); $data = $result->fetch_assoc(); $result->close(); require 'core/password_crypto.php'; //Hash old password using default Cobalt password hashing technique $hashed_old_password = cobalt_password_hash('RECREATE', $old_password, $_SESSION['user']); if ($hashed_old_password != $data['password']) { $message .= "The password you entered in 'Old Password' does not match the password in your records. <BR>"; } } if ($message == '') { //Hash the password using default Cobalt password hashing technique $hashed_password = cobalt_password_hash('NEW', $password1, $_SESSION['user'], $new_salt, $new_iteration, $new_method); $data_con = new data_abstraction(); $data_con->set_query_type('UPDATE'); $data_con->set_table('user'); $data_con->set_update("`password`='{$hashed_password}', `salt`='{$new_salt}', `iteration`='{$new_iteration}', `method`='{$new_method}'"); $data_con->set_where("username='******'user']) . "'"); $data_con->make_query(); $message = 'Your password has been successfully updated! You can <a href="main.php"> click here </a> to go back to your control center or use the menu above.'; $message_type = 'SYSTEM'; $old_password = ''; $password1 = ''; $password2 = ''; } } } $html = new html();