X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/b6f423726c6f71c769fc7d7f3b842f623595a808..b0d7e17277d6b5ec5b9110542ec7945848c1241a:/admin.php diff --git a/admin.php b/admin.php index cfdfe30..d05ce35 100644 --- a/admin.php +++ b/admin.php @@ -32,14 +32,17 @@ if (file_exists(JIRAFEAU_ROOT . 'install.php') /* If called from CLI, no password or graphical interface */ if (php_sapi_name() == "cli") { + if ($cfg['installation_done'] == false) { + die("Installation not completed yet.\n"); + } if ((count($argv)>1) && $argv[1]=="clean_expired") { $total = jirafeau_admin_clean(); - echo "$total expired files deleted."; + echo "$total expired files deleted.\n"; } elseif ((count($argv)>1) && $argv[1]=="clean_async") { $total = jirafeau_admin_clean_async(); - echo "$total old unfinished transfers deleted."; + echo "$total old unfinished transfers deleted.\n"; } else { - die("No command found. Should be admin.php ."); + die("No command found. Should be admin.php .\n"); } } else { /* Disable admin interface if we have a empty admin password. */ @@ -52,18 +55,18 @@ if (php_sapi_name() == "cli") { exit; } - /* Unlog if asked. */ + /* Logout if requested. */ if (jirafeau_admin_session_logged() && isset($_POST['action']) && (strcmp($_POST['action'], 'logout') == 0)) { jirafeau_admin_session_end(); } if (!jirafeau_admin_session_logged()) { - /* Test HTTP authentification. */ + /* Test HTTP authentication. */ if (!empty($cfg['admin_http_auth_user']) && $cfg['admin_http_auth_user'] == $_SERVER['PHP_AUTH_USER']) { jirafeau_admin_session_start(); } - /* Test web password authentification. */ + /* Test web password authentication. */ elseif (!empty($cfg['admin_password']) && isset($_POST['admin_password'])) { if ($cfg['admin_password'] === hash('sha256', $_POST['admin_password'])) { jirafeau_admin_session_start(); @@ -88,7 +91,7 @@ if (php_sapi_name() == "cli") { + size = "40" autocomplete = "current-password" /> @@ -216,6 +219,19 @@ if (php_sapi_name() == "cli") { +
+ + + + + + + + + + + +
@@ -279,6 +295,8 @@ if (php_sapi_name() == "cli") { fclose($r); } exit; + } elseif (strcmp($_POST['action'], 'bug_report_info') == 0) { + echo jirafeau_admin_bug_report($cfg); } }