only allow actions (admin) when in right state; prepare decline reason
- fixes on path's and varnames
This commit is contained in:
@@ -58,12 +58,13 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
|
||||
# $first="test"; $last="test2"; $user="test3"; $note="empty"; $email="mail+test1@matthias-kesler.de";
|
||||
|
||||
$sql = "SELECT COUNT(*) FROM registrations WHERE username = '" . $username . "' LIMIT 1;";
|
||||
$sql = "SELECT COUNT(*) FROM registrations WHERE username = '" . $username . "' AND NOT state = "
|
||||
. RegisterState::RegistrationDeclined . " LIMIT 1;";
|
||||
$res = $db->query($sql);
|
||||
if ($res->fetchColumn() > 0) {
|
||||
throw new Exception($language["USERNAME_PENDING_REGISTRATION"]);
|
||||
}
|
||||
require_once("MatrixConnection.php");
|
||||
require_once("../MatrixConnection.php");
|
||||
$mxConn = new MatrixConnection($homeserver, $access_token);
|
||||
if ($mxConn->hasUser($username)) {
|
||||
throw new Exception($language["USERNAME_REGISTERED"]);
|
||||
|
||||
Reference in New Issue
Block a user