From: Jimmi Aakjaer [aakjaer@post7.tele.dk] Sent: Friday, April 21, 2000 4:13 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: DCL Hackery On Thu, 20 Apr 2000 10:30:08 -0700, "Wolf, Gerald J" wrote: >Is there a DCL procedure out there to disuser users who have password >changed is older than a specified amount of time? Is there a way to notify >these users before they are disusered using the above method. We would like >to do this on a daily or monthly basis. > >Please include the procedure if you can. Is there a place on the internet >with contributed DCL procedures? > >Thank You, >Gerry Wolf >Gerald (Gerry) Wolf Hi gerry Here you have a little piece of pascal code which i use to warn my users about password expiration. I call it every time when my menu system is started up and it begin to warn the users 14. days before expiration. It is easy to convert to another language Best regards Jimmi TYPE item_list_3_record = record buffer_length : $word; item_code : $word; buffer_address : unsigned; return_length_address : unsigned; end; VAR _status : [volatile] unsigned; uai_item_list : [VOLATILE] array [1..3] of item_list_3_record:=ZERO; TYPE item_list_3_record = record buffer_length : $word; item_code : $word; buffer_address : unsigned; return_length_address : unsigned; end; VAR _status : [volatile] unsigned; uai_item_list : [VOLATILE] array [1..3] of item_list_3_record:=ZERO; pwd_change_date : [VOLATILE] $quad; pwd_lifetime : [VOLATILE] $quad; username : PACKED ARRAY [1..12] OF CHAR; pwd_change_date_asc : varying [30] of char; pwd_lifetime_double : double; pwd_lifetime_asc : varying [30] of char; pwd_change_date_int : integer; today_int : integer; timestamp_1, timestamp_2 : timestamp; password_dage : integer; procedure check_PASSWORD; Var life_time : integer; begin uai_item_list[1].buffer_length := 8; uai_item_list[1].item_code := uai$_pwd_date; uai_item_list[1].buffer_address := iaddress(pwd_change_date); uai_item_list[2].buffer_length := 8; uai_item_list[2].item_code := uai$_pwd_lifetime; uai_item_list[2].buffer_address := iaddress(pwd_lifetime); IF ODD($getuai(,,USERNAME,uai_item_list)) then begin pwd_change_date_asc:= ''; $asctim(pwd_change_date_asc.length,pwd_change_date_asc.body,pwd_change_date); $asctim(pwd_lifetime_asc.length,pwd_lifetime_asc.body,pwd_lifetime); gettimestamp(timestamp_1,pwd_change_date_asc); gettimestamp(timestamp_2); life_time := 0; if (substr(pwd_lifetime_asc,1,11) = '17-NOV-1858') THEN life_time := maxint else readv(substr(pwd_lifetime_asc,1,4),life_time,error:= continue); (* gdate = days since 1.1.1900 *) pwd_change_date_int := gdate(dec(timestamp_1.year,4,4) + dec(timestamp_1.month,2,2) + dec(timestamp_1.day,2,2)); today_int := gdate(dec(timestamp_2.year,4,4) + dec(timestamp_2.month,2,2) + dec(timestamp_2.day,2,2)); if (14 >= life_time - (today_int - pwd_change_date_int)) and ( 0 < life_time - (today_int - pwd_change_date_int)) then begin (* if less than 14 days before password change time wirte something on the screen*) end; end; end; pwd_change_date : [VOLATILE] $quad; pwd_lifetime : [VOLATILE] $quad; username : PACKED ARRAY [1..12] OF CHAR; pwd_change_date_asc : varying [30] of char; pwd_lifetime_double : double; pwd_lifetime_asc : varying [30] of char; pwd_change_date_int : integer; today_int : integer; timestamp_1, timestamp_2 : timestamp; password_dage : integer; procedure check_PASSWORD; Var life_time : integer; begin uai_item_list[1].buffer_length := 8; uai_item_list[1].item_code := uai$_pwd_date; uai_item_list[1].buffer_address := iaddress(pwd_change_date); uai_item_list[2].buffer_length := 8; uai_item_list[2].item_code := uai$_pwd_lifetime; uai_item_list[2].buffer_address := iaddress(pwd_lifetime); IF ODD($getuai(,,USERNAME,uai_item_list)) then begin pwd_change_date_asc:= ''; $asctim(pwd_change_date_asc.length,pwd_change_date_asc.body,pwd_change_date); $asctim(pwd_lifetime_asc.length,pwd_lifetime_asc.body,pwd_lifetime); gettimestamp(timestamp_1,pwd_change_date_asc); gettimestamp(timestamp_2); life_time := 0; if (substr(pwd_lifetime_asc,1,11) = '17-NOV-1858') THEN life_time := maxint else readv(substr(pwd_lifetime_asc,1,4),life_time,error:= continue); (* gdate = days since 1.1.1900 *) pwd_change_date_int := gdate(dec(timestamp_1.year,4,4) +dec(timestamp_1.month,2,2) + dec(timestamp_1.day,2,2)); today_int := gdate(dec(timestamp_2.year,4,4) + dec(timestamp_2.month,2,2) + dec(timestamp_2.day,2,2)); if (14 >= life_time - (today_int - pwd_change_date_int)) and ( 0 < life_time - (today_int - pwd_change_date_int)) then begin (* if less than 14 days before password change time write something on the screen*) end; end; end;