Exemplo n.º 1
0
        // Our service
        // see WxServiceBase. That is where most of the configuration
        // for this is done. In this file we are setting up the external
        // and internal services our endpoints will use...
        public WxExampleService(IConfigSource config)
            : base(config)
        {
            m_log.Info("[WxExampleService]: Wx Loading ... ");
            m_config = config;
            IConfig WxConfig = config.Configs["WxExampleService"];
            if (WxConfig != null)
            {
                // loading the UserAccountService so we can use it's methods in our example
                // see below: GetUserData(UUID userID)
                //
                // Read the configuration...
                string userService = WxConfig.GetString("UserAccountService", String.Empty);

                // Load it...
                if (userService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userService, args);
                }
            }

            // Add a command to the console
            if (MainConsole.Instance != null)
            {
                MainConsole.Instance.Commands.AddCommand("Wx", true,
                            "show names",
                            "show names",
                            "Show list of names",
                            String.Empty,
                            HandleShowNames);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Resolve an osp string into the most suitable internal OpenSim identifier.
        /// </summary>
        /// In some cases this will be a UUID if a suitable profile exists on the system.  In other cases, this may
        /// just return the same identifier after creating a temporary profile.
        /// <param name = "ospa"></param>
        /// <param name = "commsManager"></param>
        /// <returns>
        ///   A suitable UUID for use in Second Life client communication.  If the string was not a valid ospa, then UUID.Zero
        ///   is returned.
        /// </returns>
        public static UUID ResolveOspa(string ospa, IUserAccountService userService)
        {
            if (!ospa.StartsWith(OSPA_PREFIX))
                return UUID.Zero;

//            MainConsole.Instance.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa);

            string ospaMeat = ospa.Substring(OSPA_PREFIX.Length);
            string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY);

            foreach (string tuple in ospaTuples)
            {
                int tupleSeparatorIndex = tuple.IndexOf(OSPA_PAIR_SEPARATOR);

                if (tupleSeparatorIndex < 0)
                {
                    MainConsole.Instance.WarnFormat("[OSP RESOLVER]: Ignoring non-tuple component {0} in OSPA {1}", tuple, ospa);
                    continue;
                }

                string key = tuple.Remove(tupleSeparatorIndex).Trim();
                string value = tuple.Substring(tupleSeparatorIndex + 1).Trim();

                if (OSPA_NAME_KEY == key)
                    return ResolveOspaName(value, userService);
            }

            return UUID.Zero;
        }
Exemplo n.º 3
0
 // private readonly IUserAccountService _userAccountService;
 public UsersController(IUserAccountService service, IHubService hubService, IAdminUnitService adminUnitService)
 {
     _userService = service;
     _hubService = hubService;
     _adminUnitService = adminUnitService;
     //_userAccountService = userAccountService;
 }
 public ValidatedPaymentRequestController(IBusinessProcessService paramBusinessProcessService
                                 , IBusinessProcessStateService paramBusinessProcessStateService
                                 , IApplicationSettingService paramApplicationSettingService
                                 , ITransportOrderService paramTransportOrderService
                                 , ITransporterAgreementVersionService transporterAgreementVersionService
                                 , IWorkflowStatusService workflowStatusService, ITransporterService transporterService
                                 , ITransporterChequeService transporterChequeService, IUserProfileService userProfileService 
                                 ,ITransporterPaymentRequestService transporterPaymentRequestService, IBidWinnerService bidWinnerService
                                 , IUserAccountService userAccountService, IDispatchService dispatchService
                                , ITransporterChequeDetailService transporterChequeDetailService,ITransportOrderDetailService transportOrderDetailService)
 {
     _businessProcessService = paramBusinessProcessService;
         _businessProcessStateService = paramBusinessProcessStateService;
         _applicationSettingService = paramApplicationSettingService;
         _transportOrderService = paramTransportOrderService;
         _transporterAgreementVersionService = transporterAgreementVersionService;
         _workflowStatusService = workflowStatusService;
         _transporterService = transporterService;
         _transporterChequeService = transporterChequeService;
          _userProfileService = userProfileService;
         _transporterPaymentRequestService = transporterPaymentRequestService;
         _bidWinnerService = bidWinnerService;
         _userAccountService = userAccountService;
         _dispatchService = dispatchService;
         _transporterChequeDetailService = transporterChequeDetailService;
        _transportOrderDetailService = transportOrderDetailService;
 }
Exemplo n.º 5
0
        public DeliveryController(ITransportOrderService transportOrderService,
                                      IWorkflowStatusService workflowStatusService,
                                      IDispatchAllocationService dispatchAllocationService,
                                      IDeliveryService deliveryService,
            IDispatchService dispatchService,
            IDeliveryDetailService deliveryDetailService,
            INotificationService notificationService, IActionTypesService actionTypeService, IUserAccountService userAccountService,
            Cats.Services.EarlyWarning.ICommodityService commodityService, Cats.Services.EarlyWarning.IUnitService unitService,
            Cats.Services.Transaction.ITransactionService transactionService, IBusinessProcessService businessProcessService, IApplicationSettingService applicationSettingService, ITransporterPaymentRequestService transporterPaymentRequestService)
        {
            _transportOrderService = transportOrderService;
            _workflowStatusService = workflowStatusService;
            _dispatchAllocationService = dispatchAllocationService;
            _deliveryService = deliveryService;
            _dispatchService = dispatchService;
            _deliveryDetailService = deliveryDetailService;
            _notificationService = notificationService;

            _actionTypeService = actionTypeService;

            _userAccountService = userAccountService;
            _commodityService = commodityService;
            _unitService = unitService;
            _transactionService = transactionService;
            _businessProcessService = businessProcessService;
            _applicationSettingService = applicationSettingService;
            _transporterPaymentRequestService = transporterPaymentRequestService;
        }
Exemplo n.º 6
0
 public ReliefRequisitionController(
     IReliefRequisitionService reliefRequisitionService, 
     IWorkflowStatusService workflowStatusService, 
     IReliefRequisitionDetailService reliefRequisitionDetailService,
     IUserAccountService userAccountService,
     IRegionalRequestService regionalRequestService,
     IRationService rationService, 
     IDonorService donorService, 
     INotificationService notificationService, 
     IPlanService planService,
     ITransactionService transactionService,
     ICommonService commonService, IRationDetailService rationDetailService)
 {
     this._reliefRequisitionService = reliefRequisitionService;
     this._workflowStatusService = workflowStatusService;
     this._reliefRequisitionDetailService = reliefRequisitionDetailService;
     _userAccountService = userAccountService;
     _rationService = rationService;
     _donorService = donorService;
     _notificationService = notificationService;
     _planService = planService;
     _transactionService = transactionService;
     _commonService = commonService;
     _rationDetailService = rationDetailService;
     _regionalRequestService = regionalRequestService;
 }
        public OpenIdServerConnector(IConfigSource config, IHttpServer server, string configName) :
                base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];
            if (serverConfig == null)
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));

            string authService = serverConfig.GetString("AuthenticationServiceModule",
                    String.Empty);
            string userService = serverConfig.GetString("UserAccountServiceModule",
                    String.Empty);

            if (authService == String.Empty || userService == String.Empty)
                throw new Exception("No AuthenticationServiceModule or no UserAccountServiceModule in config file for OpenId authentication");

            Object[] args = new Object[] { config };
            m_AuthenticationService = ServerUtils.LoadPlugin<IAuthenticationService>(authService, args);
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userService, args);

            // Handler for OpenID user identity pages
            server.AddStreamHandler(new OpenIdStreamHandler("GET", "/users/", m_UserAccountService, m_AuthenticationService));
            // Handlers for the OpenID endpoint server
            server.AddStreamHandler(new OpenIdStreamHandler("POST", "/openid/server/", m_UserAccountService, m_AuthenticationService));
            server.AddStreamHandler(new OpenIdStreamHandler("GET", "/openid/server/", m_UserAccountService, m_AuthenticationService));

            m_log.Info("[OPENID]: OpenId service enabled");
        }
