LocalUser
LocalUser is the operation system level object for user control.
Can only be loaded from startup
RemoteUser
inherits from LocalUser
LocalUser(name: string, pass: string, perm: string|table)
Creates a new LocalUser named name
and password pass
and permissions perm
.
If a string is passed for perm
it will be put into a table.
Type | Name | Description |
---|---|---|
string |
name |
User name |
string |
pswH |
Hashed password |
table |
_perm |
(PRIVATE) Table of permission nodes |
Return | Name | Description |
---|---|---|
LocalUser |
fromFile(name: string) |
Creates a LocalUser from the file: /name.userDat |
Return | Name | Description |
---|---|---|
boolean |
save() |
Tries to save the user to: /name.userDat |
boolean |
hasPerm(perm: string) |
Checks if the user has perm or a lower order permission |
boolean |
setPerm(perm: string, value: boolean) |
Gives the user the permission perm to value |
string |
getHomeDir() |
Returns the path to the user's home directory |
boolean |
checkPass(pass: string) |
Checks if the given password is correct |
boolean |
setPass(oldPass: string, newPass: string) |
Changes the user's password if oldPass is the current password |