using HeuristicLab.Clients.Access.Administration; using HeuristicLab.Clients.Hive.WebJobManager.Services; using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User; using Microsoft.AspNet.SignalR; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace HeuristicLab.Clients.Hive.WebJobManager.Hubs { public class UserInfoHub: Hub { private WebLoginService weblog; private Guid userId; private AccessAdministrationClient aac; private void loader() { weblog = WebLoginService.Instance; string uid = Context.QueryString["userid"]; if (uid == null || uid == "" || Guid.Parse(uid) == Guid.Empty) { userId = Guid.Empty; } else { userId = Guid.Parse(uid); aac = weblog.getAccessAdminClient(userId); } } public void resetPassword(string user) { loader(); Guid userid = Guid.Parse(user); Access.User u = new UserViewModel(aac).refreshUsers().getUserById(userid); var pass = aac.resetPassword(userid); Clients.Caller.showNewPass(pass); } } }