PDA

View Full Version : [REQ] User upload timeframe


Hellraiser
04-30-2005, 03:00 PM
Hello ppl,

I am interested in a script that will prevent a user from uploading within a certain timeframe. Can this be done with TCL? What say you?
Thanks

deo
04-30-2005, 08:28 PM
yes it can

Hellraiser
05-01-2005, 06:12 AM
Thanks Deo, but, can you show me how this can be done?

deo
05-01-2005, 07:21 AM
yes i can

Hellraiser
05-01-2005, 07:26 PM
So I see...

Hellraiser
05-04-2005, 10:55 AM
Howdy ppl,

I'm still looking for some decent help/tip.
Many thanks

mentality
05-31-2005, 09:03 AM
##[FTP_Pre-Command_Events]
##stor = %TCL ..\scripts\timeframe.itcl %[$flags]

set timeframe "16-20" ;# from "this hour-to this hour"
set exemptflags "1 M G" ;# obvious

proc return_hour {} {return [clock format [clock seconds] -format %H]}

proc check_flags {flags exemptflags} {
foreach flag $exemptflags {
if {[string match *$flag* $flags]} {
return 1
}
}
return 0
}

proc check_time {hour timeframe} {
if {$hour >= [lindex $timeframe 0] && $hour <= [lindex $timeframe 1]} {
return 1
}
return 0
}

if {[check_flags [lindex $args 0] $exemptflags]} {
return 0
} elseif {[check_time [return_hour] [split $timeframe -]]} {
iputs "530 No uploading allowed between these hours '$timeframe'!"
return 1
}


...something like that