Inheritance: IService, IWebInterfaceModule
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            if (requestParameters.ContainsKey("Submit"))
            {
                string title = requestParameters["NewsTitle"].ToString();
                string text = requestParameters["NewsText"].ToString();
                IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
                GridNewsItem item = new GridNewsItem {Text = text, Time = DateTime.Now, Title = title};
                item.ID = connector.GetGenericCount(UUID.Zero, "WebGridNews") + 1;
                connector.AddGeneric(UUID.Zero, "WebGridNews", item.ID.ToString(), item.ToOSD());
                response = "<h3>News item added successfully, redirecting to main page</h3>" +
                           "<script language=\"javascript\">" +
                           "setTimeout(function() {window.location.href = \"index.html?page=news_manager\";}, 0);" +
                           "</script>";
                return null;
            }

            vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
            vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
            vars.Add("AddNewsText", translator.GetTranslatedString("AddNewsText"));
            vars.Add("Submit", translator.GetTranslatedString("Submit"));

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            vars.Add("DisplayLG1", "display: none;");
            vars.Add("DisplayLG2", "display: none;");
            vars.Add("DisplayLG3", "display: none;");
            vars.Add("DisplayLG4", "display: none;");
            vars.Add("DisplayLG5", "display: none;");
            vars.Add("DisplayLG6", "display: none;");
            if (translator.LanguageName == "en")
                vars["DisplayLG1"] = "";
            if (translator.LanguageName == "fr")
                vars["DisplayLG2"] = "";
            if (translator.LanguageName == "de")
                vars["DisplayLG3"] = "";
            if (translator.LanguageName == "it")
                vars["DisplayLG4"] = "";
            if (translator.LanguageName == "es")
                vars["DisplayLG5"] = "";
            if (translator.LanguageName == "nl")
                vars["DisplayLG6"] = "";

            return vars;
        }
Esempio n. 3
0
 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                        OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                        ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
     if (httpRequest.Query.Contains("delete"))
     {
         string newsID = httpRequest.Query["delete"].ToString();
         connector.RemoveGeneric(UUID.Zero, "WebGridNews", newsID);
         vars["Success"] = "Successfully deleted the news item";
     }
     else
         vars["Success"] = "";
     var newsItems = connector.GetGenerics<GridNewsItem>(UUID.Zero, "WebGridNews");
     vars.Add("News", newsItems.ConvertAll<Dictionary<string, object>>(item => item.ToDictionary()));
     vars.Add("NewsManager", translator.GetTranslatedString("NewsManager"));
     vars.Add("EditNewsItem", translator.GetTranslatedString("EditNewsItem"));
     vars.Add("AddNewsItem", translator.GetTranslatedString("AddNewsItem"));
     vars.Add("DeleteNewsItem", translator.GetTranslatedString("DeleteNewsItem"));
     vars.Add("NewsTitleText", translator.GetTranslatedString("NewsTitleText"));
     vars.Add("NewsDateText", translator.GetTranslatedString("NewsDateText"));
     vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
     vars.Add("DeleteNewsText", translator.GetTranslatedString("DeleteNewsText"));
     return vars;
 }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            // Style Switcher
            vars.Add("styles1", translator.GetTranslatedString("styles1"));
            vars.Add("styles2", translator.GetTranslatedString("styles2"));
            vars.Add("styles3", translator.GetTranslatedString("styles3"));
            vars.Add("styles4", translator.GetTranslatedString("styles4"));
            vars.Add("styles5", translator.GetTranslatedString("styles5"));

            vars.Add("StyleSwitcherStylesText", translator.GetTranslatedString("StyleSwitcherStylesText"));
            vars.Add("StyleSwitcherLanguagesText", translator.GetTranslatedString("StyleSwitcherLanguagesText"));
            vars.Add("StyleSwitcherChoiceText", translator.GetTranslatedString("StyleSwitcherChoiceText"));

            // Language Switcher
            vars.Add("en", translator.GetTranslatedString("en"));
            vars.Add("fr", translator.GetTranslatedString("fr"));
            vars.Add("de", translator.GetTranslatedString("de"));
            vars.Add("it", translator.GetTranslatedString("it"));
            vars.Add("es", translator.GetTranslatedString("es"));
            vars.Add("nl", translator.GetTranslatedString("nl"));

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            if (requestParameters.ContainsKey("ResetMenu"))
            {
                PagesMigrator.ResetToDefaults();
                response = "Menu: "+ translator.GetTranslatedString("ChangesSavedSuccessfully");
                return null;
            }
            if (requestParameters.ContainsKey("ResetSettings"))
            {
                SettingsMigrator.ResetToDefaults(webInterface);
                response = "WebUI: "+ translator.GetTranslatedString("ChangesSavedSuccessfully");
                return null;
            }

            vars.Add("FactoryReset", translator.GetTranslatedString("FactoryReset"));
            vars.Add("ResetMenuText", translator.GetTranslatedString("ResetMenuText"));
            vars.Add("ResetSettingsText", translator.GetTranslatedString("ResetSettingsText"));
            vars.Add("ResetMenuInfoText", translator.GetTranslatedString("ResetMenuText"));
            vars.Add("ResetSettingsInfoText", translator.GetTranslatedString("ResetSettingsInfoText"));
            vars.Add("Reset", translator.GetTranslatedString("Reset"));

            return vars;
        }
