swUser is a subclass of swRecord and handles user rights.
username username of login to be displayed.
pass password as submitted in login
ppass password as stored in powerusers.
rights user rights
exists() checks if the user page exists
hasright($action,$name) checks is a user has the right for an action in the name.
The function uses the global $swAllUserRights and the content of the record and retrieves all namespaces for a specific right.
The right fiields have the structure [_action::name]], but can also have the time limited form [_action::name|YYYY-mm-dd|YYYY-mm-dd]] where the first date is the start and the last the end.
Name is mainly a namespace
? means any namespace and * means any namespace
main means main namepace
nameshort() returns the name without namespace
validpassword() checks the password.
For master users, clear passwords are used.
For user pages, hashes are used normally, but clear passwords are possible also.
Both are stored as _pass field.
If the user has lost a password, a _newpass field is added. The old password is valid as long as he does not log in with the new password.
encryptpassword() creates the hash.