~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to scripts/usrmgt-server

  • Committer: mattgiuca
  • Date: 2008-02-14 00:48:06 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:449
php/phpBB3/cache: Set svn:ignore on all the php files here, since they are
auto-generated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
 
 
3
import sys
 
4
 
 
5
import common.chat
 
6
import common.makeuser
 
7
 
 
8
# usage:
 
9
#   usrmgt-server <port> <magic>
 
10
 
 
11
def create_user(props):
 
12
 
 
13
    if 'uid' not in props:
 
14
        uid = invent-uid
 
15
        props['uid'] = uid
 
16
 
 
17
    common.makeuser.make_user_db(props['username'], props['uid'],
 
18
                                 props['password'], props['nick'],
 
19
                                 props['fullname'], props['rolenm'],
 
20
                                 props['studentid'])
 
21
 
 
22
    common.makeuser.make_jail(props['username'], props['uid'])
 
23
 
 
24
    # eventually, we're going to want to grant shell access, in which
 
25
    # case we'll need to add the uid to the password file. Magic to do
 
26
    # that should go here.
 
27
 
 
28
    return props['uid']
 
29
 
 
30
if __name__ == "__main__":
 
31
    port = int(sys.argv[1])
 
32
    magic = sys.argv[2]
 
33
 
 
34
    common.chat.start_server(port, magic, False, create_user)