fixes and add check if selected
This commit is contained in:
@@ -45,7 +45,7 @@ try {
|
||||
$action = RegisterState::RegistrationAccepted;
|
||||
} elseif ($param_action == "deny") {
|
||||
$action = RegisterState::RegistrationDeclined;
|
||||
$decline_reason = filter_input(INPUT_GET, "reason", FILTER_SANITIZE_STRING);
|
||||
$decline_reason = filter_input(INPUT_GET, "decline_reason", FILTER_SANITIZE_STRING);
|
||||
}
|
||||
|
||||
$user = $mx_db->getUserForApproval($token);
|
||||
@@ -163,7 +163,7 @@ try {
|
||||
<h3 class="panel-title"><?php echo $language["ADMIN_VERIFY_SITE_TITLE"]; ?></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form name="appForm" role="form" action="verify_admin.php" method="GET">
|
||||
<form name="appForm" role="form" onsubmit="return submitForm()" action="verify_admin.php" method="GET">
|
||||
<?php
|
||||
if (isset($config["operationMode"]) && $config["operationMode"] === "local") {
|
||||
// this values will not be used when using the register operation type
|
||||
@@ -192,15 +192,15 @@ try {
|
||||
value="<?php echo $username; ?>" disabled=true>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" id="decline_reason" class="form-control input-sm"
|
||||
<input type="hidden" name="decline_reason" class="form-control input-sm"
|
||||
placeholder="<?php echo $language["DECLINE_REASON"]; ?>">
|
||||
</div>
|
||||
<input type="hidden" name="t" id="token" value="<?php echo $token; ?>">
|
||||
<div class="form-group">
|
||||
<input type="radio" name="d" onchange="changeSelection(true)" value="allow"><?php echo $language["ACCEPT"]; ?>
|
||||
<input type="radio" name="d" onchange="changeSelection(false)" value="deny"><?php echo $language["DECLINE"]; ?>
|
||||
<input type="radio" name="d" value="allow"><?php echo $language["ACCEPT"]; ?>
|
||||
<input type="radio" name="d" value="deny"><?php echo $language["DECLINE"]; ?>
|
||||
</div>
|
||||
<input type="submit" value="SEND<?php echo $language["ACCEPT"]; ?>" class="btn btn-info btn-block">
|
||||
<input type="submit" value="<?php echo $language["SUBMIT"]; ?>" class="btn btn-info btn-block">
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -209,6 +209,19 @@ try {
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var rad = document.appForm.d;
|
||||
function isSelected() {
|
||||
for (var i=0; i<rad.length; i++)
|
||||
if (rad[i].checked)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
function submitForm() {
|
||||
if (isSelected()) {
|
||||
return true;
|
||||
}
|
||||
alert("<?php echo $language["MAKE_A_SELECTION"];?>");
|
||||
return false;
|
||||
}
|
||||
for(var i = 0; i < rad.length; i++) {
|
||||
rad[i].onclick = function() {
|
||||
if (this.value === "deny") {
|
||||
@@ -216,7 +229,7 @@ try {
|
||||
} else {
|
||||
document.appForm.decline_reason.type = "hidden";
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user