Exemplo n.º 8
0
 public DashboardController(INotificationService notificationService, IUserAccountService userAccountService)
 {
     _notificationService = notificationService;
     _userAccountService = userAccountService;
     this._dashboardService = new Cats.Services.EarlyWarning.DashboardService();
     this._needAssessmentSummaryService = new Cats.Services.Common.NeedAssessmentSummaryService();
 }
Exemplo n.º 9
0
 public void RegionLoaded(Scene scene)
 {
     InventoryService = m_scene.InventoryService;
     AssetService = m_scene.AssetService;
     UserAccountService = m_scene.UserAccountService;
     AvatarService = m_scene.AvatarService;
 }
Exemplo n.º 10
0
        public HGAssetService(IConfigSource config, string configName) : base(config, configName)
        {
            m_log.Debug("[HGAsset Service]: Starting");
            IConfig assetConfig = config.Configs[configName];
            if (assetConfig == null)
                throw new Exception("No HGAssetService configuration");

            string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
            if (userAccountsDll == string.Empty)
                throw new Exception("Please specify UserAccountsService in HGAssetService configuration");

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
            if (m_UserAccountService == null)
                throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));

            m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI",
                new string[] { "Startup", "Hypergrid", configName }, string.Empty);
            if (m_HomeURL == string.Empty)
                throw new Exception("[HGAssetService] No HomeURI specified");

            m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);

            // Permissions
            m_AssetPerms = new AssetPermissions(assetConfig);

        }
Exemplo n.º 11
0
        public HGAssetService(IConfigSource config, string configName) : base(config, configName)
        {
            m_log.Debug("[HGAsset Service]: Starting");
            IConfig assetConfig = config.Configs[configName];
            if (assetConfig == null)
                throw new Exception("No HGAssetService configuration");

            string userAccountsDll = assetConfig.GetString("UserAccountsService", string.Empty);
            if (userAccountsDll == string.Empty)
                throw new Exception("Please specify UserAccountsService in HGAssetService configuration");

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
            if (m_UserAccountService == null)
                throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));

            // legacy configuration [obsolete]
            m_HomeURL = assetConfig.GetString("ProfileServerURI", string.Empty);
            // Preferred
            m_HomeURL = assetConfig.GetString("HomeURI", m_HomeURL);

            m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);

            // Permissions
            m_AssetPerms = new AssetPermissions(assetConfig);

        }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// </summary>
 /// <param name="userService">The user service.</param>
 /// <param name="authenticationService">The authentication service.</param>
 /// <param name="messageBus">The message bus.</param>
 /// <param name="membershipSettings"></param>
 public AccountController(IUserAccountService userService, IAuthenticationService authenticationService, IMessageBus messageBus, IMembershipSettings membershipSettings)
 {
     _membershipSettings = membershipSettings;
     _messageBus = messageBus;
     _userService = userService;
     _authenticationService = authenticationService;
 }
 public TransporterPaymentRequestController(IBusinessProcessService _paramBusinessProcessService
                                            , IBusinessProcessStateService _paramBusinessProcessStateService
                                            , IApplicationSettingService _paramApplicationSettingService
                                            , ITransporterPaymentRequestService transporterPaymentRequestService
                                            , ITransportOrderService _paramTransportOrderService
                                            , IBidWinnerService bidWinnerService
                                            , IDispatchService dispatchService
                                            , IWorkflowStatusService workflowStatusService
                                            , IUserAccountService userAccountService
                                            , Services.Procurement.ITransporterService transporterService,
                                            ITransportOrderService transportOrderService,
                                            ITransportOrderDetailService transportOrderDetailService, ICommonService commodityService
                                            , IFlowTemplateService flowTemplateService)
 {
     _BusinessProcessService = _paramBusinessProcessService;
     _BusinessProcessStateService = _paramBusinessProcessStateService;
     _ApplicationSettingService = _paramApplicationSettingService;
     _transporterPaymentRequestService = transporterPaymentRequestService;
     _TransportOrderService = _paramTransportOrderService;
     _bidWinnerService = bidWinnerService;
     _dispatchService = dispatchService;
     _workflowStatusService = workflowStatusService;
     _userAccountService = userAccountService;
     _transporterService = transporterService;
     _transportOrderService = transportOrderService;
     _transportOrderDetailService = transportOrderDetailService;
     _commodityService = commodityService;
     _flowTemplateService = flowTemplateService;
 }
Exemplo n.º 14
0
 public virtual void Start(IConfigSource config, IRegistryCore registry)
 {
     m_Database = Aurora.DataManager.DataManager.RequestPlugin<IInventoryData> ();
     m_UserAccountService = registry.RequestModuleInterface<IUserAccountService>();
     m_LibraryService = registry.RequestModuleInterface<ILibraryService>();
     m_AssetService = registry.RequestModuleInterface<IAssetService>();
 }
Exemplo n.º 15
0
        public void RegisterCaps(IRegionClientCapsService service)
        {
            IConfig displayNamesConfig = service.ClientCaps.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs["DisplayNamesModule"];
            if (displayNamesConfig != null)
            {
                if (!displayNamesConfig.GetBoolean ("Enabled", true))
                    return;
                string bannedNamesString = displayNamesConfig.GetString ("BannedUserNames", "");
                if (bannedNamesString != "")
                    bannedNames = new List<string> (bannedNamesString.Split (','));
            }
            m_service = service;
            m_profileConnector = Aurora.DataManager.DataManager.RequestPlugin<IProfileConnector> ();
            m_eventQueue = service.Registry.RequestModuleInterface<IEventQueueService> ();
            m_userService = service.Registry.RequestModuleInterface<IUserAccountService> ();

            string post = CapsUtil.CreateCAPS ("SetDisplayName", "");
            service.AddCAPS ("SetDisplayName", post);
            service.AddStreamHandler ("SetDisplayName", new RestHTTPHandler ("POST", post,
                                                      ProcessSetDisplayName));

            post = CapsUtil.CreateCAPS ("GetDisplayNames", "");
            service.AddCAPS ("GetDisplayNames", post);
            service.AddStreamHandler ("GetDisplayNames", new StreamHandler ("GET", post,
                                                      ProcessGetDisplayName));
        }
Exemplo n.º 16
0
 public TransferController(ITransferService transferService,ICommonService commonService,IUserAccountService userAccountService, ICommodityService commodityService)
 {
     _transferService = transferService;
     _commonService = commonService;
     _userAccountService = userAccountService;
     _commodityService = commodityService;
 }
