activationKey is not valid.
'; die(); } $activationKey = $testMatch; $testMatch = NULL; } //select account $sql = "SELECT mb_user_id FROM mb_user WHERE activation_key = $1"; $v = array($activationKey); $t = array('s'); $res = db_prep_query($sql, $v, $t); if(db_numrows($res) == 0){ $e = new mb_exception("php/mod_activateUserAccount.php: user with requested activation_key not found in mapbender database!"); $returnObject->success = false; $returnObject->help = "mod_activateUserAccount.php"; $returnObject->error->message = "php/mod_activateUserAccount.php: user with requested activation_key not found in mapbender database!"; $returnObject->error->{__type} = "Object not found"; header('Content-Type: application/json'); echo json_encode($this->returnObject); //redirect to register sleep(5); header("Location: ".$registerRedirectUrl); die(); } else { $row = db_fetch_assoc($res); if ($row['is_active'] == 't') { $e = new mb_exception("php/mod_activateUserAccount.php: User account already activated!"); $returnObject->success = false; $returnObject->help = "mod_activateUserAccount.php"; $returnObject->error->message = "php/mod_activateUserAccount.php: User account already activated!"; $returnObject->error->{__type} = "Object not found"; header('Content-Type: application/json'); echo json_encode($this->returnObject); //redirect to login? sleep(5); header("Location: ".$loginRedirectUrl); die(); } else { $sql = "UPDATE mb_user SET is_active = true WHERE activation_key = $1"; $v = array($activationKey); $t = array('s'); $res = db_prep_query($sql, $v, $t); if (!$res) { $e = new mb_exception("php/mod_activateUserAccount.php: Could not activate user account!"); $returnObject->success = false; $returnObject->help = "mod_activateUserAccount.php"; $returnObject->error->message = "php/mod_activateUserAccount.php: Could not activate user account!"; $returnObject->error->{__type} = "Object not found"; header('Content-Type: application/json'); echo json_encode($this->returnObject); die(); } else { $sql = "UPDATE mb_user SET mb_user_login_count = 0 WHERE activation_key = $1"; $v = array($activationKey); $t = array('s'); $res = db_prep_query($sql,$v,$t); $e = new mb_exception("php/mod_activateUserAccount.php: User account successfully activated!"); $returnObject->success = true; unset($returnObject->error); $returnObject->help = "mod_activateUserAccount.php"; //redirect to login page sleep(5); header("Location: ".$loginRedirectUrl); die(); } } } ?>