X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=db-config.d%2F002-system_site;fp=db-config.d%2F01-init;h=ced75a77afe921fcb4ec6e5c4dafafef6043642a;hb=50e2adc8f9e2a58efafedbad31b66b347b0ac61f;hp=1880c39378db2077705a608f7c69cab41b0a0021;hpb=a1d9cfaed3cedc96f0a6b23c934b28026c2afba4;p=myplc.git diff --git a/db-config.d/01-init b/db-config.d/002-system_site similarity index 71% rename from db-config.d/01-init rename to db-config.d/002-system_site index 1880c39..ced75a7 100644 --- a/db-config.d/01-init +++ b/db-config.d/002-system_site @@ -1,24 +1,10 @@ -# Create/update the default administrator account (should be person_id 2). +# -*-python-*- +# $Id$ +# $URL$ +#################### +# Create/update and populate the default site (should be site_id 1) -admin = { 'person_id': 2, - 'first_name': "Default", - 'last_name': "Administrator", - 'email': plc['root_user'], - 'password': plc['root_password'] } -persons = GetPersons([admin['person_id']]) -if not persons: - person_id = AddPerson(admin) - if person_id != admin['person_id']: - # Huh? Someone deleted the account manually from the database. - DeletePerson(person_id) - raise Exception, "Someone deleted the \"%s %s\" account from the database!" % \ - (admin['first_name'], admin['last_name']) - UpdatePerson(person_id, { 'enabled': True }) -else: - person_id = persons[0]['person_id'] - UpdatePerson(person_id, admin) - -# Create/update the default site (should be site_id 1) +### plc_www holds the contents of the PLC_WWW configuration category if plc_www['port'] == '80': url = "http://" + plc_www['host'] + "/" elif plc_www['port'] == '443':