Removes warnings on login page.
authorStéphane Jacob <sj@m4x.org>
Sun, 8 Aug 2010 16:35:37 +0000 (18:35 +0200)
committerStéphane Jacob <sj@m4x.org>
Sun, 8 Aug 2010 16:35:58 +0000 (18:35 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/security.inc.php
plugins/insert.getUserName.php
templates/core/password_prompt.tpl

index 47b38da..2f77f82 100644 (file)
@@ -78,7 +78,10 @@ function check_email($email, $message)
 
 function check_account()
 {
-    return S::user()->watch;
+    if (S::user()) {
+        return S::user()->watch;
+    }
+    return false;
 }
 
 function check_redirect($red = null)
index 769853b..7d69ee9 100644 (file)
@@ -24,7 +24,7 @@ function smarty_insert_getUsername()
     global $globals;
 
     $id = Cookie::i('uid', -1);
-    $id = S::v($_SESSION['uid'], $id);
+    $id = S::v('uid', $id);
 
     if ($id < 0) {
         return '';
index 246f4b4..a4931d8 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{if $referer || $platal->pl_self() neq 'login'}
+{if t($referer) || $platal->pl_self() neq 'login'}
 <h1>
   Accès restreint
 </h1>
@@ -52,7 +52,7 @@
       <td>
         <input type="text" name="username" size="20" maxlength="50" value="{insert name="getUserName"}" />&nbsp;@&nbsp;<select name="domain">
           <option value="login">{#globals.mail.domain#} / {#globals.mail.domain2#}</option>
-          <option value="alias" {if $smarty.cookies.ORGdomain eq alias}selected="selected"{/if}>
+          <option value="alias" {if t($smarty.cookies.ORGdomain) eq "alias"}selected="selected"{/if}>
             {#globals.mail.alias_dom#} / {#globals.mail.alias_dom2#}
           </option>
         </select>