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