]> git.sur5r.net Git - contagged/blobdiff - login.php
configurable name <-> atrribute mappings
[contagged] / login.php
index f7ad08ec1d02c16886ba4aa109bfe49b7123a866..1e4b0d0e5ace54cd55f41f657ba817110e35ecb4 100644 (file)
--- a/login.php
+++ b/login.php
@@ -1,18 +1,19 @@
 <?
   require_once('init.php');
 
-  $msg = $lang[msg_login];
-  if(isset($_REQUEST[username])){
-    if (do_ldap_bind($_REQUEST[username],$_REQUEST[password])){
+  $msg = $lang['msg_login'];
+  if(isset($_REQUEST['username'])){
+    if (empty($_REQUEST['password'])) { $_REQUEST['password']=''; }
+    if (do_ldap_bind($_REQUEST['username'],$_REQUEST['password'])){
       //forward to next page
-      if(!empty($_SESSION[ldapab][lastlocation])){
-        header('Location: '.$_SESSION[ldapab][lastlocation]);
+      if(!empty($_SESSION['ldapab']['lastlocation'])){
+        header('Location: '.$_SESSION['ldapab']['lastlocation']);
       }else{
         header('Location: index.php');
       }
       exit;
     }else{
-      $msg = $lang[msg_loginfail];;
+      $msg = $lang['msg_loginfail'];;
     }
   }
 
@@ -20,7 +21,6 @@
   tpl_std();
   $smarty->assign('msg',$msg);
   //display templates
-  $smarty->display('header.tpl');
+  header('Content-Type: text/html; charset=utf-8');
   $smarty->display('login.tpl');
-  $smarty->display('footer.tpl');
 ?>