Re: [Phplib-users] Editing user variables?
Brought to you by:
nhruby,
richardarcher
From: Nathaniel P. <np...@te...> - 2003-08-27 22:32:39
|
----- Original Message ----- From: "Andy Fundinger" <an...@bu...> To: "'Nathaniel Price'" <np...@te...> Sent: Wednesday, August 27, 2003 2:57 PM Subject: RE: [Phplib-users] Editing user variables? > Would I be misusing the library if I tried to store user profile-type data > in user variables? Generally, yes. Since the sort of data that you are talking about needs to be searchable and easily editable by other users, User variables will just gum up the works. I only use user variables for things like preference settings -- stuff that you'd like the system to remember, but don't necessarily need to be able to search for or edit very often. > Are there common/example ways to store data like real > name, location, company name, E-mail address etc. in a system using phplib? > I'd want this sort of thing to be listable, searchable, and editable by > other users. I don't know about anyone else, but I just use the database to store that info directly. The easiest way to do it is by adding columns (such as realname, location, company, email, etc.) to the auth_user table. Then, if you want PHPlib to be aware of these values, just extend it so that it takes those values from the database and does something with them. For example, in your subclass of Auth, while PHPlib is querying for the username and password data for the login process, you could easily extend that query, and put the resulting data into a global variable. It's not strictly required to do that, but it may be useful if you were depending on the data that was in the User variables in your app. As for searching, listing and editing users, you'd probably want to come up with your own interface to that. Since it's just database data, you'd use the same methods to edit it as you would with any other database. PHPlib /does/ come with an example interface for editing users; take a look at the new_user.php script (it comes with your PHPlib distro under the pages/admin/ directory). Hopefully that can give you an idea of where to start. _________________________________ Nathaniel Price Webmaster <http://www.tesseract.net> |