File: user_command.mdwn

package info (click to toggle)
ikiwiki 3.20260201-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,068 kB
  • sloc: perl: 31,488; javascript: 16,668; python: 428; sh: 213; makefile: 124
file content (13 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
After battling with the oneliners in [[tips/inside_dot_ikiwiki]], I have expanded them into a full script ([current snapshot](https://gitlab.com/anarcat/scripts/-/blob/836bda6929f23fae49f8d4cf75e88ca6cc55152b/ikiwiki-user), [latest](https://gitlab.com/anarcat/scripts/blob/master/ikiwiki-user)).

It has three commands:

 * `list`: just list the users as a TSV (tab-separated list)
 * `dump`: use `Data::Dumper` to dump the entire database, as done in the oneliners
 * `delete`: delete the given user, or interactively approve all users one by one

It's kind of rough right now, but it helped me deal with the [[bugs/emailauth_bypasses_account__95__creation__95__password]] problem, as a crude [[todo/anti-spam_protection]]. In particular, it "vendors" the lock mechanisms because `lockwiki` and `unlockwiki` are not exported by the `IkiWiki` module, which is unfortunate.

It could be improved significantly: for example, the `delete` command could use a "time" argument to review only the accounts created after a certain date, instead of reviewing the entire list each time. I just couldn't be bothered with the date parsing.

I would be happy to see this command land in ikiwiki itself, under a GPL-2+ or whatever open license. :) -- [[anarcat]]