account activate datetime
hiho, i search a solution to set a "activate datetime" for a account? in the end, i want a possebility to set a timespan where the account is active? from -> datetime to -> dateime any tips for me ? greez & thx, sky...
On Sun, Sep 16, 2012 at 11:31 PM, SkyDiablo <skydiablo@gmx.net> wrote:
hiho,
i search a solution to set a "activate datetime" for a account? in the end, i want a possebility to set a timespan where the account is active?
from -> datetime to -> dateime
any tips for me ?
Something like http://freeradius.1045715.n5.nabble.com/Unix-TimeStamp-Based-Login-td5708187... ? -- Fajar
Am 16.09.2012 23:56, schrieb Fajar A. Nugraha:
Something like http://freeradius.1045715.n5.nabble.com/Unix-TimeStamp-Based-Login-td5708187...
not realy, i want to use the "radius attributes" table, so i didnt find a module that can handle this comparing. any other ideas ?
On Mon, Sep 17, 2012 at 5:31 AM, SkyDiablo <skydiablo@gmx.net> wrote:
Am 16.09.2012 23:56, schrieb Fajar A. Nugraha:
Something like http://freeradius.1045715.n5.nabble.com/Unix-TimeStamp-Based-Login-td5708187...
not realy, i want to use the "radius attributes" table, so i didnt find a module that can handle this comparing.
any other ideas ?
Did you read the post? "Resv-Start-Time" and others in that example are custom (i.e. made up) attributes that you put on radcheck/radgroupcheck (there's no such thing as "radius attributes table", btw). The "comparing" is done by unlang because there's no existing module that can do it, but writing unlang for it only needs several lines in the config file. Or did you need something else? -- Fajar
Am 17.09.2012 03:27, schrieb Fajar A. Nugraha:
Did you read the post?
"Resv-Start-Time" and others in that example are custom (i.e. made up) attributes that you put on radcheck/radgroupcheck (there's no such thing as "radius attributes table", btw).
The "comparing" is done by unlang because there's no existing module that can do it, but writing unlang for it only needs several lines in the config file.
Or did you need something else?
okay, okay... i try to explain my problem step by step. 1. use the "sql" modul -> works fine 2. set the "authorize_check_query" for the sql module -> works fine 3. add a new attribute in the "dictionary" file: ATTRIBUTE Activate-Account-At 3080 date 4. add a new attribute like "Activate-Account-At" to the sql result from step 2 -> works and the questens are: - how can i check at "unlang" is "Activate-Account-At" attribute in the sql result from step 2 ? - how can i check is this date greater or lower as now ? - in step 3, is defined the attribute as "date", how is the expected format? => "Sep 10 2012 14:05:00" <= ??? big thx!
so, for now i have solvd my problem: add a new attribute in dictionary: ATTRIBUTE Activate-Account-At 3080 integer this will filled with the unix-timestamp for activating time. and here are the "unlang" code: authorize { ... if("%l" && "%{check:Activate-Account-At}") { if("%l" < "%{check:Activate-Account-At}") { reject } } ... } this will effect to reject, if the current time lower than the "Activate-Account-At". i have to prefix with "check:" to get the right value from my sql-modul by the "authorize_check_query". i hope this will help some other FR hacker ;) greez & thx, sky...
There is rlm_logintime module. It uses Login-Time control attribute. Login-Time attribute format is: <login-times> ::= <login-time> | <login-times>,<login-time> <login-time> ::= <days> | <days><time> <days> ::= <day> | <days><day> <day> ::= <day-of-week> | <day-of-week>-<day-of-week> | Wk | Al | Any <day-of-week>> ::= Su | Mo | Tu | We | Th | Fr | Sa <time> ::= <hh><mm> | <hh><mm>-<hh><mm> <hh> ::= 00 .. 24 <mm> ::= 00 .. 59 For example, allow logins from Monday till Friday, from 9:00 till 20:00: Login-Time := "Mo-Fr0900-2000" You can set Login-Time control attribute using rlm_files or rlm_sql (or whatever backend module). For example, using rlm_files: # raddb/files joe Cleartext-Password := "ToPsEcReT", Login-Time := "Mo-Fr0900-2000" rlm_logintime module should be called from authorize section. SkyDiablo wrote:
hiho,
i search a solution to set a "activate datetime" for a account? in the end, i want a possebility to set a timespan where the account is active?
from -> datetime to -> dateime
any tips for me ?
greez & thx, sky... - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Fajar A. Nugraha -
Iliya Peregoudov -
SkyDiablo