Esempio n. 6
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                                OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                                ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            //IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();

            // Check if we're looking at the standard page or the submitted one
            if (requestParameters.ContainsKey("Submit"))
            {
            }
            else
            {
                //vars.Add("ErrorMessage", error);

                vars.Add("SimConsoleText", translator.GetTranslatedString("SimConsoleText"));
                vars.Add("SimAddressText", translator.GetTranslatedString("SimAddressText"));
                vars.Add("UserNameText", translator.GetTranslatedString("UserNameText"));
                vars.Add("PasswordText", translator.GetTranslatedString("PasswordText"));
                vars.Add("SendCommandText", translator.GetTranslatedString("SendCommandText"));

                vars.Add("Login", translator.GetTranslatedString("Login"));

            }
            return vars;
        }
        public static void GetGridConfigSettings(WebInterface webinterface)
        {
            var configSrc = webinterface.Registry.RequestModuleInterface<ISimulationBase> ().ConfigSource;
            IConfig config;
            _settingsGrid = new GridSettings ();

            // login
            config =  configSrc.Configs ["LoginService"];
            if (config != null)
            {
                _settingsGrid.WelcomeMessage = config.GetString("WelcomeMessage", _settingsGrid.WelcomeMessage);
            }

            // gridinfo
            config =  configSrc.Configs ["GridInfoService"];
            if (config != null)
            {
                _settingsGrid.Gridname = config.GetString("gridname", _settingsGrid.Gridname);
                _settingsGrid.Gridnick = config.GetString("gridnick", _settingsGrid.Gridnick);
            }

            // RealEstate
            config =  configSrc.Configs ["EstateService"];
            if (config != null)
            {
                _settingsGrid.SystemEstateOwnerName = config.GetString("SystemEstateOwnerName", _settingsGrid.SystemEstateOwnerName);
                _settingsGrid.SystemEstateName = config.GetString("SystemEstateName", _settingsGrid.SystemEstateName);
            }
        }
