Integrate Authentication modules.
Updated code for sql that should not use parameters to expand :table_name in table name usage, since Eiffel Store will use quote, and MySQL does not like them. Merge remote-tracking branch 'jvelilla/roc_auth_v1' into ewf_v1_mod_env Conflicts: examples/demo/demo-safe.ecf modules/auth/cms_authentication_module.e
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<library name="cms" location="..\..\cms-safe.ecf" readonly="false"/>
|
||||
<library name="cms_app_env" location="..\..\library\app_env\app_env-safe.ecf" readonly="false"/>
|
||||
<library name="cms_auth_module" location="..\..\modules\auth\auth-safe.ecf" readonly="false"/>
|
||||
<library name="cms_oauth_20_module" location="..\..\modules\oauth20\oauth20-safe.ecf" readonly="false"/>
|
||||
<library name="cms_basic_auth_module" location="..\..\modules\basic_auth\basic_auth-safe.ecf" readonly="false"/>
|
||||
<library name="cms_blog_module" location="modules\blog\cms_blog_module-safe.ecf" readonly="false"/>
|
||||
<library name="cms_demo_module" location="modules\demo\cms_demo_module-safe.ecf" readonly="false"/>
|
||||
|
||||
@@ -74,7 +74,7 @@ CREATE TABLE blog_post_nodes(
|
||||
`tags` VARCHAR(255)
|
||||
);
|
||||
]"
|
||||
l_sql_storage.sql_execute_script (sql)
|
||||
l_sql_storage.sql_execute_script (sql, Void)
|
||||
if l_sql_storage.has_error then
|
||||
api.logger.put_error ("Could not initialize database for blog module", generating_type)
|
||||
end
|
||||
|
||||
@@ -69,7 +69,7 @@ CREATE TABLE tb_demo(
|
||||
`value` TEXT
|
||||
);
|
||||
]"
|
||||
l_sql_storage.sql_execute_script (sql)
|
||||
l_sql_storage.sql_execute_script (sql, Void)
|
||||
if l_sql_storage.has_error then
|
||||
api.logger.put_error ("Could not initialize database for demo module", generating_type)
|
||||
end
|
||||
|
||||
39
examples/demo/site/config/demo.json
Normal file
39
examples/demo/site/config/demo.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
CREATE TABLE `oauth2_consumers`(
|
||||
CREATE TABLE oauth2_consumers(
|
||||
`cid` INTEGER PRIMARY KEY NOT NULL CHECK(`cid`>=0),
|
||||
`name` VARCHAR(255) NOT NULL,
|
||||
`api_secret` TEXT NOT NULL,
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
CREATE TABLE :table_name (
|
||||
CREATE TABLE $table_name (
|
||||
`uid` INTEGER PRIMARY KEY NOT NULL CHECK(`uid`>=0),
|
||||
`access_token` TEXT NOT NULL,
|
||||
`created` DATETIME NOT NULL,
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="primary-tabs">
|
||||
<div>
|
||||
{foreach item="item" from="$oauth_consumers"}
|
||||
<a href="{$site_url/}account/login-with-oauth/{$item/}">Login with {$item/}</a><br>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,6 +69,10 @@ feature -- CMS setup
|
||||
a_setup.register_module (m)
|
||||
end
|
||||
|
||||
create {CMS_OAUTH_20_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
|
||||
create {CMS_DEBUG_MODULE} m.make
|
||||
m.enable
|
||||
a_setup.register_module (m)
|
||||
|
||||
Reference in New Issue
Block a user