Exemplo n.º 17
0
 public RequestController(IRegionalRequestService reliefRequistionService,
                         IFDPService fdpService,
                         IRegionalRequestDetailService reliefRequisitionDetailService,
                         ICommonService commonService,
                         IHRDService hrdService,
                         IApplicationSettingService ApplicationSettingService,
                         IUserAccountService userAccountService,
                         ILog log,
                         IHRDDetailService hrdDetailService,
                         IRegionalPSNPPlanDetailService regionalPSNPPlanDetailService,
                         IRegionalPSNPPlanService RegionalPSNPPlanService, 
     IAdminUnitService adminUnitService, 
     IPlanService planService, 
     IIDPSReasonTypeServices idpsReasonTypeServices)
 {
     _regionalRequestService = reliefRequistionService;
     _fdpService = fdpService;
     _regionalRequestDetailService = reliefRequisitionDetailService;
     _commonService = commonService;
     _hrdService = hrdService;
     _applicationSettingService = ApplicationSettingService;
     _userAccountService = userAccountService;
     _log = log;
     _HRDDetailService = hrdDetailService;
     _RegionalPSNPPlanDetailService = regionalPSNPPlanDetailService;
     _RegionalPSNPPlanService = RegionalPSNPPlanService;
     _adminUnitService = adminUnitService;
     _planService = planService;
     _idpsReasonTypeServices = idpsReasonTypeServices;
 }
Exemplo n.º 18
0
        public void RegisterCaps (IRegionClientCapsService service)
        {
            var cfgservice = service.ClientCaps.Registry.RequestModuleInterface<ISimulationBase> ();
            var displayNamesConfig = cfgservice.ConfigSource.Configs ["DisplayNames"];
            if (displayNamesConfig != null) {
                if (!displayNamesConfig.GetBoolean ("Enabled", true))
                    return;

                string bannedNamesString = displayNamesConfig.GetString ("BannedUserNames", "");
                if (bannedNamesString != "")
                    bannedNames = new List<string> (bannedNamesString.Split (','));

                m_update_days = displayNamesConfig.GetDouble ("UpdateDays", m_update_days);

            }
            m_service = service;
            m_profileConnector = Framework.Utilities.DataManager.RequestPlugin<IProfileConnector> ();
            m_eventQueue = service.Registry.RequestModuleInterface<IEventQueueService> ();
            m_userService = service.Registry.RequestModuleInterface<IUserAccountService> ();

            string post = CapsUtil.CreateCAPS ("SetDisplayName", "");
            service.AddStreamHandler ("SetDisplayName", new GenericStreamHandler ("POST", post, ProcessSetDisplayName));

            post = CapsUtil.CreateCAPS ("GetDisplayNames", "");
            service.AddStreamHandler ("GetDisplayNames", new GenericStreamHandler ("GET", post, ProcessGetDisplayName));
        }
Exemplo n.º 19
0
        public HGInventoryService(IConfigSource config, string configName)
            : base(config, configName)
        {
            m_log.Debug("[HGInventory Service]: Starting");
            if (configName != string.Empty)
                m_ConfigName = configName;

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig invConfig = config.Configs[m_ConfigName];
            if (invConfig != null)
            {                
                // realm = authConfig.GetString("Realm", realm);
                string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
                if (userAccountsDll == string.Empty)
                    throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");

                Object[] args = new Object[] { config };
                m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
                if (m_UserAccountService == null)
                    throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));

                m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI",
                    new string[] { "Startup", "Hypergrid", m_ConfigName }, String.Empty); 

                m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
            }

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }
 public UserAccountServerPostHandler (string url, IUserAccountService service, string SessionID, IRegistryCore registry) :
         base("POST", url)
 {
     m_UserAccountService = service.InnerService;
     m_SessionID = SessionID;
     m_registry = registry;
 }
 //private readonly IUserProfileService _userProfileService;
 public TransportRequisitionController(
     ITransportRequisitionService transportRequisitionService,
     IWorkflowStatusService workflowStatusService,
     IUserAccountService userAccountService,
     ILog log,
     IAdminUnitService adminUnitService,
     IProgramService programService,
     IReliefRequisitionService reliefRequisitionService,
     IHubAllocationService hubAllocationService,
     IProjectCodeAllocationService projectCodeAllocationService,
     IReliefRequisitionDetailService reliefRequisitionDetailService,
     IRationService rationService, INotificationService notificationService)
 {
     this._transportRequisitionService = transportRequisitionService;
     _workflowStatusService = workflowStatusService;
     _userAccountService = userAccountService;
     _log = log;
     _adminUnitService = adminUnitService;
     _programService = programService;
     _reliefRequisitionService = reliefRequisitionService;
     _hubAllocationService = hubAllocationService;
     _projectCodeAllocationService = projectCodeAllocationService;
     _reliefRequisitionDetailService = reliefRequisitionDetailService;
     _reliefRequisitionService = reliefRequisitionService;
     _rationService = rationService;
     _notificationService = notificationService;
     //_userProfileService = userProfileService;
 }
Exemplo n.º 22
0
        public BanCheck(IConfigSource source, IUserAccountService UserAccountService)
        {
            IConfig config = source.Configs["GrieferProtection"];
            if (config == null)
                return;

            m_enabled = config.GetBoolean("Enabled", true);

            if (!m_enabled)
                return;

            string bannedViewers = config.GetString("ViewersToBan", "");
            m_bannedViewers = Util.ConvertToList(bannedViewers, false);
            string allowedViewers = config.GetString("ViewersToAllow", "");
            m_allowedViewers = Util.ConvertToList(allowedViewers, false);
            m_useIncludeList = config.GetBoolean("UseAllowListInsteadOfBanList", false);

            m_checkOnLogin = config.GetBoolean("CheckForSimilaritiesOnLogin", m_checkOnLogin);
            m_checkOnTimer = config.GetBoolean("CheckForSimilaritiesOnTimer", m_checkOnTimer);

            if (m_checkOnTimer)
                _checkForSimilaritiesLater.Start(5, CheckForSimilaritiesMultiple);

            GrieferAllowLevel =
                (AllowLevel) Enum.Parse(typeof (AllowLevel), config.GetString("GrieferAllowLevel", "AllowKnown"));

            presenceInfo = Framework.Utilities.DataManager.RequestPlugin<IPresenceInfo>();
            m_accountService = UserAccountService;

            if (!m_accountService.RemoteCalls())
                AddCommands ();                     // only add if we are local
        }
Exemplo n.º 23
0
 public ReciptPlanForLoanController(ILoanReciptPlanService loanReciptPlanService,ICommonService commonService,
                                             ILoanReciptPlanDetailService loanReciptPlanDetailService,IUserAccountService userAccountService)
 {
     _loanReciptPlanService = loanReciptPlanService;
     _commonService = commonService;
     _loanReciptPlanDetailService = loanReciptPlanDetailService;
     _userAccountService = userAccountService;
 }
Exemplo n.º 24
0
 public AccountController(IUserAccountService userAccountService, ILog log,
                          IForgetPasswordRequestService forgetPasswordRequestService, ISettingService settingService)
 {
     _userAccountService = userAccountService;
     _log = log;
     _forgetPasswordRequestService = forgetPasswordRequestService;
     _settingService = settingService;
 }
