This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/htdocs/login.php
2011-01-14 01:45:19 +11:00

40 lines
1.1 KiB
PHP

<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/login.php,v 1.2 2009/04/19 04:00:59 wurley Exp $
/**
* Log the user in.
*
* @package leenooksApp
* @subpackage Page
*/
/**
*/
require './common.php';
$user = array();
$user['login'] = get_request('login');
$user['password'] = get_request('login_pass');
if ($user['login'] && ! strlen($user['password']))
system_message(array(
'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')));
if ($app['server']->login($user['login'],$user['password'],'user'))
system_message(array(
'title'=>_('Authenticate to server'),
'body'=>_('Successfully logged into server.'),
'type'=>'info'),
sprintf('cmd.php?server_id=%s',get_request('server_id','REQUEST')));
else
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')));
?>