|
Suspend Reason
|
|
04-15-2009, 06:44 AM
(This post was last modified: 04-17-2009 01:20 PM by umarsa.)
Post: #1
|
|||
|
|||
|
Suspend Reason
Hello all,
I switched to THT a few months back but i was having timeout issues so i went back to cp-creator. Yesterday i thought you guys might have fixed it and decided to install it again and it works perfectly. The only thing i couldnt help thinking about is WHY ON EARTH CANT THERE BE A SUSPEND MESSAGE??!? So i was looking through the code and found the function "suspend" in the file "whm.php", i edited the command line from "$action = "/xml-api/suspendacct?user=" . strtolower($user);" (line 83) and replaced with this "$action = "/xml-api/suspendacct?reason=test&user=" . strtolower($user);". This worked like a dream, the reason showed up in my WHM, i was so pleased ![]() So i was wondering if you can implement this into the new or next version, the cronjob that automatically suspends for posts should have a reason like "THT: Not Enough Posts". Also in the admin panel when the admin suspends a user the reason should be something like "THT: Suspended by (ADMIN_USERNAME)" with of course the ADMIN_USERNAME replaced with the admin that is logged in. For now i have implemented this myself. Here is a breif way if anyone wants to do it. Open WHM.php (sorry guys i can only help with cpanel/whm) Find Code: $action = "/xml-api/suspendacct?user=" . strtolower($user);Edit this with Code: $tht_suspend_reason = str_replace(" ", "%20", $tht_suspend_reason);Find Code: public function suspend($user, $server) {Edit this with Code: public function suspend($user, $server, $tht_suspend_reason) {Open class_server.php in includes. Find Code: public function suspend($id) { # Suspends a user account from the package IDReplace with Code: public function suspend($id, $reason_suspend) { # Suspends a user account from the package IDFind Code: if($this->servers[$server]->suspend($data2['user'], $server) == true) {Replace with Code: if($this->servers[$server]->suspend($data2['user'], $server, $reason_suspend) == true) {Open users.php in the admin/pages folder. Find Code: case "sus":Replace with Code: case "sus": {Save and close all files. In not sure if Code: $db->query("SELECT * FROM `<PRE>staff` WHERE `id` =".$_SESSION['user']);Im gonna need some help as to where to edit for the cron, i have looked in cron.php and compiler.php but i cant find it lol. Well you get the point, can you implement something like this in the next version. Thanks, Umar Salim |
|||
|
04-15-2009, 04:36 PM
Post: #2
|
|||
|
|||
|
RE: Suspend Reason
very nice
Nick - TheHostingTool Staff Coordinator ![]() |
|||
|
04-15-2009, 04:43 PM
Post: #3
|
|||
|
|||
|
RE: Suspend Reason
Thanks but sadly you cant use spaces in the api reason
|
|||
|
04-17-2009, 12:48 PM
Post: #4
|
|||
|
|||
|
RE: Suspend Reason
you probably could if you escape the space with" \"
Nick - TheHostingTool Staff Coordinator ![]() |
|||
|
04-17-2009, 01:18 PM
Post: #5
|
|||
|
|||
|
RE: Suspend Reason
Okay i tried it and it didnt work.
I have tried %20 and it works perfectly ![]() I will edit my first post and put that in. |
|||
|
04-17-2009, 09:49 PM
Post: #6
|
|||
|
|||
|
RE: Suspend Reason
good work, very nice
Nick - TheHostingTool Staff Coordinator ![]() |
|||
|
04-17-2009, 09:50 PM
Post: #7
|
|||
|
|||
|
RE: Suspend Reason
Thanks.
Its so easy to add things lol its the ajax that is hard
|
|||
|
04-20-2009, 03:06 PM
Post: #8
|
|||
|
|||
|
RE: Suspend Reason
Hello.
I can confirm that this feature will be included in 1.2 Rich - Ex lead developer |
|||
|
04-20-2009, 03:58 PM
Post: #9
|
|||
|
|||
|
RE: Suspend Reason
Woohoo, but i would also like to add, in the THT admin panel when you click the suspend button it should ask why you want to suspend them.
Another thing that needs to be included is if the user catches up on posts hes unsuspended, i made a little something that does this but it will only work on my server sadly. |
|||
|
04-20-2009, 04:05 PM
Post: #10
|
|||
|
|||
RE: Suspend Reason
(04-20-2009 03:58 PM)umarsa Wrote: Woohoo, but i would also like to add, in the THT admin panel when you click the suspend button it should ask why you want to suspend them. Hello, Yeah, version 1.2 will do all that
Rich - Ex lead developer |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)




![[Image: standard.png]](http://twitstamp.com/thehostingtool/standard.png)
