Line | |
---|
1 | using HeuristicLab.Clients.Access.Administration;
|
---|
2 | using HeuristicLab.Clients.Hive.WebJobManager.Services;
|
---|
3 | using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User;
|
---|
4 | using Microsoft.AspNet.SignalR;
|
---|
5 | using System;
|
---|
6 | using System.Collections.Generic;
|
---|
7 | using System.Linq;
|
---|
8 | using System.Threading.Tasks;
|
---|
9 |
|
---|
10 | namespace HeuristicLab.Clients.Hive.WebJobManager.Hubs
|
---|
11 | {
|
---|
12 | public class UserInfoHub: Hub
|
---|
13 | {
|
---|
14 | private WebLoginService weblog;
|
---|
15 | private Guid userId;
|
---|
16 | private AccessAdministrationClient aac;
|
---|
17 | private void loader()
|
---|
18 | {
|
---|
19 | weblog = WebLoginService.Instance;
|
---|
20 | string uid = Context.QueryString["userid"];
|
---|
21 | if (uid == null || uid == "" || Guid.Parse(uid) == Guid.Empty)
|
---|
22 | {
|
---|
23 | userId = Guid.Empty;
|
---|
24 | }
|
---|
25 | else
|
---|
26 | {
|
---|
27 | userId = Guid.Parse(uid);
|
---|
28 | aac = weblog.getAccessAdminClient(userId);
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void resetPassword(string user)
|
---|
33 | {
|
---|
34 | loader();
|
---|
35 | Guid userid = Guid.Parse(user);
|
---|
36 | Access.User u = new UserViewModel(aac).refreshUsers().getUserById(userid);
|
---|
37 | var pass = aac.resetPassword(userid);
|
---|
38 | Clients.Caller.showNewPass(pass);
|
---|
39 | }
|
---|
40 | }
|
---|
41 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.