Esempio n. 8
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            return vars;
        }
        public Dictionary<string, object> Fill (WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();

            List<Dictionary<string, object>> RegionListVars = new List<Dictionary<string, object>> ();
            var sortBy = new Dictionary<string, bool> ();
            if (httpRequest.Query.ContainsKey ("region"))
                sortBy.Add (httpRequest.Query ["region"].ToString (), true);
            else if (httpRequest.Query.ContainsKey ("Order"))
                sortBy.Add (httpRequest.Query ["Order"].ToString (), true);


            var regionData = Framework.Utilities.DataManager.RequestPlugin<IRegionData> ();
            var regions = regionData.Get ((RegionFlags) 0,
                                          RegionFlags.Hyperlink | RegionFlags.Foreign | RegionFlags.Hidden,
                                          null, null, sortBy);
            foreach (var region in regions) {
                string info;
                info = (region.RegionArea < 1000000) ? region.RegionArea + " m2" : (region.RegionArea / 1000000) + " km2";
                info = info + ", " + region.RegionTerrain;

                RegionListVars.Add (new Dictionary<string, object> {
                    { "RegionLocX", region.RegionLocX / Constants.RegionSize },
                    { "RegionLocY", region.RegionLocY / Constants.RegionSize },
                    { "RegionName", region.RegionName },
                    { "RegionInfo", info},
                    { "RegionStatus", region.IsOnline ? "yes" : "no"},
                    { "RegionID", region.RegionID },
                    { "RegionURI", region.RegionURI }
                });
            }

            vars.Add ("RegionList", RegionListVars);
            vars.Add ("RegionText", translator.GetTranslatedString ("Region"));

            vars.Add ("RegionNameText", translator.GetTranslatedString ("RegionNameText"));
            vars.Add ("RegionLocXText", translator.GetTranslatedString ("RegionLocXText"));
            vars.Add ("RegionLocYText", translator.GetTranslatedString ("RegionLocYText"));
            vars.Add ("RegionOnlineText", translator.GetTranslatedString ("Online"));
            vars.Add ("SortByLocX", translator.GetTranslatedString ("SortByLocX"));
            vars.Add ("SortByLocY", translator.GetTranslatedString ("SortByLocY"));
            vars.Add ("SortByName", translator.GetTranslatedString ("SortByName"));
            vars.Add ("RegionListText", translator.GetTranslatedString ("RegionListText"));
            vars.Add ("FirstText", translator.GetTranslatedString ("FirstText"));
            vars.Add ("BackText", translator.GetTranslatedString ("BackText"));
            vars.Add ("NextText", translator.GetTranslatedString ("NextText"));
            vars.Add ("LastText", translator.GetTranslatedString ("LastText"));
            vars.Add ("CurrentPageText", translator.GetTranslatedString ("CurrentPageText"));
            vars.Add ("MoreInfoText", translator.GetTranslatedString ("MoreInfoText"));
            vars.Add ("RegionMoreInfo", translator.GetTranslatedString ("RegionMoreInfo"));
            vars.Add ("MainServerURL", webInterface.GridURL);

            return vars;
        }
 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
     OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
     ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     vars.Add("RegistrationText", translator.GetTranslatedString("RegistrationText"));
     vars.Add("RegistrationsDisabled", translator.GetTranslatedString("RegistrationsDisabled"));
     return vars;
 }
        public Dictionary<string, object> Fill (WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();
            var settings = webInterface.GetGridSettings ();

            if (requestParameters.ContainsKey ("Submit")) {
                settings.Gridname = requestParameters ["Gridname"].ToString ();
                settings.Gridnick = requestParameters ["Gridnick"].ToString ();
                settings.WelcomeMessage = requestParameters ["WelcomeMessage"].ToString ();
                settings.GovernorName = requestParameters ["GovernorName"].ToString ();
                settings.RealEstateOwnerName = requestParameters ["RealEstateOwnerName"].ToString ();
                settings.BankerName = requestParameters ["BankerName"].ToString ();
                settings.MarketplaceOwnerName = requestParameters ["MarketplaceOwnerName"].ToString ();
                settings.MainlandEstateName = requestParameters ["MainlandEstateName"].ToString ();
                settings.SystemEstateName = requestParameters ["SystemEstateName"].ToString ();

                // update main grid setup
                webInterface.SaveGridSettings (settings);
                response = "Successfully updated grid settings.";

                return null;
            }

            vars.Add ("Gridname", settings.Gridname);
            vars.Add ("Gridnick", settings.Gridnick);
            vars.Add ("WelcomeMessage", settings.WelcomeMessage);
            vars.Add ("GovernorName", settings.GovernorName);
            vars.Add ("RealEstateOwnerName", settings.RealEstateOwnerName);
            vars.Add ("BankerName", settings.BankerName);
            vars.Add ("MarketplaceOwnerName", settings.MarketplaceOwnerName);
            vars.Add ("MainlandEstateName", settings.MainlandEstateName);
            vars.Add ("SystemEstateName", settings.SystemEstateName);


            vars.Add ("GridSettingsManager", translator.GetTranslatedString ("GridSettingsManager"));
            vars.Add ("GridnameText", translator.GetTranslatedString ("GridnameText"));
            vars.Add ("GridnickText", translator.GetTranslatedString ("GridnickText"));
            vars.Add ("WelcomeMessageText", translator.GetTranslatedString ("WelcomeMessageText"));
            vars.Add ("GovernorNameText", translator.GetTranslatedString ("GovernorNameText"));
            vars.Add ("RealEstateOwnerNameText", translator.GetTranslatedString ("RealEstateOwnerNameText"));
            vars.Add ("BankerNameText", translator.GetTranslatedString ("BankerNameText"));
            vars.Add ("MarketPlaceOwnerNameText", translator.GetTranslatedString ("MarketPlaceOwnerNameText"));
            vars.Add ("MainlandEstateNameText", translator.GetTranslatedString ("MainlandEstateNameText"));
            vars.Add ("SystemEstateNameText", translator.GetTranslatedString ("SystemEstateNameText"));

            vars.Add ("Save", translator.GetTranslatedString ("Save"));
            vars.Add ("No", translator.GetTranslatedString ("No"));
            vars.Add ("Yes", translator.GetTranslatedString ("Yes"));

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();

            if (requestParameters.ContainsKey("Submit"))
            {
                GridWelcomeScreen submittedInfo = new GridWelcomeScreen();
                submittedInfo.SpecialWindowMessageTitle = requestParameters["SpecialWindowTitle"].ToString();
                submittedInfo.SpecialWindowMessageText = requestParameters["SpecialWindowText"].ToString();
                submittedInfo.SpecialWindowMessageColor = requestParameters["SpecialWindowColor"].ToString();
                submittedInfo.SpecialWindowActive = requestParameters["SpecialWindowStatus"].ToString() == "1";
                submittedInfo.GridStatus = requestParameters["GridStatus"].ToString() == "1";

                connector.AddGeneric(UUID.Zero, "GridWelcomeScreen", "GridWelcomeScreen", submittedInfo.ToOSD());

                response = "Successfully saved data";
                return null;
            }

            GridWelcomeScreen welcomeInfo = connector.GetGeneric<GridWelcomeScreen>(UUID.Zero, "GridWelcomeScreen",
                                                                                    "GridWelcomeScreen");
            if (welcomeInfo == null)
                welcomeInfo = GridWelcomeScreen.Default;
            vars.Add("OpenNewsManager", translator.GetTranslatedString("OpenNewsManager"));
            vars.Add("SpecialWindowTitleText", translator.GetTranslatedString("SpecialWindowTitleText"));
            vars.Add("SpecialWindowTextText", translator.GetTranslatedString("SpecialWindowTextText"));
            vars.Add("SpecialWindowColorText", translator.GetTranslatedString("SpecialWindowColorText"));
            vars.Add("SpecialWindowStatusText", translator.GetTranslatedString("SpecialWindowStatusText"));
            vars.Add("WelcomeScreenManagerFor", translator.GetTranslatedString("WelcomeScreenManagerFor"));
            vars.Add("GridStatus", translator.GetTranslatedString("GridStatus"));
            vars.Add("Online", translator.GetTranslatedString("Online"));
            vars.Add("Offline", translator.GetTranslatedString("Offline"));
            vars.Add("Enabled", translator.GetTranslatedString("Enabled"));
            vars.Add("Disabled", translator.GetTranslatedString("Disabled"));

            vars.Add("SpecialWindowTitle", welcomeInfo.SpecialWindowMessageTitle);
            vars.Add("SpecialWindowMessage", welcomeInfo.SpecialWindowMessageText);
            vars.Add("SpecialWindowActive", welcomeInfo.SpecialWindowActive ? "selected" : "");
            vars.Add("SpecialWindowInactive", welcomeInfo.SpecialWindowActive ? "" : "selected");
            vars.Add("GridActive", welcomeInfo.GridStatus ? "selected" : "");
            vars.Add("GridInactive", welcomeInfo.GridStatus ? "" : "selected");
            vars.Add("SpecialWindowColorRed", welcomeInfo.SpecialWindowMessageColor == "red" ? "selected" : "");
            vars.Add("SpecialWindowColorYellow", welcomeInfo.SpecialWindowMessageColor == "yellow" ? "selected" : "");
            vars.Add("SpecialWindowColorGreen", welcomeInfo.SpecialWindowMessageColor == "green" ? "selected" : "");
            vars.Add("SpecialWindowColorWhite", welcomeInfo.SpecialWindowMessageColor == "white" ? "selected" : "");
            vars.Add("Submit", translator.GetTranslatedString("Submit"));

            return vars;
        }
		public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
			OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translator, out string response)
		{
			response = null;
        	
			var vars = new Dictionary<string, object>();
        	
			// This page should show if a user already has a partner and show the ability to cancel the Partnership (with a payment defined in Economy.ini)
			// 
			// If the user doesn't have a partner, allow the user to send an Partnership invite to a person (internally send a message inworld to the person)
			//
			
			return vars;
		}
