1 Commits 7acc51e9dd ... 10873e664a

Author SHA1 Message Date
  zry 10873e664a Add "UserExists" Method. 5 years ago
1 changed files with 9 additions and 0 deletions
  1. 9 0
      zTinyPasswd.go

+ 9 - 0
zTinyPasswd.go

@@ -237,3 +237,12 @@ func (this *PasswdManager) RenameUser(oldname string, new_name string) error {
 	this.stlock.Unlock()
 	return nil
 }
+
+func (this *PasswdManager) UserExists(username string) bool {
+	u := this._getUser(username)
+	if u == nil{
+		return false
+	}else {
+		return true
+	}
+}