changeset 60:592d958cab58 draft

PWRESET resets password.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 25 Jun 2012 12:34:22 +0900
parents 595ff0134cd9
children 502103680ea2
files after5.rb
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/after5.rb	Mon Jun 25 12:29:29 2012 +0900
+++ b/after5.rb	Mon Jun 25 12:34:22 2012 +0900
@@ -4,7 +4,7 @@
 # Associative Scheduling Table - after5
 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org]
 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $
-# Last modified Mon Jun 25 12:28:29 2012 on firestorm
+# Last modified Mon Jun 25 12:33:50 2012 on firestorm
 # See http://www.gentei.org/~yuuji/software/after5/
 # このスクリプトはEUCで保存してください。
 $hgid = <<_HGID_.split[1..-2].join(" ")
@@ -245,7 +245,7 @@
     @pdb.close()
   end
   def newpasswd(length)
-    srand(Time.now.to_i)
+    srand(Time.now.to_f)
     left	= "qazxswedcvfrtgb12345"
     right	= "yhnmjuik.lop;/67890-"
     array	= [left, right]
@@ -3757,8 +3757,9 @@
     prohibitviahttp()
     pm = open_pm()
     exit 1 unless pm
-    if pm.userexist?(user)
+    if pm.userexist?(user) && !ENV['PWRESET']
       printf("User %s already exists.  Skip.\n", user)
+      printf("If you reset passwd to new one, PWRESET=1 #{$0} ...\n")
       exit 1
     end
     email = nil

yatex.org