Updated Branches: refs/heads/master cfc6a2165 -> 642bdf4b0
fixing default page and start implementing the username/password authentication Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/642bdf4b Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/642bdf4b Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/642bdf4b Branch: refs/heads/master Commit: 642bdf4b0f24b3ef699d1c32a3b7bdbbdcc8a919 Parents: cfc6a21 Author: Pradeep Fernando <[email protected]> Authored: Sat Feb 1 20:44:06 2014 +0530 Committer: Pradeep Fernando <[email protected]> Committed: Sat Feb 1 20:44:06 2014 +0530 ---------------------------------------------------------------------- .../console/asset.jag | 5 --- .../console/controllers/router.jag | 26 +++++++------- .../console/default_page.jag | 5 +++ .../console/themes/theme1/renderers/asset.js | 38 -------------------- .../themes/theme1/renderers/default_page.js | 38 ++++++++++++++++++++ 5 files changed, 56 insertions(+), 56 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/642bdf4b/components/org.apache.stratos.manager.console/console/asset.jag ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/asset.jag b/components/org.apache.stratos.manager.console/console/asset.jag deleted file mode 100644 index f222473..0000000 --- a/components/org.apache.stratos.manager.console/console/asset.jag +++ /dev/null @@ -1,5 +0,0 @@ -<% -var caramel = require('caramel') -caramel.render({ -}); -%> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/642bdf4b/components/org.apache.stratos.manager.console/console/controllers/router.jag ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/controllers/router.jag b/components/org.apache.stratos.manager.console/console/controllers/router.jag index 25f2e52..50a3c4e 100755 --- a/components/org.apache.stratos.manager.console/console/controllers/router.jag +++ b/components/org.apache.stratos.manager.console/console/controllers/router.jag @@ -3,8 +3,6 @@ (function(){ var config=require('/config/console.json'); var log = new Log("controller.router"); - var DEFAULT_ROUTER_NAME='/asset.jag'; - var DEFAULT_PATH=config.paths.ASSET_DEFAULT_PATH; var acl = require('/util/acl.jag'); var MSG_404='Asset not found'; //Eror 404 message @@ -15,16 +13,16 @@ var sm=securityModule.cached(); //This will short circuit the handling of the requests - var passed=sm.check(session); - var tenantDomain = session.get("TENANT_DOMAIN"); - var roleArray = session.get("ROLE_ARRAY"); + //var passed=sm.check(session); + //var tenantDomain = session.get("TENANT_DOMAIN"); + //var roleArray = session.get("ROLE_ARRAY"); // comment out the above and uncomment below code bits for testing. It removes authentication/authorization // of the app. - //var passed=true; - //var tenantDomain = "carbon.super"; - //var roleArray = "["admin","Internal/Everyone"]"; + var passed=true; + var tenantDomain = "carbon.super"; + var roleArray = ["admin","Internal/Everyone"]; //Stop servicing the request if the check failed if(!passed){ @@ -74,7 +72,7 @@ if(fileTester.isExists()){ request.getMappedPath = function() { - return includePath; + return includePath; // setting path for caramel framework }; var permissionObject = acl.authorizationUtil.getPermissionObj(tenantDomain,roleArray); request.permissions = permissionObject; @@ -82,11 +80,13 @@ return; } - //Set the default path - path=DEFAULT_PATH+DEFAULT_ROUTER_NAME; - //Default - include(path); + var defaultPath='/default_page.jag'; + //Set the default path + request.getMappedPath = function() { + return defaultPath; // setting path for caramel framework + }; + include(defaultPath); return; } http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/642bdf4b/components/org.apache.stratos.manager.console/console/default_page.jag ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/default_page.jag b/components/org.apache.stratos.manager.console/console/default_page.jag new file mode 100644 index 0000000..f222473 --- /dev/null +++ b/components/org.apache.stratos.manager.console/console/default_page.jag @@ -0,0 +1,5 @@ +<% +var caramel = require('caramel') +caramel.render({ +}); +%> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/642bdf4b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/asset.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/asset.js b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/asset.js deleted file mode 100644 index 3aaf2c7..0000000 --- a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/asset.js +++ /dev/null @@ -1,38 +0,0 @@ -var render = function (theme, data, meta, require) { - // Re-create the data structure of the cartridges. - - theme('plain', { - body: [ - { - partial: '404', - context: { - title: 'My Cartridges' - } - } - ], - header: [ - { - partial: 'header', - context: { - title: 'My Cartridges', - my_cartridges: true, - button: { - link: '/cartridges.jag', - name: 'Subscribe to Cartridge', - class_name: 'btn-important' - }, - has_help: true, - help: 'Create cartridges like PHP, Python, Ruby etc.. Or create data cartridges with mySql, PostgreSQL. Directly install applications like Drupal, Wordpress etc..' - } - } - ], - title: [ - { - partial: 'title', - context: { - title: "My Cartridges" - } - } - ] - }); -}; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/642bdf4b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js new file mode 100644 index 0000000..3aaf2c7 --- /dev/null +++ b/components/org.apache.stratos.manager.console/console/themes/theme1/renderers/default_page.js @@ -0,0 +1,38 @@ +var render = function (theme, data, meta, require) { + // Re-create the data structure of the cartridges. + + theme('plain', { + body: [ + { + partial: '404', + context: { + title: 'My Cartridges' + } + } + ], + header: [ + { + partial: 'header', + context: { + title: 'My Cartridges', + my_cartridges: true, + button: { + link: '/cartridges.jag', + name: 'Subscribe to Cartridge', + class_name: 'btn-important' + }, + has_help: true, + help: 'Create cartridges like PHP, Python, Ruby etc.. Or create data cartridges with mySql, PostgreSQL. Directly install applications like Drupal, Wordpress etc..' + } + } + ], + title: [ + { + partial: 'title', + context: { + title: "My Cartridges" + } + } + ] + }); +}; \ No newline at end of file
