Last change
on this file since 13847 was
13847,
checked in by jlodewyc, 8 years ago
|
#2582 Security access implemented, directory renaming and choosing, adding more partials
|
File size:
1.8 KB
|
Rev | Line | |
---|
[13741] | 1 | using HeuristicLab.Clients.Access.Administration;
|
---|
[13805] | 2 | using HeuristicLab.Clients.Hive.WebJobManager.Controllers;
|
---|
[13741] | 3 | using HeuristicLab.Clients.Hive.WebJobManager.Services;
|
---|
| 4 | using HeuristicLab.Clients.Hive.WebJobManager.ViewModels.User;
|
---|
| 5 | using Microsoft.AspNet.SignalR;
|
---|
| 6 | using System;
|
---|
| 7 | using System.Collections.Generic;
|
---|
| 8 | using System.Linq;
|
---|
| 9 | using System.Threading.Tasks;
|
---|
| 10 |
|
---|
| 11 | namespace HeuristicLab.Clients.Hive.WebJobManager.Hubs
|
---|
| 12 | {
|
---|
[13805] | 13 | /// <summary>
|
---|
| 14 | /// Small SignalR hub to change the password from a user
|
---|
| 15 | /// </summary>
|
---|
[13741] | 16 | public class UserInfoHub: Hub
|
---|
| 17 | {
|
---|
| 18 | private WebLoginService weblog;
|
---|
| 19 | private Guid userId;
|
---|
| 20 | private AccessAdministrationClient aac;
|
---|
[13805] | 21 | /// <summary>
|
---|
| 22 | /// Loads required services
|
---|
| 23 | /// </summary>
|
---|
[13741] | 24 | private void loader()
|
---|
| 25 | {
|
---|
| 26 | weblog = WebLoginService.Instance;
|
---|
| 27 | string uid = Context.QueryString["userid"];
|
---|
| 28 | if (uid == null || uid == "" || Guid.Parse(uid) == Guid.Empty)
|
---|
| 29 | {
|
---|
| 30 | userId = Guid.Empty;
|
---|
| 31 | }
|
---|
| 32 | else
|
---|
| 33 | {
|
---|
| 34 | userId = Guid.Parse(uid);
|
---|
| 35 | aac = weblog.getAccessAdminClient(userId);
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
[13805] | 38 | /// <summary>
|
---|
| 39 | /// Request to change pass
|
---|
| 40 | /// </summary>
|
---|
| 41 | /// <param name="user">User id</param>
|
---|
[13741] | 42 | public void resetPassword(string user)
|
---|
| 43 | {
|
---|
| 44 | loader();
|
---|
| 45 | Guid userid = Guid.Parse(user);
|
---|
[13847] | 46 | Access.User u = new UserViewModel(aac, weblog.getCurrentUser(userId)).refreshUsers().getUserById(userid);
|
---|
[13741] | 47 | var pass = aac.resetPassword(userid);
|
---|
[13805] | 48 | UserController.sendPassmail(u, pass);//Send mail + show pass
|
---|
[13741] | 49 | Clients.Caller.showNewPass(pass);
|
---|
| 50 | }
|
---|
| 51 | }
|
---|
| 52 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.