From: kkalev Date: Tue, 20 Aug 2002 11:58:34 +0000 (+0000) Subject: * Add support for the Expiration attribute. Add it in the sql attribute map, in user_... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=12efc56d864f92a5f57ffaef400304cb326dc357;p=freeradius-dialup-admin.git * Add support for the Expiration attribute. Add it in the sql attribute map, in user_edit.attrs and check for it in user_admin * Add a few more keys in the userinfo and badusers tables. * Fix a problem with lib/sql/defaults.php3 where the first character in the default value when using operators was set to the opeator --- diff --git a/Changelog b/Changelog index d7753f6..6f776cc 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,11 @@ Ver 1.55: * Update the FAQ about missing attributes from the user/group edit pages and add a few comments in the configuration files +* Add support for the Expiration attribute. Add it in the sql attribute map, in user_edit.attrs and + check for it in user_admin +* Add a few more keys in the userinfo and badusers tables. +* Fix a problem with lib/sql/defaults.php3 where the first character in the default value when using + operators was set to the opeator Ver 1.54: * Add attributes for the sql group tables in admin.conf. Now SQL group support should really work! Ver 1.53: diff --git a/conf/sql.attrmap b/conf/sql.attrmap index 908638c..e7d1470 100644 --- a/conf/sql.attrmap +++ b/conf/sql.attrmap @@ -14,6 +14,7 @@ checkItem Dialup-Access none checkItem Max-Daily-Session Max-Daily-Session checkItem Max-Weekly-Session Max-Weekly-Session checkItem Login-Time Login-Time +chechItem Expiration Expiration replyItem Service-Type Service-Type replyItem Framed-Protocol Framed-Protocol diff --git a/conf/user_edit.attrs b/conf/user_edit.attrs index 1306580..63117eb 100644 --- a/conf/user_edit.attrs +++ b/conf/user_edit.attrs @@ -38,3 +38,4 @@ Dialup-Lock-Msg (UUCP Format) +#Expiration User Expiration Date diff --git a/htdocs/user_admin.php3 b/htdocs/user_admin.php3 index 4784af5..3420623 100644 --- a/htdocs/user_admin.php3 +++ b/htdocs/user_admin.php3 @@ -231,4 +231,15 @@ EON; else $descr = '-'; +$expiration = $default_vals['Expiration']; +if ($item_vals['Expiration'][0] != '') + $expiration = $item_vals['Expiration'][0]; +if ($expiration != ''){ + $expiration = strtotime($expiration); + if ($expiration != -1 && $expiration < time()) + $descr = <<User Account has expired +EOM; +} + require('../html/user_admin.html.php3'); diff --git a/lib/sql/defaults.php3 b/lib/sql/defaults.php3 index 1e4debc..4a2f079 100644 --- a/lib/sql/defaults.php3 +++ b/lib/sql/defaults.php3 @@ -62,11 +62,11 @@ if ($login != ''){ echo "Database query failed: " . da_sql_error($link,$config) . "
\n"; foreach($attrmap as $key => $val){ if (isset($tmp[$val])){ - if ($tmp[$val][0] != '') - $default_vals["$key"] = $tmp[$val][0]; if ($use_op) if ($tmp[$val][operator][0] != '') $default_vals["$key"][operator] = $tmp[$val][operator][0]; + if ($tmp[$val][0] != '') + $default_vals["$key"] = $tmp[$val][0]; } } } diff --git a/sql/badusers.sql b/sql/badusers.sql index 09aa8c0..9dc9689 100644 --- a/sql/badusers.sql +++ b/sql/badusers.sql @@ -6,5 +6,7 @@ CREATE TABLE badusers ( UserName varchar(30), Date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, Reason varchar(200), - PRIMARY KEY (id) + PRIMARY KEY (id), + KEY UserName (UserName), + KEY Date (Date) ); diff --git a/sql/userinfo.sql b/sql/userinfo.sql index 243a4f5..aacb4d2 100644 --- a/sql/userinfo.sql +++ b/sql/userinfo.sql @@ -10,5 +10,7 @@ CREATE TABLE userinfo ( WorkPhone varchar(200), HomePhone varchar(200), Mobile varchar(200), - PRIMARY KEY (id) + PRIMARY KEY (id), + KEY UserName (UserName), + KEY Departmet (Department) );