/// <summary> /// Handler for the selectclicked event of the finduser control. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void SelectClickedHandler(object sender, System.EventArgs e) { phDeleteResult.Visible = false; List <int> selectedUserIDs = userFinder.SelectedUserIDs; if (selectedUserIDs.Count < 0) { // nothing selected, return return; } // just use the first selected user int selectedUserID = selectedUserIDs[0]; if ((selectedUserID == 0) || (selectedUserID == SessionAdapter.GetUserID())) { // can't delete anonymous coward or him/herself return; } UserEntity user = UserGuiHelper.GetUser(selectedUserID); lblNickname.Text = user.NickName; lblUserID.Text = user.UserID.ToString(); phUserInfo.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { // If the user doesn't have any access rights to management stuff, the user should // be redirected to the default of the global system. if (!SessionAdapter.HasSystemActionRights()) { // doesn't have system rights. redirect. Response.Redirect("../Default.aspx", true); } // Check if the user has the right systemright bool userHasAccess = SessionAdapter.HasSystemActionRight(ActionRights.UserManagement); if (!userHasAccess) { // no, redirect to admin default page, since the user HAS access to the admin menu. Response.Redirect("Default.aspx", true); } // set these form variables to their required values, so the InsertParameters of the datasource control can pick them up when a new ip ban // entity is inserted. _userID.Value = SessionAdapter.GetUserID().ToString(); _currentDate.Value = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); }