Esempio n. 14
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            vars.Add("Logout", translator.GetTranslatedString("Logout"));
            vars.Add("LoggedOutSuccessfullyText", translator.GetTranslatedString("LoggedOutSuccessfullyText"));

            Authenticator.RemoveAuthentication(httpRequest);

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            IAgentInfoConnector recentUsers = Framework.Utilities.DataManager.RequestPlugin<IAgentInfoConnector>();
            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
            GridWelcomeScreen welcomeInfo = connector.GetGeneric<GridWelcomeScreen>(UUID.Zero, "GridWelcomeScreen",
                                                                                    "GridWelcomeScreen");

            if (welcomeInfo == null)
                welcomeInfo = GridWelcomeScreen.Default;

            IConfigSource config = webInterface.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource;
            vars.Add("GridStatus", translator.GetTranslatedString("GridStatus"));
            vars.Add("GridOnline",
                     welcomeInfo.GridStatus
                         ? translator.GetTranslatedString("Online")
                         : translator.GetTranslatedString("Offline"));
            vars.Add("TotalUserCount", translator.GetTranslatedString("TotalUserCount"));
            vars.Add("UserCount", webInterface.Registry.RequestModuleInterface<IUserAccountService>().
                                               NumberOfUserAccounts(null, "").ToString());
            vars.Add("TotalRegionCount", translator.GetTranslatedString("TotalRegionCount"));
            vars.Add("RegionCount", Framework.Utilities.DataManager.RequestPlugin<IRegionData>().
                                                Count((RegionFlags) 0, (RegionFlags) 0).ToString());
            vars.Add("UniqueVisitors", translator.GetTranslatedString("UniqueVisitors"));
            vars.Add("UniqueVisitorCount", recentUsers.RecentlyOnline((uint) TimeSpan.FromDays(30).TotalSeconds, false).ToString());
            vars.Add("OnlineNow", translator.GetTranslatedString("OnlineNow"));
            vars.Add ("OnlineNowCount", recentUsers.RecentlyOnline (5 * 60, true).ToString ());
            vars.Add("RecentlyOnline", translator.GetTranslatedString("RecentlyOnline"));
            vars.Add("RecentlyOnlineCount", recentUsers.RecentlyOnline(10*60, false).ToString());
            vars.Add("HGActiveText", translator.GetTranslatedString("HyperGrid"));
            string disabled = translator.GetTranslatedString("Disabled"),
                   enabled = translator.GetTranslatedString("Enabled");
            vars.Add("HGActive", disabled + "(TODO: FIX)");
            vars.Add("VoiceActiveLabel", translator.GetTranslatedString("Voice"));
            vars.Add("VoiceActive",
                     config.Configs["Voice"] != null &&
                     config.Configs["Voice"].GetString("Module", "GenericVoice") != "GenericVoice"
                         ? enabled
                         : disabled);
            vars.Add("CurrencyActiveLabel", translator.GetTranslatedString("Currency"));
            vars.Add("CurrencyActive",
                     webInterface.Registry.RequestModuleInterface<IMoneyModule>() != null ? enabled : disabled);

            return vars;
        }
Esempio n. 16
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            vars.Add("WorldMap", translator.GetTranslatedString("WorldMap"));

            var settings = webInterface.GetWebUISettings();
            vars.Add("GridCenterX", settings.MapCenter.X);
            vars.Add("GridCenterY", settings.MapCenter.Y);

            return vars;
        }
