3 # Create/update the default administrator account (should be person_id 2).
6 admin = { 'first_name': "Default",
7 'last_name': "Administrator",
8 'email': plc['root_user'],
9 'password': plc['root_password'] }
10 persons = GetPersons(the_admin_id)
12 # AddPerson won't let you pass a person_id
13 person_id = AddPerson(admin)
14 if person_id != the_admin_id:
15 # Huh? Someone deleted the account manually from the database.
16 DeletePerson(person_id)
17 raise Exception, "Someone deleted the \"%s %s\" account from the database!" % \
18 (admin['first_name'], admin['last_name'])
19 UpdatePerson(person_id, { 'enabled': True })
21 person_id = persons[0]['person_id']
22 UpdatePerson(person_id, admin)