Custom User Authentication

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
zeddicus
User
Posts: 9

Custom User Authentication

Post by zeddicus »

Hi All,

I have an application (third-party) that I use. I am using phpmaker as the reporting site for the applications data. It is going very well. I just have one issue I am trying to figure a way around.

I am using custom login, so I followed a post here, that suggested to create a mock table of the user table, and then in the connection hook, change the connection to the other database.
This works flawlessly.

The thing is now, that the client wants to allow access to certain pages of the report based on the group defined in the application.

The user table for auth is different to what phpmaker expects. The User Uid is an alphanumeric 32 char string, and so is the group uid.

So I thought to perhaps just find a hook on load of the page to fire off a query to the database, check the users group uid, and if its matches the requirement, then allow it to continue, otherwise redirect the user.

I cant seem to figure out the last part of this plan, redirecting the user in this situation.

If anyone can help me figure this out, it would really really help me out.

Thanks in advance,
Zedd


Webmaster
User
Posts: 9430

Post by Webmaster »

Use User_LoggedIn server event (fired after successful login, see Server Events and Client Scripts in the help file) to query you database and check want you need to check, if not allowed, redirect the user, e.g.

$this->Page_Terminate("Your URL");


Post Reply