Esempio n. 17
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest request, 
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters, ITranslator translation, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            // Check if we're looking at the standard page or the submitted one
            if (requestParameters.ContainsKey("Submit"))
            {
            }
            else
            {
            }
            return vars;
        }
Esempio n. 18
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            string error = "";
            if (requestParameters.ContainsKey("username") && requestParameters.ContainsKey("password"))
            {
                string username = requestParameters["username"].ToString();
                string password = requestParameters["password"].ToString();

                ILoginService loginService = webInterface.Registry.RequestModuleInterface<ILoginService>();
                if (loginService.VerifyClient(UUID.Zero, username, "UserAccount", password))
                {
                    UUID sessionID = UUID.Random();
                    UserAccount account =
                        webInterface.Registry.RequestModuleInterface<IUserAccountService>()
                                    .GetUserAccount(null, username);
                    Authenticator.AddAuthentication(sessionID, account);
                    if (account.UserLevel > 0)
                        Authenticator.AddAdminAuthentication(sessionID, account);
                    httpResponse.AddCookie(new System.Web.HttpCookie("SessionID", sessionID.ToString())
                                               {
                                                   Expires = DateTime.MinValue,
                                                   Path = ""
                                               });

                    response = "<h3>Successfully logged in, redirecting to main page</h3>" +
                               "<script language=\"javascript\">" +
                               "setTimeout(function() {window.location.href = \"index.html\";}, 0);" +
                               "</script>";
                }
                else
                    response = "<h3>Failed to verify user name and password</h3>";
                return null;
            }

            vars.Add("ErrorMessage", error);
            vars.Add("Login", translator.GetTranslatedString("Login"));
            vars.Add("UserNameText", translator.GetTranslatedString("UserName"));
            vars.Add("PasswordText", translator.GetTranslatedString("Password"));
            vars.Add("ForgotPassword", translator.GetTranslatedString("ForgotPassword"));
            vars.Add("Submit", translator.GetTranslatedString("Login"));

            return vars;
        }
Esempio n. 19
0
 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
     OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
     ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     vars.Add("HelpText", translator.GetTranslatedString("HelpText"));
     vars.Add("HelpViewersConfigText", translator.GetTranslatedString("HelpViewersConfigText"));
     vars.Add("AngstromViewer", translator.GetTranslatedString("AngstromViewer"));
     vars.Add("AstraViewer", translator.GetTranslatedString("AstraViewer"));
     vars.Add("FirestormViewer", translator.GetTranslatedString("FirestormViewer"));
     vars.Add("KokuaViewer", translator.GetTranslatedString("KokuaViewer"));
     vars.Add("SingularityViewer", translator.GetTranslatedString("SingularityViewer"));
     vars.Add("VoodooViewer", translator.GetTranslatedString("VoodooViewer"));
     return vars;
 }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            vars.Add("ColorBoxImageText", translator.GetTranslatedString("ColorBoxImageText"));
            vars.Add("ColorBoxOfText", translator.GetTranslatedString("ColorBoxOfText"));
            vars.Add("ColorBoxPreviousText", translator.GetTranslatedString("ColorBoxPreviousText"));
            vars.Add("ColorBoxNextText", translator.GetTranslatedString("ColorBoxNextText"));
            vars.Add("ColorBoxCloseText", translator.GetTranslatedString("ColorBoxCloseText"));
            vars.Add("ColorBoxStartSlideshowText", translator.GetTranslatedString("ColorBoxStartSlideshowText"));
            vars.Add("ColorBoxStopSlideshowText", translator.GetTranslatedString("ColorBoxStopSlideshowText"));

            return vars;
        }
 public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                        OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                        ITranslator translator, out string response)
 {
     response = null;
     var vars = new Dictionary<string, object>();
     vars.Add("Sun", translator.GetTranslatedString("Sun"));
     vars.Add("Mon", translator.GetTranslatedString("Mon"));
     vars.Add("Tue", translator.GetTranslatedString("Tue"));
     vars.Add("Wed", translator.GetTranslatedString("Wed"));
     vars.Add("Thu", translator.GetTranslatedString("Thu"));
     vars.Add("Fri", translator.GetTranslatedString("Fri"));
     vars.Add("Sat", translator.GetTranslatedString("Sat"));
     vars.Add("Sunday", translator.GetTranslatedString("Sunday"));
     vars.Add("Monday", translator.GetTranslatedString("Monday"));
     vars.Add("Tuesday", translator.GetTranslatedString("Tuesday"));
     vars.Add("Wednesday", translator.GetTranslatedString("Wednesday"));
     vars.Add("Thursday", translator.GetTranslatedString("Thursday"));
     vars.Add("Friday", translator.GetTranslatedString("Friday"));
     vars.Add("Saturday", translator.GetTranslatedString("Saturday"));
     vars.Add("Jan", translator.GetTranslatedString("Jan"));
     vars.Add("Feb", translator.GetTranslatedString("Feb"));
     vars.Add("Mar", translator.GetTranslatedString("Mar"));
     vars.Add("Apr", translator.GetTranslatedString("Apr"));
     vars.Add("May", translator.GetTranslatedString("May"));
     vars.Add("Jun", translator.GetTranslatedString("Jun"));
     vars.Add("Jul", translator.GetTranslatedString("Jul"));
     vars.Add("Aug", translator.GetTranslatedString("Aug"));
     vars.Add("Sep", translator.GetTranslatedString("Sep"));
     vars.Add("Oct", translator.GetTranslatedString("Oct"));
     vars.Add("Nov", translator.GetTranslatedString("Nov"));
     vars.Add("Dec", translator.GetTranslatedString("Dec"));
     vars.Add("January", translator.GetTranslatedString("January"));
     vars.Add("February", translator.GetTranslatedString("February"));
     vars.Add("March", translator.GetTranslatedString("March"));
     vars.Add("April", translator.GetTranslatedString("April"));
     vars.Add("June", translator.GetTranslatedString("June"));
     vars.Add("July", translator.GetTranslatedString("July"));
     vars.Add("August", translator.GetTranslatedString("August"));
     vars.Add("September", translator.GetTranslatedString("September"));
     vars.Add("October", translator.GetTranslatedString("October"));
     vars.Add("November", translator.GetTranslatedString("November"));
     vars.Add("December", translator.GetTranslatedString("December"));
     return vars;
 }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            var mapService = webInterface.Registry.RequestModuleInterface<IMapService>();
            if (mapService != null)
            {
                string mapUrl = mapService.MapServiceURL;
                string mapAPIUrl = mapService.MapServiceAPIURL;

                vars.Add ("WorldMapServiceURL", mapUrl.Remove (mapUrl.Length - 1));
                vars.Add ("WorldMapAPIServiceURL", mapAPIUrl.Remove (mapAPIUrl.Length - 1));
                vars.Add ("MainServerURL", webInterface.GridURL);
            }

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
            GridWelcomeScreen welcomeInfo = connector.GetGeneric<GridWelcomeScreen>(UUID.Zero, "GridWelcomeScreen",
                                                                                    "GridWelcomeScreen");
            if (welcomeInfo == null)
                welcomeInfo = GridWelcomeScreen.Default;

            vars.Add("Title", welcomeInfo.SpecialWindowMessageTitle);
            vars.Add("Text", welcomeInfo.SpecialWindowMessageText);
            vars.Add("Color", welcomeInfo.SpecialWindowMessageColor);
            vars.Add("Active", welcomeInfo.SpecialWindowActive);
            return vars;
        }
