1
I have a question about some code in the core. This may have been changed in more recent versions. It might not have either. Here goes...
In the change function, your basically setting up the XOOPS User account with data pulled from somewhere else. In my case, it's from a LDAP. My problem is the email field. Sometimes, an e-mail address isn't present in the LDAP for a given user account. When this happens, the change function tries to load in the e-mail (which is an empty string) and gets an error. This is because the XoopsUser object is defines e-mail as a required field.
So there seems to be a slight disconnect here. Now, I could update the core very easily and literally "create" the e-mail address in real time since our company's e-mail addresses are
name@company.com ... and we have the name they logged in with. So, I can solve this problem for myself. The general XOOPS community, however, might have a bit of a problem. There should be some error handling in this function to account for required XoopsUser fields that are not present in the $datas variable. It errors out right now. That's OK, I suppose. But the result is that some subset of your users simply won't be able to log on if there is something wrong with their LDAP account. Compounding this is the fact that they won't know it's their LDAP account that's the problem and may never need to bother with even trying to tell you (the webmaster) about the problem.
It would probably be better if the "Xoops-Auth server fields mapping" parameter in the "Authentication Options" screen would allow you to not only define field mappings, but also designate default values for those fields if they are missing (or maybe if they are missing *and* required).
Bonus points if you can specify certain variables so that you can create default values on the fly. For instance instead of this value:
Quote:
maybe you could expand it into something like this:
Quote:
name=cn|email=mail;{name}@company.com
The above would mean that the name variable in XoopsUser gets the cn field in the LDAP database. The email variable in XoopsUser gets the mail field in the LDAP database. But if that value is missing, it gets the name of the user plus "@company.com" as the value instead. The {name} means use the name variable that's already defined and the rest is just a literal string.
Does anyone else think this is a good idea. My vesion is a little old now, maybe this has already been worked on. I wish I had a little more time or I'd implement it myself and provide the code. Wait long enough and I just might do that! :)