]> git.sur5r.net Git - contagged/blob - login.php
configurable name <-> atrribute mappings
[contagged] / login.php
1 <?
2   require_once('init.php');
3
4   $msg = $lang['msg_login'];
5   if(isset($_REQUEST['username'])){
6     if (empty($_REQUEST['password'])) { $_REQUEST['password']=''; }
7     if (do_ldap_bind($_REQUEST['username'],$_REQUEST['password'])){
8       //forward to next page
9       if(!empty($_SESSION['ldapab']['lastlocation'])){
10         header('Location: '.$_SESSION['ldapab']['lastlocation']);
11       }else{
12         header('Location: index.php');
13       }
14       exit;
15     }else{
16       $msg = $lang['msg_loginfail'];;
17     }
18   }
19
20   //prepare templates
21   tpl_std();
22   $smarty->assign('msg',$msg);
23   //display templates
24   header('Content-Type: text/html; charset=utf-8');
25   $smarty->display('login.tpl');
26 ?>