2019-02-08 13:44:52 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Log the user in.
|
|
|
|
*
|
|
|
|
* @package phpLDAPadmin
|
|
|
|
* @subpackage Page
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
|
|
|
require './common.php';
|
|
|
|
|
|
|
|
$user = array();
|
|
|
|
$user['login'] = get_request('login');
|
|
|
|
$user['password'] = get_request('login_pass');
|
|
|
|
|
|
|
|
if ($user['login'] && ! strlen($user['password']))
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
system_message(array(
|
2019-02-12 14:57:50 -05:00
|
|
|
'title' => _('Authenticate to server'),
|
|
|
|
'body' => _('You left the password blank.'),
|
|
|
|
'type' => 'warn'),
|
|
|
|
sprintf('cmd.php?cmd=login_form&server_id=%s', get_request('server_id', 'REQUEST')));
|
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
|
|
|
|
if ($app['server']->login($user['login'],$user['password'],'user'))
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
system_message(array(
|
2019-02-12 14:57:50 -05:00
|
|
|
'title' => _('Authenticate to server'),
|
|
|
|
'body' => _('Successfully logged into server.'),
|
|
|
|
'type' => 'info'),
|
|
|
|
sprintf('cmd.php?server_id=%s', get_request('server_id', 'REQUEST')));
|
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
else
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
system_message(array(
|
2019-02-12 14:57:50 -05:00
|
|
|
'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')));
|
|
|
|
}
|
2019-02-12 14:52:01 -05:00
|
|
|
|