User authentication

I am trying to connect the iBO's (version 10) up to a website with PHP. I have successfully managed to get PHP communication to our database via the iBO's.

One thing I cannot work out from the documentation is how to authenticate a user. Can someone give me any pointers on this?

I am not sure that my logic is correct. This is the flow of my routine so far:
Create an iboUserSecurity.CUser instance
Set UserObject->DBID
Set UserObject->UserID (ID number from Name table)
Set UserObject->Password (clear text)
Call UserObject->Validate()

At this point I would expect that the call to UserObject->Validate() would return TRUE if the userID and password match. Is my thinking in this area correct?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Is this iBO COM or iBO.Net?

Is this iBO COM or iBO.Net?

COM iBO

Sorry, should have mentioned that I am using COM iBO's.

I think you're pretty much

I think you're pretty much right, except that DBID is their ID from the Name table and UserID is their login name, whatever it is.

Thanks for that but still not quite working.

I am pretty sure that DBID is the dsn for the database.
If UserID is the login name, then what is UserName?
What is ContactID?

Here is my code so far:

// starting iBO's
$ibo_oUser = new COM("iboUserSecurity.CUser") or die("Unable to instantiate iboUserSecurity");
$ibo_oUser->DBID = "ODBC:iMISLive";

//validate user
//information from the Name_Security table
$ibo_oUser->UserID = "16611";
$ibo_oUser->UserName = "aaronf";
$ibo_oUser->ContactID = "aaronf";
$ibo_oUser->Password = "mycleartextpassword";
$ibo_oUser->Validate();

echo "Validated?: " . $ibo_oUser->Validate(); //This does not return with anything (True or False).

//free the objects
$ibo_oUser = null;

I am sure I am missing something simple!

CUser.Validate doesn't

CUser.Validate doesn't return a value; you need to check the CUser.Errors collection after you call it in order to see if the user was validated. (If CUser.Errors.Count = 0, it was successful; otherwise, you can use it to get the exact error messages(s).)

Thanks Eric

Many thanks for your help Eric, I knew it had to be something simple!

Changing a users password

Is it possible for a user to change their username/password from the iBOs?

I don't see a SubmitChanges() function in UserSecurity.CUser