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