public PivotalTrackerApi(IFormsAuthenticationService formsAuthenticationService )
        {
            this.formsAuthenticationService = formsAuthenticationService;

            //user = new PivotalUser(Configuration.PivotalApiToken);
            user = new PivotalUser(this.formsAuthenticationService.ApiToken());
        }
        public TwitterController(IFormsAuthenticationService FormsAuthService)
        {
            _db = new SiteDB();
            _log = new UserActivity(_db);

            this.FormsAuthService = FormsAuthService;
        }
        public HomeController(ISession session, IFormsAuthenticationService FormsAuthService)
        {
            _session = session;
            _userRepository = new UserRepository(_session);

            this.FormsAuthService = FormsAuthService;
        }
Exemple #4
0
 public AccountController(IUserService userService, IFacebookClientService facebookClient,
                          IFormsAuthenticationService authenticationService, IErrorLogger errorLogger)
     : base(userService, errorLogger)
 {
     _facebookClient        = facebookClient;
     _authenticationService = authenticationService;
 }
Exemple #5
0
        void application_PreSendRequestHeaders(object sender, EventArgs e)
        {
            HttpApplication             application           = (HttpApplication)sender;
            IFormsAuthenticationService authenticationService = IocContainer.Instance.Resolve <IFormsAuthenticationService>();

            authenticationService.SlideExpire(application.Context);
        }
 public AuthenticationController(
     IFormsAuthenticationService formsAuthService,
     IUserService userService)
 {
     FormsAuth = formsAuthService;
     UserService = userService;
 }
 /// <summary>
 /// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
 /// </summary>
 /// <param name="FormsAuthService"></param>
 /// <returns></returns>
 public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
 {
     return HttpContext.Current.Cache.GetOrStore<string>(
         GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
         () =>
         {
             if (FormsAuthService.IsAuthenticated())
             {
                 using (SiteDB db = new SiteDB())
                 {
                     var user = UserRepository.GetUser(db, FormsAuthService.GetCurrentUserId());
                     if (user != null)
                     {
                         return user.Username;
                     }
                     else
                     {
                         return "";
                     }
                 }
             }
             else
             {
                 return "";
             }
         }
     );
 }
Exemple #8
0
 public AccountController(IFormsAuthenticationService formsService, IMembershipService membershipService, IUserService userService, IMasterService masterService)
 {
     this.formsService = formsService;
     this.membershipService = membershipService;
     this.userService = userService;
     this.masterService = masterService;
 }
 /// <summary>
 /// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
 /// </summary>
 /// <param name="FormsAuthService"></param>
 /// <returns></returns>
 public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
 {
     return(HttpContext.Current.Cache.GetOrStore <string>(
                GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
                () =>
     {
         if (FormsAuthService.IsAuthenticated())
         {
             using (SiteDB db = new SiteDB())
             {
                 var user = UserRepository.GetUser(db, FormsAuthService.GetCurrentUserId());
                 if (user != null)
                 {
                     return user.Username;
                 }
                 else
                 {
                     return "";
                 }
             }
         }
         else
         {
             return "";
         }
     }
                ));
 }
 // This constructor is not used by the MVC framework but is instead provided for ease
 // of unit testing this type. See the comments in AccountModels.cs for more information.
 public AccountController(IFormsAuthenticationService formsService,
                          IMembershipService membershipService)
 {
     FormsService = formsService ?? new FormsAuthenticationService();
     MembershipService = membershipService ??
                         new AccountMembershipService();
 }
