[FB] Making the Suspend Reason more friendly

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,418
Location
London UK
Ok, I would like to share my code with you to make it more friendly (if you use this feature).

The env variable is exactly what you put first (before the =) in /usr/local/directadmin/data/templates/suspension_reason.txt, if it's meant to use the &text, it's not for me (imho, it should) - maybe it uses the language files referenced by the id?

So what I did was:

in index.php (if you have .html, not sure if it'll work?) in /home/<reseller user or admin>/domains/suspended/ I put:
PHP:
<?php
$reason=getenv("reason"); 
$reason=str_replace("_"," ",$reason);
$reason=ucwords($reason);
?>
at the top then:
PHP:
This account has been suspended <?php if ($reason!=""){ echo "for <b>$reason</b>"; } ?>
where ever you want to put it, if you do not specify a reason when you suspend, it'll just display
This account has been suspended
So, that is all that's needed to remove the underscore in env and capitalise each word.
 
Last edited:
Thanks for sharing.

I would ask, since i didnt well understand the suspension_reason.txt part, this will work with da default file aswell right?

Also, please tell me, how you would add other custom values for suspension reason?

Should work this way:
mad=id=22&text=cause i'm mad
?

Ofc this is an example but for better explain how custom i mean :P

Regards
 
The ID corresponds to the language file for the DA skins in:
/usr/local/directadmin/data/skins/enhanced/lang/en/internal/suspension.txt

so, for eg.

if

/usr/local/directadmin/data/templates/suspension_reason.txt

has

mad=id=22&text=cause i'm mad

then /usr/local/directadmin/data/skins/enhanced/lang/en/internal/suspension.txt

should have

22=mad

so in the Reason drop-down on CMD_ALL_USER_SHOW will show mad or cause i'm mad as an option
 
Last edited:
Back
Top