Posted: Thu Nov 30, 2006 11:06 am Post subject: Generic external auth php script?
Hi All,
Anyone have a working example php script that could be used as a replacement for the phpbb auth.php system?
I want to intergrate our current db system, so I don't think installing a completely seperate forum system is ideal, and since we already have a database with the required information, all I need is a php script where I can tell it the host / db information.
ok, this is making a little more sense now...
So your Auth.php that is in your example is what I'm looking for.
By changing the table / field names, then linking the gamecreate external auth setting to this script, I should be ready to go, right?
This function returns:
* Id
* Name
* Nickname (deprecated)
* Username
* Email
You need to reply with the appropriate information for that user.
In phpBB, the 'user_id' column holds the unique user ID, your database may be different (ie just 'id' or something else). This must be a unique value that cannot ever change.
It's important to not remove any functionality from these calls.
Also notice:
if($row['user_id'])
return null;
This means return NULL (ie, no result) if the requested user id did not exist.
Be sure to not remove functionality from the methods.
Now,
Does the use of the external auth system mean that any user returned with these function have access to the booking, or does gamecreate still use a list.
In otherwords... Do I need to filter these users to prevent them from being seen by gamecreate...
If you use External authentication, ANY user permissions etc are tied to users your external users, it does NOT use GameCreate's internal users anymore, ever.
What I mean is that auth.php will return ANY registered user from phpbb, and as such any user who is registered at the web site has the ability to book a temporary server time.
So to prevent this, another field must be added to say if they can use it or not, then add the sql filter to auth.php to filter out non-authorised users.
I wish to insert the users name and ID into the GCPgae.php file
I'm using phpbb 2.0.20, and would like to just add the username and ID from the current user session data..
What I mean is that auth.php will return ANY registered user from phpbb, and as such any user who is registered at the web site has the ability to book a temporary server time.
So to prevent this, another field must be added to say if they can use it or not, then add the sql filter to auth.php to filter out non-authorised users.
Correct?
Pretty much yes.
auth.php (in the example) returns any users - If you simply return a null result for a user requested then GameCreate wont be aware of it.
However if you return a valid user, and then decide later to not return one - the user may still be logged into the website by their session.
Quote:
Permissions are still controlled by gamecreate, not the external auth system right?
Of course. You can just 'search' for users in the Permissions tab by email for example or username, and find users inside your database.
However we offer Web Services which allow some remote control of GameCreate so far.
Quote:
Think you could look at adding a function to return a couple of permission flags from the external auth system?
I changed the code to match your example.
( which is what I started with.. )
And I'm getting the same error I was getting from the start.
Quote:
Sorry, an unknown error occurred preventing GameCreate from processing your request.
GameCreate administrators have been notified of this problem.
If you wish to create a Support Ticket about this problem,
please include this Error ID: UAXY-NFLS.
I verified this by replacing the GCPage.php with a fresh downloaded one, and changed the userinfo section. So, I'm still stuck with what is happening to the userinfo. It seems to be disappearing. The userinfo is fine up until the GC_RenderPage function is called. ( I had traced this earlier. ) This is with php 5.
Notice that the username and password are empty.
This is what I'm talking about. I can trace their existance up to the point where I call 'require "GCPage.php";'
From that point on, it seems to wipe out my session data, and leave the $userdata array empty.
// Request the 'Edit' page from GameCreate Bookings (View, List, or Edit) pages are available
// See GCPage.php for runtime configuration information
GC_RenderPage('Edit');
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum