Exemplo n.º 1
0
        public ActionResult LstLanguages()
        {
            LanguageSwitcher ls = new LanguageSwitcher();

            Appleseed.Framework.Web.UI.WebControls.LanguageCultureCollection lcc = Appleseed.Framework.Localization.LanguageSwitcher.GetLanguageCultureList();


            List <string[]> datos = new List <string[]>();

            foreach (Appleseed.Framework.Web.UI.WebControls.LanguageCultureItem l in lcc)
            {
                string[] dato  = new string[3];
                string   aux   = l.ToString();
                char[]   array = new char[1];
                array[0] = '/';
                string[] lang = aux.Split(array);

                dato[0] = HttpUrlBuilder.BuildUrl("~/site/0/Home?lang=" + lang[0]);

                LanguageSwitcher lswitcher = new LanguageSwitcher();
                dato[1] = lswitcher.GetFlagImgLCI(l);
                dato[1] = dato[1].Replace("images", "~/aspnet_client");

                dato[1] = HttpUrlBuilder.BuildUrl(dato[1]);

                dato[2] = lswitcher.getNameLCI(l);
                datos.Add(dato);
            }

            ViewData["datos"] = datos;
            return(View());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <param name="e"></param>
        override protected void OnInit(EventArgs e)
        {
            //Controls must be created here
            updateButton          = new Esperantus.WebControls.LinkButton();
            updateButton.CssClass = "CommandButton";

//			updateButton.Text="Apply Module Changes";
            //		((Esperantus.WebControls.LinkButton) updateButton).TextKey="APPLY_MODULE_CHANGES";
            PlaceHolderButtons.Controls.Add(updateButton);

            PlaceHolderButtons.Controls.Add(new LiteralControl("&#160;"));
            saveAndCloseButton          = new Esperantus.WebControls.LinkButton();
            saveAndCloseButton.TextKey  = "OK";
            saveAndCloseButton.Text     = "Save and close";
            saveAndCloseButton.CssClass = "CommandButton";
            PlaceHolderButtons.Controls.Add(saveAndCloseButton);
            this.saveAndCloseButton.Click += new System.EventHandler(this.saveAndCloseButton_Click);

            PlaceHolderButtons.Controls.Add(new LiteralControl("&#160;"));
            moduleSettingsButton             = new Esperantus.WebControls.HyperLink();
            moduleSettingsButton.TextKey     = "MODULESETTINGS_SETTINGS";
            moduleSettingsButton.Text        = "Settings";
            moduleSettingsButton.CssClass    = "CommandButton";
            moduleSettingsButton.NavigateUrl = HttpUrlBuilder.BuildUrl("~/DesktopModules/Admin/PropertyPage.aspx", TabID, ModuleID);
            PlaceHolderButtons.Controls.Add(moduleSettingsButton);

            PlaceHolderButtons.Controls.Add(new LiteralControl("&#160;"));

            cancelButton          = new Esperantus.WebControls.LinkButton();
            cancelButton.CssClass = "CommandButton";
            PlaceHolderButtons.Controls.Add(cancelButton);

            InitializeComponent();
            base.OnInit(e);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Builds the URL.
 /// </summary>
 /// <param name="targetPage">
 /// The target page.
 /// </param>
 /// <param name="pageId">
 /// The page ID.
 /// </param>
 /// <returns>
 /// A string value...
 /// </returns>
 public string BuildUrl(string targetPage, int pageId)
 {
     // targetPage = System.Text.RegularExpressions.Regex.Replace(targetPage,@"[\.\$\^\{\[\(\|\)\*\+\?!'""]",string.Empty);
     // targetPage = targetPage.Replace(" ","_").ToLower();
     // return Appleseed.HttpUrlBuilder.BuildUrl("~/" + targetPage + ".aspx", tabID);
     return(HttpUrlBuilder.BuildUrl(string.Concat("~/", Clean(targetPage), ".aspx"), pageId));
 }
        internal OAuthTokenResponse GetTwitterRequestToken()
        {
            try {
                if (PortalSettings.CustomSettings.ContainsKey("SITESETTINGS_TWITTER_APP_ID") &&
                    !PortalSettings.CustomSettings["SITESETTINGS_TWITTER_APP_ID"].ToString().Equals(string.Empty) &&
                    PortalSettings.CustomSettings.ContainsKey("SITESETTINGS_TWITTER_APP_SECRET") &&
                    !PortalSettings.CustomSettings["SITESETTINGS_TWITTER_APP_SECRET"].ToString().Equals(string.Empty))
                {
                    string appId     = PortalSettings.CustomSettings["SITESETTINGS_TWITTER_APP_ID"].ToString();
                    var    appSecret = PortalSettings.CustomSettings["SITESETTINGS_TWITTER_APP_SECRET"].ToString();

                    string server = ConvertRelativeUrlToAbsoluteUrl(HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/SignIn/LogInTweeter.aspx"));                        //ConvertRelativeUrlToAbsoluteUrl("~/DesktopModules/CoreModules/SignIn/LogInTweeter.aspx");
                    Session["TwitterAppId"]     = appId;
                    Session["TwitterAppSecret"] = appSecret;

                    OAuthTokenResponse requestToken = OAuthUtility.GetRequestToken(appId, appSecret, server);

                    return(requestToken);
                }

                return(null);
            } catch (Exception) {
                return(null);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Kills session after timeout
        ///   jminond - fix kill session after timeout.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static void KillSession()
        {
            SignOut(HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Admin/Logon.aspx"), true);

            // HttpContext.Current.Response.Redirect(urlToRedirect);
            // PortalSecurity.AccessDenied();
        }
Exemplo n.º 6
0
 public JsonResult edit(int id)
 {
     if ((UserProfile.isCurrentUserAdmin) || UserProfile.CurrentUser.HasPermission(AccessPermissions.MODULE_EDITING))
     {
         ModulesDB modules     = new ModulesDB();
         Guid      TabGuid     = new Guid("{1C575D94-70FC-4A83-80C3-2087F726CBB3}");
         int       TabModuleID = 0;
         foreach (ModuleItem m in modules.FindModuleItemsByGuid(PortalSettings.PortalID, TabGuid))
         {
             bool HasEditPermissionsOnTabs = PortalSecurity.HasEditPermissions(m.ID);
             if (HasEditPermissionsOnTabs)
             {
                 TabModuleID = m.ID;
                 break;
             }
         }
         string dir = HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Pages/PageLayout.aspx?PageID=" + id.ToString() +
                                              "&mID=" + TabModuleID + "&Alias=" + this.PortalSettings.PortalAlias + "&returntabid=" +
                                              this.PortalSettings.ActiveModule);
         return(Json(new { url = dir }));
     }
     else
     {
         string errorMessage = General.GetString("ACCESS_DENIED", "You don't have permissin to edit this module", this);
         return(Json(new { error = true, errorMess = errorMessage }));
     }
 }
Exemplo n.º 7
0
        /// <summary>
        /// The EditBtn_Click server event handler on this page is
        ///   used to edit an individual portal module's settings
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="T:System.Web.UI.ImageClickEventArgs"/> instance containing the event data.
        /// </param>
        /// <remarks>
        /// </remarks>
        protected void EditBtn_Click(object sender, ImageClickEventArgs e)
        {
            var pane     = ((ImageButton)sender).CommandArgument;
            var _listbox = (ListBox)this.Page.FindControl(pane);

            if (_listbox == null)
            {
                _listbox = (ListBox)this.Page.Master.FindControl("Content").FindControl(pane);
            }

            if (_listbox.SelectedIndex != -1)
            {
                var mid = Int32.Parse(_listbox.SelectedItem.Value);

                // Add role control to edit module settings by Mario Endara <*****@*****.**> (2004/11/09)
                if (PortalSecurity.IsInRoles(PortalSecurity.GetPropertiesPermissions(mid)))
                {
                    var url = HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Admin/ModuleSettings.aspx", this.PageID, mid);
                    // Redirect to module settings page
                    if (Request.QueryString.GetValues("ModalChangeMaster") != null)
                    {
                        url += "&ModalChangeMaster=true&camefromEditPage=true";
                    }
                    this.Response.Redirect(url);
                }
                else
                {
                    this.msgError.Visible = true;
                    return;
                }
            }
        }
Exemplo n.º 8
0
        private string getStringPopUpLanguages()
        {
            string txt  = General.GetString("LANGUAGE", "Language", null);
            string dir  = HttpUrlBuilder.BuildUrl("~/appleseed.Core/home/lstLanguages");
            string url  = "\"" + dir + "\"";
            string post = "\"Post\"";

            return(string.Concat(@"
                $(document).ready(function () {
                    $('#AppleseedLang').dialog({
                        autoOpen: false,
                        modal: true,
                        width: 310,
                        height: 300,
                        resizable: false
                    });
                    $('#ui-dialog-title-AppleseedLang').append('", txt, @"');
                    $('#popUpLang').click(function () {
                        $('#AppleseedLang').dialog('open');
                        $.ajax({
                            type:", post, @",
                            url:", url, @",
                            success: function (data){
                                $('#AppleseedLang').html(data)
                            }
                        });
                        return false;    
                    });
                });"
                                 ));
        }
        public string GetUrlToEdit(string pageId, string moduleId)
        {
            var url = HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Admin/ModuleSettings.aspx", Int32.Parse(pageId));

            url += "&mID=" + moduleId;
            return(url);
        }
Exemplo n.º 10
0
        /// <summary>
        /// The cancelButton_Click is used to return to the
        /// previous page if present
        /// Created by Mike Stone 30/12/2004
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void cancelButton_Click(object sender, EventArgs e)
        {
            string returnPage =
                HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx", int.Parse(Request.QueryString["returntabid"]));

            Response.Redirect(returnPage);
        }
Exemplo n.º 11
0
        /// <summary>
        /// The DefsList_ItemCommand server event handler on this page
        /// is used to handle the user editing module definitions
        /// from the DefsList &lt;asp:datalist&gt; control
        /// </summary>
        /// <param name="source"></param>
        /// <param name="e"></param>
        private void defsList_ItemCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
        {
            Guid GeneralModDefID = new Guid(defsList.DataKeys[e.Item.ItemIndex].ToString());

            // Go to edit page
            Response.Redirect(HttpUrlBuilder.BuildUrl("~/DesktopModules/ModuleDefinitions/ModuleDefinitions.aspx", TabID, "DefID=" + GeneralModDefID + "&Mid=" + ModuleID));
        }
Exemplo n.º 12
0
 private string GetLinkUrl(object itemID, object url, bool editionMode)
 {
     if (editionMode)
     {
         if (IsEditable)
         {
             return(HttpUrlBuilder.BuildUrl("~/DesktopModules/EnhancedLinks/EnhancedLinksEdit.aspx", "ItemID=" + itemID.ToString() + "&mID=" + ModuleID.ToString()));
         }
         else
         {
             return(string.Empty);
         }
     }
     else
     {
         string linkStr = url.ToString();
         if (linkStr.IndexOf("://") < 0)
         {
             if (IsNumeric(linkStr))
             {
                 return(HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx?tabid=" + linkStr));
             }
             else
             {
                 if (linkStr.IndexOf("~/") < 0)
                 {
                     linkStr = "~/" + linkStr;
                 }
                 return(HttpUrlBuilder.BuildUrl(linkStr));
             }
         }
         return(linkStr);
     }
 }
        private void FacebookSignInMethod()
        {
            var     client = new FacebookWebClient();
            dynamic me     = client.Get("me");

            Session["CameFromSocialNetwork"] = true;
            if (Membership.GetUser(me.email) == null)
            {
                Session["FacebookUserName"] = me.email;
                Session["FacebookName"]     = me.name;


                string urlRegister = ConvertRelativeUrlToAbsoluteUrl(HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Register/Register.aspx"));
                Response.Redirect(urlRegister);
            }
            else
            {
                //PortalSecurity.SignOn(me.email, GeneratePasswordHash(me.email as String));
                Session["UserName"] = me.email;
            }
            Response.Redirect(HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/SignIn/LoginIn.aspx"));
            if (this.Settings["SIGNIN_AUTOMATICALLYHIDE"] != null)
            {
                bool hide = bool.Parse(this.Settings["SIGNIN_AUTOMATICALLYHIDE"].ToString());
                this.Visible = false;
            }
        }
Exemplo n.º 14
0
        public JsonResult ViewPage(string page_Id)
        {
            int pageId = Convert.ToInt32(page_Id.Trim('"'));
            var url    = HttpUrlBuilder.BuildUrl(pageId);

            return(Json(url));
        }
Exemplo n.º 15
0
 /// <summary>
 /// Dames the URL.
 /// </summary>
 /// <param name="custom">
 /// The custom.
 /// </param>
 /// <returns>
 /// The dame url.
 /// </returns>
 /// <remarks>
 /// </remarks>
 private string DameUrl(string custom)
 {
     // Sugerence by Mario Endara [email protected] 21-jun-2004
     // for compatibility with handler splitter
     return(HttpUrlBuilder.BuildUrl(
                "~/" + HttpUrlBuilder.DefaultPage, this.PageID, this.ModuleID, null, custom, string.Empty, string.Empty));
 }
Exemplo n.º 16
0
        /// <summary>
        /// Raised when the pages is loading. Here the CodeMirrorTextBox register its scripts.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            if (!Page.ClientScript.IsClientScriptIncludeRegistered(this.GetType(), "CodeMirror"))
            {
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "CodeMirror", HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/js/codemirror.js"));
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "CodeMirror_mode_xml", HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/mode/xml/xml.js"));
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "CodeMirror_mode_js", HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/mode/javascript/javascript.js"));
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "CodeMirror_mode_css", HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/mode/css/css.js"));
                Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "CodeMirror_mode_htmlmixed", HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/mode/htmlmixed/htmlmixed.js"));

                Literal cssFile = new Literal()
                {
                    Text = @"<link href=""" + HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/css/docs.css") + @""" type=""text/css"" rel=""stylesheet"" />"
                };
                Page.Header.Controls.Add(cssFile);
                cssFile = new Literal()
                {
                    Text = @"<link href=""" + HttpUrlBuilder.BuildUrl("~/aspnet_client/CodeMirrorV5.12/css/codemirror.css") + @""" type=""text/css"" rel=""stylesheet"" />"
                };
                Page.Header.Controls.Add(cssFile);

                var jsToAdd = "<script type=\"text/javascript\"> $(document).ready(function(){ var editor = CodeMirror.fromTextArea(document.getElementById('" + this.ClientID + "'), { mode: \"text/html\", extraKeys: {\"Ctrl-Space\": \"autocomplete\"},value: document.getElementById('" + this.ClientID + "').innerHTML }); }); </script>";


                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CM_load", jsToAdd);
            }
            base.OnLoad(e);
        }
        /// <summary>
        /// The UpDown_Click server event handler on this page is
        /// used to move a portal module up or down on a tab's layout pane
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.Web.UI.ImageClickEventArgs"/> instance containing the event data.</param>
        protected void UpDown_Click(object sender, ImageClickEventArgs e)
        {
            string cmd = (( ImageButton )sender).CommandName;

            if (tabList.SelectedIndex > -1)
            {
                int delta;

                // Determine the delta to apply in the order number for the module
                // within the list.  +3 moves down one item; -3 moves up one item
                if (cmd == "down")
                {
                    delta = 3;
                }
                else
                {
                    delta = -3;
                }

                PageItem t;
                t        = ( PageItem )portalPages[tabList.SelectedIndex];
                t.Order += delta;
                OrderPages();
                Response.Redirect(HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx", PageID, "selectedtabID=" + t.ID));
            }
        }
        /// <summary>
        /// Author:					Joe Audette
        /// Created:				1/18/2004
        /// Last Modified:			2/8/2004
        ///
        /// The Page_Load server event handler on this page is used
        /// to obtain the Blogs list, and to then display
        /// the message contents.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack && ModuleID > 0 && ItemID > 0)
            {
                if (Context.User.Identity.IsAuthenticated)
                {
                    char[]   separator   = { ';' };
                    string[] deleteRoles = Module.AuthorizedDeleteRoles.Split(separator);
                    foreach (string role in deleteRoles)
                    {
                        if (role.Length > 0)
                        {
                            if (Context.User.IsInRole(role))
                            {
                                IsDeleteable = true;
                            }
                        }
                    }
                }
                lnkRSS.HRef       = HttpUrlBuilder.BuildUrl("~/DesktopModules/CommunityModules/Blog/RSS.aspx", PageID, "&mID=" + ModuleID);
                imgRSS.Src        = HttpUrlBuilder.BuildUrl("~/DesktopModules/CommunityModules/Blog/xml.gif");
                lblCopyright.Text = moduleSettings["Copyright"].ToString();

                BindData();
            }
        }
Exemplo n.º 19
0
        public ActionResult LstLanguages()
        {
            LanguageSwitcher ls = new LanguageSwitcher();

            Appleseed.Framework.Web.UI.WebControls.LanguageCultureCollection lcc = Appleseed.Framework.Localization.LanguageSwitcher.GetLanguageCultureList();


            List <string[]> datos          = new List <string[]>();
            var             settings       = PortalSettings.HasEnablePageFriendlyUrl(Portal.PageID, Config.DefaultPortal);
            var             pageextenstion = System.Configuration.ConfigurationManager.AppSettings["friendlyUrlExtension"];

            foreach (Appleseed.Framework.Web.UI.WebControls.LanguageCultureItem l in lcc)
            {
                string[] dato  = new string[3];
                string   aux   = l.ToString();
                char[]   array = new char[1];
                array[0] = '/';
                string[] lang = aux.Split(array);

                dato[0] = settings == true?HttpUrlBuilder.BuildUrl("~/Home" + pageextenstion + "?lang=" + lang[0]) : HttpUrlBuilder.BuildUrl("~/site/0/Home?lang=" + lang[0]);

                LanguageSwitcher lswitcher = new LanguageSwitcher();
                dato[1] = lswitcher.GetFlagImgLCI(l);
                dato[1] = dato[1].Replace("images", "~/aspnet_client");

                dato[1] = HttpUrlBuilder.BuildUrl(dato[1]);

                dato[2] = lswitcher.getNameLCI(l);
                datos.Add(dato);
            }

            ViewData["datos"] = datos;
            return(View());
        }
        /// <summary>
        /// The DeleteBtn_Click server event handler is used to delete
        /// the selected tab from the portal
        /// </summary>
        protected void DeleteBtn_Click(object sender, ImageClickEventArgs e)
        {
            //base.OnDelete();

            if (tabList.SelectedIndex > -1)
            {
                try {
                    // must delete from database too
                    PageItem t    = ( PageItem )portalPages[tabList.SelectedIndex];
                    PagesDB  tabs = new PagesDB();
                    tabs.DeletePage(t.ID);

                    portalPages.RemoveAt(tabList.SelectedIndex);

                    if (tabList.SelectedIndex > 0)
                    {
                        t = ( PageItem )portalPages[tabList.SelectedIndex - 1];
                    }

                    OrderPages();

                    Response.Redirect(HttpUrlBuilder.BuildUrl("~/DesktopDefault.aspx", PageID, "SelectedPageID=" + t.ID));
                }
                catch (SqlException) {
                    Controls.Add(
                        new LiteralControl("<br><span class='Error'>" +
                                           General.GetString("TAB_DELETE_FAILED", "Failed to delete Page", this) +
                                           "<br>"));
                }
            }
        }
Exemplo n.º 21
0
        /// <summary>
        /// The BindData method is used to obtain details of a message
        /// from the Articles table, and update the page with
        /// the message content.
        /// </summary>
        private void BindData(int ItemID)
        {
            if (IsEditable)
            {
                editLinkDetail.NavigateUrl =
                    HttpUrlBuilder.BuildUrl("~/DesktopModules/CommunityModules/Articles/ArticlesEdit.aspx",
                                            "ItemID=" + ItemID + "&mid=" + ModuleID);
                editLinkDetail.Visible = true;
            }
            else
            {
                editLinkDetail.Visible = false;
            }


            // Obtain the selected item from the Articles table
            ArticlesDB    Article = new ArticlesDB();
            SqlDataReader dr      = Article.GetSingleArticle(ItemID, Version);

            try
            {
                // Load first row from database
                if (dr.Read())
                {
                    // Update labels with message contents
                    TitleDetail.Text = dr["Title"].ToString();

                    //[email protected]  5/24/04 added subtitle to ArticlesView.
                    if (dr["Subtitle"].ToString().Length > 0)
                    {
                        SubtitleDetail.Text = dr["Subtitle"].ToString();
                    }
                    StartDateDetail.Text    = ((DateTime)dr["StartDate"]).ToShortDateString();
                    StartDateDetail.Visible = bool.Parse(Settings["ShowDate"].ToString());
                    Description.Text        = Server.HtmlDecode(dr["Description"].ToString());
                    CreatedDate.Text        = ((DateTime)dr["CreatedDate"]).ToShortDateString();
                    CreatedBy.Text          = dr["CreatedByUser"].ToString();
                    // 15/7/2004 added localization by Mario Endara [email protected]
                    if (CreatedBy.Text == "unknown")
                    {
                        CreatedBy.Text = General.GetString("UNKNOWN", "unknown");
                    }

                    //Chris Farrell, [email protected], 5/24/2004
                    if (!bool.Parse(Settings["MODULESETTINGS_SHOW_MODIFIED_BY"].ToString()))
                    {
                        CreatedLabel.Visible = false;
                        CreatedDate.Visible  = false;
                        OnLabel.Visible      = false;
                        CreatedBy.Visible    = false;
                    }
                }
            }
            finally
            {
                // close the datareader
                dr.Close();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Raises the Init event.
        /// </summary>
        /// <param name="e"></param>
        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();

            ReturnHome.NavigateUrl = HttpUrlBuilder.BuildUrl();

            base.OnInit(e);
        }
Exemplo n.º 23
0
 private void saveAndCloseButton_Click(object sender, EventArgs e)
 {
     OnUpdate(e);
     if (Page.IsValid == true && Request.QueryString.GetValues("ModalChangeMaster") == null)
     {
         Response.Redirect(HttpUrlBuilder.BuildUrl("~/" + HttpUrlBuilder.DefaultPage, PageID));
     }
 }
Exemplo n.º 24
0
 private void saveAndCloseButton_Click(object sender, EventArgs e)
 {
     OnUpdate(e);
     if (Page.IsValid == true)
     {
         Response.Redirect(HttpUrlBuilder.BuildUrl("~/Default.aspx", PageID));
     }
 }
Exemplo n.º 25
0
        //
        // GET: /ForgotPassword/

        public ActionResult Index()
        {
            if (Request.IsAuthenticated)
            {
                Response.Redirect(HttpUrlBuilder.BuildUrl("~/"));
            }

            return(View());
        }
Exemplo n.º 26
0
        /// <summary>
        /// Used by flags and label
        /// </summary>
        /// <param name="language">
        /// The language.
        /// </param>
        /// <returns>
        /// The get lang url.
        /// </returns>
        private string GetLangUrl(string language)
        {
            string lang = HttpUrlBuilder.BuildUrl("~/site/1/Home");


            return(this.ChangeLanguageAction == LanguageSwitcherAction.LinkRedirect
                       ? string.Format("{0}?lang={1}", lang, language)
                       : string.Format("javascript:{0}", this.Page.ClientScript.GetPostBackEventReference(this, language)));
        }
Exemplo n.º 27
0
        private void GetPanes(string pageid, List <JsTreeModel> pages, bool loadModules, string panename)
        {
            string URL = ConvertRelativeUrlToAbsoluteUrl(HttpUrlBuilder.BuildUrl("~/?pageid=" + Convert.ToInt32(pageid) + "&panelist=y"));

            System.Net.WebRequest webRequest = System.Net.WebRequest.Create(URL);
            webRequest.Method = "GET";
            StreamReader       sr     = new StreamReader(webRequest.GetResponse().GetResponseStream());
            string             result = sr.ReadToEnd();
            List <JsTreeModel> child2 = new List <JsTreeModel>();
            var panelist = result.Split('+').ToList();
            //var panetopage = ModelServices.GetPageModules(Convert.ToInt32(pageid));
            var lowerpane = panelist.ConvertAll(d => d.ToLower());
            var i         = 0;

            if (!loadModules)
            {
                foreach (var pane in panelist)
                {
                    //JsTreeModel[] childm = getModuleToPane(pane, Convert.ToInt32(pageid));
                    JsTreeModel nodem = new JsTreeModel
                    {
                        text     = pane,
                        id       = pane,
                        isPane   = true,
                        nodeType = "pane",
                        // icon = @"/aspnet_client/jQuery/jsTree/icon.png", //+ "http://jstree.com/tree.png",
                        type = "pane",
                        //data = pane,
                        attr = new JsTreeAttribute {
                            id = "pjson_pane_" + i, rel = "folder"
                        },
                        //children2 = childm
                    };
                    child2.Add(nodem);
                    i++;
                }
                pages.AddRange(child2);
            }
            else
            {
                // add other pane.
                JsTreeModel[] childm = getModuleToPane(panename, Convert.ToInt32(pageid));
                pages.AddRange(childm);
                //JsTreeModel nodem = new JsTreeModel
                //{
                //    text = pane.Key,
                //    id = pane.Key + i.ToString(),
                //    isPane = true,
                //    //data = pane.Key + "  [Not present in current layout]",
                //    attr = new JsTreeAttribute { id = "pjson_pane_" + i, rel = "folder2" },
                //    //children2 = childm
                //};
                //child2.Add(nodem);
                //i++;
            }
        }
        // Helper methods
        private SiteMapNode CreateSiteMapNodeFromDataReader(DbDataReader reader)
        {
            // Make sure the node ID is present
            if (reader.IsDBNull(_indexPageID))
            {
                throw new ProviderException(_errmsg1);
            }

            // Get the node ID from the DataReader
            int id = reader.GetInt32(_indexPageID);

            // Make sure the node ID is unique
            if (_nodes.ContainsKey(id))
            {
                throw new ProviderException(_errmsg2);
            }

            string name        = reader.IsDBNull(_indexPageName) ? null : reader.GetString(_indexPageName).Trim();
            string description = reader.IsDBNull(_indexPageDescription) ? null : reader.GetString(_indexPageDescription).Trim();
            string roles       = reader.IsDBNull(_indexAuthorizedRoles) ? null : reader.GetString(_indexAuthorizedRoles).Trim();

            string url = HttpUrlBuilder.BuildUrl(id);

            // If roles were specified, turn the list into a string array
            string[] rolelist = null;
            if (!String.IsNullOrEmpty(roles))
            {
                rolelist = roles.Split(new char[] { ',', ';' }, 512);
            }
            if (rolelist != null)
            {
                int rolelistLength = rolelist.Length;
                if (rolelistLength > 0)
                {
                    if (rolelist[rolelistLength - 1].Equals(string.Empty))
                    {
                        string[] auxrolelist = new string[rolelistLength - 1];
                        for (int i = 0; i < rolelistLength - 1; i++)
                        {
                            auxrolelist[i] = rolelist[i];
                        }

                        rolelist = auxrolelist;
                    }
                }
            }

            // Create a SiteMapNode
            SiteMapNode node = new SiteMapNode(this, id.ToString(), url, name, description, rolelist, null, null, null);

            // Record the node in the _nodes dictionary
            _nodes.Add(id, node);

            // Return the node
            return(node);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Single point edit access deny.
        ///   Called when there is an unauthorized access attempt to an edit page.
        /// </summary>
        /// <remarks>
        /// </remarks>
        public static void AccessDeniedEdit()
        {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                throw new HttpException(403, "Access Denied Edit", 3);
            }

            HttpContext.Current.Response.Redirect(
                HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Admin/Logon.aspx"));
        }
Exemplo n.º 30
0
        protected string getUrlToEdit()
        {
            var url = HttpUrlBuilder.BuildUrl("~/DesktopModules/CoreModules/Admin/ModuleSettings.aspx", this.PageID);

            if (Request.QueryString.GetValues("ModalChangeMaster") != null)
            {
                url += "&ModalChangeMaster=true&camefromEditPage=true";
            }
            return("'" + url + "'");
        }