diff options
| author | 2023-10-22 09:00:37 +0200 | |
|---|---|---|
| committer | 2023-10-22 09:00:37 +0200 | |
| commit | 0d78deef42cd1e5d461d98d2acefd4266d323046 (patch) | |
| tree | a6187aa52656349b707fa48f266d040361ab65cb /main.c | |
| parent | Backport from xs. (diff) | |
| download | snac2-0d78deef42cd1e5d461d98d2acefd4266d323046.tar.gz snac2-0d78deef42cd1e5d461d98d2acefd4266d323046.tar.xz snac2-0d78deef42cd1e5d461d98d2acefd4266d323046.zip | |
New function deluser(), to delete a user.
Only unfollows by now.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
| @@ -19,6 +19,7 @@ int usage(void) | |||
| 19 | printf("init [{basedir}] Initializes the data storage\n"); | 19 | printf("init [{basedir}] Initializes the data storage\n"); |
| 20 | printf("upgrade {basedir} Upgrade to a new version\n"); | 20 | printf("upgrade {basedir} Upgrade to a new version\n"); |
| 21 | printf("adduser {basedir} [{uid}] Adds a new user\n"); | 21 | printf("adduser {basedir} [{uid}] Adds a new user\n"); |
| 22 | printf("deluser {basedir} {uid} Deletes a user\n"); | ||
| 22 | printf("httpd {basedir} Starts the HTTPD daemon\n"); | 23 | printf("httpd {basedir} Starts the HTTPD daemon\n"); |
| 23 | printf("purge {basedir} Purges old data\n"); | 24 | printf("purge {basedir} Purges old data\n"); |
| 24 | printf("webfinger {basedir} {actor} Queries about an actor (@user@host or actor url)\n"); | 25 | printf("webfinger {basedir} {actor} Queries about an actor (@user@host or actor url)\n"); |
| @@ -169,7 +170,7 @@ int main(int argc, char *argv[]) | |||
| 169 | } | 170 | } |
| 170 | 171 | ||
| 171 | if (!user_open(&snac, user)) { | 172 | if (!user_open(&snac, user)) { |
| 172 | printf("error in user '%s'\n", user); | 173 | printf("invalid user '%s'\n", user); |
| 173 | return 1; | 174 | return 1; |
| 174 | } | 175 | } |
| 175 | 176 | ||
| @@ -179,6 +180,10 @@ int main(int argc, char *argv[]) | |||
| 179 | return resetpwd(&snac); | 180 | return resetpwd(&snac); |
| 180 | } | 181 | } |
| 181 | 182 | ||
| 183 | if (strcmp(cmd, "deluser") == 0) { /** **/ | ||
| 184 | return deluser(&snac); | ||
| 185 | } | ||
| 186 | |||
| 182 | if (strcmp(cmd, "queue") == 0) { /** **/ | 187 | if (strcmp(cmd, "queue") == 0) { /** **/ |
| 183 | process_user_queue(&snac); | 188 | process_user_queue(&snac); |
| 184 | return 0; | 189 | return 0; |