} $sql = "UPDATE " . UA_TABLE . " SET `level` = '" . $level . "' WHERE `randid` = '" . $_GET['randid'] . "'"; if ($db->query($sql)) { $_SESSION['ERROR']['type'] = 'Done'; $_SESSION['ERROR']['reason'] = "Operation Completed."; } else { $_SESSION['ERROR']['type'] = 'Error'; $_SESSION['ERROR']['reason'] = "Cannot Perforn The Operation.Please Try Again"; } } } if (!empty($_GET['username'])) { if ($_GET['username'] == $_SESSION['UA_DETAILS']['username']) { echo "true"; } else { if (checkUsernameExists($db, $_GET['username'])) { echo "false"; } else { echo "true"; } } } if (!empty($_GET['email'])) { if ($_GET['email'] == $_SESSION['UA_DETAILS']['email']) { echo "true"; } else { if (checkEmailExists($db, $_GET['email'])) { echo "false"; } else { echo "true"; }
function checkUsernameEmail($username, $email) { // Implementing the Javascript check in case that is broken on the site $regex = preg_match("#[<>\"'%;()&]#i", $username); if (strlen($username) < 2 || $regex) { aecErrorAlert(JText::_('AEC_VALIDATE_ALPHANUMERIC')); return JText::_('AEC_VALIDATE_ALPHANUMERIC'); } if (checkUsernameExists($username)) { aecErrorAlert(JText::_('AEC_VALIDATE_USERNAME_EXISTS')); return JText::_('AEC_VALIDATE_USERNAME_EXISTS'); } if (!empty($email)) { if (checkEmailExists($email)) { aecErrorAlert(JText::_('AEC_VALIDATE_EMAIL_EXISTS')); return JText::_('AEC_VALIDATE_EMAIL_EXISTS'); } } return true; }