Exemplo n.º 25
0
        /// <summary>
        /// Make an OSPA given a user UUID
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="commsManager"></param>
        /// <returns>The OSPA.  Null if a user with the given UUID could not be found.</returns>
        public static string MakeOspa(UUID userId, IUserAccountService userService)
        {
            UserAccount account = userService.GetUserAccount(UUID.Zero, userId);
            if (account != null)
                return MakeOspa(account.FirstName, account.LastName);

            return null;
        }
Exemplo n.º 26
0
 public DataGenerator()
 {
     _ninjectKernel = new StandardKernel(new Modules.MockRepositoryModule());
     _ninjectKernel.Bind<IClientService>().To<ClientService>();
     _ninjectKernel.Bind<IUserAccountService>().To<UserAccountService>();
     _clientService = _ninjectKernel.Get<IClientService>();
     _userAccountService = _ninjectKernel.Get<IUserAccountService>();
 }
Exemplo n.º 27
0
 public PlanController(IPlanService hrdPlanService,IUserAccountService userAccountService,
                       ICommonService commonService,INeedAssessmentService needAssessmentService,IHRDService hrdService)
 {
     _planService = hrdPlanService;
     _userAccountService = userAccountService;
     _commonService = commonService;
     _needAssessmentService = needAssessmentService;
 }
Exemplo n.º 28
0
        public AccountController(IHttpContextService httpContext,
                                 IUserAccountService userAccountService)
        {
            if (httpContext == null) throw new NullReferenceException();
            if (userAccountService == null) throw new NullReferenceException();

            _httpContext = httpContext;
            _userAccountService = userAccountService;
        }
Exemplo n.º 29
0
 //
 // GET: /Procurement/FetchData/
 public FetchDataController(IPaymentRequestService paymentRequestService,
     ITransportBidQuotationHeaderService bidQuotationHeader,IBidService bidService, IUserAccountService userAccountService, IBidWinnerService bidWinnerService)
 {
     _paymentRequestService = paymentRequestService;
     _bidService = bidService;
     _userAccountService = userAccountService;
     _bidWinnerService = bidWinnerService;
     _bidQuotationHeader = bidQuotationHeader;
 }
        public DeliveryReconcileController(IDispatchAllocationService dispatchAllocationService,
                                           IDeliveryService deliveryService,
                                           IDispatchService dispatchService,
                                           Cats.Services.EarlyWarning.ICommodityService commodityService, Cats.Services.EarlyWarning.IUnitService unitService,
                                           Cats.Services.Transaction.ITransactionService transactionService,
                                           Cats.Services.EarlyWarning.IAdminUnitService adminUnitService, Cats.Services.EarlyWarning.IFDPService fdpService,
                                           Cats.Services.Logistics.IDeliveryReconcileService deliveryReconcileService, IUserAccountService userAccountService, ILossReasonService lossReasonService)

        {
            _dispatchAllocationService = dispatchAllocationService;
            _deliveryService           = deliveryService;
            _dispatchService           = dispatchService;
            _commodityService          = commodityService;
            _unitService              = unitService;
            _transactionService       = transactionService;
            _adminUnitService         = adminUnitService;
            _fdpService               = fdpService;
            _deliveryReconcileService = deliveryReconcileService;
            _userAccountService       = userAccountService;
            _lossReasonService        = lossReasonService;
        }
Exemplo n.º 31
0
        private byte[] Authenticated(OSDMap map)
        {
            IUserAccountService accountService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         user           = accountService.GetUserAccount(UUID.Zero, map["UUID"].AsUUID());

            bool   Verified = user != null;
            OSDMap resp     = new OSDMap();

            resp["Verified"] = OSD.FromBoolean(Verified);

            if (Verified)
            {
                user.UserLevel = 0;
                accountService.StoreUserAccount(user);
            }

            string       xmlString = OSDParser.SerializeJsonString(resp);
            UTF8Encoding encoding  = new UTF8Encoding();

            return(encoding.GetBytes(xmlString));
        }
Exemplo n.º 32
0
        public RFQController(ITransportBidPlanService transportBidPlanServiceParam
                             , IAdminUnitService adminUnitServiceParam
                             , IProgramService programServiceParam
                             , ITransportBidPlanDetailService transportBidPlanDetailServiceParam
                             , IHubService hubServiceParam
                             , ITransportBidQuotationService bidQuotationServiceParam
                             , ITransporterService transporterServiceParam
                             , IBidService bidServiceParam
                             , IUserAccountService userAccountService)

        {
            this._transportBidPlanService       = transportBidPlanServiceParam;
            this._adminUnitService              = adminUnitServiceParam;
            this._programService                = programServiceParam;
            this._transportBidPlanDetailService = transportBidPlanDetailServiceParam;
            this._hubService          = hubServiceParam;
            this._bidQuotationService = bidQuotationServiceParam;
            this._bidService          = bidServiceParam;
            this._transporterService  = transporterServiceParam;
            this._userAccountService  = userAccountService;
        }
Exemplo n.º 33
0
        public UserController(
            IUserService userService,
            IMapper mapper,
            IOptions <CloudinarySettings> cloudinaryConfig,
            IFilterService filterService,
            IUserAccountService userAccountService
            )
        {
            _mapper           = mapper;
            _userService      = userService;
            _cloudinaryConfig = cloudinaryConfig;

            Account acc = new Account(
                CryptoHelper.Decrypt(_cloudinaryConfig.Value.CloudName),
                CryptoHelper.Decrypt(_cloudinaryConfig.Value.ApiKey),
                CryptoHelper.Decrypt(_cloudinaryConfig.Value.ApiSecret));

            _cloudinary         = new Cloudinary(acc);
            _filterService      = filterService;
            _userAccountService = userAccountService;
        }
Exemplo n.º 34
0
        protected void KickUserMessage(IScene scene, string[] cmd)
        {
            //Combine the params and figure out the message
            string user = CombineParams(cmd, 3, 5);

            if (user.EndsWith(" "))
            {
                user = user.Remove(user.Length - 1);
            }
            string message = CombineParams(cmd, 5);
            IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         account     = userService.GetUserAccount(null, user);

            if (account == null)
            {
                MainConsole.Instance.Info("User does not exist.");
                return;
            }

            KickUser(account.PrincipalID, message);
        }
Exemplo n.º 35
0
        public void Initialise(IConfigSource source)
        {
            IConfig moduleConfig = source.Configs["Modules"];

            if (moduleConfig != null)
            {
                string name = moduleConfig.GetString("UserAccountServices", "");
                if (name == Name)
                {
                    IConfig userConfig = source.Configs["UserAccountService"];
                    if (userConfig == null)
                    {
                        m_log.Error("[LOCAL USER ACCOUNT SERVICE CONNECTOR]: UserAccountService missing from OpenSim.ini");
                        return;
                    }

                    string serviceDll = userConfig.GetString("LocalServiceModule", String.Empty);

                    if (serviceDll == String.Empty)
                    {
                        m_log.Error("[LOCAL USER ACCOUNT SERVICE CONNECTOR]: No LocalServiceModule named in section UserService");
                        return;
                    }

                    Object[] args = new Object[] { source };
                    m_UserService = ServerUtils.LoadPlugin <IUserAccountService>(serviceDll, args);

                    if (m_UserService == null)
                    {
                        m_log.ErrorFormat(
                            "[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Cannot load user account service specified as {0}", serviceDll);
                        return;
                    }
                    m_Enabled = true;
                    m_Cache   = new UserAccountCache();

                    m_log.Info("[LOCAL USER ACCOUNT SERVICE CONNECTOR]: Local user connector enabled");
                }
            }
        }
