Skip to content

Commit baad48a

Browse files
committed
Replaced CRLF by LF again
1 parent cfe677c commit baad48a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9826
-9826
lines changed

web/login/index.php

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
1-
<?php
2-
3-
session_start();
4-
5-
define('NO_AUTH_REQUIRED',true);
6-
7-
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
8-
9-
if (isset($_GET['logout'])) {
10-
session_destroy();
11-
}
12-
13-
$TAB = 'LOGIN';
14-
15-
if (isset($_SESSION['user'])) {
16-
if ($_SESSION['user'] == 'admin' && !empty($_GET['loginas'])) {
17-
if ($_GET['loginas'] == 'admin') {
18-
unset($_SESSION['look']);
19-
} else {
20-
$_SESSION['look'] = $_GET['loginas'];
21-
$_SESSION['look_alert'] = $_GET['loginas'];
22-
}
23-
}
24-
header("Location: /");
25-
exit;
26-
} else {
27-
if (isset($_POST['user']) && isset($_POST['password'])) {
28-
$cmd="/usr/bin/sudo /usr/local/vesta/bin/";
29-
$v_user = escapeshellarg($_POST['user']);
30-
$v_password = escapeshellarg($_POST['password']);
31-
$command="$cmd"."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'";
32-
exec ($command, $output, $return_var);
33-
if ( $return_var > 0 ) {
34-
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or password')."</a>";
35-
} else {
36-
$_SESSION['user'] = $_POST['user'];
37-
if ($_POST['user'] == 'root') $_SESSION['user'] = 'admin';
38-
if (!empty($_SESSION['request_uri'])) {
39-
header("Location: ".$_SESSION['request_uri']);
40-
unset($_SESSION['request_uri']);
41-
exit;
42-
} else {
43-
header("Location: /");
44-
exit;
45-
}
46-
}
47-
}
48-
require_once '../templates/header.html';
49-
require_once '../templates/login.html';
50-
}
51-
?>
1+
<?php
2+
3+
session_start();
4+
5+
define('NO_AUTH_REQUIRED',true);
6+
7+
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
8+
9+
if (isset($_GET['logout'])) {
10+
session_destroy();
11+
}
12+
13+
$TAB = 'LOGIN';
14+
15+
if (isset($_SESSION['user'])) {
16+
if ($_SESSION['user'] == 'admin' && !empty($_GET['loginas'])) {
17+
if ($_GET['loginas'] == 'admin') {
18+
unset($_SESSION['look']);
19+
} else {
20+
$_SESSION['look'] = $_GET['loginas'];
21+
$_SESSION['look_alert'] = $_GET['loginas'];
22+
}
23+
}
24+
header("Location: /");
25+
exit;
26+
} else {
27+
if (isset($_POST['user']) && isset($_POST['password'])) {
28+
$cmd="/usr/bin/sudo /usr/local/vesta/bin/";
29+
$v_user = escapeshellarg($_POST['user']);
30+
$v_password = escapeshellarg($_POST['password']);
31+
$command="$cmd"."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'";
32+
exec ($command, $output, $return_var);
33+
if ( $return_var > 0 ) {
34+
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or password')."</a>";
35+
} else {
36+
$_SESSION['user'] = $_POST['user'];
37+
if ($_POST['user'] == 'root') $_SESSION['user'] = 'admin';
38+
if (!empty($_SESSION['request_uri'])) {
39+
header("Location: ".$_SESSION['request_uri']);
40+
unset($_SESSION['request_uri']);
41+
exit;
42+
} else {
43+
header("Location: /");
44+
exit;
45+
}
46+
}
47+
}
48+
require_once '../templates/header.html';
49+
require_once '../templates/login.html';
50+
}
51+
?>

web/logout/index.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<?php
2-
3-
session_start();
4-
5-
if (!empty($_SESSION['look'])) {
6-
unset($_SESSION['look']);
7-
} else {
8-
session_destroy();
9-
}
10-
11-
header("Location: /");
12-
exit;
13-
?>
1+
<?php
2+
3+
session_start();
4+
5+
if (!empty($_SESSION['look'])) {
6+
unset($_SESSION['look']);
7+
} else {
8+
session_destroy();
9+
}
10+
11+
header("Location: /");
12+
exit;
13+
?>