Esempio n. 24
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
            var vars = new Dictionary<string, object>();

            vars.Add("News", translator.GetTranslatedString("News"));
            vars.Add("NewsDateText", translator.GetTranslatedString("NewsDateText"));
            vars.Add("NewsTitleText", translator.GetTranslatedString("NewsTitleText"));

            vars.Add("CurrentPageText", translator.GetTranslatedString("CurrentPageText"));
            vars.Add("FirstText", translator.GetTranslatedString("FirstText"));
            vars.Add("BackText", translator.GetTranslatedString("BackText"));
            vars.Add("NextText", translator.GetTranslatedString("NextText"));
            vars.Add("LastText", translator.GetTranslatedString("LastText"));

            uint amountPerQuery = 10;
            int maxPages = 0;
            int start = httpRequest.Query.ContainsKey("Start") ? int.Parse(httpRequest.Query["Start"].ToString()) : 0;

            if (connector != null)
            {
                uint count = (uint)connector.GetGenericCount (UUID.Zero, "WebGridNews");
                maxPages = (int)(count / amountPerQuery) - 1;
                if (start == -1)
                    start = (maxPages < 0 ? 0 : maxPages);

                var newsItems = connector.GetGenerics<GridNewsItem> (UUID.Zero, "WebGridNews");
                if (newsItems.Count == 0)
                    newsItems.Add (GridNewsItem.NoNewsItem);
                vars.Add("NewsList", newsItems.ConvertAll<Dictionary<string, object>>(item => item.ToDictionary()));
            }

            vars.Add("CurrentPage", start);
            vars.Add("NextOne", start + 1 > maxPages ? start : start + 1);
            vars.Add("BackOne", start - 1 < 0 ? 0 : start - 1);

            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
            GridNewsItem news;
            if (requestParameters.ContainsKey("Submit"))
            {
                string title = requestParameters["NewsTitle"].ToString();
                string text = requestParameters["NewsText"].ToString();
                string id = requestParameters["NewsID"].ToString();
                news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", id);
                if (news != null)
                {
                    connector.RemoveGeneric (UUID.Zero, "WebGridNews", id);
                    GridNewsItem item = new GridNewsItem { Text = text, Time = news.Time, Title = title, ID = int.Parse (id) };
                    connector.AddGeneric (UUID.Zero, "WebGridNews", id, item.ToOSD ());
                    response = "<h3>News item editted successfully, redirecting to main page</h3>" +
                    "<script language=\"javascript\">" +
                    "setTimeout(function() {window.location.href = \"index.html?page=news_manager\";}, 0);" +
                    "</script>";
                }
                return null;
            }

            news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews", httpRequest.Query["newsid"].ToString());
            if (news != null)
            {
                vars.Add ("NewsTitle", news.Title);
                vars.Add ("NewsText", news.Text);
                vars.Add ("NewsID", news.ID.ToString ());

                vars.Add ("NewsItemTitle", translator.GetTranslatedString ("NewsItemTitle"));
                vars.Add ("NewsItemText", translator.GetTranslatedString ("NewsItemText"));
                vars.Add ("EditNewsText", translator.GetTranslatedString ("EditNewsText"));
                vars.Add ("Submit", translator.GetTranslatedString ("Submit"));
            }
            return vars;
        }
        public static void InitializeWebUIDefaults (WebInterface webinterface)
        {
            _settingsWebUI = new WebUISettings ();

            _settingsWebUI.LastSettingsVersionUpdateIgnored = CurrentVersion;
            _settingsWebUI.LastPagesVersionUpdateIgnored = PagesMigrator.GetVersion ();
            _settingsWebUI.MapCenter = new Vector2 (Constants.DEFAULT_REGIONSTART_X, Constants.DEFAULT_REGIONSTART_Y);

            // check for user configurations
            var configSrc = webinterface.Registry.RequestModuleInterface<ISimulationBase> ().ConfigSource;
            var loginConfig = configSrc.Configs ["LoginService"];
            if (loginConfig != null) {
                _settingsWebUI.WebRegistration = loginConfig.GetBoolean ("AllowAnonymousLogin", true);
            }
        
            var mapConfig = configSrc.Configs ["WebInterface"];
            if (mapConfig != null) {
                _settingsWebUI.MapCenter.X = mapConfig.GetInt ("mapcenter_x", (int)_settingsWebUI.MapCenter.X);
                _settingsWebUI.MapCenter.Y = mapConfig.GetInt ("mapcenter_y", (int)_settingsWebUI.MapCenter.Y);
            }
        }
