aboutsummaryrefslogtreecommitdiffstats
path: root/identification.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-02-23 15:52:32 +0000
committerplegall <plg@piwigo.org>2010-02-23 15:52:32 +0000
commit149268353dddbdd848c59417d7f285d07994debd (patch)
tree3fe11cf65e49f9ef26272ab8429858f6f7b5a6b3 /identification.php
parent570c9055564b1de94b35ddc75d42337aaf97ab41 (diff)
merge r4955 from branch 2.0 to trunk
bug 1452 fixed: check cookies are enabled in web browser and notify user otherwise that she can't connect. git-svn-id: http://piwigo.org/svn/trunk@4956 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--identification.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/identification.php b/identification.php
index 802a2c170..2b6e856b9 100644
--- a/identification.php
+++ b/identification.php
@@ -45,15 +45,25 @@ if ( !empty($_GET['redirect']) )
if (isset($_POST['login']))
{
- $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
- $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
- if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
+ if (!isset($_COOKIE[session_name()]))
{
- redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
+ array_push(
+ $errors,
+ l10n('Cookies are blocked or not supported by your browser. You must enable cookies to connect.')
+ );
}
else
- {
- array_push( $errors, l10n('invalid_pwd') );
+ {
+ $redirect_to = isset($_POST['redirect']) ? $_POST['redirect'] : '';
+ $remember_me = isset($_POST['remember_me']) and $_POST['remember_me']==1;
+ if ( try_log_user($_POST['username'], $_POST['password'], $remember_me) )
+ {
+ redirect(empty($redirect_to) ? make_index_url() : $redirect_to);
+ }
+ else
+ {
+ array_push( $errors, l10n('invalid_pwd') );
+ }
}
}