JS - User Functions
checkpassword #
Checks if a string matches the current user's password.
- Argument:
- String: Password to check.
- Returns:
- Boolean: True if match, false if not.
checkuser #
Checks if a user exists and returns their username.
- Arguments:
- String: Username of user.
- Returns:
- String: Username of user, or empty string if user does not exist.
editsig #
Allows the user to edit their signature.
- Arguments: None
- Returns: None
getactions #
Gets current node actions, returns an array of objects with the uid of the user logged in to the node (or 0 if none) and the action.
- Arguments: None
- Returns:
- Array: node action objects.
Example return value for a 2 node system
[
{
"uid": 1,
"action": "Browsing main menu"
},
{
"uid": 0,
"action": "Waiting for Caller"
}
]
getattr #
Get an attribute of the current user.
- Arguments:
- String: The attribute name
- String: Fallback value
- Returns:
- String: The attribute value (or fallback value)
getattro #
Get an attribute of specified user.
- Arguments:
- Integer: The user's UID
- String: The attribute name
- String: Fallback value
- Returns:
- String: The attribute value (or fallback value)
getusername #
Get the current user's username.
- Arguments: None
- Returns:
- String: Username of current user.
getusernameo #
Gets the username of a specified user.
- Arguments:
- Integer: The user's UID.
- Returns:
- String: The user's username.
getusers #
Get's an array of objects representing all users on the system,
- Arguments: None
- Returns:
- Array: The list of users.
Example user list.
[
{
"uid": 1,
"username": "Some User"
},
{
"uid": 2,
"username": "Some Other User"
}
]
isvisible #
Checks if a user should be 'visible'.
- Arguments: None
- Returns:
- Boolean: True if visible, false if not.
putattr #
Saves an attribute for the current user.
- Arguments:
- String: The attribute name
- String: The value to save
- Returns: None
putattro #
Saves an attribute for the specified user.
- Arguments:
- Integer: The UID of the user
- String: The attribute name
- String: The value to save
- Returns: None
setaction #
Sets the node action for the current node.
- Arguments:
- String: The action
- Returns: None
setpassword #
Sets the current user's password
- Arguments:
- String: new password
- Returns: None
setpasswordo #
Sets the specified user's password
- Arguments:
- Integer: UID of the user
- String: New password.
- Returns: None
timeleft #
The amount of time a user has left for the day
- Arguments: None
- Returns:
- Integer: Number of minutes