Jump to content
Sign in to follow this  
billchalmers

Opensrs existing clients module

Recommended Posts

The opensrs module that ships with whmcs is very good, but if you have existing opensrs users you have a slight problem using the module as the normal module stores the domain username & password when it registers the domain - opensrs is unusual as it requires a different username / password combo for each domain, you cant just use the reseller details and there is nowhere to put an existing opensrs domain username & password (if you know them).

 

I have created a module to allow integration with opensrs using the subscription field to store the username & password for the domain as I have no use of this field.

 

The module uses the open source opensrs-php library which is the same libary used by whmcs within the normal opensrs module.

 

Features supported:

 

Get / save Nameservers

Get / save Registrar lock

Get / save Contact details

Get EPP Code

Renew

 

NOT Implemented:

 

Register - you should use the normal opensrs module for new domains

All the DNS / Email Forwarding functionality

Transfer

 

The code is provided as is, dont blame me if it messes your system up, backup everything first.

 

Install instructions:

 

Create a new directory in your modules/registars directory called opensrsexisting and put the files in there.

 

Put your live / test api keys in the config section

 

Modify an existing domain - one which you have the opensrs domain username & password, put it into the subscription id field in the following format: username/password

 

Bill Chalmers

opensrsexisting.zip

Share this post


Link to post
Share on other sites

Hi Bill

 

Can you re-post? I cannot open the attached, it appears to be a corrupt archive.

I am interested in the fucntionality!

Share this post


Link to post
Share on other sites

Hi Bill

 

Thanks for creating this, I am in desperate need but unable to unarchive the file with the zip or rar extension. A file called country_codes.php does come up but no place to put the api key.

 

Help please.

 

Lester

Edited by zondotca

Share this post


Link to post
Share on other sites
Any feedback guys, does this mod work?

 

You do need to copy the Crypt & PEAR directories from the opensrs directory into the new opensrsexisting directory and it will work, yes.

Share this post


Link to post
Share on other sites

So I have set this up following billchalmers instructions (thank you billchalmers) and added the Crypt & PEAR directories (thank you for the reminder w1zard). However I still get the following error when I save changes with the userid/password entered and opensrsexisting selected.

 

Registrar Error

Authentication Error.

 

Any suggestions folks?

Share this post


Link to post
Share on other sites
The opensrs module that ships with whmcs is very good, but if you have existing opensrs users you have a slight problem using the module as the normal module stores the domain username & password when it registers the domain - opensrs is unusual as it requires a different username / password combo for each domain, you cant just use the reseller details and there is nowhere to put an existing opensrs domain username & password (if you know them).

 

I have created a module to allow integration with opensrs using the subscription field to store the username & password for the domain as I have no use of this field.

 

The module uses the open source opensrs-php library which is the same libary used by whmcs within the normal opensrs module.

 

Features supported:

 

Get / save Nameservers

Get / save Registrar lock

Get / save Contact details

Get EPP Code

Renew

 

NOT Implemented:

 

Register - you should use the normal opensrs module for new domains

All the DNS / Email Forwarding functionality

Transfer

 

The code is provided as is, dont blame me if it messes your system up, backup everything first.

 

Install instructions:

 

Create a new directory in your modules/registars directory called opensrsexisting and put the files in there.

 

Put your live / test api keys in the config section

 

Modify an existing domain - one which you have the opensrs domain username & password, put it into the subscription id field in the following format: username/password

 

Bill Chalmers

 

hi, one doubt, with the default module opensrs can not do the function before say?

Share this post


Link to post
Share on other sites
i have the follow error:

 

Registrar Error

Authentication Error.

 

any suggestions

 

I too am getting this error. Communication between the server and the Tucows API is successful.

 

Any ideas?

Share this post


Link to post
Share on other sites

I'm having the authentication error as well. Going to call OpenSRS tomorrow but wish there was some insight to this... Seems like absolutely 0 documentation is availabe.

Share this post


Link to post
Share on other sites

Aside from the authentication error - which I am hopeful for an answer, I don't understand how to actually get the domain name into WHMCS in the first place? When I go to add a domain under the client my only option is the register/transfer a new domain as a new order to get it into the database, which defeats the purpose of this great addon.

 

What am I missing to add an existing domain without going through the register/transfer process?

 

Thanks!

 

Phil

Share this post


Link to post
Share on other sites

I think I got this figured out guys. There seemed to be some problem with the code thinking the domainid for the session was good, so it wouldn't create a new one. I'm just forcing to always lookup the domain info. I commented out a couple lines in opensrsexisting.php and it's working, yay.

 

Here's what I changed. Just look for the "#" in the code and do the same in yours:

        //If the passed param is different to the session domain id, then we need a new cookie
       #if($params['domainid'] != $_SESSION['domainid'])
       #{
               /** Get domain details **/
               $domainAuth = getDomainUserPass();
               $domain_username = $domainAuth[0];
               $domain_password = $domainAuth[1];
               $fulldomain = $params['sld'].".".$params['tld'];

               /** Create command object **/
               $cmd = array(
                               'action'        => 'set',
                               'object'        => 'cookie',
                               'attributes'    => array(
                                               'domain'        => $fulldomain,
                                               'reg_username'  => $domain_username,
                                               'reg_password'  => $domain_password
                               )
               );

               /** Get the global srs class **/
               $O = $GLOBALS['OpenSRSExisting'];

               $result = $O->send_cmd($cmd);

               //write the current domain id into the session
               $_SESSION['domainid'] = $params['domainid'];

               /** If we get a sucsessful cookie from opensrs update the domain expiry and put the cookie into the session **/
               if(isset($result))
               {
                       $exptime =  strtotime($result['attributes']['expiredate']);

                       if($exptime)
                       {
                               $expiredate = date("Y-m-d",$exptime);
                               $query = "UPDATE tbldomains SET expirydate = '".$expiredate."', nextduedate = '".$expiredate."' WHERE id = ".$params['domainid'];
                               mysql_query($query);
                       }

                       if(isset($result['attributes']['cookie']))
                       {
                               $_SESSION['OpenSRSCookie'] = $result['attributes']['cookie'];
                       }
                       else
                       {
                               unset($_SESSION['OpenSRSCookie']);
                       }
               }
       #}

 

- Brian

Share this post


Link to post
Share on other sites

Is anyone else is having a simular issue? I am using WHMCS 4.2.1, when i'm in the admin area I'm able to edit and manage a domain using the Opensrsexisting module assigned to the domain, but it seems when i'm logged in the client area lookups to OpenSRS don't seem to work correctly.

 

I've modified the following code for client area to work correctly:

 

#1 Change the call to the getDomainUserPass function.

 

$domainAuth = getDomainUserPass($params['domainid']);

 

#2 I modified the getDomainUserPass function to accept a param and do an SQL lookup of the domain to get the subscriptionid field which contains the user/pw.

 

function getDomainUserPass($domainid)
{
       /** Domain username & password from subscription id field**/
       $query = "SELECT * FROM tbldomains WHERE id = ".$domainid;
       $result = mysql_query($query);
       $row = mysql_fetch_assoc($result);
       $user_pass = $row['subscriptionid'];
       #if(empty($_SESSION['data']['subscriptionid']))
       #{
       #       $user_pass = $GLOBALS['subscriptionid'];
       #}
       #else
       #{
       #       $user_pass = $_SESSION['data']['subscriptionid'];
       #}

       $auth = explode("/", $user_pass);
       return $auth;
}

Share this post


Link to post
Share on other sites

Just add current username/password for the domain (which you get from the OpenSRS controlpanel) to the subscription ID field in the domain overview in WHMCS.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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