Example #1
0
        /// <summary>
        /// Gets the current session state user...
        /// </summary>
        /// <returns></returns>
        public static UserHandler ReturnCurrentStoredUser()
        {
            var uH = new UserHandler();

            if (UserHandler.IsUserSet())
            {
                uH = (UserHandler)HttpContext.Current.Session["currentUser"];
            }

            return uH;
        }
 /// <summary>
 /// sets the user if it is not set...
 /// </summary>
 public void SetUserInformation()
 {
     if (!UserHandler.IsUserSet())
         {
             UserHandler uH = new UserHandler();
             uH.CreateUserSession();
             this.CurrentUser = UserHandler.ReturnCurrentStoredUser();
         }
         else
         {
             this.CurrentUser = UserHandler.ReturnCurrentStoredUser();
         }
 }
Example #3
0
        /// <summary>
        /// sets the user if it is not set...
        /// </summary>
        public void SetUserInformation()
        {
            if (!UserHandler.IsUserSet())
            {
                var uH = new UserHandler();
                uH.CreateUserSession();
                this.CurrentUser = UserHandler.ReturnCurrentStoredUser();
            }
            else
            {
                this.CurrentUser = UserHandler.ReturnCurrentStoredUser();
            }

            this.CurrentUserName = this.CurrentUser.UserObject.FullName.ToString();
            CheckForSecurity();
        }
Example #4
0
        /// <summary>
        /// Gets the user's information by login ID after object is constructed
        /// </summary>
        public void CreateUserSession()
        {
            //So, again, like throughout this
            //trash heap, basically Im trying to quickly
            //emulate the same behavior that I had implemented
            //previously in the corp AD environment.
            //Because the whole thing lived inside of the corp intranet,
            //basically we had the luxury of just setting needed items
            //into a session to be used through the application and not
            //worry too too much about security restrictions...so thats whats here

            this.ID = UserHandler.ReturnLogInID();
            var fsu = new FakeUserService();

            var objUsr = fsu.GetUserByLogin(ID);

            this.UserObject = objUsr;

            //Finally set it into a session state...
            HttpContext.Current.Session["currentUser"] = this;
        }