|
pianod2
multisource multiuser scriptable networked music player
|
Command handlers for all things user-related. More...
#include <config.h>#include <cstdio>#include <cassert>#include <vector>#include <football/football.h>#include <parsnip/parsnip.h>#include <parsnip/parsnip_command.h>#include <parsnip/parsnip_schema.h>#include "fundamentals.h"#include "utility.h"#include "enum.h"#include "interpreter.h"#include "response.h"#include "user.h"#include "users.h"#include "servicemanager.h"#include "mediamanager.h"#include "engine.h"
Macros | |
| #define | RANK_PATTERN "<rank:disabled|listener|user|admin>" |
| #define | PRIV_PATTERN "<privilege:service|deejay|influence|tuner>" |
Typedefs | |
| typedef enum user_commands_t | COMMAND |
Enumerations | |
| enum | user_commands_t { AUTHENTICATE = CMD_RANGE_USER , AUTHANDEXEC , SETMYPASSWORD , USESHADOWPASSWORD , USERCREATE , USERSETPASSWORD , GETVISITORRANK , SETVISITORRANK , GETSHADOWUSERNAME , SETSHADOWUSERNAME , GETUSERRANK , USERSETRANK , USERDELETE , USERGRANT , USERREVOKE , USERLISTBYPRIVILEGE , USERLIST , USERKICK , USERKICKVISITORS , USERSONLINE , USERSINROOM , AUTOTUNEUSERS , AUTOTUNEUSERSLIST , AUTOTUNEADDREMOVE } |
Functions | |
| Response | send_privileges (const User *user) |
| Assemble a user's privileges into a response. More... | |
| static CommandReply | validate_user_list (const std::vector< std::string > &users) |
| Check a list of users and record errors. More... | |
| static void | set_privileges (const std::vector< std::string > &users, Privilege priv, bool setting) |
| Set the requested privilege for a list of users. More... | |
| ResponseGroup | send_user (const User *user, bool details) |
| Return a user record in transmittable form, either just name or with details. More... | |
| static DataResponse | send_users (UserList which, bool details) |
| Prepare lists of users for transmission based on privilege or state criteria. More... | |
| static DataResponse | send_users (PianodConnection &conn, UserList which) |
| Prepare lists of users for transmission. More... | |
| static bool | user_logoff (PianodService *service, User *user, const std::string &message) |
| Logoff users. More... | |
Command handlers for all things user-related.
| #define PRIV_PATTERN "<privilege:service|deejay|influence|tuner>" |
| #define RANK_PATTERN "<rank:disabled|listener|user|admin>" |
| typedef enum user_commands_t COMMAND |
| enum user_commands_t |
Assemble a user's privileges into a response.
| user | User whose privileges to send. |


| ResponseGroup send_user | ( | const User * | user, |
| bool | details | ||
| ) |
Return a user record in transmittable form, either just name or with details.
| user | The user to send information of. |
| details | Whether to send privileges, etc. |


|
static |
Prepare lists of users for transmission.
| conn | The connection to which the tranmission is being sent. If an administrator, details are included; otherwise omitted. |
| which | A list of users to send. |

|
static |
Prepare lists of users for transmission based on privilege or state criteria.
which must not overlap. | which | A list of users to send. |
| details | Whether to include privileged information in the list. |


|
static |
Set the requested privilege for a list of users.
| users | A list of usernames. |
| priv | The privileges to set. |
| setting | Whether to enable (true) or disable (false). |


|
static |
Logoff users.
| service | The service/room to logoff user in, or null to logoff everywhere. |
| user | The user to logoff, or nullptr to logoff visitors/unauthenticated users. |
| message | An optional message to send before disconnecting. |

|
static |
Check a list of users and record errors.
| users | The list of users. |

