summaryrefslogtreecommitdiff
path: root/includes/pages/guest_login.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-08-30 19:57:01 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2017-08-30 19:57:01 +0200
commit2bd127c011846aad69731d1d63535a3d4f100af0 (patch)
treec05736a9ab1daa00047a3092887f972f701609e4 /includes/pages/guest_login.php
parent96f1d9fd541d0c5ef78151f8c69a89c41684b67a (diff)
Use symfony session
Diffstat (limited to 'includes/pages/guest_login.php')
-rw-r--r--includes/pages/guest_login.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php
index 4a77b40c..9179c6c4 100644
--- a/includes/pages/guest_login.php
+++ b/includes/pages/guest_login.php
@@ -39,6 +39,7 @@ function guest_register()
$min_password_length = config('min_password_length');
$event_config = EventConfig();
$request = request();
+ $session = session();
$msg = '';
$nick = '';
@@ -226,7 +227,7 @@ function guest_register()
$password_hash,
$comment,
$hometown,
- $_SESSION['locale'],
+ $session->get('locale'),
$planned_arrival_date,
]
);
@@ -377,25 +378,36 @@ function guest_register()
]);
}
+/**
+ * @return string
+ */
function entry_required()
{
return '<span class="text-info glyphicon glyphicon-warning-sign"></span>';
}
+/**
+ * @return bool
+ */
function guest_logout()
{
- session_destroy();
+ session()->invalidate();
redirect(page_link_to('start'));
return true;
}
+/**
+ * @return string
+ */
function guest_login()
{
$nick = '';
$request = request();
- unset($_SESSION['uid']);
+ $session = session();
$valid = true;
+ $session->remove('uid');
+
if ($request->has('submit')) {
if ($request->has('nick') && strlen(User_validate_Nick($request->input('nick'))) > 0) {
$nick = User_validate_Nick($request->input('nick'));
@@ -420,8 +432,8 @@ function guest_login()
}
if ($valid && !empty($login_user)) {
- $_SESSION['uid'] = $login_user['UID'];
- $_SESSION['locale'] = $login_user['Sprache'];
+ $session->set('uid', $login_user['UID']);
+ $session->set('locale', $login_user['Sprache']);
redirect(page_link_to('news'));
}
@@ -477,6 +489,9 @@ function guest_login()
]);
}
+/**
+ * @return string
+ */
function get_register_hint()
{
global $privileges;