Skip to content
This repository has been archived by the owner on Aug 6, 2022. It is now read-only.

III.3.d. Users

Andrey Bogdanov edited this page Jul 26, 2016 · 9 revisions

Contents

Requests

Ban a user
/action/banUser

Sets the specified user's ban levels for each of the specified boards. If the ban level for a board is not specified, the user is considered not banned on that board. Ban levels on a board you do not have access to are not changed if not specified (if specified, an error is raised). Returns an empty object.

Note: Your access level must be MODER or higher, and higher than the level of the target user.

The required fields are:

  • userIp IP address of the user to ban. May be specified either in IPv4 or IPv6 form.

Ban levels for each board are specified using the set of the following fields:

  • banBoard_BOARD Name of the board to ban a user on. The BOARD part of the field name must match it's value.
  • banLevel_BOARD Ban level on the corresponding board. Optional. The BOARD part of the field name must match the BOARD part of the field name of the banBoard_BOARD field. Possible values:
  • NONE Or any other value. The user will not be banned. The default.
  • READ_ONLY The user will only be able to read threads/posts.
  • NO_ACCESS The user will not be able to create or read threads/posts.
  • banExpires_BOARD Time (in the YYYY/MM/DD HH:mm format) when the ban expires. Optional. The BOARD part of the field name must match the BOARD part of the field name of the banBoard_BOARD field.
  • banReason_BOARD Ban reason. A string. Optional. The BOARD part of the field name must match the BOARD part of the field name of the banBoard_BOARD field.
  • banPostNumber_BOARD Number of the post for which the user is to be banned. Optional. If specified, the corresponding mark will be added to the post. The BOARD part of the field name must match the BOARD part of the field name of the banBoard_BOARD field.

Example:

/action/banUser { userIp=192.168.0.2&banBoard_b=b&banLevel_b=READ_ONLY&banReason_b=faggot }

{}

On any error, an error object is returned.

Example:

/action/banUser { userIp=192.168.0.2&banBoard_c=c&banLevel_c=READ_ONLY }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Delete all user threads and posts on selected boards
/action/delall

Deletes all user's threads and posts on the specified boards. Returns an empty object.

Note: Your access level must be MODER or higher, and higher than the level of the target user.

The required fields are:

  • userIp IP address of the user whose posts are subject to deletion.

Fields specifying the selected boards should follow the template: board_BOARD, where the BOARD part is a board name, and is equal to the field's value.

Example:

/action/delall { userIp=192.168.0.3&board_b=b&board_d=d }

{}

On any error, an error object is returned.

/action/delall { userIp=192.168.0.3&board_b=b&board_c=c }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Register a user
/api/registerUser

Registers a user, assigning the access levels for each board. Returns an object containing the user's hashpass.

Note: Your access level must be SUPERUSER.

The required fields are:

  • password Either a password or a hashpass. The password is stored as a SHA-1 hash in the database. Hashpass is recognized automatically.

The optional fields are:

  • ips The list of IP addresses separated by spaces. These addresses are used to prevent the deletion of user posts by another user (accidentally or intentionally). May be specified in either IPv4 or IPv6 form.

Access levels for each board are specified using the set of the following fields:

  • accessLevelBoard_BOARD Name of the board to assign the user's access level on. The BOARD part of the field name must match it's value.
  • accessLevel_BOARD Access level of the user on the corresponding board. Optional. The BOARD part of the field name must match the BOARD part of the field name of the accessLevelBoard_BOARD field. Possible values:

Example:

/api/registerUser { password=****************&accessLevelBoard_b=b&accessLevel_b=MODER&ips=192.168.0.1 }

{
    "hashpass": "****************************************"
}

On any error, an error object is returned.

Example:

/api/registerUser { password=****************&accessLevelBoard_c=c&accessLevel_c=MODER }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "Invalid board"
}
Update a register user access levels
/api/updateRegisteredUser

Updates a registered user access level information, assigning the access levels for each board. Returns an empty object.

Note: Your access level must be SUPERUSER.

The required fields are:

  • hashpass The hashpass of the user.

The optional fields are:

  • ips The list of IP addresses separated by spaces. These addresses are used to prevent the deletion of user posts by another user (accidentally or intentionally). May be specified in either IPv4 or IPv6 form.

Access levels for each board are specified using the set of the following fields:

  • accessLevelBoard_BOARD Name of the board to assign the user's access level on. The BOARD part of the field name must match it's value.
  • accessLevel_BOARD Access level of the user on the corresponding board. Optional. The BOARD part of the field name must match the BOARD part of the field name of the accessLevelBoard_BOARD field. Possible values:

Example:

/api/updateRegisteredUser { hashpass=****************************************&accessLevelBoard_b=b&accessLevel_b=MODER&ips=192.168.0.1 }

{
    "hashpass": "****************************************"
}

On any error, an error object is returned.

Example:

/api/updateRegisteredUser { hashpass=****************************************&accessLevelBoard_b=b&accessLevel_b=MODER }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No such user"
}
Unregister a user
/api/unegisteredUser

Unregisteres a user. Returns an empty object.

Note: Your access level must be SUPERUSER.

The required fields are:

  • hashpass The hashpass of the user.

Example:

/api/unegisteredUser { hashpass=**************************************** }

{}

On any error, an error object is returned.

Example:

/api/unegisteredUser { hashpass=**************************************** }

{
    "title": "Error",
    "errorMessage": "Error",
    "errorDescription": "No such user"
}
Clone this wiki locally