Change user policies / group via an automated script + mySQL

Author Message

Magnus Olsson

Tuesday 03 January 2006 5:36:48 am

Hi,
I have a slight problem concerning how to manipulate a users usergroup via a SQL-query.

The application I'm coding is supposed to let a user insert a one time code (provided to her via SMS) into a table, and when the code is accepted by the system, it should place the user in usergroup Z

I've been searching through the database for some sort of cross-reference table that tells eZ that user X is part of usergroup Y but to no avail.

The ugly solution would be to make a separate table in the database, telling if user X has inserted the code and having the webpage query that table every time the user tries to access a restricted part of the site. But a solution just placing the user in the correct usergroup would be a lot prettier.

Any suggestions or pointers in the right direction is highly appreciated!

Xavier Dutoit

Tuesday 03 January 2006 9:24:04 am

Why don't you use the php classes provided by ez ? Much easier and robust than dig into the sql!

Setting the user right is based on its location of the user node. Have a look at the various code around (eg the one for the content move), but if you change the location of the user to a new usergroup, that should do it.

Let us know...

X+

http://www.sydesy.com

Magnus Olsson

Tuesday 03 January 2006 10:36:37 pm

Because I'm so new at this system (actually just helping a friend with my limited knowledge of PHP / MySQL) I didn't even know about class you mentioned.

Thanks for the tip, I'll go check the classes ASAP :)

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.