rejetto forum

Software => HFS ~ HTTP File Server => Topic started by: PP on January 27, 2010, 08:08:42 PM

Title: How to ban a user account?
Post by: PP on January 27, 2010, 08:08:42 PM
I can ban a user only from the IP, not from user account (the user can change the IP and reconnect again)
How to ban a user account?
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 27, 2010, 08:21:21 PM
I don't think there is support for that currently.
Maybe rejetto will consider this!
Good idea!
Title: Re: How to ban a user account?
Post by: SilentPliz on January 27, 2010, 08:29:18 PM
With the beta 2.3 #XXX make events script (alt+F6) like this.

eg:

[+request]
{.add to log|%user% is banned.}
{.if|{.=|%user%|rejetto.}|{:{.disconnect.}:}.}


Quote
having several usernames would be easy by using {.switch.} instead of {.=.}
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 27, 2010, 08:36:38 PM
it leaves a blank page when you ban using event scripts!
Can you have a custom user ban page?
Title: Re: How to ban a user account?
Post by: rejetto on January 27, 2010, 10:24:10 PM
go the the account properties and remove the "enabled".
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 28, 2010, 03:59:30 AM
thanks rejetto! :D  sometimes my head is in the clouds! ::)
Title: Re: How to ban a user account?
Post by: PP on January 28, 2010, 04:27:01 AM
go the the account properties and remove the "enabled".


It's a good alternative, but I would prefer to block a user with a message like "Under construction" (from ban option) because If he could not log in, I will receive a call immediately asking about this. :)
Title: Re: How to ban a user account?
Post by: rejetto on January 28, 2010, 03:18:30 PM
good news everyone!
from next version you'll be able to install this little script in ALT+F6

Code: [Select]
[+server start=every 5 seconds]
{.file changed|ban.txt|#banned.users.}

[+request]
{.set|b|{.from table|#banned.users|%user%.}.}
{.if|{.length|var=b.}|{:
{.disconnection reason| Hello %user%. You are banned. {.^b.}.}
:}.}

after you copy&paste this script, all you have to do is to create a file "ban.txt" in the same folder of hfs.exe using this format
Code: [Select]
mark=you are impolite
rejetto=you suck
uploader=sorry, temporarily disabled
other username=other reason for banning
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 28, 2010, 09:49:03 PM
Many thanks again rejetto! ;D  You are talking about #253 correct?
Title: Re: How to ban a user account?
Post by: SilentPliz on January 28, 2010, 10:03:04 PM
Quote
rejetto=you suck

Donate for it !  ;D

-----------------------------

thank for this script ! ;)
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 28, 2010, 10:05:43 PM
We have one tiny problem though!  When using this new ban feature the reason for ban does not show up in any other templates than the default and also disable macros.  Check the image out.  Template used is rawr 0.1.2.  Can this be fixed?
Title: Re: How to ban a user account?
Post by: rejetto on January 29, 2010, 09:35:09 AM
that's because the template you are testing is not using the needed feature (that's the %reason% in section [deny])
we should ask RAWR-designs to include it.
try right clicking on the root/home > properties > diff template
and paste this

[deny]
<h1>Unallowed</h1>
{.or|%reason%|This resource is not accessible..}
Title: Re: How to ban a user account?
Post by: uvbeenzaned on January 29, 2010, 10:26:51 PM
Thanks, it worked!
Title: Re: How to ban a user account?
Post by: r][m on August 28, 2010, 08:33:55 PM
that's because the template you are testing is not using the needed feature (that's the %reason% in section [deny])
we should ask RAWR-designs to include it.
try right clicking on the root/home > properties > diff template
and paste this

[deny]
<h1>Unallowed</h1>
{.or|%reason%|This resource is not accessible..}
Shouldn't this have been [ban]? from the main template section [ban] rather than [deny]?
Deny is the section presented to a user who has attemped to access a resource/file they
haven't been granted rights to, but they can continue to use the server.
Ban is the section a user see's when they can no longer log on at all.
Aparrently [deny] is the default in the server code, since I don't seem to be able to change it
so it will work correctly.
Title: Re: How to ban a user account?
Post by: rejetto on September 01, 2010, 09:40:26 AM
it's not [ban] because we are not using here the ban feature of HFS.
we are using a generic disconnection, through scripting. HFS doesn't know it's used for conceptual banning.

note: in recent betas, section [+request] can be simplified this way

{.set|b|{.from table|#banned.users|%user%.}.}
{.disconnection reason| Hello %user%. You are banned. {.^b.}|if={.length|var=b.}.}
Title: Re: How to ban a user account?
Post by: r][m on September 02, 2010, 05:24:30 AM
OK
Thanks for the code, I'm using something similar.

But for me, banned is banned, no matter if the method is
by IP address or by user name the result should be the same.
 When the user see's the banned page they understand what their
situation is. When they see the "Deny" page they just think the
server is screwed up, and rightly so. The "Deny" page is used here
for files in folders marked for "No download" with a link back to a
server INFO page with explanation.
Title: Re: How to ban a user account?
Post by: SilentPliz on September 02, 2010, 05:31:42 AM
F.A.Q updated !  ;)

http://www.rejetto.com/forum/index.php/topic,8383.0.html
Title: Re: How to ban a user account?
Post by: rejetto on September 02, 2010, 09:20:00 PM
@r][m
this is a "scripting" solution. It can't always match the quality of an "embedded" solution.
This said, we may get this working as you want. You can reprogram [deny] (as diff tpl) to load [ban] whenever %reason% has "ban" in it.

[deny]
{.if|{.pos|ban|%reason%.}|{:{.$ban.}:}|{:{.$deny|back=1.}:}/if.}
Title: Re: How to ban a user account?
Post by: r][m on September 05, 2010, 04:27:11 AM
@ Rejetto Thanks
This works
Code: [Select]
[deny]
{.if|{.pos|ban|%reason%.}|{:{.$ban.}:}|{:{.$deny|back=1.}:}/if.}
I changed it to ban2 and added that to the main tpl error section. The user now see's
a ip ban, user ban or deny page when those conditions exist.

It would be good to have user ban as an embedded solution for the stunnel users.