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). 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
|
||||
Posts: 8601
you can visit Site Admin / Users, pick "edit" for a user and select "Lock user".
Posts: 3
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.
Posts: 8601
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.
Posts: 3
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.