diff --git a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs index 7201dab..b8a45ba 100644 --- a/400-SOURCECODE/AIAHTML5.API/Models/Users.cs +++ b/400-SOURCECODE/AIAHTML5.API/Models/Users.cs @@ -23,23 +23,28 @@ namespace AIAHTML5.API.Models var client = new MongoClient(); var db = client.GetDatabase(Settings.Default.database); - var collection = db.GetCollection("Users"); + var collection = db.GetCollection("Users"); // var builder = Builders.Filter; BsonDocument filter = new BsonDocument(); filter.Add("loginId", credentials["username"].ToString()); filter.Add("password", credentials["password"].ToString()); - dynamic userDetails = collection.Find(filter).SingleOrDefault(); - logger.Debug("userDetails= " + userDetails.ElementCount); - if (userDetails.ElementCount > 0) - { + + FilterDefinition[] filterCondition = { Builders.Filter.Eq("loginId", credentials["username"].ToString()), + Builders.Filter.Eq("password", credentials["password"].ToString())}; + + dynamic userDetails = collection.Find(Builders.Filter.And(filterCondition)).SingleOrDefault(); + + //logger.Debug("userDetails= " + userDetails.ElementCount); + //if (userDetails.ElementCount > 0) + //{ return userDetails; - } - else - { - return AIAConstants.USER_NOT_FOUND; - } + //} + //else + //{ + // return AIAConstants.USER_NOT_FOUND; + //} } catch(Exception e) { diff --git a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj index dd3527c..0766c20 100644 --- a/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj +++ b/400-SOURCECODE/AIAHTML5.Web/AIAHTML5.Web.csproj @@ -50,7 +50,6 @@ - @@ -43228,7 +43227,6 @@ - diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js index a4b02e3..c0c7263 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js @@ -20,6 +20,10 @@ function ($scope, $rootScope, pages, log,Modules,$http,$compile) { //load json data $scope.loadCurriculumBuiderData = function () { + + //get current path + var currentURL = $location.path(); + $http({ method: 'GET', url: 'content/data/json/cb/cb_list_content.json' }).success(function (data) { $scope.listCurriculumBuilder = data; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 7043864..35add25 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -170,7 +170,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($('#MainImage') != null) { $('#MainImage').remove(); } - $rootScope.currentActiveModuleTitle = Modules[0].Name; + // $rootScope.currentActiveModuleTitle = Modules[0].Name; $("#bodyViewList").empty(); //for default load if ($event == null || $event == undefined) { @@ -363,6 +363,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //load json data for body view $scope.loadDissectibleAnatomyData = function () { + //get current path + var currentURL = $location.path(); + var selectedModuleName = ''; + angular.forEach( $rootScope.userModules, function (value, key) { + // alert(value.slug + 'and currentURL= ' + currentURL + 'NAD value.name= ' + value.name); + if (value.slug === currentURL.replace('/','')) { + selectedModuleName = value.name; + // alert('moduleName= '+moduleName) + } + $rootScope.currentActiveModuleTitle = selectedModuleName; + }) + + $rootScope.ClearIframe(); //load common data diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index e970b4c..33053ec 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -72,9 +72,9 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService,Authentica $rootScope.shapestyleborderStyles = "solid"; $rootScope.initializeAIA = function () { + $rootScope.isLoading = false; $rootScope.isVisibleLogin = true; - $rootScope.isVisibleIndex = false; } @@ -86,11 +86,11 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService,Authentica $rootScope.userModules ; $rootScope.AuthenticateUser = function (userInfo) { + AuthenticationService.authenticateUser(userInfo) .then( function (result) { - $rootScope.userData = result; $rootScope.userModules = result.modules; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js index 3f29507..d7a573b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LinkController.js @@ -19,7 +19,8 @@ function ($scope, $rootScope, log, pages, $routeParams) { // code that will be executed ... // every time this view is loaded - for (var i = 0; i < $scope.links.length; i++) { + + for (var i = 0; i < $scope.links.length; i++) { if ($scope.links[i].modname == $routeParams.modname) { $rootScope.currentActiveModuleTitle = $scope.links[i].title; $scope.objdata = $scope.links[i].objurl; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js deleted file mode 100644 index aa044cd..0000000 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LoginController.js +++ /dev/null @@ -1,72 +0,0 @@ -'use strict'; - -AIA.controller("LoginController", ["$scope", "$rootScope", "$location", "$window", "AuthenticationService", -function ($scope, $rootScope,$location, $window, AuthenticationService) { - - $scope.userInfo = { - username: null, - password: null - }; - - $scope.AuthenticateUser = function (userInfo) { - AuthenticationService.authenticateUser(userInfo) - .then( - - function (result) { - - if (result.length > 0) { - angular.forEach(result, function (value, key) { - - if (value.Name == "modules") { - $scope.modules = value.Value; - var moduleList = [] - angular.forEach($scope.modules, function (value, key) { - - - moduleList.push( - - { - - "ModuleName": value[0].Value, - "ModuleSlug": value[1].Value - - } - - ); - }); - localStorage.setItem("modules", moduleList); - - $scope.name = "HELLO"; - // $location.url('/index.html') - $window.location.assign('/index.html'); - - } - - - - // if ((value._id == 1) - }) - } - //alert('user authentication = ' + result) - }, - function (error) { - // handle errors here - console.log(' $rootScope.BodyLayerData= ' + error.statusText); - }); - //.success(function (data) { - - // alert('user authentication= '+data) - - // }) - // .error(function () { - // alert('issue in authentocation') - // }) - } - - - $scope.showModules = function () { - $scope.modules = localStorage.getItem("modules"); - - } -} -]) \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js index dd59b77..63ac5df 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/main/AIA.js @@ -13,14 +13,7 @@ AIA.constant('pages', [ pageUrl: 'index.html', pageController: 'HomeController' }, - { - // id:0, - name: 'Login', - pageSlug: 'login', - pageUrl: 'login.html', - pageController: 'AuthenticationController' - }, - { // id:1, + { // id:1, name: 'Dissectible Anatomy Views List', pageSlug: 'da-view-list', pageUrl: 'app/views/da/da-body-view-list.html', @@ -49,7 +42,7 @@ AIA.constant('pages', [ }, { // id:5, name: '3D Anatomy', - pageSlug: '3dAnatomy', + pageSlug: '3d-anatomy-list', pageUrl: 'app/views/3dA/3dA-view.html', pageController: '3dAController' diff --git a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js index 921a3a1..8bcdc16 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/services/AuthenticationService.js @@ -3,7 +3,7 @@ authenticateUser: function (userInfo) { var deferred = $q.defer(); - $http.post('http://localhost:95/API/api/Authenticate', JSON.stringify(userInfo), { + $http.post('/API/api/Authenticate', JSON.stringify(userInfo), { headers: { 'Content-Type': 'application/json' } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html index b753659..af46d1a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html @@ -1,4 +1,4 @@ -
+
@@ -46,8 +46,7 @@
- - + diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 5147b45..372ff74 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -1233,7 +1233,6 @@ - diff --git a/400-SOURCECODE/AIAHTML5.Web/login.html b/400-SOURCECODE/AIAHTML5.Web/login.html deleted file mode 100644 index e9a4f02..0000000 --- a/400-SOURCECODE/AIAHTML5.Web/login.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - A.D.A.M. Interactive Anatomy - - - - - - - - - -
-
-
- -
-
-

A.D.A.M. Interactive Anatomy

-

The most compresive online interactive anatomy learning resource

-
-
-
- -
-
-
- -
-
- - - - -
- - -
- Forgot User ID? - - -
-
- - -
- - -
- Forgot Password? -
-
- -
-
-
-
- -
-
-
- - -
-
Copyright © 2016 Ebix Inc. All rights reserved.
-
- - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file