- Timestamp:
- 05/30/16 16:52:40 (9 years ago)
- Location:
- branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/AccessAdministrationClient.cs
r13844 r13862 26 26 using System.ServiceModel; 27 27 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels; 28 using HeuristicLab.Clients.Hive.WebJobManager.Services;29 28 using System.Collections.Generic; 30 29 using System.ServiceModel.Security; 31 32 namespace HeuristicLab.Clients.Access.Administration 30 using HeuristicLab.Clients.Access; 31 32 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports 33 33 { 34 34 /// <summary> … … 485 485 } 486 486 #endregion 487 488 internal bool CheckLogin() 489 { 490 try 491 { 492 this.RefreshUsers(); 493 return true; 494 } 495 catch (SecurityAccessDeniedException e) 496 { 497 return false; 498 } 499 catch (MessageSecurityException e) 500 { 501 return false; 502 } 503 } 487 504 } 488 505 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/HiveAdminClientWeb.cs
r13754 r13862 25 25 using HeuristicLab.Core; 26 26 using HeuristicLab.Clients.Hive.WebJobManager.Services; 27 28 namespace HeuristicLab.Clients.Hive 27 using System.ServiceModel.Security; 28 29 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports 29 30 { 30 31 [Item("Hive Administrator", "Hive Administrator")] … … 99 100 }); 100 101 } 101 catch 102 { 103 throw ;102 catch(Exception e) 103 { 104 throw e; 104 105 } 105 106 finally … … 200 201 } 201 202 } 203 204 internal bool CheckLogin() 205 { 206 try 207 { 208 this.Refresh(); 209 return true; 210 } 211 catch (MessageSecurityException e) 212 { 213 return false; 214 } 215 catch(SecurityAccessDeniedException e) 216 { 217 return false; 218 } 219 } 202 220 } 203 221 } -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/HiveClientWeb.cs
r13860 r13862 33 33 using HeuristicLab.PluginInfrastructure; 34 34 using TS = System.Threading.Tasks; 35 using HeuristicLab.Clients.Hive.WebJobManager.Services;36 using HeuristicLab.Clients.Common.Properties;37 35 using Microsoft.AspNetCore.Hosting; 38 using HeuristicLab.Clients.Hive.WebJobManager.Services.Imports; 39 40 namespace HeuristicLab.Clients.Hive.WebJobManager 36 37 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports 41 38 { 42 39 /// <summary> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/Imports/HiveServiceLocatorWeb.cs
r13860 r13862 11 11 using System.Threading.Tasks; 12 12 13 namespace HeuristicLab.Clients.Hive.WebJobManager.Services 13 namespace HeuristicLab.Clients.Hive.WebJobManager.Services.Imports 14 14 { 15 15 /// <summary> -
branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Services/WebLoginService.cs
r13860 r13862 21 21 22 22 23 using HeuristicLab.Clients.Access.Administration;24 23 using HeuristicLab.Clients.Hive.WebJobManager.Models; 24 using HeuristicLab.Clients.Hive.WebJobManager.Services.Imports; 25 25 using HeuristicLab.Clients.Hive.WebJobManager.ViewModels; 26 26 using System; … … 48 48 private List<HiveWebUser> loggedinUsers; 49 49 private List<QueryWebClient> queryclients; 50 private List<OkbAdministrationWebClient> okbmanclients; 50 51 /// <summary> 51 52 /// Service instance that keeps all the information per user seperated. Data is in different lists so … … 77 78 adminclients = new List<HiveAdminClientWeb>(); 78 79 loggedinUsers = new List<HiveWebUser>(); 79 queryclients = new List<QueryWebClient>(); 80 queryclients = new List<QueryWebClient>(); 81 okbmanclients = new List<OkbAdministrationWebClient>(); 80 82 } 81 83 /// <summary> … … 94 96 loggedIn.Add(log); 95 97 locators.Add(loc); 98 96 99 webclients.Add(new HiveClientWeb(loc, log.userId)); 97 100 fileopeners.Add(new FileOpeningService(log.userId)); 98 101 jobopeners.Add(new FileOpeningService(log.userId)); 99 accessclients.Add(new AccessAdministrationClient(log.userId)); 100 adminclients.Add(new HiveAdminClientWeb(log.userId)); 102 var acc = new AccessAdministrationClient(log.userId); 103 if(acc.CheckLogin()) 104 accessclients.Add(acc); 101 105 loggedinUsers.Add(new HiveWebUser(log.userId, log.loginName, false).updateUserInfo()); 102 queryclients.Add(new QueryWebClient(log.userId)); 103 } 104 public void newLoginOKBOnly(LoginViewModel log, QueryWebClient qwc) 106 var ad = new HiveAdminClientWeb(log.userId); 107 if(ad.CheckLogin()) 108 adminclients.Add(ad); 109 var qu = new QueryWebClient(log.userId); 110 if(qu.CheckLogin()) 111 queryclients.Add(qu); 112 var okb = new OkbAdministrationWebClient(log.userId); 113 if (okb.CheckLogin()) 114 okbmanclients.Add(okb); 115 } 116 public void newLoginOKBOnly(LoginViewModel log, QueryWebClient qwc, string pass) 105 117 { 106 118 destroyPossiblePreviousSessions(log.loginName); … … 113 125 queryclients.Add(qwc); 114 126 loggedinUsers.Add(new HiveWebUser(log.userId, log.loginName, true).updateUserInfo()); 127 var okb = new OkbAdministrationWebClient(log, pass); 128 if (okb.CheckLogin()) 129 okbmanclients.Add(okb); 115 130 116 131 } … … 194 209 { 195 210 return loggedinUsers.Find(x => x.webIdToken == id); 211 } 212 213 public OkbAdministrationWebClient getOkbAdminClient(Guid id) 214 { 215 return okbmanclients.Find(x => x.UserId == id); 196 216 } 197 217 /// <summary> … … 209 229 adminclients.RemoveAll(x => x.userId == id); 210 230 queryclients.RemoveAll(x => x.UserId == id); 231 okbmanclients.RemoveAll(x => x.UserId == id); 211 232 loggedIn.RemoveAll(x => x.userId == id); 212 233 loggedinUsers.RemoveAll(x => x.webIdToken == id);
Note: See TracChangeset
for help on using the changeset viewer.