Exemplo n.º 36
0
        public static void ConfigureContainer()
        {
            var builder = new ContainerBuilder();

            builder.RegisterControllers(typeof(MvcApplication).Assembly);

            builder.RegisterType <UnitOfWork>().As <IUnitOfWork>().SingleInstance();

            builder.RegisterType <MapSong>().As <IMapper <DataAccess.Song, Domain.DataTransfer.Song> >().SingleInstance();
            builder.RegisterType <MapAlbum>().As <IMapper <DataAccess.Album, Domain.DataTransfer.Album> >().SingleInstance();
            builder.RegisterType <MapBoughtSong>().As <IMapper <DataAccess.BoughtSong, Domain.DataTransfer.BoughtSong> >().SingleInstance();
            builder.RegisterType <MapUserAccount>().As <IMapper <User, UserAccount> >().SingleInstance();

            builder.RegisterType <MusicStoreService>().As <IMusicStoreService>().SingleInstance();
            builder.RegisterType <MusicStoreDisplayService>().As <IMusicStoreDisplayService>().SingleInstance();
            builder.RegisterType <UserAccountService>().As <IUserAccountService>().SingleInstance();
            builder.RegisterType <AdminService>().As <IAdminService>().SingleInstance();
            builder.RegisterType <UserStatisticService>().As <IUserStatisticService>().SingleInstance();
            builder.RegisterType <AdminStatisticService>().As <IAdminStatisticService>().SingleInstance();
            builder.RegisterType <DiscountService>().As <IDiscountService>().SingleInstance();

            var container = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));

            IUnitOfWork unitOfWork = container.Resolve <IUnitOfWork>();

            var songMapper        = container.Resolve <IMapper <DataAccess.Song, Domain.DataTransfer.Song> >();
            var boughtSongMapper  = container.Resolve <IMapper <DataAccess.BoughtSong, Domain.DataTransfer.BoughtSong> >();
            var userAccountMapper = container.Resolve <IMapper <User, UserAccount> >();
            var albumMapper       = container.Resolve <IMapper <DataAccess.Album, Domain.DataTransfer.Album> >();

            IMusicStoreDisplayService musicStoreDisplayService = container.Resolve <IMusicStoreDisplayService>();
            IMusicStoreService        musicStoreService        = container.Resolve <IMusicStoreService>();
            IUserAccountService       userAccountService       = container.Resolve <IUserAccountService>();
            IAdminService             adminService             = container.Resolve <IAdminService>();
            IUserStatisticService     userStatisticService     = container.Resolve <IUserStatisticService>();
            IAdminStatisticService    adminStatisticService    = container.Resolve <IAdminStatisticService>();
            IDiscountService          discountService          = container.Resolve <IDiscountService>();
        }
Exemplo n.º 37
0
        OSDMap ActivateAccount(OSDMap map)
        {
            OSDMap resp = new OSDMap();

            resp ["Verified"] = OSD.FromBoolean(false);

            if (map.ContainsKey("UserName") && map.ContainsKey("PasswordHash") && map.ContainsKey("ActivationToken"))
            {
                IUserAccountService accountService = m_registry.RequestModuleInterface <IUserAccountService> ();
                UserAccount         user           = accountService.GetUserAccount(null, map ["UserName"].ToString());
                if (user != null)
                {
                    IAgentConnector con   = DataPlugins.RequestPlugin <IAgentConnector> ();
                    IAgentInfo      agent = con.GetAgent(user.PrincipalID);
                    if (agent != null && agent.OtherAgentInformation.ContainsKey("WebUIActivationToken"))
                    {
                        UUID   activationToken      = map ["ActivationToken"];
                        string WebUIActivationToken = agent.OtherAgentInformation ["WebUIActivationToken"];
                        string PasswordHash         = map ["PasswordHash"];
                        if (!PasswordHash.StartsWith("$1$"))
                        {
                            PasswordHash = "$1$" + Util.Md5Hash(PasswordHash);
                        }
                        PasswordHash = PasswordHash.Remove(0, 3);  //remove $1$

                        bool verified = Utils.MD5String(activationToken.ToString() + ":" + PasswordHash) == WebUIActivationToken;
                        resp ["Verified"] = verified;
                        if (verified)
                        {
                            user.UserLevel = 0;
                            accountService.StoreUserAccount(user);
                            agent.OtherAgentInformation.Remove("WebUIActivationToken");
                            con.UpdateAgent(agent);
                        }
                    }
                }
            }

            return(resp);
        }
Exemplo n.º 38
0
        public HGInventoryService(IConfigSource config, string configName)
            : base(config, configName)
        {
            m_log.Debug("[HGInventory Service]: Starting");
            if (configName != string.Empty)
            {
                m_ConfigName = configName;
            }

            //
            // Try reading the [InventoryService] section, if it exists
            //
            IConfig invConfig = config.Configs[m_ConfigName];

            if (invConfig != null)
            {
                // realm = authConfig.GetString("Realm", realm);
                string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
                if (userAccountsDll == string.Empty)
                {
                    throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
                }

                Object[] args = new Object[] { config };
                m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userAccountsDll, args);
                if (m_UserAccountService == null)
                {
                    throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
                }

                // legacy configuration [obsolete]
                m_HomeURL = invConfig.GetString("ProfileServerURI", string.Empty);
                // Preferred
                m_HomeURL = invConfig.GetString("HomeURI", m_HomeURL);

                m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
            }

            m_log.Debug("[HG INVENTORY SERVICE]: Starting...");
        }
Exemplo n.º 39
0
 public HRDController(IAdminUnitService adminUnitService, IHRDService hrdService,
                      IRationService rationservice, IRationDetailService rationDetailService,
                      IHRDDetailService hrdDetailService, ICommodityService commodityService,
                      INeedAssessmentDetailService needAssessmentDetailService, INeedAssessmentHeaderService needAssessmentService,
                      IWorkflowStatusService workflowStatusService, ISeasonService seasonService,
                      IUserAccountService userAccountService, ILog log, IPlanService planService, ITransactionService transactionService)
 {
     _adminUnitService            = adminUnitService;
     _hrdService                  = hrdService;
     _hrdDetailService            = hrdDetailService;
     _commodityService            = commodityService;
     _rationService               = rationservice;
     _rationDetailService         = rationDetailService;
     _needAssessmentDetailService = needAssessmentDetailService;
     _needAssessmentService       = needAssessmentService;
     _workflowStatusService       = workflowStatusService;
     _seasonService               = seasonService;
     _userAccountService          = userAccountService;
     _log                = log;
     _planService        = planService;
     _transactionService = transactionService;
 }
Exemplo n.º 40
0
        public UserProfilesService(IConfigSource config, string configName) :
            base(config, configName)
        {
            IConfig Config = config.Configs[configName];

            if (Config == null)
            {
                m_log.Warn("[PROFILES SERVICE]: No configuration found!");
                return;
            }
            Object[] args = null;

            args = new Object[] { config };
            string accountService = Config.GetString("UserAccountService", String.Empty);

            if (accountService != string.Empty)
            {
                userAccounts = ServerUtils.LoadPlugin <IUserAccountService>(accountService, args);
            }

            args = new Object[] { config };
        }
