$result = $db->editPermissionUser($_POST["permission"], $_POST["UserId"]); } if (isset($_POST["AdminUserId"])) { $result = $db->editAdminUser($_POST["permissionAdmin"], $_POST["AdminUserId"]); } if (isset($_POST["AuditorUserId"])) { $result = $db->editAuditorUser($_POST["permissionAuditor"], $_POST["AuditorUserId"]); } if (isset($_POST["DeleteUserId"])) { $result = $db->deleteUser($_POST["DeleteUserId"]); } if (isset($_POST["DeleteReport"])) { $result = $db->deleteReportRow($_POST["DeleteReport"]); } if (isset($_POST["ChangePassword"])) { $result = $db->changePassword($_POST["ChangePassword"], $_POST["Email"], $_POST["Pass"]); } if (isset($_POST["replaceName"])) { $result = $db->replaceResponsible($_POST["replaceName"], $_POST["newName"]); } if (isset($_POST["ChangeEmailId"])) { $result = $db->editEmail($_POST["ChangeEmailId"], $_POST["NewEmailId"]); } if (isset($_POST["ChangePasswordId"])) { $result = $db->editPasswordById($_POST["ChangePasswordId"], $_POST["NewPassword"]); } if (isset($_POST["selectUser"])) { if ($_POST["selectUser"] == "All") { $result = $db->getAllReportList(); } else { $result = $db->getReportList($_POST["selectUser"]);
?> <div class="password-change alert alert-danger fade in" role="alert"> <p class="lead"> <span class="glyphicon glyphicon-remove-sign" aria-hidden="true"></span> <strong>Error</strong> New password does not match confirmed password. <br> <a class="alert-link" href="javascript:history.back()">Return and Fix</a> </p> </div> <?php exit; } else { if (checkPassword($currentpwd)) { $db = new DB_Functions(); $hashedPassword = getPasswordHash($newpass); $db->changePassword($_SESSION['email'], $hashedPassword); ?> <div class="password-change alert alert-success fade in" role="alert"> <p class="lead"> <span class="glyphicon glyphicon-ok-sign" aria-hidden="true"></span> <strong>Success</strong> Your password has been changed! </p> </div> <script type="text/javascript"> (function(){ setTimeout(function(){window.location.href = "./"; }, 1200); })(); </script> <?php } else { ?>
} sendResponse(200, json_encode($response)); } else { // user failed to store $response["error"] = 1; $response["error_msg"] = "Error occurred in Registration"; sendResponse(417, json_encode($response)); } } } else { if ($tag == 'changePassword') { // Request type is check Login $name = $_POST['name']; $password = $_POST['password']; // check for user $user = $db->changePassword($name, $password); if ($user != false) { // user found // echo json with success = 1 $response["success"] = 1; sendResponse(200, json_encode($response)); } else { // user not found // echo json with error = 1 $response["name"] = $name; $response["password"] = $password; $response["error"] = 1; $response["error_msg"] = "change password failed!"; sendResponse(417, json_encode($response)); } } else {