Display the web-add.sh version

This commit is contained in:
Ludovic Poujol 2023-02-15 11:36:25 +01:00
parent 77f5076c88
commit 66c159a625
2 changed files with 5 additions and 3 deletions

View file

@ -20,6 +20,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST)) {
$_SESSION['auth'] = true; $_SESSION['auth'] = true;
$_SESSION['user'] = $input_username; $_SESSION['user'] = $input_username;
$_SESSION['user_id'] = posix_getpwnam($input_username) ? posix_getpwnam($input_username)['uid'] : 65534; $_SESSION['user_id'] = posix_getpwnam($input_username) ? posix_getpwnam($input_username)['uid'] : 65534;
$_SESSION['cli_version'] = run_webadd_cmd('version')[0];
unset($_SESSION['error']); unset($_SESSION['error']);
} elseif (isset($conf['logins'][$input_username]) && strlen($conf['logins'][$input_username]) == 64 && hash("sha256",$input_password) === $conf['logins'][$input_username]) { } elseif (isset($conf['logins'][$input_username]) && strlen($conf['logins'][$input_username]) == 64 && hash("sha256",$input_password) === $conf['logins'][$input_username]) {
@ -27,6 +28,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST)) {
$_SESSION['auth'] = true; $_SESSION['auth'] = true;
$_SESSION['user'] = $input_username; $_SESSION['user'] = $input_username;
$_SESSION['user_id'] = posix_getpwnam($input_username) ? posix_getpwnam($input_username)['uid'] : 65534; $_SESSION['user_id'] = posix_getpwnam($input_username) ? posix_getpwnam($input_username)['uid'] : 65534;
$_SESSION['cli_version'] = run_webadd_cmd('version')[0];
unset($_SESSION['error']); unset($_SESSION['error']);
} else { } else {

View file

@ -21,7 +21,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EvoAdmin - Powered by Evolix</title> <title>Evoadmin-web - Powered by Evolix</title>
<link rel="stylesheet" href="/inc/css/main.css" type="text/css" media="screen, projection" /> <link rel="stylesheet" href="/inc/css/main.css" type="text/css" media="screen, projection" />
<script type="text/javascript" src="/inc/js/lib/prototype-1.6.0.3.js"></script> <script type="text/javascript" src="/inc/js/lib/prototype-1.6.0.3.js"></script>
<script type="text/javascript" src="/inc/js/ftpadmin.js"></script> <script type="text/javascript" src="/inc/js/ftpadmin.js"></script>
@ -31,10 +31,10 @@
<body> <body>
<div id="main"> <div id="main">
<h1 id="top">EvoAdmin <h1 id="top">Evoadmin-web
<?php <?php
if(!empty($_SESSION['user'])) { if(!empty($_SESSION['user'])) {
print ' - '.$_SESSION['user']; print ' v'.$_SESSION['cli_version'].' - '.$_SESSION['user'];
if(is_superadmin()) { if(is_superadmin()) {
print ' (Administrateur)'; print ' (Administrateur)';