Exemplo n.º 41
0
        /// <summary>
        /// Make an OSPA given a user UUID
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="commsManager"></param>
        /// <returns>The OSPA.  Null if a user with the given UUID could not be found.</returns>
        public static string MakeOspa(UUID userId, IUserAccountService userService)
        {
            if (userService == null)
            {
                m_log.Warn("[OSP RESOLVER]: UserService is null");
                return(userId.ToString());
            }

            UserAccount account = userService.GetUserAccount(UUID.Zero, userId);

            if (account != null)
            {
                return(MakeOspa(account.FirstName, account.LastName));
            }
            //            else
            //            {
            //                m_log.WarnFormat("[OSP RESOLVER]: No user account for {0}", userId);
            //                System.Console.WriteLine("[OSP RESOLVER]: No user account for {0}", userId);
            //            }

            return(null);
        }
Exemplo n.º 42
0
        /// <summary>
        /// After conformation the email is saved
        /// </summary>
        /// <param name="map">UUID, Email</param>
        /// <returns>Verified</returns>
        byte[] SaveEmail(OSDMap map)
        {
            string email = map["Email"].AsString();

            IUserAccountService accountService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         user           = accountService.GetUserAccount(UUID.Zero, map["UUID"].AsUUID());
            OSDMap resp = new OSDMap();

            bool verified = user != null;

            resp["Verified"] = OSD.FromBoolean(verified);
            if (verified)
            {
                user.Email     = email;
                user.UserLevel = 0;
                accountService.StoreUserAccount(user);
            }
            string       xmlString = OSDParser.SerializeJsonString(resp);
            UTF8Encoding encoding  = new UTF8Encoding();

            return(encoding.GetBytes(xmlString));
        }
Exemplo n.º 43
0
 public RegionalPSNPPlanController(IRegionalPSNPPlanService regionalPSNPPlanServiceParam
                                   , IRationService rationServiceParam
                                   , IAdminUnitService adminUnitServiceParam
                                   , IBusinessProcessService BusinessProcessServiceParam
                                   , IBusinessProcessStateService BusinessProcessStateServiceParam
                                   , IApplicationSettingService ApplicationSettingParam
                                   , ILog log
                                   , IPlanService planService
                                   , IUserAccountService userAccountService, ITransactionService transactionService, IUserProfileService userProfileService)
 {
     this._regionalPSNPPlanService     = regionalPSNPPlanServiceParam;
     this._rationService               = rationServiceParam;
     this._adminUnitService            = adminUnitServiceParam;
     this._BusinessProcessService      = BusinessProcessServiceParam;
     this._BusinessProcessStateService = BusinessProcessStateServiceParam;
     this._ApplicationSettingService   = ApplicationSettingParam;
     this._log                = log;
     this._planService        = planService;
     this._userAccountService = userAccountService;
     _transactionService      = transactionService;
     this._userProfileService = userProfileService;
 }
Exemplo n.º 44
0
        void InitGodNames()
        {
            if (m_fullNames.Count > 0)
            {
                return;
            }

            IUserAccountService userService = m_service.Registry.RequestModuleInterface <IUserAccountService> ();
            var gods = userService.GetUserAccounts(null, "*");

            if (gods != null)
            {
                foreach (UserAccount user in gods)
                {
                    if (user.UserLevel >= Constants.USER_GOD_LIASON)
                    {
                        m_lastNames.Add(user.LastName);
                        m_fullNames.Add(user.Name);
                    }
                }
            }
        }
        public void Initialize(IGenericData GenericData, IConfigSource source, IRegistryCore registry,
                               string defaultConnectionString)
        {
            GD         = GenericData;
            m_registry = registry;

            IConfig config = source.Configs["Currency"];

            if (config == null || source.Configs["Currency"].GetString("Module", "") != "BaseCurrency")
            {
                return;
            }

            IConfig gridInfo = source.Configs["GridInfoService"];

            if (gridInfo != null)
            {
                InWorldCurrency = gridInfo.GetString("CurrencySymbol", string.Empty) + " ";
                RealCurrency    = gridInfo.GetString("RealCurrencySymbol", string.Empty) + " ";
            }

            if (source.Configs[Name] != null)
            {
                defaultConnectionString = source.Configs[Name].GetString("ConnectionString", defaultConnectionString);
            }

            if (GenericData != null)
            {
                GenericData.ConnectToDatabase(defaultConnectionString, "SimpleCurrency", true);
            }
            Framework.Utilities.DataManager.RegisterPlugin(Name, this);

            m_config             = new BaseCurrencyConfig(config);
            m_userInfoService    = m_registry.RequestModuleInterface <IAgentInfoService>();
            m_userAccountService = m_registry.RequestModuleInterface <IUserAccountService> ();

            Init(m_registry, Name, "", "/currency/", "CurrencyServerURI");
        }
Exemplo n.º 46
0
        OSDMap ConfirmUserEmailName(OSDMap map)
        {
            string Name  = map ["Name"].AsString();
            string Email = map ["Email"].AsString();

            OSDMap resp = new OSDMap();
            IUserAccountService accountService = m_registry.RequestModuleInterface <IUserAccountService> ();
            UserAccount         user           = accountService.GetUserAccount(null, Name);
            bool verified = user != null;

            resp ["Verified"] = OSD.FromBoolean(verified);

            if (verified)
            {
                resp ["UUID"] = OSD.FromUUID(user.PrincipalID);
                if (user.UserLevel >= 0)
                {
                    if (user.Email.ToLower() != Email.ToLower())
                    {
                        MainConsole.Instance.TraceFormat("User email for account \"{0}\" is \"{1}\" but \"{2}\" was specified.", Name, user.Email.ToString(), Email);
                        resp ["Error"]     = OSD.FromString("Email does not match the user name.");
                        resp ["ErrorCode"] = OSD.FromInteger(3);
                    }
                }
                else
                {
                    resp ["Error"]     = OSD.FromString("This account is disabled.");
                    resp ["ErrorCode"] = OSD.FromInteger(2);
                }
            }
            else
            {
                resp ["Error"]     = OSD.FromString("No such user.");
                resp ["ErrorCode"] = OSD.FromInteger(1);
            }

            return(resp);
        }
Exemplo n.º 47
0
 public HomeController(IReliefRequisitionService reliefRequisitionService,
                       hub.IDispatchAllocationService dispatchAllocationService,
                       IUserAccountService userAccountService,
                       ITransportOrderService transportOrderService,
                       ITransportOrderDetailService transportOrderDetailService,
                       hub.DispatchService dispatchService,
                       hub.DispatchDetailService dispatchDetailService,
                       ISIPCAllocationService sipcAllocationService,
                       IAdminUnitService adminUnitService,
                       IHRDService hrdService,
                       IBidWinnerService bidWinnerService,
                       IBidService bidService,
                       IHRDDetailService hrdDetailService,
                       IRationDetailService rationDetailService,
                       IProgramService programService,
                       IStockStatusService stockStatusService, IReceiptPlanDetailService receiptPlanDetailService, IDeliveryService deliveryService, IGiftCertificateDetailService giftCertificateDetailService, hub.IReceiptAllocationService receiptAllocationService)
 {
     this._reliefRequisitionService = reliefRequisitionService;
     _dispatchAllocationService     = dispatchAllocationService;
     _userAccountService            = userAccountService;
     _transportOrderService         = transportOrderService;
     _transportOrderDetailService   = transportOrderDetailService;
     _dispatchService              = dispatchService;
     _dispatchDetailService        = dispatchDetailService;
     _sipcAllocationService        = sipcAllocationService;
     _adminUnitService             = adminUnitService;
     _hrdService                   = hrdService;
     _bidWinnerService             = bidWinnerService;
     _bidService                   = bidService;
     _hrdDetailService             = hrdDetailService;
     _rationDetailService          = rationDetailService;
     _programService               = programService;
     _stockStatusService           = stockStatusService;
     _receiptPlanDetailService     = receiptPlanDetailService;
     _deliveryService              = deliveryService;
     _giftCertificateDetailService = giftCertificateDetailService;
     _receiptAllocationService     = receiptAllocationService;
 }