Esempio n. 27
0
        public Dictionary<string, object> Fill (WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();
            var clientloginuri = webInterface.LoginURL.Replace ("http", "secondlife");

            vars.Add ("Login", translator.GetTranslatedString ("Login"));
            vars.Add ("ClientLoginURI", clientloginuri);
            vars.Add ("HelpText", translator.GetTranslatedString ("HelpText"));
            vars.Add ("HelpViewersConfigText", translator.GetTranslatedString ("HelpViewersConfigText"));
            vars.Add ("Alchemy", "Alchemy");
            vars.Add ("Firestorm", "Firestorm");
            vars.Add ("Kokua", "Kokua");
            vars.Add ("Singularity", "Singularity");
            vars.Add ("Lumiya", "Lumiya (Android)");
            vars.Add ("PocketMetaverse", "Pocket Metaverse (iPhone/iPad)");
            vars.Add ("Radegast", "Radegast");
            vars.Add ("MobileGridClient", "MobileGridClient (Android)");
            vars.Add ("MoreInfo", translator.GetTranslatedString ("MoreInfo"));
            return vars;
        }
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
            OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
            ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();

            // Check if we're looking at the standard page or the submitted one
            if (requestParameters.ContainsKey("Submit"))
            {
            }
            else
            {
                vars.Add("SimConsoleText", translator.GetTranslatedString("SimConsoleText"));
                vars.Add("SimAddressText", translator.GetTranslatedString("SimAddressText"));
                vars.Add("UserNameText", translator.GetTranslatedString("UserNameText"));
                vars.Add("PasswordText", translator.GetTranslatedString("PasswordText"));
                vars.Add("SendCommandText", translator.GetTranslatedString("SendCommandText"));

                vars.Add("Login", translator.GetTranslatedString("Login"));

            }
            return vars;
        }
Esempio n. 29
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object>();
            IGenericsConnector connector = Framework.Utilities.DataManager.RequestPlugin<IGenericsConnector>();
            GridNewsItem news = connector.GetGeneric<GridNewsItem>(UUID.Zero, "WebGridNews",
                                                                   httpRequest.Query["newsid"].ToString());
            if (news != null)
            {
                vars.Add("NewsTitle", news.Title);
                vars.Add("NewsText", news.Text);
                vars.Add("NewsID", news.ID.ToString());
            }
            else
            {
                if (httpRequest.Query["newsid"].ToString() == "-1")
                {
                    vars.Add("NewsTitle", "No news to report");
                    vars.Add("NewsText", "");
                }
                else
                {
                    vars.Add("NewsTitle", "Invalid News Item");
                    vars.Add("NewsText", "");
                }
                vars.Add("NewsID", "-1");
            }

            vars.Add("News", translator.GetTranslatedString("News"));
            vars.Add("NewsItemTitle", translator.GetTranslatedString("NewsItemTitle"));
            vars.Add("NewsItemText", translator.GetTranslatedString("NewsItemText"));
            vars.Add("EditNewsText", translator.GetTranslatedString("EditNewsText"));
            return vars;
        }
