コード例 #1
0
        public void OnAuthorizeRequest(object s, EventArgs e)
        {
            //First check if we are upgrading/installing
            var app = (HttpApplication) s;
            HttpRequest request = app.Request;

            //check if we are upgrading/installing or if this is a captcha request
            if (request.Url.LocalPath.ToLower().EndsWith("/install/install.aspx")
                || request.Url.LocalPath.ToLower().Contains("/install/installwizard.aspx")
                || request.Url.LocalPath.ToLower().Contains("/install/upgradewizard.aspx")
                || request.Url.LocalPath.ToLower().EndsWith("captcha.aspx") 
                || request.Url.LocalPath.ToLower().EndsWith("scriptresource.axd") 
                || request.Url.LocalPath.ToLower().EndsWith("webresource.axd"))
            {
                return;
            }
            //Create a Users Online Controller
            var objUserOnlineController = new UserOnlineController();

            //Is Users Online Enabled?
            if ((objUserOnlineController.IsEnabled()))
            {
                objUserOnlineController.TrackUsers();
            }
        }
コード例 #2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// UpdateUsersOnline updates the Users Online information
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void UpdateUsersOnline()
        {
            var objUserOnlineController = new UserOnlineController();

            //Is Users Online Enabled?
            if ((objUserOnlineController.IsEnabled()))
            {
                //Update the Users Online records from Cache
                Status = "Updating Users Online";
                objUserOnlineController.UpdateUsersOnline();
                Status = "Update Users Online Successfully";
                ScheduleHistoryItem.Succeeded = true;
            }
        }
コード例 #3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// UpdateUsersOnline updates the Users Online information
        /// </summary>
        /// <history>
        ///     [cnurse]	03/14/2006	documented
        /// </history>
        /// -----------------------------------------------------------------------------
        private void UpdateUsersOnline()
        {
            var objUserOnlineController = new UserOnlineController();

            //Is Users Online Enabled?
            if ((objUserOnlineController.IsEnabled()))
            {
                //Update the Users Online records from Cache
                Status = "Updating Users Online";
                objUserOnlineController.UpdateUsersOnline();
                Status = "Update Users Online Successfully";
                ScheduleHistoryItem.Succeeded = true;
            }
        }
コード例 #4
0
        public void OnAuthorizeRequest( object s, EventArgs e )
        {
            //First check if we are upgrading/installing
            HttpApplication app = (HttpApplication)s;
            HttpRequest Request = app.Request;
            if( Request.Url.LocalPath.EndsWith( "Install.aspx" ) )
            {
                return;
            }

            // Create a Users Online Controller
            UserOnlineController objUserOnlineController = new UserOnlineController();

            // Is Users Online Enabled?
            if( objUserOnlineController.IsEnabled() )
            {
                // Track the current user
                objUserOnlineController.TrackUsers();
            }
        }
コード例 #5
0
        public void OnAuthorizeRequest(object s, EventArgs e)
        {
            //First check if we are upgrading/installing
            var app = (HttpApplication) s;
            HttpRequest request = app.Request;

            //check if we are upgrading/installing or if this is a captcha request
            if (!Initialize.ProcessHttpModule(request, false, false))
            {
                return;
            }

            //Create a Users Online Controller
            var objUserOnlineController = new UserOnlineController();

            //Is Users Online Enabled?
            if ((objUserOnlineController.IsEnabled()))
            {
                objUserOnlineController.TrackUsers();
            }
        }
コード例 #6
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// Gets whether the user in question is online
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <param name="user">The user.</param>
 /// <returns>A Boolean indicating whether the user is online.</returns>
 /// -----------------------------------------------------------------------------
 public override bool IsUserOnline(UserInfo user)
 {
     bool isOnline = false;
     var objUsersOnline = new UserOnlineController();
     if (objUsersOnline.IsEnabled())
     {
         Hashtable userList = objUsersOnline.GetUserList();
         var onlineUser = (OnlineUserInfo) userList[user.UserID.ToString()];
         if (onlineUser != null)
         {
             isOnline = true;
         }
         else
         {
             //Next try the Database
             onlineUser = CBO.FillObject<OnlineUserInfo>(_dataProvider.GetOnlineUser(user.UserID));
             if (onlineUser != null)
             {
                 isOnline = true;
             }
         }
     }
     return isOnline;
 }
コード例 #7
0
        /// <summary>
        /// Gets whether the user in question is online
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="user">The user.</param>
        /// <returns>A Boolean indicating whether the user is online.</returns>
        /// <history>
        ///     [cnurse]	03/14/2006	created
        /// </history>
        public override bool IsUserOnline( UserInfo user )
        {
            bool isOnline = false;
            UserOnlineController objUsersOnline = new UserOnlineController();

            if( objUsersOnline.IsEnabled() )
            {
                //First try the Cache
                Hashtable userList = objUsersOnline.GetUserList();
                OnlineUserInfo onlineUser = userList[user.UserID.ToString()] as OnlineUserInfo;

                if( onlineUser != null )
                {
                    isOnline = true;
                }
                else
                {
                    //Next try the Database
                    onlineUser = (OnlineUserInfo)CBO.FillObject( dataProvider.GetOnlineUser( user.UserID ), typeof( OnlineUserInfo ) );
                    if( onlineUser != null )
                    {
                        isOnline = true;
                    }
                }
            }

            return isOnline;
        }