Changeset 71
- Timestamp:
- 11/21/08 19:35:31 (3 years ago)
- File:
-
- 1 edited
-
devel/sshgw/bin/createsshuser (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devel/sshgw/bin/createsshuser
r70 r71 4 4 use strict; 5 5 use SSHGWUser; 6 use Time::localtime qw(localtime); 7 use Date::Manip; 6 8 7 9 my ($username, $groups, $uid, $expire, $fullname, $email, $sshkey, $emailcc) ; … … 96 98 die "Expiration date format should be YYYY-MM-DD\n" unless $expire =~ /^\d{4}-\d{2}-\d{2}$/ ; 97 99 } 100 my @date = pb_get_date(); 101 my $date = strftime("%Y-%m-%d", @date); 102 my $flag = Date_Cmp($date,$expire); 103 if ($flag >= 0) { 104 # expire is earlier 105 die "Expiration date ($expire) should be after current date ($date)\n"; 106 } 98 107 99 108 if (defined $email) { … … 113 122 return ($username, $fullname, $groups, $expire, $email, $sshkey, $emailcc); 114 123 } 124 125 sub pb_get_date { 126 return(localtime->sec(), localtime->min(), localtime->hour(), localtime->mday(), localtime->mon(), localtime->year(), localtime->wday(), localtime->yday(), localtime->isdst()); 127 }
Note: See TracChangeset
for help on using the changeset viewer.
