public string HyperlinkAddRequest(Environment env, string address, uint xloc, uint yloc) { m_log.Debug("[Wifi]: HyperlinkAddRequest"); SessionInfo sinfo; if (TryGetSessionInfo(env.TheRequest, out sinfo)) { env.Session = sinfo; env.Flags = Flags.IsLoggedIn; if (sinfo.Account.UserLevel >= m_WebApp.AdminUserLevel) { env.Flags |= Flags.IsAdmin; } if (sinfo.Account.UserLevel >= m_WebApp.HyperlinksUserLevel || sinfo.Account.UserLevel >= m_WebApp.AdminUserLevel) { if (address != string.Empty) { string reason; if (WebAppUtils.IsValidRegionAddress(address)) { UUID owner = sinfo.Account.PrincipalID; if (sinfo.Account.UserLevel >= m_WebApp.AdminUserLevel) { owner = UUID.Zero; } // Create hyperlink xloc = xloc * Constants.RegionSize; yloc = yloc * Constants.RegionSize; if (m_GridService.TryLinkRegionToCoords(UUID.Zero, address, xloc, yloc, owner, out reason) == null) { reason = string.Format(_("Failed to link region: {0}", env), reason); } else { reason = string.Format(_("Region link to {0} established. (If this link already existed, then it will remain at the original location.)", env), address); } } else { reason = _("Invalid region address.", env); } NotifyOK(env, reason, delegate(Environment e) { return(HyperlinkGetRequest(e)); }); } else { return(HyperlinkGetRequest(env)); } } return(WebAppUtils.PadURLs(env, sinfo.Sid, m_WebApp.ReadFile(env, "index.html"))); } return(m_WebApp.ReadFile(env, "index.html")); }