Jump to content

WHMCS + Invision Power Board (IPB) Loginshare


nielsenj

Recommended Posts

This file will help you create a loginshare for Invision Power Board (IPB) and WHMCS.

 

Users logging into IPB with an email and password will be validated against the WHMCS client database (their main email address and password).

 

- If they exist IPB will create a local account for them and ask for a display name.

 

- If they do not exist IPB will forward the user to the client registration form of WHMCS.

 

Clients modifying their email in WHMCS will be updated in IPB's members table so that the users stay in sync.

 

Existing administrators for IPB log in with their previous information as usual.

 

 

Requirements:

 

- WHMCS 3.6

- IPB 2.3.4 (Only tested version, may work on other versions with external authentication abilities)

- General knowledge on how to edit files on a server

 

Known issues:

 

- To automaticaly sync client emails it must be done through the client area. Changing an email on the administration side will require the administrator to log into IPB and update the client's email manually.

 

Special notes:

 

- Synching information requires the use of PHP syntax in your clientarea template. If you don't like this you can skip that part but you will have to either disable client email changes or update their information manually in IPB.

 

Link:

 

http://www.mcintegrator.com/downloads/IPB%20Loginshare.zip

 

Regards,

J

Link to comment
Share on other sites

This code looks like it is missing a return statement so that anyone can login with any password (as long as the username is correct)!

 

Here is the code to fix:

 

In the method authenticate find:

if ( ! $this->_authenticateWHMCS( $username, $password ) )
	{
		$this->return_code = 'WRONG_AUTH';	
	}

 

Replace with

if ( ! $this->_authenticateWHMCS( $username, $password ) )
	{
		$this->return_code = 'WRONG_AUTH';
		return;
	}

Link to comment
Share on other sites

Thanks for that edit, Danami.

 

However I'm currently having trouble with just login in with my admin email address (which was registered before I added the login script.

I can login to the ACP fine, however when the board is offline, I'm finding it trouble when logging into the forums.

 

It just says it doesn't recongise me.... Any help? :)

Link to comment
Share on other sites

Thanks for that edit, Danami.

 

However I'm currently having trouble with just login in with my admin email address (which was registered before I added the login script.

I can login to the ACP fine, however when the board is offline, I'm finding it trouble when logging into the forums.

 

It just says it doesn't recongise me.... Any help? :)

 

I think this problem is because the root admin login info is stored only as the username in places and not the full email. Check the db record for the login you are using and see. Make sure that the "member_l_username" and "email" fields in the members table is set to the full email for the admin. I remember having this problem also and doing a manual edit to the record to the full email fixed it.

Link to comment
Share on other sites

Ok, long story short danami is correct, that edit in "auth.php" is the fix. It was accidentally removed when taking out the debugging info.

 

As for the admin login it has wierd restrictions, you should be able to log into the adminCP still without issue using your original setup username and password. Logging in as Admin to the board is a problem and i'm tracing it through the IPB code. I know of a work around but i'd like to see it properly ues the IPB functions. Basically IPB wants you to use converge, when you really shouldn't have to.

 

 

Now, covering a VB mod, please use another thread to discuss it as this is a thread for the IPB loginshare. You'll get better responses if you dedicate a discussion to it rather than hijacking this thread. Thanks.

 

PS: i'm having issues with this proxy while travelling so i can't update a fix to the original install. I'll update the thread when i manage to do so. It should also have a fix for admin logins into the board.

Link to comment
Share on other sites

Sorry AVeal,

 

It's been one of those types of weeks.

 

I've looked into the IPB code and it's basically checking the converge portion of the DB in IPB to validate admin logins.

 

Frankly, this is stupid as converge isn't enabled by default so default admin accounts arn't created in it.

 

That being said, adding the admin account to the converge portion of the DB should fix this issue (but i havn't tested that theory) and allow locally created admin to login using their email.

 

I havn't had time to code an alternative that works without converge, my goal is the end of the weekend/early next week when things lighten up a bit and i'm back home.

Link to comment
Share on other sites

Thank you for your feedback danami.

 

It is done without hooks and it is possible, it's just not an ideal situation as it requires smarty php execution.

 

I've looked at your instructions included in the module .. Adding code in the client side smarty templates is fine .. but it doesn't help when someone changes an email address in the WHMCS admin backend .. then everything gets out of sync .. only the proper hooks would work.

Link to comment
Share on other sites

You are correct, as it is stated in the documentation. It doesn't make it a waste of time and it's fairly easy to log in as the client to make the modification.

 

It looks like we won't need to ... Matt is adding all the proper action hooks that get called in both the frontend and backend ... so now you can really do true member syncing :)

Link to comment
Share on other sites

Any update on the fix Nielsenj?

 

This is a great mod; I look forward to being able to login again ;)

 

AVeal,

 

Here's the scoop, i double checked everything and i can log in as the root admin created during the installation.

 

That is, by default, the user local authentication checks for.

 

Can you clarify what type of admin you are trying to authenticate?

 

I have tested it against the root admin (created during the initial installation) as well as administrators who are created from a whmcs login. (ie, i've logged into IPB with my WHMCS credentials and set that user in IPB to the admin group).

 

Both of the above have worked, you log in using the email associated with either account.

 

Also note, it authenticates against IPB's 'converge' table. Meaning if you've modified converge settings that may have an impact on it.

 

 

DOWNLOAD UPDATE:

 

In any event, an updated file is located at the download link in the initial post.

 

For those of you with the first release, you only need to overwrite /WHMCS/auth.php and that will correct issues with improper authentication of standard users.

 

Pleaste notify me of other issues via email or this thread so i can fix things when i have spare time.

 

When Matt releases updated actionhooks the mod will be updated to take advantage of those features.

 

Best regards,

J

Link to comment
Share on other sites

Great!

Thanks for the update; I think it's because I was playing around with Converge on this board; I reinstalled it anyway, and it works all fine now.

 

Can you login on the main board when it is set to offline though?

It's not a big deal, anyway.

 

Thanks again.

Link to comment
Share on other sites

  • 2 months later...
works fine, really great mod, now, is there anyway we can create a link in the header.tpl that sends to ipb the whmcs username and password so when they click they will only get the thanks for login redirect?

 

I'm sure with a direct post to IPB that it would be possible.

 

Now that WHMCS has the actionhooks for username change etc i'll be updating the mod to take advantage of these changes. I'll look into this at that point.

Link to comment
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.

  • 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