I'm trying to write a hook to fix this using the info on the documentation site here
https://wiki.centos-webpanel.com/action-hooks
But I'm not getting anywhere! .. I created the php file as instructed in
/usr/local/cwpsrv/htdocs/resources/admin/hooks/account/account_unsuspend.php
and I added this to it :
<?php
function account_unsuspend($array) {
// Extracting data from the array
$username = $array['username'];
$status = $array['status'];
// Log the unsuspension event
$logfile = '/var/log/cwp_account_unsuspend.log';
$timestamp = date('Y-m-d H:i:s');
file_put_contents($logfile, "$timestamp - User $username was unsuspended. Status: $status\n", FILE_APPEND);
// Set unlimited quotas for the unsuspended user
$command = "setquota -u $username 0 0 0 0 /";
exec($command);
// Send email notification
$subject = "User Unsuspension";
$message = "User $username has been unsuspended.";
mail("myemail@gmail.com", $subject, $message);
}
?>
but when I unsuspend the user nothing happens and the log is empty. The documentation site is not clear enough on this or maybe outdated?