1
1
# -*- coding: iso-8859-1 -*-
3
MoinMoin - create a user account
3
MoinMoin - create a user account
5
@copyright: 2006 by MoinMoin:ThomasWaldmann
6
@license: GNU GPL, see COPYING for details.
5
@copyright: 2006 MoinMoin:ThomasWaldmann
6
@license: GNU GPL, see COPYING for details.
9
from MoinMoin.script._util import MoinScript
9
from MoinMoin.script import MoinScript
11
11
class PluginScript(MoinScript):
15
This tool allows you to create user accounts via a command line interface.
17
Detailed Instructions:
18
======================
19
General syntax: moin [options] account create [create-options]
21
[options] usually should be:
22
--config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
24
[create-options] see below:
25
0. Verify that the account does not exist.
26
Currently this script does not check if the user exists.
28
1. Verify that you have specified the right options.
29
This script does no verification of email addresses or the like.
31
2. To create a normal user 'JohnSmith' with an alias of 'JSmith' and an
32
email of 'john@smith.com'
33
moin ... account create --name JohnSmith --alias JSmith --email john@smith.com
12
36
def __init__(self, argv, def_values):
13
37
MoinScript.__init__(self, argv, def_values)
14
38
self.parser.add_option(
42
66
self.init_request()
43
67
request = self.request
45
from MoinMoin import user, wikiutil
69
from MoinMoin import user
46
70
u = user.User(request, None, self.options.uname, password=self.options.password)
47
71
u.email = self.options.email
48
72
u.aliasname = self.options.ualiasname or ''
49
73
print " %-20s %-25s %-35s" % (u.id, u.name, u.email),