Exemplo n.º 48
0
        // Our service
        // see WxServiceBase. That is where most of the configuration
        // for this is done. In this file we are setting up the external
        // and internal services our endpoints will use...
        public WxUserService(IConfigSource config)
            : base(config)
        {
            m_log.Info("[WxUserService]: Wx Loading ... ");
            m_config = config;
            IConfig WxConfig = config.Configs["WxUserService"];

            if (WxConfig != null)
            {
                // loading the UserAccountService so we can use it's methods in our example
                // see below: GetUserData(UUID userID)
                //
                // Read the configuration...
                string userService = WxConfig.GetString("UserAccountService", String.Empty);

                // Load it...
                if (userService != String.Empty)
                {
                    Object[] args = new Object[] { config };
                    m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(userService, args);
                }
            }
        }
Exemplo n.º 49
0
        protected internal AssetsRequest(
            AssetsArchiver assetsArchiver, IDictionary <UUID, AssetType> uuids,
            IAssetService assetService, IUserAccountService userService,
            UUID scope, Dictionary <string, object> options,
            AssetsRequestCallback assetsRequestCallback)
        {
            m_assetsArchiver        = assetsArchiver;
            m_uuids                 = uuids;
            m_assetsRequestCallback = assetsRequestCallback;
            m_assetService          = assetService;
            m_userAccountService    = userService;
            m_scopeID               = scope;
            m_options               = options;
            m_repliesRequired       = uuids.Count;

            // FIXME: This is a really poor way of handling the timeout since it will always leave the original requesting thread
            // hanging.  Need to restructure so an original request thread waits for a ManualResetEvent on asset received
            // so we can properly abort that thread.  Or request all assets synchronously, though that would be a more
            // radical change
            m_requestCallbackTimer           = new System.Timers.Timer(TIMEOUT);
            m_requestCallbackTimer.AutoReset = false;
            m_requestCallbackTimer.Elapsed  += new ElapsedEventHandler(OnRequestCallbackTimeout);
        }
Exemplo n.º 50
0
        public void RegionLoaded(Scene scene)
        {
            if (!enabled)
            {
                return;
            }

            m_Scene = scene;

            m_UserManager = scene.RequestModuleInterface <IUserManagement>();
            if (m_UserManager == null)
            {
                return;
            }

            m_UserAccountService = scene.RequestModuleInterface <IUserAccountService>();
            if (m_UserAccountService == null)
            {
                return;
            }

            scene.RegisterModuleInterface <IDisplayNamesModule>(this);
        }
Exemplo n.º 51
0
 public ValidatedPaymentRequestController(IBusinessProcessService paramBusinessProcessService
                                          , IBusinessProcessStateService paramBusinessProcessStateService
                                          , IApplicationSettingService paramApplicationSettingService
                                          , ITransportOrderService paramTransportOrderService
                                          , ITransporterAgreementVersionService transporterAgreementVersionService
                                          , IWorkflowStatusService workflowStatusService, ITransporterService transporterService
                                          , ITransporterChequeService transporterChequeService, IUserProfileService userProfileService, ITransporterPaymentRequestService transporterPaymentRequestService, IBidWinnerService bidWinnerService, IUserAccountService userAccountService, IDispatchService dispatchService, ITransporterChequeDetailService transporterChequeDetailService)
 {
     _businessProcessService             = paramBusinessProcessService;
     _businessProcessStateService        = paramBusinessProcessStateService;
     _applicationSettingService          = paramApplicationSettingService;
     _transportOrderService              = paramTransportOrderService;
     _transporterAgreementVersionService = transporterAgreementVersionService;
     _workflowStatusService              = workflowStatusService;
     _transporterService               = transporterService;
     _transporterChequeService         = transporterChequeService;
     _userProfileService               = userProfileService;
     _transporterPaymentRequestService = transporterPaymentRequestService;
     _bidWinnerService               = bidWinnerService;
     _userAccountService             = userAccountService;
     _dispatchService                = dispatchService;
     _transporterChequeDetailService = transporterChequeDetailService;
 }
        public UserAccountServiceConnector(IConfigSource config, IHttpServer server, string configName) :
            base(config, server, configName)
        {
            IConfig serverConfig = config.Configs[m_ConfigName];

            if (serverConfig == null)
            {
                throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
            }

            string service = serverConfig.GetString("LocalServiceModule",
                                                    String.Empty);

            if (service == String.Empty)
            {
                throw new Exception("No LocalServiceModule in config file");
            }

            Object[] args = new Object[] { config };
            m_UserAccountService = ServerUtils.LoadPlugin <IUserAccountService>(service, args);

            server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig));
        }
Exemplo n.º 53
0
        private void ClearDefaultInventory(string module, string[] cmd)
        {
            string sure = MainConsole.Instance.CmdPrompt("Are you sure you want to delete the default inventory?", "yes");

            if (!sure.Equals("yes", StringComparison.CurrentCultureIgnoreCase))
            {
                return;
            }
            IUserAccountService UserAccountService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         uinfo            = UserAccountService.GetUserAccount(UUID.Zero, LibraryOwner);
            IInventoryService   InventoryService = m_registry.RequestModuleInterface <IInventoryService> ();

            if (uinfo != null)
            {
                //Delete the root folders
                InventoryFolderBase root = InventoryService.GetRootFolder(uinfo.PrincipalID);
                while (root != null)
                {
                    InventoryService.ForcePurgeFolder(root);
                    root = InventoryService.GetRootFolder(uinfo.PrincipalID);
                }
            }
        }
 public TransporterPaymentRequestController(IBusinessProcessService _paramBusinessProcessService
                                            , IBusinessProcessStateService _paramBusinessProcessStateService
                                            , IApplicationSettingService _paramApplicationSettingService
                                            , ITransporterPaymentRequestService transporterPaymentRequestService
                                            , ITransportOrderService _paramTransportOrderService
                                            , IBidWinnerService bidWinnerService
                                            , IDispatchService dispatchService
                                            , IWorkflowStatusService workflowStatusService
                                            , IUserAccountService userAccountService
                                            , Services.Procurement.ITransporterService transporterService, ITransportOrderService transportOrderService)
 {
     _BusinessProcessService           = _paramBusinessProcessService;
     _BusinessProcessStateService      = _paramBusinessProcessStateService;
     _ApplicationSettingService        = _paramApplicationSettingService;
     _transporterPaymentRequestService = transporterPaymentRequestService;
     _TransportOrderService            = _paramTransportOrderService;
     _bidWinnerService      = bidWinnerService;
     _dispatchService       = dispatchService;
     _workflowStatusService = workflowStatusService;
     _userAccountService    = userAccountService;
     _transporterService    = transporterService;
     _transportOrderService = transportOrderService;
 }
