[phplib] Re: How do I create user variables when a new user is created? From: Matthew Leingang (leingang <email protected>)
Date: 12/08/00

Garry,

That is a bona fide Good Question (tm). As far as I can remember,
new_user.php3 only messes with the auth_user, table, and not the
active_sessions table where the user data is stored. You can write
functions that will make those database updates if you want to set up a
stock of default variables.

Another thing you can do is put them into your user class. When user
information is thawed out at during page_open, you can check for the
existence of the variables you want. If they don't exist, initialize and
register them.

Of course, you can get terribly fancy with an approach of the first class.
You'll really be extending the usefulness of new_user. Good luck!

--Matt

----------------------------------------------------------------
Matthew Leingang http://www.math.rutgers.edu/
Rutgers University leingang <email protected>
Department of Mathematics "This signature needs no quote."

On Fri, 8 Dec 2000, Garry Dunn wrote:

> To all,
>
> I'm using the PHPLIB new_user_md5 file to allow an administrator to create
> new users. I'd like to add to that page so when a new user is created, I
> start him out with a set of default variables.
>
> On the new_user_md5() page, I can't just use $user->register(), because I'm
> not logged in as that user (I'm the administrator at that point). I
> suspect I will have to manually run some insert queries on the user
> database to do this, but that seems harder than it should be.
>
> Is there an easy way to do this? I'd like to have the variables set before
> the user logs in for the first time.
>
> If there is an archived discussion about this, please let me know. I
> couldn't find one.
>
> Thanks in advance,
>
> Garry
>
>
> --acaflcdjekgekhenocjm--
>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>