示例#1
0
        /// <summary>
        /// 
        /// </summary>
        public LoginUI()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            InitializeComponent();

            //will comment out after Spring.NET implementation
            //authSvc = (IAuthenticationSvc)factory.getService("IAuthenticationSvc");

            //Spring.NET
            XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
            authSvc = (IAuthenticationSvc)ctx.GetObject("authSvc");

            //authSvc = new AuthenticationSvcSocketImpl();

            this.AcceptButton = loginBtn;
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        public LoginUI()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            InitializeComponent();

            //will comment out after Spring.NET implementation
            //authSvc = (IAuthenticationSvc)factory.getService("IAuthenticationSvc");

            //Spring.NET
            XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");

            authSvc = (IAuthenticationSvc)ctx.GetObject("authSvc");

            //authSvc = new AuthenticationSvcSocketImpl();

            this.AcceptButton = loginBtn;
        }
示例#3
0
 //method for validating user
 public Boolean ValidateUser(string username, string password)
 {
     try
     {
         //calls service here
         IAuthenticationSvc authSvc = (IAuthenticationSvc)GetService(typeof(IAuthenticationSvc).Name);
         return(authSvc.SendCredentials(username, password));
     }
     catch (ServiceLoadException e)
     {
         throw new AuthenticationException(e.Message);
     }
     catch (AuthenticationException e)
     {
         throw new AuthenticationException(e.Message);
     }
     catch (SocketException e)
     {
         throw new AuthenticationException(e.Message);
     }
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserController"/> class.
 /// </summary>
 /// <param name="container"></param>
 public UserController(IServiceProvider container) : base(container)
 {
     _userService       = _container.GetService <IUserService>();
     _authenticationSvc = container.GetService <IAuthenticationSvc>();
 }
示例#5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="authSvc"></param>
 public void setAuthenticationSvc(IAuthenticationSvc authSvc)
 {
     this.authSvc = authSvc;
 }
        public Boolean ISValidCredentials(Credentials credential)
        {
            IAuthenticationSvc svc = (IAuthenticationSvc)GetService(typeof(IAuthenticationSvc).Name);

            return(svc.isValidCredentials(credential.Username, credential.Password));
        }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="container"></param>
 public LoginController(IServiceProvider container) : base(container)
 {
     _authenticationSvc = container.GetService <IAuthenticationSvc>();
 }
示例#8
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="authSvc"></param>
 public void setAuthenticationSvc(IAuthenticationSvc authSvc)
 {
     this.authSvc = authSvc;
 }