[module] userGroups

I’ve probably misunderstood the above, as I thought I’d followed the index instructions correctly, but I’ve added a PRIMARY key:


CREATE TABLE IF NOT EXISTS `user_extension` (

  `ug_id` bigint(20) NOT NULL,

  `firstname` varchar(50) NOT NULL,

  `lastname` varchar(100) NOT NULL,

  PRIMARY KEY (`ug_id`),

  UNIQUE KEY `ug_id` (`ug_id`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1;

That would be wonderful! :)

:( Yep: I could see that… but that’s in the userGroups\views\_view.php, which I wouldn’t have thought would be using my extension????

I guess that means that the “$data” that’s been passed to it is the extension and not the profile??

[b]

OK: found it… it’s the path of the itemView[/b]

ok scribbly, here’s the implementation of user extension i use while i’m testing.

unfortunately here at work I don’t have access to my test db, so i had to create the db table by scratch, and i couldn’t test it.

the profile.sql contains the db table, the Profile.php is the model, the profile folder should be placed inside the views directory

to make userGroups aware of this specific extension you have to use Profile as the proper string on the userGroups settings:


'userGroups'=>array(

	'accessCode'=>'whatever',

	'profile' => array('Profile'),

),

http://creationgears.com/img/modules/userGroups/profileExtension.tgz

let me know if you are still experiencing some errors.

@veluroff

thanks a lot for helping him out :D

Nope: all good… now to find my errors… (I’ve even added some hobbies :) )

Did you see above I found that I used the wrong path?

+1

yep!

I’m glad you worked it out.

ps:

as you mentioned before I kept the profile at the minimum because every single application might have different needs for its users, so I didn’t want to put too much useless stuff and preferred instead to let you guys extend it as much as you liked it.

I hope you’ll enjoy it :D

I’m feeling a lot more happy tonight :D

A suggestion? Maybe you could include that small external as an example to build on?

Now, I’m trying to get my head around the lack of Controller… it was the Controller that mucked me up :-[

Now I’m off to try and get an avitar working :)

BTW: Thanks so much for the module and the help!!

you can actually use a custom controller for your update needs…

one of the few cases when you are forced to use your own controller for the update action is when you need to upload a file.

edit:

i think you are right, i get a lot of questions about how to actually implement user extensions… for the next release i’ll rewrite the documentation regarding that issue and will provide the hobby example

You know, when you’ve got nothing to do, you could probably write quite a few plugin external modules to install along side userGroups :lol:

or allow 3rd party uploads??

i’m totally up for third party userExtensions :P

as long as they are tested :D

right now i don’t have much time to buid some on my own, i’m too busy at work, preparing the 1.8 release of userGroups and another module first release :(

hello all

@nickcv: thank you so much for such a nice extension.

just a simple question: why you dont use Yii::app()->createUrl(route) instead of Yii::app()->baseUrl.route to get rid of urlManager configuration things?!

also there is homeUrl property provided that can solve the showscriptName issue

best regards

@nickcv: i found a bug:

in installation process, at initializeGroups() function, you add ROOT group with id=1

after that, you add user group without specifying id, which means letting db to choose an id,

for postgresql, you defined id as BIGSERIAL, which by default starts from 1, and this is where the error occurs (id=1 is created before),

I changed id BIGSERIAL to id BIGSERIAL START 2 and problem solved

I think the same bug would exist for mysql and others.

by presence of this bug, I wonder how installation works for others

Thanks a lot for notifying the bug.

It doesn’t occur under mysql because autoincrement fields automatically check for last value.

Weird thing is that i have several users using postgres and none of them reported such a bug, and they usually do so (take a look at the google project page) Are you sure that tris bug is not related to your own postgres installation settings?

this is the default setting of postgresql. I use postgresql 8.4, and the default minvalue for sequences is 1, also for 9.1 is so.

BIGSERIAL START 2 did not work too. sorry. the correct way to do this is altering the sequence after creating table (or create sequence before table, but not in front of BIGSERIAL as i stated before).

i don’t know where i can add the alter command (it’s not possible to add it right after creating table, because db cannot insert multiple commands into a prepared statement)

i dont know what the best fix is, but for now, i simply change the const ROOT value to 0 :)

maybe I’m doing something wrong, but I think I found another bug that is so weird that nobody reported this before :blink:

password of UseGroupsUser model can’t be null, but in invitation scenario, the password don’t get any value(=null), and invitation action try to save a new record to table. and that’s where the error occurs:


Not null violation: 7 ERROR: null value in column "password" violates not-null constraint. The SQL statement executed was: INSERT INTO "usergroups_user" ("status", "email", "creation_date", "username", "activation_code", "activation_time", "group_id") VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6) 

also, this is the case at passRequest senario, which password is explicitely set to null in beforeSave.

I’m pretty sure that when I tried this it stored a temp password…

But I’ll have another look tonight.

Hi nick,

I have installed your module. Its great, just what i needed. I want to add a new field called location to the add user form, i tried making some changes but all in vain. Can u please help me with this.

PS: i’m a total newbie. Jus 2 weeks since i’ve been using yii.

Any help would be really really appreciated.

Thanku

I came across something else today. In the admin panel if you want to change the Data or Access Permissions of a given user you can’t do so since it is requiring the users password.

Before I opened an issue on this I just wanted to check that I am using it as intended. I can just build scenarios here to overcome the rules here but wondering if there is another way to manage users?