2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-07-01 06:09:17 +00:00
|
|
|
// $Header$
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-06-30 09:22:30 +00:00
|
|
|
/**
|
2009-07-01 06:09:17 +00:00
|
|
|
* Log the user in.
|
2009-06-30 08:05:37 +00:00
|
|
|
*
|
2009-06-30 09:29:51 +00:00
|
|
|
* @package phpLDAPadmin
|
2009-07-01 06:09:17 +00:00
|
|
|
* @subpackage Page
|
2009-06-30 09:29:51 +00:00
|
|
|
*/
|
2009-07-01 06:09:17 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
2009-06-30 08:05:37 +00:00
|
|
|
*/
|
|
|
|
|
2009-06-30 09:22:30 +00:00
|
|
|
require './common.php';
|
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$user = array();
|
|
|
|
$user['login'] = get_request('login');
|
|
|
|
$user['password'] = get_request('login_pass');
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
if ($user['login'] && ! strlen($user['password']))
|
2009-06-30 10:46:00 +00:00
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Authenticate to server'),
|
|
|
|
'body'=>_('You left the password blank.'),
|
|
|
|
'type'=>'warn'),
|
2009-07-01 06:09:17 +00:00
|
|
|
sprintf('cmd.php?cmd=login_form&server_id=%s',get_request('server_id','REQUEST')));
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
if ($app['server']->login($user['login'],$user['password'],'user'))
|
2009-06-30 10:46:00 +00:00
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Authenticate to server'),
|
2009-07-01 06:09:17 +00:00
|
|
|
'body'=>_('Successfully logged into server.'),
|
|
|
|
'type'=>'info'),
|
|
|
|
sprintf('cmd.php?server_id=%s',get_request('server_id','REQUEST')));
|
2009-06-30 08:10:17 +00:00
|
|
|
else
|
2009-07-01 06:09:17 +00:00
|
|
|
system_message(array(
|
|
|
|
'title'=>_('Failed to Authenticate to server'),
|
|
|
|
'body'=>_('Invalid Username or Password.'),
|
|
|
|
'type'=>'error'),
|
|
|
|
sprintf('cmd.php?cmd=login_form&server_id=%s',get_request('server_id','REQUEST')));
|
2009-06-30 09:22:30 +00:00
|
|
|
?>
|