diff --git a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs index cab1cf8..dea6361 100644 --- a/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs +++ b/400-SOURCECODE/AIAHTML5.API/Controllers/AuthenticateController.cs @@ -31,17 +31,26 @@ namespace AIAHTML5.API.Controllers { ILog logger = log4net.LogManager.GetLogger((System.Reflection.MethodBase.GetCurrentMethod().DeclaringType)); logger.Debug("inside POST"); - - dynamic authenticationRepsonse = AIAHTML5.API.Models.Users.AuthenticateUser(credentials); - if (Convert.ToString(authenticationRepsonse) != AIAConstants.USER_NOT_FOUND && Convert.ToString(authenticationRepsonse) != AIAConstants.ERROR_IN_FECTHING_DETAILS) - { - string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(authenticationRepsonse); - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userDetails) }; + + bool isUserAuthenticatedByDefault = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["isUserAuthenticated"]); + if (isUserAuthenticatedByDefault) { + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent("true") }; + } else { - return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) }; + dynamic authenticationRepsonse = AIAHTML5.API.Models.Users.AuthenticateUser(credentials); + if (Convert.ToString(authenticationRepsonse) != AIAConstants.USER_NOT_FOUND && Convert.ToString(authenticationRepsonse) != AIAConstants.ERROR_IN_FECTHING_DETAILS) + { + string userDetails = Newtonsoft.Json.JsonConvert.SerializeObject(authenticationRepsonse); + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(userDetails) }; + } + else + { + return new HttpResponseMessage { StatusCode = HttpStatusCode.OK, Content = new StringContent(authenticationRepsonse) }; + + } } } diff --git a/400-SOURCECODE/AIAHTML5.API/Web.config b/400-SOURCECODE/AIAHTML5.API/Web.config index d8ba05f..f592e55 100644 --- a/400-SOURCECODE/AIAHTML5.API/Web.config +++ b/400-SOURCECODE/AIAHTML5.API/Web.config @@ -39,6 +39,7 @@ + diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll index 70aa98b..0e170d5 100644 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll +++ b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config index d8ba05f..f592e55 100644 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config +++ b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.dll.config @@ -39,6 +39,7 @@ + diff --git a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb index bd13005..4b7d4bc 100644 --- a/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb +++ b/400-SOURCECODE/AIAHTML5.API/bin/AIAHTML5.API.pdb diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 207bfc8..0e5f2b0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1,7 +1,7 @@ 'use strict'; -AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants", -function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants) { +AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", "$timeout", "DataService", "AuthenticationService", "LoginConstants","UserModules", +function ($rootScope, Modules, $log, $location, $timeout, DataService, AuthenticationService, LoginConstants, UserModules) { //$scope.pageToOpen = { // name: 'MainMenu' @@ -99,7 +99,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic if (userInfo.username == "" || userInfo.username == null || userInfo.password == "" || userInfo.password == null) { alert("Username or Password is missing."); - $rootScope.isVisibleLogin = true; + } else { @@ -107,6 +107,14 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic .then( function (result) { + if (result == 'true') { + $rootScope.userModules = UserModules; + $rootScope.isVisibleLogin = true; + // $rootScope.userData = result; + $rootScope.isVisibleLogin = false; + } + else + { if (result == LoginConstants.USER_NOT_FOUND) { $rootScope.isVisibleLogin = true; alert(LoginConstants.USER_NOT_FOUND); @@ -126,6 +134,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic localStorage.setItem('loggedInUserDetails', JSON.stringify(result)); } } + } }, function (error) { console.log(' Error in authentication = ' + error.statusText); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index bac9f02..bdf11ba 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -287,6 +287,76 @@ AIA.constant("LoginConstants", { }) +AIA.constant("UserModules", [ + { + "name": "Dissectible Anatomy", + "slug": "da-view-list" + }, + { + "name": "Atlas Anatomy", + "slug": "aa-view-list" + }, + { + "name": "3D Anatomy", + "slug": "3d-anatomy-list" + }, + { + "name": "Clinical Illustrations", + "slug": "clinical-illustrations" + }, + { + "name": "Clinical Animations", + "slug": "clinical-animations" + }, + { + "name": "Encyclopedia", + "slug": "Link/encyclopedia" + }, + { + "name": "Curriculum Builder", + "slug": "curriculum-builder" + }, + { + "name": "Anatomy Tests", + "slug": "anatomy-test" + }, + { + "name": "IP 10", + "slug": "Link/IP-10" + }, + { + "name": "Lab Exercises", + "slug": "lab-exercises" + }, + { + "name": "In-Depth Reports", + "slug": "Link/indepth-reports" + }, + { + "name": "Complementary and Alternative Medicine", + "slug": "Link/complementary-and-alternate-medicine" + }, + { + "name": "A.D.A.M Images", + "slug": "ADAM-images" + }, + { + "name": "Body Guide", + "slug": "Link/bodyguide" + }, + { + "name": "Symptom Navigator", + "slug": "Link/symptom-navigator" + }, + { + "name": "The Wellness Tools", + "slug": "Link/wellness-tools" + }, + { + "name": "A.D.A.M OnDemand", + "slug": "ADAM-on-demand" + } +]); AIA.config(function ($routeProvider, pages, $locationProvider) {