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