public override Task OnConnected() { var name = PXAccess.GetUserName(); Groups.Add(Context.ConnectionId, name); return(base.OnConnected()); }
public bool CanPostToClosedPeriod() { GLSetup setup = PXSelect <GLSetup> .Select(Graph); return(setup.RestrictAccessToClosedPeriods != true || !string.IsNullOrEmpty(PredefinedRoles.FinancialSupervisor) && System.Web.Security.Roles.IsUserInRole(PXAccess.GetUserName(), PredefinedRoles.FinancialSupervisor)); }
/// <summary> /// Gets the braches enumerator. /// </summary> private IEnumerable <PXAccess.BranchCollection.Info> GetBranches() { var currentUser = PXAccess.GetUserName(); foreach (PXAccess.BranchCollection.Info item in PXAccess.GetBranches(currentUser, true)) { yield return(item); } }
protected override void Dispose(bool disposing) { if (HttpContext.Current != null && HttpContext.Current.Session != null) { PXLogin.LogoutUser(PXAccess.GetUserName(), HttpContext.Current.Session.SessionID); } FormsAuthenticationModule.SignOut(); base.Dispose(disposing); }
public void SaveCurrentContextValues(string companyName, object parentLongOperationKey) { this._parentFinished = false; this._parentLongOperationKey = parentLongOperationKey; this.CompanyName = companyName; this.UserNameForLoginScope = PXDatabase.Companies.Length > 0 ? PXAccess.GetUserName() + "@" + this.CompanyName : PXAccess.GetUserName(); this.BranchID = PXContext.GetBranchID(); this.BusinessDate = PXContext.GetBusinessDate(); this.ScreenID = PXContext.GetScreenID(); }
protected virtual void UserPreferences_RowPersisted(PXCache sender, PXRowPersistedEventArgs e) { if (e.TranStatus == PXTranStatus.Completed) { if (System.Web.HttpContext.Current != null && String.Equals(this.UserProfile.Current.Username, PXAccess.GetUserName())) { // do not throw an exception to prevent breaking of the event-handling chain Redirector.Refresh(System.Web.HttpContext.Current); } } }
protected void Logout(object sender, EventArgs e) { try { PXLogin.LogoutUser(PXAccess.GetUserName(), Session.SessionID); PXContext.Session.SetString("UserLogin", string.Empty); Session.Abandon(); PX.Data.Auth.ExternalAuthHelper.SignOut(Context, "~/Frames/Outlook/FirstRun.html"); PXDatabase.Delete <PX.SM.UserIdentity>( new PXDataFieldRestrict <PX.SM.UserIdentity.providerName>(PXDbType.VarChar, "ExchangeIdentityToken"), new PXDataFieldRestrict <PX.SM.UserIdentity.userID>(PXDbType.UniqueIdentifier, PXAccess.GetUserID()) ); } finally { PX.Data.Redirector.Redirect(System.Web.HttpContext.Current, "~/Frames/Outlook/FirstRun.html"); } }
protected virtual void SelectedFieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { if ((bool)e.NewValue == true || PXAccess.GetUserName() != ((Users)_Graph.Caches[typeof(Users)].Current).Username) { return; } EPLoginTypeAllowsRole role = (EPLoginTypeAllowsRole)e.Row; if (Access.WillSelfLock(sender, role.Rolename)) { if (Ask(Messages.Warning, Messages.UserLockingHimselfOut, MessageButtons.YesNo, MessageIcon.Warning) != WebDialogResult.Yes) { e.NewValue = true; e.Cancel = true; } } }