Users management

102 views
Skip to first unread message

MauMau

unread,
Jul 5, 2013, 6:03:25 AM7/5/13
to uf...@googlegroups.com
I'd like to manage other users changing its password, name, surname etc.
I tried something like:

            $nuser = new uFlex();
            $nuser->getRow(Array($select => $uid));   
            $data=array("first_name"=>"Mau");
            $nuser->update($data);

but it runs only on current user.
How can I solve?

Thanks.

Pablo Tejada

unread,
Jul 5, 2013, 9:03:37 AM7/5/13
to uf...@googlegroups.com

As stated here http://crusthq.com/projects/uFlex/ managing other users is out of the class.

However you could extend the uFlex class and add your own methods. For example you can create a updateUser method which will globally update any user. The source of the original update method could be used, just remove the part where it checks if the user is signed and satisfy the dependency of a user id.

There is another thing you could try, and is cloning your instace of uFlex. This is usually used by people who want a signed in user register other users which can kinda of fall under the user management topic. I have not try it my self but you could try it. Assuming $user is your instance of uFlex:

$nuser = clone $user;

$nuser->id = $userIdToManage;
$nuser->signed = true;

$nuser->update("first_name" => "Mau");

In the future I would to implement some kind of a factory that would implement full user magement features.

--
Project's home page http://crusthq.com/projects/uFlex/
---
You received this message because you are subscribed to the Google Groups "uFlex" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uflex+un...@googlegroups.com.
To post to this group, send email to uf...@googlegroups.com.
Visit this group at http://groups.google.com/group/uflex.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

MauMau

unread,
Jul 8, 2013, 5:25:03 AM7/8/13
to uf...@googlegroups.com
Great, thank you.
I'm implementing users management cloning the instance of uFlex. It's very simple and immediate.

Only an edit in the update row:

$nuser->update(Array("first_name" => "Mau"));

instead of


$nuser->update("first_name" => "Mau");


Reply all
Reply to author
Forward
0 new messages