#137433 - 2005-04-07 06:29 PM
Display Password Expiration Days Left
|
Broxoth
Getting the hang of it
Registered: 2005-04-07
Posts: 78
|
Greetings! This is my first post so be gentle.  I have a login script that calls a display script giving users their various login info. The one thing I would like to add to this script but can't find any info on how to add it is a function that display users days remaining before their password expires. Now, I am aware that the server will inform them from 14 days on in but I have some users that log in so rarely that they won't be annoyed with this message everyday for 14 days straight which, with normal people, would be enough to just go ahead and change their bloody passwords! Here's a snippet of the display script that involves displaying the users' info: Code:
Color y+/n At ( 9,40) @userid At (10,40) @fullname At (11,40) @priv At (12,40) @wksta At (13,40) @domain At (14,40) @lserver Sleep 4 CLS
I'd prefer to just add to the bottom of the display box something like "Your password will expire in days." Thanks everyone!!
|
|
Top
|
|
|
|
#137435 - 2005-04-07 08:08 PM
Re: Display Password Expiration Days Left
|
Broxoth
Getting the hang of it
Registered: 2005-04-07
Posts: 78
|
Told ya I was new! Thanks Les for setting me straight. Works like a charm. Next time I won't forget to RTFM when I'm researching. Hehe!
|
|
Top
|
|
|
|
#137437 - 2005-04-08 03:54 PM
Re: Display Password Expiration Days Left
|
Broxoth
Getting the hang of it
Registered: 2005-04-07
Posts: 78
|
Thanks! Glad to be here. I'm looking forward to learning as much as possible.
One more thing, though. Although @PWAGE works great, I'd prefer it to count down rather than display the length the password has been in use. Now, I'm sure that goes right against the whole function of @PWAGE, so I'd probably have find another way of doing it. Even though my users read and signed an Acceptable Use Policy that states how long they have until their passwords expire they still don't know. (I administrate a K-12 school network...can anyone else relate?!)  Any ideas on how to do this? If not I'll just look around for awhile and deal with it as is for now. Thanks again!
|
|
Top
|
|
|
|
#137440 - 2005-04-08 06:15 PM
Re: Display Password Expiration Days Left
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
...which is why subtracting the current password age from the max password age gives you "days before password expires" hence
Code:
$daysLeft = @MaxPWAge - @PWAge ? "your password will expire in " $daysLeft " days"
|
|
Top
|
|
|
|
#137441 - 2005-04-08 06:18 PM
Re: Display Password Expiration Days Left
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
What does one get if one's password never expires, I got this:
Code:
E:\>kix32 t
your password will expire in -389 days
|
|
Top
|
|
|
|
#137442 - 2005-04-08 06:25 PM
Re: Display Password Expiration Days Left
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
of course that would have to be tested if it's a possibility. From the manual...
Quote:
@MaxPWAge Maximum password age (Note: if passwords are set not to expire, this value is set to ((unsigned long)-1) (or 0xFFFFFFFF in hex). This evaluates to 4294967295 decimal).
|
|
Top
|
|
|
|
#137444 - 2005-04-08 06:47 PM
Re: Display Password Expiration Days Left
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
you can read? Then yes, RTFM
|
|
Top
|
|
|
|
#137445 - 2005-04-08 06:50 PM
Re: Display Password Expiration Days Left
|
Broxoth
Getting the hang of it
Registered: 2005-04-07
Posts: 78
|
You know, when people work real hard to answer my questions and then I disregard the whole "- @pwage" part of their response, well....that's just stupid!
|
|
Top
|
|
|
|
#137448 - 2005-04-08 07:37 PM
Re: Display Password Expiration Days Left
|
maciep
Korg Regular
   
Registered: 2002-06-14
Posts: 947
Loc: Pittsburgh
|
Don't worry about it David...i really wouldn't call it "hard work" anyway.
Shawn, thanks for the rating. i'll never doubt your literacy again.
|
|
Top
|
|
|
|
#137449 - 2005-04-08 07:56 PM
Re: Display Password Expiration Days Left
|
Broxoth
Getting the hang of it
Registered: 2005-04-07
Posts: 78
|
Yeah, I thought better of my "hard work" comment after the fact, but, eh. 
Shawn, clarify what you meant by the negative number thingies. Did you mean that in relation to users with non-expiring passwords?
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|