Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5557f00e57
|
||
|
|
baddc17b33
|
||
|
|
8d495c9f37
|
||
|
|
cc8f1e1ace
|
||
|
|
97e04d785c
|
||
|
|
0c102da1d7
|
No files matched your search
+1
-1
@@ -10,7 +10,7 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"esoko/soko-web": "0.8",
|
||||
"esoko/soko-web": "0.10",
|
||||
"firebase/php-jwt": "^6.4"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
Generated
+4
-4
@@ -4,15 +4,15 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "a89a42e04596ab159fc41abbd9390068",
|
||||
"content-hash": "607b383c44826c6307dd79b0362ca320",
|
||||
"packages": [
|
||||
{
|
||||
"name": "esoko/soko-web",
|
||||
"version": "v0.8",
|
||||
"version": "0.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://git.esoko.eu/esoko/soko-web.git",
|
||||
"reference": "219b42f995b8e34432da4dde77e53e24b75d78dd"
|
||||
"reference": "fd286c9cffadc4a26609bfa00944f8014a2f3f59"
|
||||
},
|
||||
"require": {
|
||||
"phpmailer/phpmailer": "^6.8",
|
||||
@@ -33,7 +33,7 @@
|
||||
"GNU GPL 3.0"
|
||||
],
|
||||
"description": "Lightweight web framework",
|
||||
"time": "2023-05-01T17:08:22+00:00"
|
||||
"time": "2023-05-02T10:55:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
<?php if ($user['password'] !== null && $user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with your password or with Google to modify your account.</p>
|
||||
<div class="inputWithButton">
|
||||
<input type="password" class="text" name="password" placeholder="Current password" required minlength="6" autofocus><!--
|
||||
<input type="password" class="text" name="password" placeholder="Current password" autocomplete="current-password" required minlength="6" autofocus><!--
|
||||
--><button id="authenticateWithGoogleButton" class="yellow" type="button">Google</button>
|
||||
</div>
|
||||
<?php elseif ($user['password'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with your password to modify your account.</p>
|
||||
<input type="password" class="text big fullWidth" name="password" placeholder="Current password" required minlength="6" autofocus>
|
||||
<input type="password" class="text big fullWidth" name="password" placeholder="Current password" autocomplete="current-password" required minlength="6" autofocus>
|
||||
<?php elseif ($user['google_sub'] !== null): ?>
|
||||
<p class="justify small">Please confirm your identity with Google to modify your account.</p>
|
||||
<div class="inputWithButton">
|
||||
@@ -23,10 +23,10 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<hr>
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= $user['email'] ?>">
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" autocomplete="username" value="<?= $user['email'] ?>">
|
||||
<input type="text" class="text big fullWidth marginTop" name="username" placeholder="Username" value="<?= $user['username'] ?>">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" minlength="6">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" minlength="6">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new" placeholder="New password" autocomplete="new-password" minlength="6">
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_new_confirm" placeholder="New password confirmation" autocomplete="new-password" minlength="6">
|
||||
<hr>
|
||||
<input type="text" class="text big fullWidth marginTop" name="full_name" placeholder="Full name" value="<?= $user['full_name'] ?>" disabled>
|
||||
<input type="text" class="text big fullWidth marginTop" name="nickname" placeholder="Nickname" value="<?= $user['nickname'] ?>">
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<h2>Login</h2>
|
||||
<div class="box compactBox">
|
||||
<form id="loginForm" action="<?= Container::$routeCollection->getRoute('login-action')->generateLink() ?>" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||
<input type="text" class="text big fullWidth" name="email" placeholder="Email address / Username" required autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" required minlength="6">
|
||||
<input type="text" class="text big fullWidth" name="email" placeholder="Email address / Username" autocomplete="username" required autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" autocomplete="current-password" required minlength="6">
|
||||
<p id="loginFormError" class="formError justify marginTop"></p>
|
||||
<div class="right marginTop">
|
||||
<button type="submit">Login</button>
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<div class="box compactBox">
|
||||
<?php if ($success) : ?>
|
||||
<form id="resetPasswordForm" action="<?= Container::$routeCollection->getRoute('password.reset-action')->generateLink(['token' => $token]) ?>"" method="post" data-redirect-on-success="<?= $redirectUrl ?>">
|
||||
<input type="email" class="text big fullWidth" name="email" placeholder="Email address" value="<?= $email ?>" disabled>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" required minlength="6" autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_confirm" placeholder="Password confirmation" required minlength="6">
|
||||
<input type="text" class="text big fullWidth" name="email" placeholder="Email address / Username" autocomplete="username" value="<?= $email ?>" disabled>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password" placeholder="Password" autocomplete="new-password" required minlength="6" autofocus>
|
||||
<input type="password" class="text big fullWidth marginTop" name="password_confirm" placeholder="Password confirmation" autocomplete="new-password" required minlength="6">
|
||||
<p id="resetPasswordFormError" class="formError justify marginTop"></p>
|
||||
<div class="right">
|
||||
<button class="marginTop" type="submit">Reset password</button>
|
||||
|
||||
@@ -4,6 +4,7 @@ use SokoWeb\Response\HttpResponse;
|
||||
use SokoWeb\Routing\RouteCollection;
|
||||
use SokoWeb\Session\DatabaseSessionHandler;
|
||||
use SokoWeb\Request\Request;
|
||||
use SokoWeb\Request\Session;
|
||||
use RVR\Controller\HomeController;
|
||||
use RVR\Controller\LoginController;
|
||||
use RVR\Controller\OAuthAuthController;
|
||||
@@ -88,33 +89,27 @@ Container::$routeCollection->group('communities', function (RouteCollection $rou
|
||||
});
|
||||
});
|
||||
|
||||
Container::$sessionHandler = new DatabaseSessionHandler(Container::$dbConnection);
|
||||
Container::$sessionHandler = new DatabaseSessionHandler(
|
||||
Container::$dbConnection,
|
||||
'sessions',
|
||||
new DateTime('-7 days')
|
||||
);
|
||||
|
||||
session_set_save_handler(Container::$sessionHandler, true);
|
||||
session_start([
|
||||
'gc_probability' => 0, // old sessions are deleted by MaintainDatabaseCommand
|
||||
'cookie_lifetime' => 604800,
|
||||
'cookie_lifetime' => 0,
|
||||
'cookie_path' => '/',
|
||||
'cookie_httponly' => true,
|
||||
'cookie_samesite' => 'Lax'
|
||||
]);
|
||||
|
||||
if (isset($_COOKIE[session_name()])) {
|
||||
// extend session cookie lifetime is cookie already exists
|
||||
setcookie(session_name(), session_id(), [
|
||||
'expires' => time() + 604800,
|
||||
'path' => '/',
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax'
|
||||
]);
|
||||
}
|
||||
|
||||
Container::$request = new Request(
|
||||
$_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'],
|
||||
$_GET,
|
||||
$_POST,
|
||||
getallheaders(),
|
||||
$_SESSION,
|
||||
new Session($_SESSION),
|
||||
new UserRepository()
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user