|
|
@ -52,7 +52,7 @@ class AuthController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function guestSignin() { |
|
|
|
public function guestSignin() { |
|
|
|
header('Location: /'); |
|
|
|
// header('Location: /'); |
|
|
|
|
|
|
|
|
|
|
|
// Prevent invalid email input |
|
|
|
// Prevent invalid email input |
|
|
|
$email = $_POST['username']; |
|
|
|
$email = $_POST['username']; |
|
|
@ -78,6 +78,8 @@ class AuthController { |
|
|
|
$_SESSION['user_name'] = "Guest"; |
|
|
|
$_SESSION['user_name'] = "Guest"; |
|
|
|
$_SESSION['user_id'] = self::insertGuestUser($email); |
|
|
|
$_SESSION['user_id'] = self::insertGuestUser($email); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$s = self::insertGuestGroup($_SESSION['user_id']); |
|
|
|
|
|
|
|
|
|
|
|
header('HTTP/1.1 302 Found'); |
|
|
|
header('HTTP/1.1 302 Found'); |
|
|
|
header('Location: /'); |
|
|
|
header('Location: /'); |
|
|
|
exit(0); |
|
|
|
exit(0); |
|
|
@ -108,6 +110,13 @@ class AuthController { |
|
|
|
|
|
|
|
|
|
|
|
return json_decode(PgSql::insert($sql, 'geo_id'))->geo_id; |
|
|
|
return json_decode(PgSql::insert($sql, 'geo_id'))->geo_id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private function insertGuestGroup($id) { |
|
|
|
|
|
|
|
$sql = "INSERT INTO webapp.users__groups (user_id, group_id) |
|
|
|
|
|
|
|
VALUES ('${id}', 1) ON CONFLICT DO NOTHING"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PgSql::insert($sql, 'NULL'); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|