Old 03-05-2005, 06:29 AM   #16
kiezz
Junior Member
 
Join Date: Feb 2004
Posts: 27
Default Trial And Auto Del User

I'm testing a new version, 3.0, it have a basic trial, !rank and few improuvement.
About deluser i'm thinking about but is not so easy.
I've see whit my personal experience the people often don't set correctly affils/excluded groups.
Often site's clock can be not set correctly , maybe the hour is wrong (+- 1 at least) can false the last day's quota.
Another problem is the eggdrop doing recursive ftp command can crash, that can stop the delete process.
The last problem i've see is related to glFTPD, if you do site monthup it give only users who have uploaded 1+ MB , if a user have uploaded 0 Mb he will not be displayed.
I think a check on the first day of month is needed, on the next days i'll try to make some test about that.
ByE
kiezz is offline   Reply With Quote
Old 03-05-2005, 09:55 AM   #17
jeza
Senior Member
ioFTPD Scripter
 
jeza's Avatar
 
Join Date: May 2003
Posts: 530
Default

check this
Code:
    set iojTQ(year)			[clock format [clock seconds] -format "%Y" -gmt true]
    set iojTQ(month)			[clock format [clock seconds] -format "%m" -gmt true]
    set iojTQ(time_month_begin)		[clock scan "$iojTQ(month)/01/$iojTQ(year) 00:00:00" -gmt true]
    set iojTQ(nmonth)			[expr int([format %f [clock format [clock seconds] -format "%m" -gmt true]])+1]
    if {$iojTQ(nmonth) == 13} {
      set iojTQ(nmonth)			1
      set iojTQ(year)			[expr $iojTQ(year)+1]
    }
    set iojTQ(time_month_end)		[clock scan "$iojTQ(nmonth)/01/$iojTQ(year) 00:00:00" -gmt true]
jeza is offline   Reply With Quote
Old 03-07-2005, 12:21 PM   #18
kiezz
Junior Member
 
Join Date: Feb 2004
Posts: 27
Default