Exemplo n.º 55
0
 public virtual void RegionLoaded(Scene s)
 {
     if (!m_Enabled)
     {
         return;
     }
     if (m_ServiceThrottle == null)
     {
         m_ServiceThrottle = s.RequestModuleInterface <IServiceThrottleModule>();
     }
     if (m_userAccountService == null)
     {
         m_userAccountService = s.UserAccountService;
     }
     if (m_gridUserService == null)
     {
         m_gridUserService = s.GridUserService;
     }
     if (s.RegionInfo.ScopeID != UUID.Zero)
     {
         m_scopeID = s.RegionInfo.ScopeID;
     }
 }
Exemplo n.º 56
0
 public BidController(IBidService bidService, IBidDetailService bidDetailService,
                      IAdminUnitService adminUnitService,
                      IStatusService statusService,
                      ITransportBidPlanService transportBidPlanService,
                      ITransportBidPlanDetailService transportBidPlanDetailService,
                      IApplicationSettingService applicationSettingService, IUserAccountService userAccountService,
                      ITransportBidQuotationService transportBidQuotationService, IBidWinnerService bidWinnerService,
                      ITransporterService transporterService, IHubService hubService, IWorkflowStatusService workflowStatusService)
 {
     _bidService                    = bidService;
     _bidDetailService              = bidDetailService;
     _adminUnitService              = adminUnitService;
     _statusService                 = statusService;
     _transportBidPlanService       = transportBidPlanService;
     _transportBidPlanDetailService = transportBidPlanDetailService;
     _applicationSettingService     = applicationSettingService;
     _userAccountService            = userAccountService;
     _transportBidQuotationService  = transportBidQuotationService;
     _bidWinnerService              = bidWinnerService;
     _transporterService            = transporterService;
     _hubService                    = hubService;
     _workflowStatusService         = workflowStatusService;
 }
Exemplo n.º 57
0
        private object CreateUserInformation(string functionname, object parameters)
        {
            UUID userid = (UUID)parameters;
            IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         user        = userService.GetUserAccount(null, userid);

            if (user == null)
            {
                return(null);
            }
            if ((m_options.StipendsPremiumOnly) && ((user.UserFlags & 600) != 600))
            {
                return(null);
            }

            SchedulerItem i = m_scheduler.Get(user.PrincipalID.ToString(), "StipendsPayout");

            if (i != null)
            {
                return(null);
            }
            RepeatType runevertype = (RepeatType)Enum.Parse(typeof(RepeatType), m_options.StipendsEveryType);
            int        runevery    = m_options.StipendsEvery;

            m_scheduler.Save(new SchedulerItem("StipendsPayout",
                                               OSDParser.SerializeJsonString(
                                                   new StipendsInfo()
            {
                AgentID = user.PrincipalID
            }.ToOSD()),
                                               false, UnixTimeStampToDateTime(user.Created), runevery,
                                               runevertype, user.PrincipalID)
            {
                HisotryKeep = true, HistoryReciept = true
            });
            return(null);
        }
Exemplo n.º 58
0
        /*		#region IService implementation
         *
         *      public void Initialize(IConfigSource config, IRegistryCore registry)
         *      {
         *          throw new System.NotImplementedException();
         *      }
         *
         *      public void Start(IConfigSource config, IRegistryCore registry)
         *      {
         *          throw new System.NotImplementedException();
         *      }
         *
         *      public void FinishedStartup()
         *      {
         *          throw new System.NotImplementedException();
         *      }
         *
         #endregion
         */

        #region user

        /// <summary>
        /// Gets user information for change user info page on site
        /// </summary>
        /// <param name="map">UUID</param>
        /// <returns>Verified, HomeName, HomeUUID, Online, Email, FirstName, LastName</returns>
        OSDMap GetGridUserInfo(OSDMap map)
        {
            string uuid = string.Empty;

            uuid = map ["UUID"].AsString();

            IUserAccountService accountService = m_registry.RequestModuleInterface <IUserAccountService> ();
            UserAccount         user           = accountService.GetUserAccount(null, map ["UUID"].AsUUID());
            IAgentInfoService   agentService   = m_registry.RequestModuleInterface <IAgentInfoService> ();

            UserInfo userinfo;
            OSDMap   resp     = new OSDMap();
            bool     verified = user != null;

            resp ["Verified"] = OSD.FromBoolean(verified);
            if (verified)
            {
                userinfo = agentService.GetUserInfo(uuid);
                IGridService gs = m_registry.RequestModuleInterface <IGridService> ();
                GridRegion   gr = null;
                if (userinfo != null)
                {
                    gr = gs.GetRegionByUUID(null, userinfo.HomeRegionID);
                }

                resp ["UUID"]      = OSD.FromUUID(user.PrincipalID);
                resp ["HomeUUID"]  = OSD.FromUUID((userinfo == null) ? UUID.Zero : userinfo.HomeRegionID);
                resp ["HomeName"]  = OSD.FromString((userinfo == null) ? "" : gr.RegionName);
                resp ["Online"]    = OSD.FromBoolean((userinfo == null) ? false : userinfo.IsOnline);
                resp ["Email"]     = OSD.FromString(user.Email);
                resp ["Name"]      = OSD.FromString(user.Name);
                resp ["FirstName"] = OSD.FromString(user.FirstName);
                resp ["LastName"]  = OSD.FromString(user.LastName);
            }

            return(resp);
        }
Exemplo n.º 59
0
        private object StipendsPayOutEvent(string functionName, object parameters)
        {
            if (functionName != "StipendsPayout")
            {
                return(null);
            }
            StipendsInfo si = new StipendsInfo();

            si.FromOSD((OSDMap)OSDParser.DeserializeJson(parameters.ToString()));
            IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>();
            UserAccount         ua          = userService.GetUserAccount(null, si.AgentID);

            if ((ua != null) && (ua.UserFlags >= 0) && ((!m_options.StipendsPremiumOnly) || ((ua.UserLevel & Constants.USER_FLAG_MEMBER) == Constants.USER_FLAG_MEMBER)))
            {
                if (m_options.GiveStipendsOnlyWhenLoggedIn)
                {
                    ICapsService       capsService = m_registry.RequestModuleInterface <ICapsService>();
                    IClientCapsService client      = capsService.GetClientCapsService(ua.PrincipalID);
                    if (client == null)
                    {
                        return("");
                    }
                }
                IMoneyModule mo = m_registry.RequestModuleInterface <IMoneyModule>();
                if (mo == null)
                {
                    return(null);
                }
                UUID transid = UUID.Random();
                MainConsole.Instance.Info("[MONEY MODULE] Stipend Payment for " + ua.FirstName + " " + ua.LastName + " is now running");
                if (m_currencyService.UserCurrencyTransfer(ua.PrincipalID, UUID.Zero, (uint)m_options.Stipend, "Stipend Payment", TransactionType.StipendPayment, transid))
                {
                    return(transid.ToString());
                }
            }
            return("");
        }