diff --git a/examples/demo/site/config/application_configuration.json b/examples/demo/site/config/application_configuration.json deleted file mode 100644 index a4109cb..0000000 --- a/examples/demo/site/config/application_configuration.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "database": { - "datasource": { - "driver": "odbc", - "environment": "odbc-sqlite" - }, - "environments": { - "odbc-sqlite": { - "connection_string":"Driver=SQLite3 ODBC Driver;Database=./site/database.sqlite;LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;" - }, - "odbc-mysql": { - "connection_string":"Driver=mysql ODBC Driver;Server=localhost;Port=3306;Database=roc;Uid=roc;Pwd=roc;" - }, - "mysql": { - "connection_string":"Driver=mysql;Server=localhost;Port=3306;Database=roc;Uid=roc;Pwd=roc;" - }, - "development": { - "connection_string":"Server=localhost;Port=3306;Database=cms_dev;Uid=root;Pwd=;" - }, - "production": { - "connection_string":"" - } - } - }, - "smtp": { - "server": "localhost" - }, - "logger": { - "level":"error", - "type":"stderr", - "backup_count":"4" - }, - "server": { - "mode":"html" - } - -} - - diff --git a/examples/demo/site/config/modules/login/login.json b/examples/demo/site/modules/login/login.json similarity index 100% rename from examples/demo/site/config/modules/login/login.json rename to examples/demo/site/modules/login/login.json diff --git a/examples/demo/site/config/modules/login/account_activation.html b/examples/demo/site/modules/login/mail_templates/account_activation.html similarity index 100% rename from examples/demo/site/config/modules/login/account_activation.html rename to examples/demo/site/modules/login/mail_templates/account_activation.html diff --git a/examples/demo/site/config/modules/login/account_new_password.html b/examples/demo/site/modules/login/mail_templates/account_new_password.html similarity index 100% rename from examples/demo/site/config/modules/login/account_new_password.html rename to examples/demo/site/modules/login/mail_templates/account_new_password.html diff --git a/examples/demo/site/config/modules/login/account_re_activation.html b/examples/demo/site/modules/login/mail_templates/account_re_activation.html similarity index 100% rename from examples/demo/site/config/modules/login/account_re_activation.html rename to examples/demo/site/modules/login/mail_templates/account_re_activation.html diff --git a/examples/demo/site/config/modules/login/account_welcome.html b/examples/demo/site/modules/login/mail_templates/account_welcome.html similarity index 100% rename from examples/demo/site/config/modules/login/account_welcome.html rename to examples/demo/site/modules/login/mail_templates/account_welcome.html diff --git a/examples/demo/site/config/modules/login/oauth2_gmail.json b/examples/demo/site/modules/login/oauth2_gmail.json similarity index 100% rename from examples/demo/site/config/modules/login/oauth2_gmail.json rename to examples/demo/site/modules/login/oauth2_gmail.json diff --git a/examples/demo/site/scripts/oauth2_consumers.sql b/examples/demo/site/modules/login/scripts/oauth2_consumers.sql similarity index 100% rename from examples/demo/site/scripts/oauth2_consumers.sql rename to examples/demo/site/modules/login/scripts/oauth2_consumers.sql diff --git a/examples/demo/site/scripts/oauth2_consumers_initialize.sql b/examples/demo/site/modules/login/scripts/oauth2_consumers_initialize.sql similarity index 100% rename from examples/demo/site/scripts/oauth2_consumers_initialize.sql rename to examples/demo/site/modules/login/scripts/oauth2_consumers_initialize.sql diff --git a/examples/demo/site/scripts/oauth2_template.sql b/examples/demo/site/modules/login/scripts/oauth2_template.sql similarity index 100% rename from examples/demo/site/scripts/oauth2_template.sql rename to examples/demo/site/modules/login/scripts/oauth2_template.sql diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_login.tpl b/examples/demo/site/modules/login/templates/block_login.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_login.tpl rename to examples/demo/site/modules/login/templates/block_login.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_new_password.tpl b/examples/demo/site/modules/login/templates/block_new_password.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_new_password.tpl rename to examples/demo/site/modules/login/templates/block_new_password.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_post_password.tpl b/examples/demo/site/modules/login/templates/block_post_password.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_post_password.tpl rename to examples/demo/site/modules/login/templates/block_post_password.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_post_reactivate.tpl b/examples/demo/site/modules/login/templates/block_post_reactivate.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_post_reactivate.tpl rename to examples/demo/site/modules/login/templates/block_post_reactivate.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_post_register.tpl b/examples/demo/site/modules/login/templates/block_post_register.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_post_register.tpl rename to examples/demo/site/modules/login/templates/block_post_register.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_post_reset.tpl b/examples/demo/site/modules/login/templates/block_post_reset.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_post_reset.tpl rename to examples/demo/site/modules/login/templates/block_post_reset.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_reactivate.tpl b/examples/demo/site/modules/login/templates/block_reactivate.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_reactivate.tpl rename to examples/demo/site/modules/login/templates/block_reactivate.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_register.tpl b/examples/demo/site/modules/login/templates/block_register.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_register.tpl rename to examples/demo/site/modules/login/templates/block_register.tpl diff --git a/examples/demo/site/themes/bootstrap/modules/login/templates/block_reset_password.tpl b/examples/demo/site/modules/login/templates/block_reset_password.tpl similarity index 100% rename from examples/demo/site/themes/bootstrap/modules/login/templates/block_reset_password.tpl rename to examples/demo/site/modules/login/templates/block_reset_password.tpl diff --git a/library/app_env/src/application_environment.e b/library/app_env/src/application_environment.e index fa897b2..c663b89 100644 --- a/library/app_env/src/application_environment.e +++ b/library/app_env/src/application_environment.e @@ -109,7 +109,7 @@ feature -- Access: internal do p := internal_application_config_path if p = Void then - p := config_path.extended ("application_configuration.json") + p := config_path.extended (name + ".json") internal_application_config_path := p end Result := p diff --git a/modules/auth/cms_authentication_email_service_parameters.e b/modules/auth/cms_authentication_email_service_parameters.e index e9f2e91..8e0d4ef 100644 --- a/modules/auth/cms_authentication_email_service_parameters.e +++ b/modules/auth/cms_authentication_email_service_parameters.e @@ -21,7 +21,7 @@ feature {NONE} -- Initialization s: detachable READABLE_STRING_32 l_contact_email, l_subject_register, l_subject_activate, l_subject_password, l_subject_oauth: detachable READABLE_STRING_8 do - setup := a_cms_api.setup + cms_api := a_cms_api -- Use global smtp setting if any, otherwise "localhost" smtp_server := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.text_item_or_default ("smtp", "localhost")) l_site_name := utf.escaped_utf_32_string_to_utf_8_string_8 (a_cms_api.setup.site_name) @@ -92,6 +92,8 @@ feature {NONE} -- Initialization feature -- Access + cms_api: CMS_API + smtp_server: IMMUTABLE_STRING_8 admin_email: IMMUTABLE_STRING_8 @@ -132,8 +134,11 @@ feature {NONE} -- Implementation: Template template_path (a_name: READABLE_STRING_GENERAL): PATH -- Location of template named `a_name'. + local + p: PATH do - Result := setup.environment.config_path.extended ("modules").extended ("login").extended (a_name) + create p.make_from_string (a_name) + Result := cms_api.module_location_by_name ("login").extended ("mail_templates").extended (a_name) end template_string (a_name: READABLE_STRING_GENERAL; a_default: STRING): STRING @@ -151,8 +156,6 @@ feature {NONE} -- Implementation: Template feature {NONE} -- Implementation - setup: CMS_SETUP - read_template_file (a_path: PATH): detachable STRING -- Read the content of the file at path `a_path'. local diff --git a/modules/auth/cms_authentication_module.e b/modules/auth/cms_authentication_module.e index 20a9f84..e6ad7ce 100644 --- a/modules/auth/cms_authentication_module.e +++ b/modules/auth/cms_authentication_module.e @@ -102,13 +102,13 @@ feature {CMS_API} -- Module management if attached {CMS_STORAGE_SQL_I} api.storage as l_sql_storage then if not l_sql_storage.sql_table_exists ("oauth2_consumers") then --| Schema - l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers.sql")) + l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers.sql")) if l_sql_storage.has_error then api.logger.put_error ("Could not initialize database for blog module", generating_type) end -- TODO workaround. - l_sql_storage.sql_execute_file_script (l_setup.environment.path.extended ("scripts").extended ("oauth2_consumers_initialize.sql")) + l_sql_storage.sql_execute_file_script (api.modules_location.extended ("scripts").extended ("oauth2_consumers_initialize.sql")) end -- TODO workaround, until we have an admin module @@ -131,7 +131,7 @@ feature {CMS_API} -- Module management if not l_sql_storage.sql_table_exists (ic.item) then create l_params.make (1) l_params.force (ic.item, "table_name") - l_sql_storage.sql_execute_file_script_with_params (l_setup.environment.path.extended ("scripts").extended ("oauth2_template.sql"), l_params) + l_sql_storage.sql_execute_file_script_with_params (api.modules_location.extended ("scripts").extended ("oauth2_template.sql"), l_params) end end end