Exemple #11
0
        public LangController(
            IUserService userService, 
            IFormsAuthenticationService formsAuthenticationService) 
            : base(userService, formsAuthenticationService)
        {

        }
 public BCProxyLoginController(IPortalUserFacade portalUserFacade, ILoginService loginService, IFormsAuthenticationService formsAuthenticationService, IPortletTemplateFacade portletTemplateFacade)
 {
     _loginService = loginService;
     _formsAuthenticationService = formsAuthenticationService;
     _portletTemplateFacade      = portletTemplateFacade;
     _portalUserFacade           = portalUserFacade;
 }
        public SGAccountController()
        {
            this.membershipService = new MembershipService(Membership.Provider);

            this.authenticationService = new AuthenticationService(membershipService, new FormsAuthenticationService());
            this.formsAuthenticationService = new FormsAuthenticationService();
        }
 public AccountController(
     IFormsAuthenticationService formsAuthenticationService,
     MySettings mySettings)
 {
     _formsAuthenticationService = formsAuthenticationService;
     _mySettings = mySettings;
 }
 public AccountController(IDbContext dbContext, IRepresentativeUserService representativeUserService, IFormsAuthenticationService formsAuthentication, IUserService userService)
 {
     _dbContext = dbContext;
     _representativeUserService = representativeUserService;
     _formsAuthentication = formsAuthentication;
     _userService = userService;
 }
 /// <summary>
 /// Return how we want to display the user's name in the UI. Currently set to Username, could be changed to First/Last, etc,
 /// </summary>
 /// <param name="FormsAuthService"></param>
 /// <returns></returns>
 public static string GetUserFriendlyName(IFormsAuthenticationService FormsAuthService)
 {
     return HttpContext.Current.Cache.GetOrStore<string>(
         GetUserSignInKey(FormsAuthService, UserFriendlyNameKey),
         () =>
         {
             if (FormsAuthService.IsAuthenticated())
             {
                 var userRepository = new UserRepository(MvcApplication.SessionFactory.OpenSession());
                 var user = userRepository.GetUser(FormsAuthService.GetCurrentUserName());
                 if (user != null)
                 {
                     return user.Username;
                 }
                 else
                 {
                     return "";
                 }
             }
             else
             {
                 return "";
             }
         }
     );
 }
 public UserController(
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
 {
     _formsAuthenticationService = formsAuthenticationService;
     _userService = userService;
 }
Exemple #18
0
 public UserControllerBuilder()
 {
     _appService = null;
     _formsAuthenticationService = null;
     _userService = null;
     _wordService = null;
 }
 public AccountController(
     IFormsAuthenticationService formsAuthenticationService,
     MySettings mySettings)
 {
     _formsAuthenticationService = formsAuthenticationService;
     _mySettings = mySettings;
 }
 public ManyConstructorsController(
     IFormsAuthenticationService formsService,
     IMembershipService membershipService)
 {
     FormsService      = formsService;
     MembershipService = MembershipService;
 }
Exemple #21
0
 public AuthenticationController(
     IFormsAuthenticationService formsAuthSvc,
     IUserService userSvc)
 {
     this.formsAuthSvc = formsAuthSvc;
     this.userSvc      = userSvc;
 }
Exemple #22
0
 public CanvasAuthorizeAttribute(IFacebookClientService facebookClient, IUserService userService,
                                 IFormsAuthenticationService formsAuthenticationService)
 {
     _facebookClient             = facebookClient;
     _userService                = userService;
     _formsAuthenticationService = formsAuthenticationService;
 }
 public UserControllerBuilder()
 {
     _appService = null;
     _formsAuthenticationService = null;
     _userService = null;
     _wordService = null;
 }
Exemple #24
0
 public AccountController(IDbContext dbContext, IRepresentativeUserService representativeUserService, IFormsAuthenticationService formsAuthentication, IUserService userService)
 {
     _dbContext = dbContext;
     _representativeUserService = representativeUserService;
     _formsAuthentication       = formsAuthentication;
     _userService = userService;
 }
Exemple #25
0
 public UserController(IUnitOfWork uow, IUserService userService, IRoleService roleService, IFormsAuthenticationService formsAuthenticationService)
 {
     _uow = uow;
     _userService = userService;
     _roleService = roleService;
     _formsAuthenticationService = formsAuthenticationService;
 }
 public AuthenticationController(
     IFormsAuthenticationService formsAuthSvc,
     IUserService userSvc)
 {
     this.formsAuthSvc = formsAuthSvc;
     this.userSvc = userSvc;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 /// <param name="formsAuthenticationService">The forms authentication service.</param>
 /// <param name="membershipService">The membership service.</param>
 public AccountController(
     IFormsAuthenticationService formsAuthenticationService, 
     IMembershipService membershipService)
 {
     this.MembershipService = membershipService;
     this.FormsService = formsAuthenticationService;
 }
Exemple #28
0
        public SGAccountController(IRoleRepository roleRepoParam, IOwnerRepository repoOwner)
        {
            //Common.Logging.ILog log = Common.Logging.LogManager.GetCurrentClassLogger();

            //using (var conn = new Npgsql.NpgsqlConnection(ConfigurationManager.ConnectionStrings["UserManagement"].ConnectionString))
            //{
            //    conn.Open();
            //    using (var trans = conn.BeginTransaction())
            //    {
            //        //test up to v1.1.  This is basicially the entire original schema.
            //        log.Debug(d => d("Checking for v1.1 schema..."));
            //        using (var cmd = new Npgsql.NpgsqlCommand("select null from pg_tables where schemaname = 'public' and tablename = @tablename;", conn, trans))
            //        {
            //            cmd.Parameters.Add("@tableName", NpgsqlTypes.NpgsqlDbType.Varchar, 255).Value = "versions";
            //            using (var r = cmd.ExecuteReader())
            //            {
            //                log.Info(m => m("info info info"));
            //                //log.Debug("hasrow: " + r.HasRows);
            //            }
            //        }

            //    }
            //}


            this.membershipService          = new MembershipService(System.Web.Security.Membership.Provider);
            this.authenticationService      = new AuthenticationService(membershipService, new FormsAuthenticationService());
            this.formsAuthenticationService = new FormsAuthenticationService();

            roleRepo  = roleRepoParam;
            RepoOwner = repoOwner;
        }
Exemple #29
0
 public UserController(IUnitOfWork uow, IUserService userService, IRoleService roleService, IFormsAuthenticationService formsAuthenticationService)
 {
     _uow         = uow;
     _userService = userService;
     _roleService = roleService;
     _formsAuthenticationService = formsAuthenticationService;
 }
        public void SetUp()
        {
            EmployeeModel fakeModel = new EmployeeModel
            {
                Id           = 2,
                Email        = "*****@*****.**",
                Type         = EmployeeType.HR,
                PasswordHash = new byte[] { 0, 1, 2 }
            };
            Mock <IEmployeeRepository> employeeRepository = new Mock <IEmployeeRepository>();

            employeeRepository.Setup(c => c.GetEmployeeByLoginPassword(It.IsAny <string>(), It.IsAny <byte[]>())).Returns(fakeModel);
            employeeRepository.Setup(c => c.GetEmployee(It.IsAny <int>())).Returns(fakeModel);

            _employeeRepository = employeeRepository.Object;

            Mock <IFormsAuthenticationService> formsAuthenticationService = new Mock <IFormsAuthenticationService>();

            formsAuthenticationService.Setup(c => c.Login(It.IsAny <string>()));
            formsAuthenticationService.Setup(c => c.Logout());

            _formsAuthenticationService = formsAuthenticationService.Object;
            _encryptService             = new EncryptService();
            _accountService             = new AccountService(_encryptService, _employeeRepository);
        }
Exemple #31
0
 public AccountService(IAccountViewsModelFactory accountViewsModelFactory, IEmailFactory emailFactory,
                       ILookupRepository lookupRepository, IAccountRepository accountRepository,
                       IFormsAuthenticationService formsAuthentication, IEmployeeOnBoardRepository employeeOnBoardRepository,
                       ISessionStateService session, IProfileRepository profileRepository, IEnvironment environment,
                       IEmploymentHistoryRepository employmentHistoryRepository, ICompanyRepository companyRepository,
                       IEducationHistoryRepository educationHistoryRepository, IUserProfileModelFactory userProfileModelFactory,
                       ISkillSetRepository skillSetRepository, IDigitalFileRepository digitalFileRepository, IEmail email,
                       IUsersRepository usersRepository, IAesEncryption encryptionService, IEmployeeRepository employeeRepository)
 {
     this.accountViewsModelFactory    = accountViewsModelFactory;
     this.userProfileModelFactory     = userProfileModelFactory;
     this.employeeRepository          = employeeRepository;
     this.employeeOnBoardRepository   = employeeOnBoardRepository;
     this.lookupRepository            = lookupRepository;
     this.accountRepository           = accountRepository;
     this.profileRepository           = profileRepository;
     this.educationHistoryRepository  = educationHistoryRepository;
     this.employmentHistoryRepository = employmentHistoryRepository;
     this.skillSetRepository          = skillSetRepository;
     this.digitalFileRepository       = digitalFileRepository;
     this.usersRepository             = usersRepository;
     this.emailFactory        = emailFactory;
     this.formsAuthentication = formsAuthentication;
     this.session             = session;
     this.encryptionService   = encryptionService;
     this.companyRepository   = companyRepository;
     this.environment         = environment;
     this.email = email;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 /// <param name="formsAuthenticationService">The forms authentication service.</param>
 /// <param name="membershipService">The membership service.</param>
 public AccountController(
     IFormsAuthenticationService formsAuthenticationService,
     IMembershipService membershipService)
 {
     this.MembershipService          = membershipService;
     this.FormsAuthenticationService = formsAuthenticationService;
 }
Exemple #33
0
 public AuthenticationService(ICommandRepository <LoginUser> cmdRepository, IQueryRepository <LoginUser> qRepository, IEncryptionService encryptionService, IFormsAuthenticationService formsAuthenticationService)
 {
     this.formsAuthenticationService = formsAuthenticationService;
     this.cmdRepository     = cmdRepository;
     this.qRepository       = qRepository;
     this.encryptionService = encryptionService;
 }
 public AuthenticationController(
     IFormsAuthenticationService formsAuthService,
     IUserService userService)
 {
     FormsAuth = formsAuthService;
     Users     = userService;
 }
 public BCProxyLoginController(IPortalUserFacade portalUserFacade, ILoginService loginService, IFormsAuthenticationService formsAuthenticationService, IPortletTemplateFacade portletTemplateFacade)
 {
     _loginService = loginService;
     _formsAuthenticationService = formsAuthenticationService;
     _portletTemplateFacade = portletTemplateFacade;
     _portalUserFacade = portalUserFacade;
 }
Exemple #36
0
 public TagController(
     ITagService tagService,
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
     : base(userService, formsAuthenticationService)
 {
     _tagService = tagService;
 }
 public RecipientController(IDataService<Recipient> recipientDataService,
     IDataService<Volunteer> volunteerDataService,
     IFormsAuthenticationService formsAuthenticationService)
 {
     this.recipientDataService = recipientDataService;
     this.volunteerDataService = volunteerDataService;
     this.formsAuthenticationService = formsAuthenticationService;
 }
 public AccountController(IFormsAuthenticationService formsService,
     IMembershipService membershipService,
     ILogger logger)
 {
     this._FormsService = formsService;
     this._MembershipService = membershipService;
     this._Logger = logger;
 }
 public UserController(IUserService userService, IFormsAuthenticationService formsAuthenticationService,
                       TardisConfiguration configuration, IMediator mediator)
 {
     this.userService = userService;
     this.formsAuthenticationService = formsAuthenticationService;
     this.configuration = configuration;
     this.mediator      = mediator;
 }
Exemple #40
0
 public HomeController(
     IReportService reportService,
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
     : base(userService, formsAuthenticationService)
 {
     _reportService = reportService;
 }
Exemple #41
0
 public AuthenticationService(ICurrentSDKUser currentSdkUser, IFormsAuthenticationService formsAuthentication, IUserAuthenticator agentAuthenticator, IClarifySessionCache sessionCache, IPrincipalFactory principalFactory)
 {
     _currentSdkUser      = currentSdkUser;
     _formsAuthentication = formsAuthentication;
     _agentAuthenticator  = agentAuthenticator;
     _sessionCache        = sessionCache;
     _principalFactory    = principalFactory;
 }
Exemple #42
0
 public LoginController(
     IFormsAuthenticationService formsAuthenticationService,
     ISecurityService securityService,
     IOjbMemberShipProvider memberShipProvider)
 {
     this.formsAuthenticationService = formsAuthenticationService;
     this.memberShipProvider         = memberShipProvider;
 }
 public virtual void SetUp()
 {
     OrganisationService        = Substitute.For <IOrganisationService>();
     FormsAuthenticationService = Substitute.For <IFormsAuthenticationService>();
     ApplicationService         = Substitute.For <IApplicationService>();
     LabelCollectionRetriever   = Substitute.For <ILabelCollectionRetriever>();
     DashboardViewModelGetter   = new DashboardViewModelGetter(ApplicationService, LabelCollectionRetriever, OrganisationService);
 }
 public AccountController()
 {
     this.membershipService          = new MembershipService(Membership.Provider);
     this.authenticationService      = new AuthenticationService(membershipService, new FormsAuthenticationService());
     this.formsAuthenticationService = new FormsAuthenticationService();
     //this.appServices = new ApprovalServiceReference.ApprovalClient();
     //this.db = new DbNNSW(ConfigurationManager.ConnectionStrings["AppDb"].ConnectionString);
 }
        public SessionController(IFormsAuthenticationService FormsAuthService, IMembershipService MembershipService)
        {
            _db  = new SiteDB();
            _log = new UserActivity(_db);

            this.FormsAuthService  = FormsAuthService;
            this.MembershipService = MembershipService;
        }
 public AppController(
     IUserService userService, 
     IFormsAuthenticationService formsAuthenticationService, 
     IAppService appService)
     : base(userService, formsAuthenticationService)
 {
     _appService = appService;
 }
Exemple #47
0
 //Initialise
 protected override void Initialize(RequestContext requestContext)
 {
     if (FormsService == null)
     {
         FormsService = new FormsAuthenticationService();
     }
     base.Initialize(requestContext);
 }
Exemple #48
0
 public SearchController(
     ISearchService searchService,
     IUserService userService, 
     IFormsAuthenticationService formsAuthenticationService) 
     : base(userService, formsAuthenticationService)
 {
     _searchService = searchService;
 }
Exemple #49
0
 public WordController(
     IWordService wordService,
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
     : base(userService, formsAuthenticationService)
 {
     _wordService = wordService;
 }
Exemple #50
0
        public SGAccountController(IRoleRepository roleRepoParam)
        {
            this.membershipService          = new MembershipService(Membership.Provider);
            this.authenticationService      = new AuthenticationService(membershipService, new FormsAuthenticationService());
            this.formsAuthenticationService = new FormsAuthenticationService();

            roleRepo = roleRepoParam;
        }
Exemple #51
0
        public AccountController(IUserService userService,IFormsAuthenticationService authenticationService)
        {
            Check.Argument.IsNotNull(userService, "userService");
            Check.Argument.IsNotNull(authenticationService, "authenticationService");

            _userService = userService;
            _authenticationService = authenticationService;
        }
Exemple #52
0
 public LoginAmplaSessionUsingQueryString(IHttpRequestWrapper requestWrapper, IHttpResponseWrapper responseWrapper, IAmplaUserService amplaUserService, IFormsAuthenticationService formsAuthenticationService, IAmplaSessionStorage amplaSessionStorage)
 {
     this.requestWrapper             = requestWrapper;
     this.responseWrapper            = responseWrapper;
     this.amplaUserService           = amplaUserService;
     this.formsAuthenticationService = formsAuthenticationService;
     this.amplaSessionStorage        = amplaSessionStorage;
 }
Exemple #53
0
 public TagController(
     ITagService tagService,
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
     : base(userService, formsAuthenticationService)
 {
     _tagService = tagService;
 }
 public AccountController(IQuestionRepository repository, IFormsAuthenticationService formsService, IMembershipService membershipService, IEmailService emailService, IUser currentUser)
 {
     _repository = repository;
     FormsService = formsService;
     MembershipService = membershipService;
     _emailService = emailService;
     _currentUser = currentUser;
 }
 public AccountController(IQuestionRepository repository, IFormsAuthenticationService formsService, IMembershipService membershipService, IEmailService emailService, IUser currentUser)
 {
     _repository       = repository;
     FormsService      = formsService;
     MembershipService = membershipService;
     _emailService     = emailService;
     _currentUser      = currentUser;
 }
 public AuthenticationService(ICurrentSDKUser currentSdkUser, IFormsAuthenticationService formsAuthentication, IUserAuthenticator agentAuthenticator, IClarifySessionCache sessionCache, IPrincipalFactory principalFactory)
 {
     _currentSdkUser = currentSdkUser;
     _formsAuthentication = formsAuthentication;
     _agentAuthenticator = agentAuthenticator;
     _sessionCache = sessionCache;
     _principalFactory = principalFactory;
 }
Exemple #57
0
 public LoginController(
     IFormsAuthenticationService formsAuthenticationService,
     ISecurityService securityService,
     IOjbMemberShipProvider memberShipProvider)
 {
     this.formsAuthenticationService = formsAuthenticationService;
     this.memberShipProvider = memberShipProvider;
 }
Exemple #58
0
        //views
        //todo:new
        //todo:list
        //todo:detail

 
        //todo: json GET

        public DayController(
            IDayService dayService,
            IUserService userService, 
            IFormsAuthenticationService formsAuthenticationService) 
            : base(userService, formsAuthenticationService)
        {
            _dayService = dayService;
        }
Exemple #59
0
 public WordController(
     IWordService wordService,
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService)
     : base(userService, formsAuthenticationService)
 {
     _wordService = wordService;
 }
Exemple #60
0
 public AppController(
     IUserService userService,
     IFormsAuthenticationService formsAuthenticationService,
     IAppService appService)
     : base(userService, formsAuthenticationService)
 {
     _appService = appService;
 }