mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
Merge branch 'master' into master
This commit is contained in:
commit
8e293259bf
10 changed files with 36 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
|
||||
|
||||
exit;
|
||||
if (isset($_POST['user']) || isset($_POST['hash'])) {
|
||||
|
||||
// Authentication
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
require_once('/usr/local/vesta/web/inc/secure_login.php');
|
||||
session_start();
|
||||
|
||||
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
|
||||
|
|
12
web/inc/secure_login.php
Normal file
12
web/inc/secure_login.php
Normal file
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
if (!defined('NO_AUTH_REQUIRED2')) {
|
||||
if (file_exists('/usr/local/vesta/web/inc/login_url.php')) {
|
||||
require_once('/usr/local/vesta/web/inc/login_url.php');
|
||||
if (isset($_GET[$login_url])) {
|
||||
setcookie($login_url, '1', time() + 31536000, '/', $_SERVER['HTTP_HOST'], true);
|
||||
header ("Location: /login/");
|
||||
exit;
|
||||
}
|
||||
if (!isset($_COOKIE[$login_url])) exit;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,16 @@
|
|||
<?php
|
||||
session_start();
|
||||
if (isset($_SESSION['user'])) {
|
||||
header("Location: /list/user/");
|
||||
|
||||
if (!file_exists('/usr/local/vesta/web/inc/login_url.php')) {
|
||||
session_start();
|
||||
if (isset($_SESSION['user'])) {
|
||||
header("Location: /list/user/");
|
||||
} else {
|
||||
header("Location: /login/");
|
||||
}
|
||||
} else {
|
||||
header("Location: /login/");
|
||||
require_once('/usr/local/vesta/web/inc/login_url.php');
|
||||
if (isset($_GET[$login_url])) {
|
||||
require_once('/usr/local/vesta/web/inc/secure_login.php');
|
||||
}
|
||||
header("Location: /webmail/");
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ if (isset($_SESSION['user'])) {
|
|||
$_SESSION['look_alert'] = 'yes';
|
||||
}
|
||||
}
|
||||
header("Location: /");
|
||||
header("Location: /list/user/");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
|
|||
unset($_SESSION['request_uri']);
|
||||
exit;
|
||||
} else {
|
||||
header("Location: /");
|
||||
header("Location: /list/user/");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,6 @@ if (!empty($_SESSION['look'])) {
|
|||
session_destroy();
|
||||
}
|
||||
|
||||
header("Location: /");
|
||||
header("Location: /login/");
|
||||
exit;
|
||||
?>
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
<?php
|
||||
// Init
|
||||
define('NO_AUTH_REQUIRED',true);
|
||||
define('NO_AUTH_REQUIRED2',true);
|
||||
error_reporting(NULL);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Checking IP of incoming connection, checking is it NAT address
|
||||
//echo '<pre>'; print_r($_SERVER); exit;
|
||||
$ok=0;
|
||||
$ip=$_SERVER['REMOTE_ADDR'];
|
||||
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
|
||||
|
@ -152,7 +154,7 @@ if ((!empty($_POST['email'])) && (!empty($_POST['password'])) && (!empty($_POST[
|
|||
fclose($fp);
|
||||
exec (VESTA_CMD."v-change-mail-account-password '".$v_user."' ".$v_domain." ".$v_account." ".$v_new_password, $output, $return_var);
|
||||
if ($return_var == 0) {
|
||||
echo "ok";
|
||||
echo "==ok==";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<div class="l-header">
|
||||
<div class="l-center">
|
||||
<a href="/" class="l-logo"></a>
|
||||
<a href="/list/user/" class="l-logo"></a>
|
||||
<!-- /.l-logo -->
|
||||
<div class="l-menu clearfix noselect">
|
||||
<div class="l-menu__item <?php if($TAB == 'PACKAGE' ) echo 'l-menu__item--active' ?>"><a href="/list/package/"><?=__('Packages')?></a></div>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</a>
|
||||
<div class="l-header">
|
||||
<div class="l-center">
|
||||
<a href="/" class="l-logo"></a>
|
||||
<a href="/list/user/" class="l-logo"></a>
|
||||
<!-- /.l-logo -->
|
||||
<div class="l-menu clearfix">
|
||||
<div class="l-menu__item <?php if($TAB == 'STATS' ) echo 'l-menu__item--active' ?>"><a href="/list/stats/"><?=__('Statistics')?></a></div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue