join fixes
This commit is contained in:
parent
f9351eaa14
commit
95ed2d8d6d
|
|
@ -1,16 +1,19 @@
|
|||
<?php
|
||||
session_start();
|
||||
require_once '../core/config.php';
|
||||
require_once '../core/classes/user.php';
|
||||
|
||||
header('content-type:application/json');
|
||||
$user = new User($con, $_SESSION['user']);
|
||||
function sign($script, $key) {
|
||||
$signature = "";
|
||||
$signature = openssl_pkey_new();
|
||||
openssl_sign($script, $signature, $key, OPENSSL_ALGO_SHA1);
|
||||
return base64_encode($signature);
|
||||
}
|
||||
|
||||
$joinUser = [
|
||||
"id" => rand(1,getrandmax()),
|
||||
"username" => "User".rand(1,getrandmax()),
|
||||
"id" => $_SESSION['user'],
|
||||
"username" => $user->getUsername(),
|
||||
"mship" => "None"
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ if(isset($_POST['submit'])) {
|
|||
$username = $_POST['username'];
|
||||
$password = $_POST['pass'];
|
||||
$passwordconfirm = $_POST['passconfirm'];
|
||||
echo '<script>
|
||||
/*echo '<script>
|
||||
if ( window.history.replaceState ) {
|
||||
window.history.replaceState( null, null, window.location.href );
|
||||
}
|
||||
</script>';
|
||||
</script>';*/
|
||||
$user = new User($con, $user->getID($con, $username));
|
||||
if(preg_match('/^[a-zA-Z0-9]+$/', $username) == 0) {
|
||||
$usernamespecialchar = true;
|
||||
|
|
@ -53,7 +53,6 @@ if(isset($_POST['submit'])) {
|
|||
$query->bindParam(':username', $username);
|
||||
$query->bindParam(':password', $password);
|
||||
$query->execute();
|
||||
$_POST['success'] = 1;
|
||||
$_SESSION["user"] = $user->getID($con, $username);
|
||||
header("Location: /home");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue