From 14cc77bfed824f865515d9b1c3bd66142d7d7745 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 1 Jul 2024 02:12:12 -0700 Subject: [PATCH] Allow running accountmgr and maintenance without changing to spoolnews dir first. --- Rocksolid_Light/rslight/scripts/account_manager.php | 12 ++++++++++-- Rocksolid_Light/rslight/scripts/cron.php | 8 ++++++++ Rocksolid_Light/rslight/scripts/maintenance.php | 9 +++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Rocksolid_Light/rslight/scripts/account_manager.php b/Rocksolid_Light/rslight/scripts/account_manager.php index 4071a44..340f372 100644 --- a/Rocksolid_Light/rslight/scripts/account_manager.php +++ b/Rocksolid_Light/rslight/scripts/account_manager.php @@ -1,7 +1,15 @@ - /groups.txt */ +include ("paths.inc.php"); +chdir($spoolnews_path); include "config.inc.php"; include ("$file_newsportal"); +$processUser = posix_getpwuid(posix_geteuid()); +if ($processUser['name'] != $CONFIG['webserver_user']) { + echo "You are running as: " . $processUser['name'] . "\n"; + echo 'Please run this scripts as: ' . $CONFIG['webserver_user'] . "\n"; + exit(); +} + $logfile = $logdir . '/import.log'; $lockfile = $lockdir . '/' . $config_name . '-spoolnews.lock';