doc/Admin.md: updated admins -> users; plus improvements

This commit is contained in:
Pragmatic Software 2020-01-26 19:51:35 -08:00
parent a321adce9b
commit 8897918726
1 changed files with 53 additions and 44 deletions

View File

@ -4,14 +4,14 @@
* [Logging in and out](#logging-in-and-out) * [Logging in and out](#logging-in-and-out)
* [login](#login) * [login](#login)
* [logout](#logout) * [logout](#logout)
* [Admin management commands](#admin-management-commands) * [User management commands](#user-management-commands)
* [adminadd](#adminadd) * [useradd](#useradd)
* [adminrem](#adminrem) * [userdel](#userdel)
* [Admin levels](#admin-levels) * [Admin levels](#admin-levels)
* [adminset](#adminset) * [userset](#userset)
* [adminunset](#adminunset) * [userunset](#userunset)
* [Admin metadata list](#admin-metadata-list) * [User metadata list](#user-metadata-list)
* [Listing admins](#listing-admins) * [Listing users](#listing-users)
* [Channel management commands](#channel-management-commands) * [Channel management commands](#channel-management-commands)
* [join](#join) * [join](#join)
* [part](#part) * [part](#part)
@ -69,73 +69,82 @@ Logs out of PBot.
Usage: `logout` Usage: `logout`
## Admin management commands ## User management commands
### adminadd ### useradd
Adds a new admin to PBot. Adds a new user to PBot.
Usage: `adminadd <name> <channel> <hostmask> <level> <password>` Usage: `useradd <account name> <channel> <hostmask> [level] [password]`
Parameter | Description Parameter | Description
--- | --- --- | ---
`<name>` | A unique name to identify this account (usually the `nick` of the admin, but can be any identifier). `<account name>` | A unique name to identify this account (usually the `nick` of the user, but it can be any identifier).
`<channel>` | Which channel the admin can administrate; use `global` for all channels. This field cannot be changed without removing and re-adding the admin. `<channel>` | The channel this user belongs to; use `global` for all channels. This field cannot be changed without removing and re-adding the user.
`<hostmask>` | What hostmask the admin is recognized/allowed to login from (e.g., `somenick!*@*somedomain.com` or `*@unaffiliated/someuser`). This field cannot be changed without removing and re-adding the admin. `<hostmask>` | The hostmask from which this user is recognized/allowed to login from (e.g., `somenick!*@*.somedomain.com` or `*!*@unaffiliated/someuser`). This field cannot be changed without removing and re-adding the user.
`<level>` | An integer representing the admin's level of privileges. See [admin-levels](#admin-levels). `[level]` | An integer representing the user's level of privileges. See [admin-levels](#admin-levels). Defaults to `0` if omitted (i.e., a normal unprivileged user).
`<password>` | The password the admin will use to login (from /msg!). A password is not required if the `autologin` [metadata](#admin-metadata-list) is set for the admin; however, a dummy password still needs to be set. `[password]` | The password the user will use to login (from `/msg`, obviously). Generates a random password if omitted. Users may view and set their password by using the [`my`](Commands.md#my) command.
### adminrem ### userdel
Removes an admin from PBot. You can use the name field or the hostmask field that was set via `adminadd`. Removes a user from PBot. You can use the `account name` field or the `hostmask` field that was set via the [`useradd`](#useradd) command.
Usage: `adminrem <channel> <name or hostmask>` Usage: `userdel <channel> <account name or hostmask>`
#### Admin levels #### Admin levels
This is a list of admin commands allowed by each admin level. Higher level admins have access to all lower level admin commands. This is a list of admin commands allowed by each admin level, by default. You
can use [`cmdset`](#cmdset) to adjust any command's admin level.
Note that you can use [`cmdset`](#cmdset) to adjust any command's admin level. Higher level admins have access to all lower level admin commands.
Note that Plugins may also add new admin commands, so this list may be incomplete
if you have third-party Plugins loaded.
Level | Commands Level | Commands
--- | --- --- | ---
10 | actiontrigger, antispam, whitelist, blacklist, chanlist, ban, unban, mute, unmute, op, deop, voice, devoice, invite, kick, ignore, unignore 10 | actiontrigger, antispam, whitelist, blacklist, chanlist, ban, unban, mute, unmute, op, deop, voice, devoice, invite, kick, ignore, unignore
40 | chanset, chanunset, chanadd, chanrem, join, part, mode 40 | chanset, chanunset, chanadd, chanrem, join, part, mode
60 | adminadd, adminrem, adminset, adminunset, akalink, akaunlink, regset, regunset, regsetmeta, regunsetmeta, regchange, dumpbans 60 | useradd, userdel, userset, userunset, akalink, akaunlink, regset, regunset, regsetmeta, regunsetmeta, regchange, dumpbans
90 | sl, plug, unplug, replug, load, unload, reload, export, rebuildaliases, refresh, die 90 | sl, plug, unplug, replug, load, unload, reload, export, rebuildaliases, refresh, die
99 | eval 99 | eval
### adminset ### userset
Sets metadata for an admin account. You can use the `name` field or the `hostmask` field that was set via `adminadd`. See also: [admin metadata list](#admin-metadata-list). Sets metadata for a user account. You can use the `account name` field or the `hostmask` field that was set via the [`useradd`](#useradd) command. See also: [user metadata list](#user-metadata-list).
If `key` is omitted, it will list all the keys and values that are set. If `value` is omitted, it will show the value for `key`. If `key` is omitted, it will list all the keys and values that are set. If `value` is omitted, it will show the value for `key`.
Usage: `adminset <channel> <name or hostmask> [<key> [value]]` Usage: `userset <channel> <account name or hostmask> [<key> [value]]`
### adminunset ### userunset
Deletes a metadata key from an admin account. You can use the name `field` or the `hostmask` field that was set via adminadd. Deletes a metadata key from a user account. You can use the `account name` field or the `hostmask` field that was set via the [`adminadd`](#adminadd) command.
Usage: `adminunset <channel> <name or hostmask> <key>` Usage: `userunset <channel> <account name or hostmask> <key>`
#### Admin metadata list #### User metadata list
This is a list of recognized metadata keys for admin accounts. This is a list of recognized metadata keys for user accounts.
Name | Description Name | Description
--- | --- --- | ---
`name` | A unique name identifying this admin account. `name` | A unique name identifying the user account.
`level` | The privilege level of the admin. See [admin levels](#admin-levels). `level` | The privilege level of the user. See [admin levels](#admin-levels).
`password` | The password for this admin account. `password` | The password for the user account.
`loggedin` | Whether the admin is logged in or not. `loggedin` | Whether the user is logged in or not.
`stayloggedin` | Do not log the admin out when they part/quit. `stayloggedin` | Do not log the user out when they part/quit.
`autologin` | Automatically log the admin in when they join the channel. Make sure the admin's hostmask wildcards are minimal. `autologin` | Automatically log the user in when they join the channel. *Note: make sure the user's hostmask wildcards are as restrictive as possible.*
`autoop` | Automatically give the admin operator status when they join the channel. Make sure the admin's hostmask wildcards are minimal. `autoop` | Give the user `operator` status when they join the channel. *Note: make sure the admin's hostmask wildcards are as restrictive as possible.*
`autovoice` | Automatically give the admin voiced status when they join the channel. Make sure the admin's hostmask wildcards are minimal. `autovoice` | Give the user `voiced` status when they join the channel. *Note: make sure the admin's hostmask wildcards are as restrictive as possible.*
### Listing admins ### Listing users
To list admins, use the `list admins` command. This is not an admin command, but To list user accounts, use the `list users` command. This is not an admin command, but
it is included here for completeness. it is included here for completeness.
Usage: `list admins` Usage: `list users [channel]`
When used in a channel, it will list only the admins for that channel, plus all When the optional `[channel]` argument is provided, only users for that channel
global admins. When used from private message, it will list all admins from will be listed; no global users will be listed.
all channels, including global admins.
When `[channel]` is omitted and the command is used in a channel, it will list
the users for that channel, plus all global users.
When `[channel]` is omitted and the command is used from private message, it will
list all users from all channels, including global users.
## Channel management commands ## Channel management commands