Properly show shadowlastchange and mail disabled message when locking an
[mirror/userdir-ldap.git] / ud-info
diff --git a/ud-info b/ud-info
index a94ff91..282d6a4 100755 (executable)
--- a/ud-info
+++ b/ud-info
@@ -299,10 +299,10 @@ def Lock(UserDn, Attrs, DisableMail=True):
       (ldap.MOD_REPLACE,"shadowExpire","1")];
    if DisableMail:
       recs.append( (ldap.MOD_REPLACE,"mailDisableMessage","account locked") )
-      Attrs[0][1]["shadowLastChange"] = [shadowLast];
+      Attrs[0][1]["mailDisableMessage"] = ["account locked"];
    l.modify_s(UserDn,recs);
    Attrs[0][1]["userPassword"] = ["{crypt}*LK*"];
-   Attrs[0][1]["mailDisableMessage"] = ["account locked"];
+   Attrs[0][1]["shadowLastChange"] = [shadowLast];
    Attrs[0][1]["shadowExpire"] = ["1"];
 
 # Main program starts here
@@ -444,7 +444,7 @@ while(1):
 
       print "Set account to:"
       print "  1) retiring (lock account but do not disable mail):"
-      print "  2) retired (lock account and disable mail):"
+      print "  2) inactive (removed/emeritus/... - lock account and disable mail):"
       print "  3) memorial (lock account and disable mail):"
       print "  4) active (do not change other settings, you will have to deal with them)"
       print "  q) return (no change)"
@@ -454,7 +454,7 @@ while(1):
          if Resp == "1":
            newstatus = "retiring %s"%(time.strftime("%Y-%m-%d"))
          else:
-           newstatus = "retired %s"%(time.strftime("%Y-%m-%d"))
+           newstatus = "inactive %s"%(time.strftime("%Y-%m-%d"))
          l.modify_s(UserDn,[(ldap.MOD_REPLACE,"accountStatus",newstatus)])
          Attrs[0][1]["accountStatus"] = [newstatus]