public static int ChangeUserPassword(int userId, string newPassword) { // load user account esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); try { UserInfo user = usersService.GetUserById(userId); // change WebsitePanel account password int result = usersService.ChangeUserPassword(userId, newPassword); if (result < 0) { return(result); } // change auth cookie if (String.Compare(user.Username, AuthTicket.Name, true) == 0) { FormsAuthenticationTicket ticket = CreateAuthTicket(user.Username, newPassword, user.Role, AuthTicket.IsPersistent); SetAuthTicket(ticket, AuthTicket.IsPersistent); } return(result); } catch (Exception ex) { throw ex; } }
public static UserInfo GetCurrentUser() { UserInfo user = null; if (AuthTicket != null) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService); user = usersService.GetUserByUsername(AuthTicket.Name); } return(user); }
public static int ChangeUserStatus(int userId, UserStatus status) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); try { // add user to WebsitePanel server return(usersService.ChangeUserStatus(userId, status)); } catch (Exception ex) { throw ex; } }
public static int DeleteUserAccount(int userId) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); try { // add user to WebsitePanel server return(usersService.DeleteUser(userId)); } catch (Exception ex) { throw ex; } }
public static int AddUserAccount(List <string> log, UserInfo user, bool sendLetter) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); try { // add user to WebsitePanel server return(usersService.AddUser(user, sendLetter)); } catch (Exception ex) { throw ex; } }
public static int UpdateUserAccount(string taskId, UserInfo user) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); try { // update user in WebsitePanel return(usersService.UpdateUserTask(taskId, user)); } catch (Exception ex) { throw ex; } }