Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebJobManager/HeuristicLab.Clients.Hive.WebJobManager/Hubs/UserInfoHub.cs @ 13777

Last change on this file since 13777 was 13741, checked in by jlodewyc, 9 years ago

#2582 Users: Load, show info, update and add

File size: 1.3 KB
Line 
1using HeuristicLab.Clients.Access.Administration;
2using HeuristicLab.Clients.Hive.WebJobManager.Services;
3using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User;
4using Microsoft.AspNet.SignalR;
5using System;
6using System.Collections.Generic;
7using System.Linq;
8using System.Threading.Tasks;
9
10namespace 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.