Hi jeza , i'm glad you are looking on my project .
Tcl 8.5+ bring new improuvment on clock command , very very usefull:
(http://www.tcl.tk/man/tcl8.5/TclCmd/clock.htm)

clock add timeVal ?count unit...? ?-option value?

I've tested this under Linux , whit this is very simple, also for trial time across month end.
My code whit this is :

set u_trial [lindex $text 0]
putlog "user in trial: $u_trial"
set trial_list [open $cts(progdir)/cts/logs/cts.trials.users a]
set now [clock format [clock seconds] -format {%m/%d/%Y@%H:%M:%S}]
set c_now [clock seconds]
---> set a [clock add $c_now $cts(tday) days] <-----
set end [clock format $a -format {%m/%d/%Y@%H:%M:%S}]
puts $trial_list "$u_trial|$now|$end"
close $trial_list


However on Windrop is unrecognised (do to tcl 8.4), whitout that the code is:

set u_trial [lindex $text 0]
putlog "user in trial: $u_trial"
set trial_list [open $cts(progdir)/cts/logs/cts.trials.users a]
set now [clock format [clock seconds] -format {%m/%d/%Y@%H:%M:%S}]
set day [clock format [clock seconds] -format {%d}]
set nday [expr $day + 7]
set month [clock format [clock seconds] -format {%m}]
set year [clock format [clock seconds] -format {%Y}]
set time [clock format [clock seconds] -format {%H:%M:%S}]
set c_now [clock seconds]
set end "$month/$nday/$year@$time"
puts $trial_list "$u_trial|$now|$end"
close $trial_list

But the problem is if you want start a trial of 7 days starting the 28 you get the end trial day on 35 ....

Thanks for help , ByE
kiezz is offline   Reply With Quote
Old 03-07-2005, 08:21 PM   #19
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

If I may make a suggestion: I think most people would find dynamic trial/quota periods to be better than static periods. What does this mean? It means the periods don't depend on calendar weeks/months. So for instance, trial doesn't start on Sunday and end on Saturday and quota doesn't start on 1st and end on 30th. Using dynamic periods, trial starts the day user was added and ends 7 days after and quota starts the day user was added to a quota group and ends 30 days after. This way users always get a fair trial/quota period and 'user managers' don't have to worry about time of week/month they add users. I'm not sure if it's harder to code it this way or maybe it can even offer a solution to the calendar problem you mentioned (if we can move away from using calendar days). If you want an idea how to do it just take a peek at ss-trial because it has dynamic trial periods.

But, if this way is harder for you then forget about it. Working trial+quota across slaves is more important than having it be dynamic.
PopWeasel is offline   Reply With Quote
Old 03-08-2005, 02:03 AM   #20
jeza
Senior Member
ioFTPD Scripter
 
jeza's Avatar
 
Join Date: May 2003
Posts: 530
Default

i use this - io example
get date from SysOp.log


Code:
proc iojTQ:DateAdded { user } {
...
      if { [lindex $n 5] == "io" } {
        if {[regexp -nocase -- ".*created user '$user'.*" $line]} {
          #if { $iojTQ(debug) } { putlog "..iojTQ...: $line" }
          set iojTQ(date_found)	true
          set temp		[split [lindex $line 1] "-"]
          set iojTQ(time)	[clock scan "[lindex $temp 0]/[lindex $temp 1]/[lindex $temp 2] [lindex $line 2]" -gmt true]
        }
      };#io
...
}

set iojTQ(date_added) [iojTQ:DateAdded $iojTQ(user)]

...

set iojTQ(trial_end) 		[expr $iojTQ(date_added)+[expr $iojTQ(trial_days)*86400]]

if { $iojTQ(trial_end) <= $iojTQ(time_now) }
  -> failed


...
jeza is offline   Reply With Quote
Old 03-09-2005, 11:29 AM   #21
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

Question: how to get tagline to show in top10 output?
PopWeasel is offline   Reply With Quote
Old 03-13-2005, 01:23 PM   #22
Sjon
Junior Member
 
Join Date: Jan 2004
Posts: 9
Question

lo m8 great work on CTS i love it!

but can you plz tell me how the summary is working ? (maybe someone else ? ) cause when i do !summary all it says is ... "I CAN'T FIND THE FILE WHIT THE SUMMARY OF MONTH's END" so i search for some save options but cant find them plz help cause i think this is very handy..
Sjon is offline   Reply With Quote
Old 03-13-2005, 07:03 PM   #23
typhon|wk
Member
 
Join Date: Nov 2003
Posts: 55
Default

how can i fix this error ?

[23:30] Tcl error [cts-quota:end.quota.ontime]: couldn't open "scripts/cts/logs/cts.quota.day.13:03:2005": invalid argument

im getting it every day.
typhon|wk is offline   Reply With Quote
Old 03-19-2005, 07:47 PM   #24
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

kiezz, your post about v3.0 sounds promising, have you been able to make any progress with it? Let me know if you'd like any collaboration on your project, I'll try to help if I can. I can't code but I can offer feedback and give input on features.
PopWeasel is offline   Reply With Quote
Old 04-09-2005, 06:23 PM   #25
PopWeasel
Senior Member
ioFTPD Scripter
 
Join Date: Feb 2004
Posts: 181
Default

How about adding a !rank cmd?
Quote:
<user> !rank johnny
<@bot> MONTH-RANK -> johnny/lewsers is #23 with 221F @ 4.4GB (avg. speed 5.7MB/s) needs to upload 161.7MB to beat mary/workers
Showing number of files and the speed they were upped isn't important, but you get the idea...
PopWeasel is offline   Reply With Quote
Old 04-11-2005, 09:43 AM   #26
CyberAL
Banned
 
Join Date: Jul 2004
Posts: 22
Default

is there any way to get this script to work with blowfish?
CyberAL is offline   Reply With Quote
Old 06-05-2005, 09:52 AM   #27
foxmaster
Member
ioFTPD Foundation User
 
Join Date: Sep 2004
Posts: 31
Default

Having a bit of truble using !passed error I get in partyline is [16:48] Tcl error [cts-quotaassedasync]: syntax error in expression "round(STAFF)": variable references require preceding $

someone have any ide ?

Foxmaster
foxmaster is offline   Reply With Quote
Old 06-06-2005, 04:13 AM   #28
kiezz
Junior Member
 
Join Date: Feb 2004
Posts: 27
Default

Dear Foxmaster

Your problem is do to a bad reply by one of your ftp.
The CTS.Bot do a site monthup on every site, but one of yours is giving a bad reply and instead of getting a number value it got the word "STAFF".
My tip is to have a look on the monthup files manually, whit a text editor and see which is having problems.
In case you fix it on ftp you have to stop the bot running, delete the monthup and monthup.last files, then restart it and do on query saveusers.
This shoud fix it.

I'm on testing, RC level, whit CTS.ReLoAdeD 3.0 , i hope to not found more bugs and publish soon it.
I'm in lack whit tester, if somebody have some time to spent i will be glad to give around some pre release.
You can find me on irc, on efnet or linknet (NiK or N|K).

Thanks, ByE
kiezz is offline   Reply With Quote
Reply

Tags
change, fix, quota, rings, [login]

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:36 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)