web/reset/index.php

Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
1-
<?php
2-
session_start();
3-
4-
define('NO_AUTH_REQUIRED',true);
5-
6-
$TAB = 'RESET PASSWORD';
7-
//
8-
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
9-
10-
11-
if ((!empty($_POST['user'])) && (empty($_POST['code']))) {
12-
$v_user = escapeshellarg($_POST['user']);
13-
$user = $_POST['user'];
14-
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
15-
exec ($cmd." ".$v_user." json", $output, $return_var);
16-
if ( $return_var == 0 ) {
17-
$data = json_decode(implode('', $output), true);
18-
$rkey = $data[$user]['RKEY'];
19-
$fname = $data[$user]['FNAME'];
20-
$lname = $data[$user]['LNAME'];
21-
$contact = $data[$user]['CONTACT'];
22-
$to = $data[$user]['CONTACT'];
23-
$subject = _('MAIL_RESET_SUBJECT',date("Y-m-d H:i:s"));
24-
$hostname = exec('hostname');
25-
$from = _('MAIL_FROM',$hostname);
26-
if (!empty($fname)) {
27-
$mailtext = _('GREETINGS_GORDON_FREEMAN',$fname,$lname);
28-
} else {
29-
$mailtext = _('GREETINGS');
30-
}
31-
$mailtext .= _('PASSWORD_RESET_REQUEST',$_SERVER['HTTP_HOST'],$user,$rkey,$_SERVER['HTTP_HOST'],$user,$rkey);
32-
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from);
33-
unset($output);
34-
}
35-
36-
header("Location: /reset/?action=code&user=".$_POST['user']);
37-
exit;
38-
}
39-
40-
if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['password'])) ) {
41-
if ( $_POST['password'] == $_POST['password_confirm'] ) {
42-
$v_user = escapeshellarg($_POST['user']);
43-
$user = $_POST['user'];
44-
$v_password = escapeshellarg($_POST['password']);
45-
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
46-
exec ($cmd." ".$v_user." json", $output, $return_var);
47-
if ( $return_var == 0 ) {
48-
$data = json_decode(implode('', $output), true);
49-
$rkey = $data[$user]['RKEY'];
50-
if ($rkey == $_POST['code']) {
51-
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-change-user-password";
52-
exec ($cmd." ".$v_user." ".$v_password, $output, $return_var);
53-
if ( $return_var > 0 ) {
54-
$ERROR = "<a class=\"error\">"._('An internal error occurred')."</a>";
55-
} else {
56-
$_SESSION['user'] = $_POST['user'];
57-
header("Location: /");
58-
exit;
59-
}
60-
} else {
61-
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or code')."</a>";
62-
}
63-
} else {
64-
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or code')."</a>";
65-
}
66-
} else {
67-
$ERROR = "<a class=\"error\">"._('ERROR: Passwords not match')."</a>";
68-
}
69-
}
70-
71-
require_once '../templates/header.html';
72-
if (empty($_GET['action'])) {
73-
require_once '../templates/reset_1.html';
74-
} else {
75-
if ($_GET['action'] == 'code' ) {
76-
require_once '../templates/reset_2.html';
77-
}
78-
if (($_GET['action'] == 'confirm' ) && (!empty($_GET['code']))) {
79-
require_once '../templates/reset_3.html';
80-
}
81-
}
82-
83-
?>
1+
<?php
2+
session_start();
3+
4+
define('NO_AUTH_REQUIRED',true);
5+
6+
$TAB = 'RESET PASSWORD';
7+
//
8+
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
9+
10+
11+
if ((!empty($_POST['user'])) && (empty($_POST['code']))) {
12+
$v_user = escapeshellarg($_POST['user']);
13+
$user = $_POST['user'];
14+
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
15+
exec ($cmd." ".$v_user." json", $output, $return_var);
16+
if ( $return_var == 0 ) {
17+
$data = json_decode(implode('', $output), true);
18+
$rkey = $data[$user]['RKEY'];
19+
$fname = $data[$user]['FNAME'];
20+
$lname = $data[$user]['LNAME'];
21+
$contact = $data[$user]['CONTACT'];
22+
$to = $data[$user]['CONTACT'];
23+
$subject = _('MAIL_RESET_SUBJECT',date("Y-m-d H:i:s"));
24+
$hostname = exec('hostname');
25+
$from = _('MAIL_FROM',$hostname);
26+
if (!empty($fname)) {
27+
$mailtext = _('GREETINGS_GORDON_FREEMAN',$fname,$lname);
28+
} else {
29+
$mailtext = _('GREETINGS');
30+
}
31+
$mailtext .= _('PASSWORD_RESET_REQUEST',$_SERVER['HTTP_HOST'],$user,$rkey,$_SERVER['HTTP_HOST'],$user,$rkey);
32+
if (!empty($rkey)) send_email($to, $subject, $mailtext, $from);
33+
unset($output);
34+
}
35+
36+
header("Location: /reset/?action=code&user=".$_POST['user']);
37+
exit;
38+
}
39+
40+
if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['password'])) ) {
41+
if ( $_POST['password'] == $_POST['password_confirm'] ) {
42+
$v_user = escapeshellarg($_POST['user']);
43+
$user = $_POST['user'];
44+
$v_password = escapeshellarg($_POST['password']);
45+
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
46+
exec ($cmd." ".$v_user." json", $output, $return_var);
47+
if ( $return_var == 0 ) {
48+
$data = json_decode(implode('', $output), true);
49+
$rkey = $data[$user]['RKEY'];
50+
if ($rkey == $_POST['code']) {
51+
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-change-user-password";
52+
exec ($cmd." ".$v_user." ".$v_password, $output, $return_var);
53+
if ( $return_var > 0 ) {
54+
$ERROR = "<a class=\"error\">"._('An internal error occurred')."</a>";
55+
} else {
56+
$_SESSION['user'] = $_POST['user'];
57+
header("Location: /");
58+
exit;
59+
}
60+
} else {
61+
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or code')."</a>";
62+
}
63+
} else {
64+
$ERROR = "<a class=\"error\">"._('ERROR: Invalid username or code')."</a>";
65+
}
66+
} else {
67+
$ERROR = "<a class=\"error\">"._('ERROR: Passwords not match')."</a>";
68+
}
69+
}
70+
71+
require_once '../templates/header.html';
72+
if (empty($_GET['action'])) {
73+
require_once '../templates/reset_1.html';
74+
} else {
75+
if ($_GET['action'] == 'code' ) {
76+
require_once '../templates/reset_2.html';
77+
}
78+
if (($_GET['action'] == 'confirm' ) && (!empty($_GET['code']))) {
79+
require_once '../templates/reset_3.html';
80+
}
81+
}
82+
83+
?>

0 commit comments

Comments
 (0)