~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/script/account/disable.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
General syntax: moin [options] account disable [disable-options]
20
20
 
21
21
[options] usually should be:
22
 
    --config-dir=/path/to/my/cfg/ --wiki-url=http://wiki.example.org/
 
22
    --config-dir=/path/to/my/cfg/ --wiki-url=wiki.example.org/
23
23
 
24
24
[disable-options] see below:
25
25
    0. Verify that you really want to disable the account.
26
26
       While there is a disable script, no such enable script exists.
27
27
 
28
 
    1. To disable the user 'JohnSmith':
 
28
    1. If using usernames, verify that multiple usernames with the same
 
29
       user ID do not exist.
 
30
 
 
31
    2. To disable the user 'JohnSmith':
29
32
       moin ... account disable --name JohnSmith
30
33
 
31
 
    2. To disable the user 'JohnSmith', based on his UID '1198872910.78.56322':
 
34
    3. To disable the user 'JohnSmith', based on his UID '1198872910.78.56322':
32
35
       moin ... account disable --uid 1198872910.78.56322
33
36
"""
34
37
 
62
65
            u = user.User(request, self.options.uid)
63
66
        elif self.options.uname:
64
67
            u = user.User(request, None, self.options.uname)
65
 
 
66
 
        if not u.exists():
67
 
            print 'This user "%s" does not exists!' % u.name
68
 
            return
69
 
 
70
68
        print " %-20s %-25s %-35s" % (u.id, u.name, u.email),
71
69
        if not u.disabled: # only disable once
72
70
            u.disabled = 1