rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: MelkiyProd. on August 12, 2013, 10:37:20 PM

Title: Ban
Post by: MelkiyProd. on August 12, 2013, 10:37:20 PM
I create settings in the template. Need the code (button) to add the ban for ip address. Help me, plz.
Title: Re: Ban
Post by: rejetto on August 16, 2013, 09:07:13 PM
it's not easy.
there's no {.command.} for ban, so you have to change the HFS configuration, by using {.set ini.}

the string is in this form
ban-list=120.113.14.1#comment|22.242.21.2#other comment|

here you can see 2 ban rules, for 2 addresses.
If you are not a programmer this will be hard to get
Title: Re: Ban
Post by: rejetto on August 18, 2013, 03:44:21 PM
to manipulate an existing setting, you'll have to read the value, not just write it.
So, a side {.set ini.} i introduced {.get ini.} in version #285
Title: Re: Ban
Post by: MelkiyProd. on August 22, 2013, 09:54:49 AM
And how to display the list of banned accounts?  :)
Title: Re: Ban
Post by: rejetto on August 24, 2013, 12:00:17 PM
display? where? where are you stuck?
Title: Re: Ban
Post by: MelkiyProd. on August 25, 2013, 08:56:57 AM
I want to create a ban list in the template to see whom I added to the ban list  :) Is it possible?

P.S. I created the button for ban
Title: Re: Ban
Post by: rejetto on August 25, 2013, 01:04:18 PM
yes, it's possible. Since it's not native, you need programming skills.
read "ban-list", split it on the "|" character, then split again on the "#" character. Loop over them, just output the pieces.
Title: Re: Ban
Post by: MelkiyProd. on August 25, 2013, 07:14:05 PM
Can you write to me an example? :)