Ban Users Module + questions

Manel

Joined: 2007-02-13
Posts: 3
Posted: Tue, 2007-02-13 18:02

I'm working on a module to ban users. I want to disallow access to the gallery to some people, that once registered had made some abusive/offending comments, but I don't want delete the comments/rating/images that have made (the good ones).
Looking at the quotas module, I've created the table and maintenace to ban/unban users (I attach this little module), but I don't know how to add the following actions:
1. I want to check when a session is valid if the user is banned. If the user is banned, I will revert to the user guest.
2. I will make the same check when the user logins.

I've read throug the documentation and tried to register an eventlistener for Gallery::login, but for sure I'm doing something wrong because nothing happens, and my callback function is never called. There is any clear sample or how-to to make this kind of integration?

Thanks in advance,

Manel

AttachmentSize
banuser.tar_.gz5.53 KB
 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2007-04-14 00:44

you can visit Site Admin / Users, pick "edit" for a user and select "Lock user".

 
Manel

Joined: 2007-02-13
Posts: 3
Posted: Mon, 2007-04-16 15:09

Thanks for your response, but when you lock a user, this user is unable to change their data, but he can continue comenting pictures, uploading pictures and rating pictures.

Our problem is related to conflictive users, users that maybe have upload pictures, or made correct comments once time ago, but now they are creating troubles making offensive comments. I can delete the user, but he can reregister with the same name. The main idea is moderate gallery like a forum, and be able to block a user, and disallow him to participate but without delete the content that him has upload previously.

Is for this reason that I'm trying to make a new module that can "ban" a user.

Any suggestion please?

Thanks in advance,

Manel

P.D.: english is not my primary language, if I have not explained clearly do not hesitate to ask me more information.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2007-04-16 17:48

you're right.. I totally forgot what the "lock user" feature was for.

your approach looks right.. a site admin screen to manage banned users, and an event listener to block logins for those users. rather than check every request for every session, I suggested deleting all sessions for a particular user when that user gets banned. since they can't login anymore due to the check at login time, this is sufficient.

modules/useralbum/module.inc is a good example of using the Gallery::Login event (make sure to use capital L). if you still have trouble, maybe post the event handling code you're trying.

 
Manel

Joined: 2007-02-13
Posts: 3
Posted: Wed, 2007-04-18 14:12

Finally I've reinstalled galllery from scrath and finally I got it!! I don't know for what reason I never get the event (and I've checked the capital L).

When I finish the module I will share, maybe anyone have the same problem and can use it.

Thanks for your help.