Jump to content

phuber

Member
  • Posts

    7
  • Joined

  • Last visited

About phuber

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

phuber's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. HI, so my module is having an issue where it terminates the service on the day of non payment and that's all working great. The problem is I end up with a list of Failed Module actions due to either the module or maybe whmcs not being able to find the account as it's already been removed. I'm wondering if there's a way to one find out which is failing ( module or whmcs ) and then to either slow down execution or even better would be to only have one handle the accounts. My initial thought is that it's caused by the module running termination as a curl request instead of whmcs running it's termination command? function plex_TerminateAccount($params) { $useremail = $params["customfields"]["plex_email"]; $plexDetails = Illuminate\Database\Capsule\Manager::table("plex_clients")->where("useremail", $useremail)->first(); $is_nonremoveable = $params["configoption8"]; $apiurl = $params["configoption2"]; $endpoint = $apiurl . "servers/" . $params["configoption3"] . "/shared_servers/" . $plexDetails->shared_id; if ($plexDetails) { $id = get_query_val("plex_clients", "id", array("useremail" => $useremail, "status" => 1)); if ($id) { $fields = array("X-Plex-Product" => $params["configoption4"], "X-Plex-Version" => $params["configoption5"], "X-Plex-Client-Identifier" => $params["configoption6"], "X-Plex-Token" => $params["configoption7"]); $return = Plex_CurlFunction($endpoint, $fields, "unshareLibraries"); $response = $return->data; if ($return->intCode == 200) { if ($is_nonremoveable == "on") { Illuminate\Database\Capsule\Manager::table("plex_clients")->where("useremail", $useremail)->update(array("status" => 0)); } else { if (isset($plexDetails->user_id) && !empty($plexDetails->user_id)) { $endpoint2 = $apiurl . "friends/" . $plexDetails->user_id; Plex_CurlFunction($endpoint2, $fields, "removeFriend"); } Illuminate\Database\Capsule\Manager::table("plex_clients")->where("useremail", $useremail)->delete(); Illuminate\Database\Capsule\Manager::table("plex_schedule")->where("useremail", $useremail)->delete(); } return "success"; } if ($response["@attributes"]["status"]) { return $response["@attributes"]["status"]; } if ($response["error"]) { return $response["error"]; } return "error"; } if ($is_nonremoveable == "on") { Illuminate\Database\Capsule\Manager::table("plex_clients")->where("useremail", $useremail)->update(array("status" => 0)); } else { Illuminate\Database\Capsule\Manager::table("plex_clients")->where("useremail", $useremail)->delete(); Illuminate\Database\Capsule\Manager::table("plex_schedule")->where("useremail", $useremail)->delete(); } return "success"; } return "There isn't active service with this user"; }
  2. I'm looking to have a module made. it needs to do the following: on create ( payment made/manual ) needs to pull custom field data ( ip ) connect via ssh to a list of servers ( 4 or more ) and run a command ( addip ip [ where ip is the custom field value ) on terminate run command ( remip ip ) and a change ip button would run ( changeip oldip newip ) where the data would need to be entered by client and replace the old field data with new one as well. If you could give me a rough estimate of cost that would be great. Thank you.
  3. if anyone has this issue, as this is the first and pretty much only thread that comes up: alter table `tbltickets` add `attachments_removed` tinyint(1) NOT NULL DEFAULT '0' AFTER `attachment` alter table `tblticketreplies` add `attachments_removed` tinyint(1) NOT NULL DEFAULT '0' AFTER `attachment` alter table `tblticketnotes` add `attachments_removed` tinyint(1) NOT NULL DEFAULT '0' AFTER `attachments`
  4. Hi I have very long product descriptions due to the amount of info required for the products, as such I'm always looking for ways to shorten them. Latest idea is to use something like a spoiler code so gfdgffdg dgffggfdgfd dgfgfdggd gdfgdfg turns into What would be the easiest and or best way to do this?
  5. Hi so I'm just looking for some guidance. What I want to do is retrieve the list of active subs on a product(s) say product id #1 Select from plex_clients where 'productid=1' then run the function to create the accounts however the code is of course ioncubed and unreadable. so is it possible to retrieve the data then emulate a button press using the list?
  6. Welcome to WHMCS.Community phuber! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated