Пример #1
0
 /// <summary>
 /// Validates the username and password and returns whether or not the combination is a valid user
 /// </summary>
 /// <param name="userName">The username to validate</param>
 /// <param name="password">The password to match</param>
 /// <param name="user">The user object created</param>
 /// <returns>
 /// true if the combination is a valid user;false otherwise
 /// </returns>
 public virtual bool IsValidUser( string userName, string password, out IBasicUser user )
 {
     user = new BasicUser();
     user.UserName = userName;
     user.Password = password;
     return true;
 }
Пример #2
0
 /// <summary>
 /// Validates the username and password and returns whether or not the combination is a valid user
 /// </summary>
 /// <param name="userName">The username to validate</param>
 /// <param name="password">The password to match</param>
 /// <param name="user">The user object created</param>
 /// <returns>
 /// true if the combination is a valid user;false otherwise
 /// </returns>
 public bool IsValidUser(string userName, string password, out IBasicUser user)
 {
     user          = new BasicUser();
     user.UserName = userName;
     user.Password = password;
     return(true);
 }
        /// <summary>
        /// Handles the AuthorizeRequest event of the context control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void context_AuthorizeRequest(object sender, EventArgs e)
        {
            HttpApplication context = sender as HttpApplication;

            if (context == null)
            {
                return;
            }
            BasicUser bu = context.User.Identity as BasicUser;

            if (!AP.IsRequestAllowed(context.Request, bu))
            {
                SendNotAuthorized(context);
            }
        }