thernes Posted August 14, 2012 Share Posted August 14, 2012 Hi all We have discovered an error in a custom built registrar module that has added an extra year to the next due date in our DB whenever a domain has been registered/transfered/renewed by this module. I was planning to just add a custom button with a function that would correct this to the Registrar commands that are available, but it seems that this is not possible? After reading the doc, only the functions found here seems to be supported: http://docs.whmcs.com/Registrar_Module_Developer_Docs? I would appreciate if somebody can confirm that it is not possible to add new, custom buttons to the registrar commands or help me out with a small hint on how it is done, if it is possible to do this? Thanks, Thomas 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted August 14, 2012 Share Posted August 14, 2012 It doesn't appear to be listed in the docs but you can add a custom command/button by adding a AdminCustomButtonArray function in your registrar module and map the button name to a custom function name. function modulename_AdminCustomButtonArray() { $buttonarray = array( "Fix next due date" => "fixduedate", ); return $buttonarray; } 0 Quote Link to comment Share on other sites More sharing options...
thernes Posted August 14, 2012 Author Share Posted August 14, 2012 The AdminCustomButtonArray is mentioned in the docs, but only under provisioning modules. If I try to add a AdminCustomButtonArray to the registrar-module, no buttons show up 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted August 14, 2012 Share Posted August 14, 2012 What version of WHMCS are you using? This works for me in 5.1.2. 0 Quote Link to comment Share on other sites More sharing options...
ptomter Posted August 30, 2012 Share Posted August 30, 2012 What version of WHMCS are you using? This works for me in 5.1.2. I testet in whmcs 5.1.2 this and it seems that its not working for Registrar Module, 0 Quote Link to comment Share on other sites More sharing options...
jclarke Posted August 30, 2012 Share Posted August 30, 2012 I'm not sure why it isn't displaying for you guys but it does work for me with 5.1.2, here is example of adding a custom button to the email registrar module. The button doesn't actually do anything in this example, it just displays: <?php function email_getConfigArray() { $configarray = array( "FriendlyName" => array("Type" => "System", "Value"=>"Email Notifications"), "Description" => array("Type" => "System", "Value"=>"This module can be used for any TLDs that have no integrated registrar"), "EmailAddress" => array( "Type" => "text", "Size" => "40", "Description" => "Enter the email address notifications should be sent to", ), ); return $configarray; } function email_AdminCustomButtonArray() { $buttonarray = array( "Fix next due date" => "fixduedate", ); return $buttonarray; } function email_RegisterDomain($params) { global $CONFIG; $command = "Register Domain"; $message = "Domain: ".$params["sld"].".".$params["tld"]."<br>Registration Period: ".$params["regperiod"]."<br>Nameserver 1: ".$params["ns1"]."<br>Nameserver 2: ".$params["ns2"]."<br>Nameserver 3: ".$params["ns3"]."<br>Nameserver 4: ".$params["ns4"]."<br>RegistrantFirstName: ".$params["firstname"]."<br>RegistrantLastName: ".$params["lastname"]."<br>RegistrantOrganizationName: ".$params["companyname"]."<br>RegistrantAddress1: ".$params["address1"]."<br>RegistrantAddress2: ".$params["address2"]."<br>RegistrantCity: ".$params["city"]."<br>RegistrantStateProvince: ".$params["state"]."<br>RegistrantCountry: ".$params["country"]."<br>RegistrantPostalCode: ".$params["postcode"]."<br>RegistrantPhone: ".$params["phonenumber"]."<br>RegistrantEmailAddress: ".$params["email"]."<br>AdminFirstName: ".$params["adminfirstname"]."<br>AdminLastName: ".$params["adminlastname"]."<br>AdminOrganizationName: ".$params["admincompanyname"]."<br>AdminAddress1: ".$params["adminaddress1"]."<br>AdminAddress2: ".$params["adminaddress2"]."<br>AdminCity: ".$params["admincity"]."<br>AdminStateProvince: ".$params["adminstate"]."<br>AdminCountry: ".$params["admincountry"]."<br>AdminPostalCode: ".$params["adminpostcode"]."<br>AdminPhone: ".$params["adminphonenumber"]."<br>AdminEmailAddress: ".$params["adminemail"].""; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$CONFIG["CompanyName"]." <".$CONFIG["Email"].">\r\n"; return array( 'error' => '' ); } function email_TransferDomain($params) { global $CONFIG; $command = "Transfer Domain"; $message = "Domain: ".$params["sld"].".".$params["tld"]."<br>Registration Period: ".$params["regperiod"]."<br>Transfer Secret: ".$params["transfersecret"]."<br>RegistrantFirstName: ".$params["firstname"]."<br>RegistrantLastName: ".$params["lastname"]."<br>RegistrantOrganizationName: ".$params["companyname"]."<br>RegistrantAddress1: ".$params["address1"]."<br>RegistrantAddress2: ".$params["address2"]."<br>RegistrantCity: ".$params["city"]."<br>RegistrantStateProvince: ".$params["state"]."<br>RegistrantCountry: ".$params["country"]."<br>RegistrantPostalCode: ".$params["postcode"]."<br>RegistrantPhone: ".$params["phonenumber"]."<br>RegistrantEmailAddress: ".$params["email"].""; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$CONFIG["CompanyName"]." <".$CONFIG["Email"].">\r\n"; mail($params["EmailAddress"],$command,$message,$headers); } function email_RenewDomain($params) { global $CONFIG; $command = "Renew Domain"; $message = "Domain: ".$params["sld"].".".$params["tld"]."<br>Registration Period: ".$params["regperiod"].""; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$CONFIG["CompanyName"]." <".$CONFIG["Email"].">\r\n"; mail($params["EmailAddress"],$command,$message,$headers); } ?> 0 Quote Link to comment Share on other sites More sharing options...
ptomter Posted August 30, 2012 Share Posted August 30, 2012 It works now. Here it was a catching problem! Sincerly 0 Quote Link to comment Share on other sites More sharing options...
thernes Posted September 1, 2012 Author Share Posted September 1, 2012 Updated to 5.1.2 and now it works 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.