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

« back to all changes in this revision

Viewing changes to makeuser.py

  • Committer: mattgiuca
  • Date: 2008-07-27 11:44:59 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:955
browser: Restyled "special home" page. Now much more in-line with the existing
    file browser interface.
    Includes changes to JavaScript (the DOM layout).
    Reduced h1s -> h2s, h2s -> h3s (since H1 is the full IVLE heading).
    Added colours, borders and padding to reduce space usage on the page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import sys
31
31
import os
32
32
import os.path
33
 
import pwd
34
33
import getopt
 
34
import random
35
35
# Import modules from the website is tricky since they're in the www
36
36
# directory.
37
37
sys.path.append(os.path.join(os.getcwd(), 'www'))
84
84
    user['nick'] = user['fullname']
85
85
 
86
86
try:
87
 
    # Resolve the user's username into a UID
88
 
    # Create the user if it does not exist
89
 
    try:
90
 
        (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
91
 
    except KeyError:
92
 
        if os.system("useradd '%s'" % login) != 0:
93
 
            raise Exception("Failed to add Unix user account")
94
 
        try:
95
 
            (_,_,uid,_,_,_,_) = pwd.getpwnam(login)
96
 
        except KeyError:
97
 
            raise Exception("Failed to add Unix user account")
98
 
    user['unixid'] = uid
99
 
    # Make the user's jail
100
 
    common.makeuser.make_jail(login, uid)
101
87
    # Make the user's database entry
102
88
    common.makeuser.make_user_db(**user)
103
89
except Exception, message: