Browse Source

Add "UserExists" Method.

zry 5 years ago
parent
commit
10873e664a
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
+	}
+}