Esempio n. 30
0
        public Dictionary<string, object> Fill(WebInterface webInterface, string filename, OSHttpRequest httpRequest,
                                               OSHttpResponse httpResponse, Dictionary<string, object> requestParameters,
                                               ITranslator translator, out string response)
        {
            response = null;
            var vars = new Dictionary<string, object> ();

            IAbuseReportsConnector abuseModule = Framework.Utilities.DataManager.RequestPlugin<IAbuseReportsConnector> ();
            IUserAccountService accountService = webInterface.Registry.RequestModuleInterface<IUserAccountService> ();
            IWebHttpTextureService webTextureService = webInterface.Registry.RequestModuleInterface<IWebHttpTextureService> ();

            string noDetails = translator.GetTranslatedString ("NoDetailsText");
            string infoMessage = "";

            AbuseReport rpt;
            var snapshotURL = "../images/icons/no_screenshot.jpg";

            // the card number can come in a number of ways
            int cardID = httpRequest.Query.ContainsKey ("cardid")
                ? int.Parse (httpRequest.Query ["cardid"].ToString ())
                : int.Parse (requestParameters ["cardid"].ToString ());

            rpt = abuseModule.GetAbuseReport (cardID);
            if (rpt == null)
            {
                vars.Add ("NoDetailsText", noDetails);
                return vars;
            }

            // we have the report
            noDetails = "";
            if (rpt.ScreenshotID != UUID.Zero)
                snapshotURL = webTextureService.GetTextureURL (rpt.ScreenshotID);

            // updating?
            if (requestParameters.ContainsKey ("SubmitUpdates"))
            {
                {
                    string newNote = requestParameters ["AbuseNoteText"].ToString ();
                    if (newNote != "")
                        rpt.Notes = newNote;

                    rpt.Checked = (requestParameters ["Checked"].ToString ().ToLower () == "yes");
                    rpt.Active = (requestParameters ["Active"].ToString ().ToLower () == "yes");
                    rpt.AssignedTo = requestParameters ["AssignedTo"].ToString ();

                    abuseModule.UpdateAbuseReport (rpt);

                    infoMessage = translator.GetTranslatedString ("ChangesSavedSuccessfully");
                }

            }

            // get admin users
            var adminUsers = accountService.GetUserAccounts (null, Constants.USER_GOD_CUSTOMER_SERVICE, 0);
            var adminUsersList = new List<Dictionary<string, object>> ();
            if (adminUsers != null)
            {

                foreach (var user in adminUsers)
                {
                    if (!Utilities.IsSystemUser (user.PrincipalID))
                        adminUsersList.Add (new Dictionary<string, object> { { "Value", user.Name } });
                }
                adminUsersList.Add (new Dictionary<string, object> { { "Value", "No One" } });
            }
            vars.Add ("AdminUsersList", adminUsersList);

            // details
            vars.Add ("CardNumber", rpt.Number);
            //vars.Add("Date"), Culture.LocaleDate (transaction.TransferDate.ToLocalTime(), "MMM dd, hh:mm:ss tt");
            vars.Add ("Details", rpt.AbuseDetails);
            vars.Add ("AbuseLocation", rpt.AbuseLocation);
            vars.Add ("Summary", rpt.AbuseSummary);
            vars.Add ("AbuserName", rpt.AbuserName);
            vars.Add ("IsActive", rpt.Active);
            vars.Add ("IsNotActive", !rpt.Active);

            vars.Add ("AssignedTo", rpt.AssignedTo);
            vars.Add ("Category", rpt.Category);

            vars.Add ("IsChecked", rpt.Checked);
            vars.Add ("IsNotChecked", !rpt.Checked);

            vars.Add ("Notes", rpt.Notes);
            vars.Add ("ObjectName", rpt.ObjectName);
            vars.Add ("ObjectPosition", rpt.ObjectPosition);
            vars.Add ("ObjectUUID", rpt.ObjectUUID);
            vars.Add ("RegionName", rpt.RegionName);
            vars.Add ("ReporterName", rpt.ReporterName);
            vars.Add ("ScreenshotURL", snapshotURL);

            vars.Add ("NoDetailsText", noDetails);
            vars.Add ("InfoMessage", infoMessage);

            // labels
            vars.Add ("AbuseReportText", translator.GetTranslatedString ("AbuseReportText"));

            vars.Add ("DateText", translator.GetTranslatedString ("DateText"));
            vars.Add ("CategoryText", translator.GetTranslatedString ("CategoryText"));
            vars.Add ("SummaryText", translator.GetTranslatedString ("SummaryText"));
            vars.Add ("AbuserNameText", translator.GetTranslatedString ("AbuserNameText"));
            vars.Add ("AbuseReporterNameText", translator.GetTranslatedString ("AbuseReporterNameText"));
            vars.Add ("RegionNameText", translator.GetTranslatedString ("RegionNameText"));
            vars.Add ("ObjectNameText", translator.GetTranslatedString ("ObjectNameText"));
            vars.Add ("LocationText", translator.GetTranslatedString ("LocationText"));
            vars.Add ("UUIDText", translator.GetTranslatedString ("UUIDText"));
            vars.Add ("DetailsText", translator.GetTranslatedString ("DetailsText"));
            vars.Add ("NotesText", translator.GetTranslatedString ("NotesText"));
            vars.Add ("AddNotesText", translator.GetTranslatedString ("AddNotesText"));
            vars.Add ("ActiveText", translator.GetTranslatedString ("ActiveText"));
            vars.Add ("CheckedText", translator.GetTranslatedString ("CheckedText"));
            vars.Add ("AssignedToText", translator.GetTranslatedString ("AssignedToText"));
            vars.Add ("Submit", translator.GetTranslatedString ("SaveUpdates"));
            vars.Add ("Yes", translator.GetTranslatedString ("Yes"));
            vars.Add ("No", translator.GetTranslatedString ("No"));

            return vars;
        }