summaryrefslogtreecommitdiff
blob: 5e9d4c3d39b094f4a7cb7f157377647ff7b607d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 *  Admin login. 
 *  @package mirror
 *  @subpackage admin
 */
require_once('../cfg/init.php');
require_once(LIB.'/auth.php');

// authenticate
if (!empty($_POST['submit'])) {
    if ($auth = auth_mysql($_POST['username'],$_POST['password'])) {
        auth_create_session($auth);
        header('Location: http://'.$_SERVER['HTTP_HOST'].WEBPATH.'/admin/');
        exit;
    } else {
        $msg = 'Authentication failed.  Please check username and password and try again.';
    }
}

$title='Gentoo Mirror Manager Login';
$body_tags=' onload="document.getElementById(\'username\').focus();" ';
require_once(HEADER);
?>
<h1>Gentoo Mirror Manager Login</h1>
<?php echo (!empty($msg))?'<pre>'.$msg.'</pre>':null; ?>
<form name="form" id="form" method="post" action="./login.php" >
<div>
    <label for="username">Username:</label>
    <input type="text" name="username" id="username" size="30" maxlength="100" />
</div>
<br />
<div>
    <label for="password">Password:</label>
    <input type="password" name="password" id="password" size="30" maxlength="100" />
</div>
<br />
<input type="submit" name="submit" id="submit" class="button" value="Log In" />
</form>
<?php
require_once(FOOTER);
?>