-
Notifications
You must be signed in to change notification settings - Fork 66
/
login.php
47 lines (37 loc) · 1001 Bytes
/
login.php
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
43
44
45
46
47
<?php
/*
Cassandra Cluster Admin
@author Sébastien Giroux
@copyright All rights reserved - 2011
*/
require('include/kernel.inc.php');
/*
No login required mode, redirect to index
*/
if (!CCA_LOGIN_REQUIRED) {
redirect('index.php');
}
$vw_vars['login_error'] = '';
/*
Submit login form
*/
if (isset($_POST['btn_login'])) {
$username = $_POST['username'];
$password = $_POST['password'];
if ($username === CCA_USERNAME && $password === CCA_PASSWORD) {
$_SESSION['cca_login'] = md5($username.$password);
redirect('index.php');
}
else {
$vw_vars['login_error'] = displayErrorMessage('login_wrong_username_password');
}
}
$vw_vars['you_must_be_logged'] = '';
if (isset($_GET['you_must_be_logged'])) {
$vw_vars['you_must_be_logged'] = displayErrorMessage('you_must_be_logged');
}
$current_page_title = 'Cassandra Cluster Admin > Login';
echo getHTML('header.php');
echo getHTML('login.php',$vw_vars);
echo getHTML('footer.php');
?>