当前位置: 首页>>代码示例>>C#>>正文


C# PortalAliasController.GetPortalAliasArrayByPortalID方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliasArrayByPortalID方法的典型用法代码示例。如果您正苦于以下问题:C# PortalAliasController.GetPortalAliasArrayByPortalID方法的具体用法?C# PortalAliasController.GetPortalAliasArrayByPortalID怎么用?C# PortalAliasController.GetPortalAliasArrayByPortalID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Portals.PortalAliasController的用法示例。


在下文中一共展示了PortalAliasController.GetPortalAliasArrayByPortalID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CmdSwitchClick

        protected void CmdSwitchClick(object sender, EventArgs e)
        {
            try
            {
                if ((!string.IsNullOrEmpty(SitesLst.SelectedValue)))
                {
                    int selectedPortalID = int.Parse(SitesLst.SelectedValue);
                    var portalAliasCtrl = new PortalAliasController();
                    ArrayList portalAliases = portalAliasCtrl.GetPortalAliasArrayByPortalID(selectedPortalID);

                    if (((portalAliases != null) && portalAliases.Count > 0 && (portalAliases[0] != null)))
                    {
                        Response.Redirect(Globals.AddHTTP(((PortalAliasInfo) portalAliases[0]).HTTPAlias));
                    }
                }
            }
            catch(ThreadAbortException)
            {
              //Do nothing we are not logging ThreadAbortxceptions caused by redirects
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
            }
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:25,代码来源:SwitchSite.ascx.cs

示例2: BindData

        private void BindData()
        {
            ArrayList arr;
            PortalAliasController p = new PortalAliasController();

            arr = p.GetPortalAliasArrayByPortalID( intPortalID );
            dgPortalAlias.DataSource = arr;
            dgPortalAlias.DataBind();
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:9,代码来源:PortalAlias.ascx.cs

示例3: FormatPortalAliases

        /// <summary>
        /// FormatExpiryDate formats the format name as an <a> tag
        /// </summary>
        /// <history>
        /// 	[cnurse]	9/28/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        public string FormatPortalAliases( int PortalID )
        {
            StringBuilder str = new StringBuilder();
            try
            {
                PortalAliasController objPortalAliasController = new PortalAliasController();
                ArrayList arr = objPortalAliasController.GetPortalAliasArrayByPortalID( PortalID );

                for( int i = 0; i < arr.Count; i++ )
                {
                    PortalAliasInfo objPortalAliasInfo = (PortalAliasInfo)arr[i];
                    str.Append( "<a href=\"" + Globals.AddHTTP( objPortalAliasInfo.HTTPAlias ) + "\">" + objPortalAliasInfo.HTTPAlias + "</a>" + "<BR>" );
                }
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
            return str.ToString();
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:27,代码来源:Portals.ascx.cs

示例4: FormatPortalAliases

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// FormatExpiryDate formats the format name as an a tag
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	9/28/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        public string FormatPortalAliases(int portalID)
        {
            var str = new StringBuilder();
            try
            {
                var objPortalAliasController = new PortalAliasController();
                var arr = objPortalAliasController.GetPortalAliasArrayByPortalID(portalID);
                PortalAliasInfo objPortalAliasInfo;
                int i;
                for (i = 0; i <= arr.Count - 1; i++)
                {
                    objPortalAliasInfo = (PortalAliasInfo) arr[i];

                    var httpAlias = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias);
                    var originalUrl = HttpContext.Current.Items["UrlRewrite:OriginalUrl"].ToString().ToLowerInvariant();

                    httpAlias = Globals.AddPort(httpAlias, originalUrl);

                    str.Append("<a href=\"" + httpAlias + "\">" + objPortalAliasInfo.HTTPAlias + "</a>" + "<BR>");
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
            return str.ToString();
        }
开发者ID:sunsiz,项目名称:dnn6-chinese-language-pack,代码行数:38,代码来源:Portals.ascx.cs

示例5: LocatePortal

        BlogInfo[] IMetaWeblog.GetUsersBlogs(string key, string username, string password)
        {
            LocatePortal(Context.Request);
            DotNetNuke.Entities.Users.UserInfo ui = Authenticate(username, password);

            if (ui.UserID > 0)
            {
                //todo: configure blog info for users
                var infoList = new List<BlogInfo>();
                var bi = new BlogInfo {blogid = "0"};
                var pac = new PortalAliasController();
                foreach (PortalAliasInfo api in pac.GetPortalAliasArrayByPortalID(PortalId))
                {
                    bi.url = "http://" + api.HTTPAlias;
                    break;
                }

                bi.blogName = ui.Username;

                infoList.Add(bi);

                return infoList.ToArray();
            }
            throw new XmlRpcFaultException(0, Localization.GetString("FailedAuthentication.Text", LocalResourceFile));
        }
开发者ID:ChrisHammond,项目名称:Engage-Publish,代码行数:25,代码来源:MetaWeblog.cs

示例6: GetFormattedLink

 protected string GetFormattedLink(object dataItem)
 {
     var returnValue = new StringBuilder();
     if ((dataItem is TabInfo))
     {
         var tab = (TabInfo) dataItem;
         if ((tab != null))
         {
             int index = 0;
             TabCtrl.PopulateBreadCrumbs(ref tab);
             foreach (TabInfo t in tab.BreadCrumbs)
             {
                 if ((index > 0))
                 {
                     returnValue.Append(" > ");
                 }
                 if ((tab.BreadCrumbs.Count - 1 == index))
                 {
                     string url;
                     var objPortalAliasController = new PortalAliasController();
                     ArrayList arr = objPortalAliasController.GetPortalAliasArrayByPortalID(t.PortalID);
                     var objPortalAliasInfo = (PortalAliasInfo) arr[0];
                     url = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias) + "/Default.aspx?tabId=" + t.TabID;
                     returnValue.AppendFormat("<a href=\"{0}\">{1}</a>", url, t.LocalizedTabName);
                 }
                 else
                 {
                     returnValue.AppendFormat("{0}", t.LocalizedTabName);
                 }
                 index = index + 1;
             }
         }
     }
     return returnValue.ToString();
 }
开发者ID:sunsiz,项目名称:dnn6-chinese-language-pack,代码行数:35,代码来源:UsageDetails.ascx.cs

示例7: BindMarketing

        private void BindMarketing(PortalInfo portal)
        {
            //Load DocTypes
            var searchEngines = new Dictionary<string, string>
                               {
                                   { "Google", "http://www.google.com/addurl?q=" + Globals.HTTPPOSTEncode(Globals.AddHTTP(Globals.GetDomainName(Request))) },
                                   { "Yahoo", "http://siteexplorer.search.yahoo.com/submit" },
                                   { "Microsoft", "http://search.msn.com.sg/docs/submit.aspx" }
                               };

            cboSearchEngine.DataSource = searchEngines;
            cboSearchEngine.DataBind();

            var portalAliasController = new PortalAliasController();
            var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);
            if (PortalController.IsChildPortal(portal, Globals.GetAbsoluteServerPath(Request)))
            {
                txtSiteMap.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + @"/SiteMap.aspx?portalid=" + portal.PortalID;
            }
            else
            {
                if (aliases.Count > 0)
                {
                    //Get the first Alias
                    var objPortalAliasInfo = (PortalAliasInfo)aliases[0];
                    txtSiteMap.Text = Globals.AddHTTP(objPortalAliasInfo.HTTPAlias) + @"/SiteMap.aspx";
                }
                else
                {
                    txtSiteMap.Text = Globals.AddHTTP(Globals.GetDomainName(Request)) + @"/SiteMap.aspx";
                }
            }
            optBanners.SelectedIndex = portal.BannerAdvertising;
            if (UserInfo.IsSuperUser)
            {
                lblBanners.Visible = false;
            }
            else
            {
                optBanners.Enabled = portal.BannerAdvertising != 2;
                lblBanners.Visible = portal.BannerAdvertising == 2;
            }
        }
开发者ID:hackoose,项目名称:cfi-team05,代码行数:43,代码来源:SiteSettings.ascx.cs

示例8: BindAliases

        private void BindAliases(PortalInfo portal)
        {
            var portalSettings = new PortalSettings(portal);
            var portalAliasController = new PortalAliasController();
            var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);

            var portalAliasMapping = portalSettings.PortalAliasMappingMode.ToString().ToUpper();
            if (String.IsNullOrEmpty(portalAliasMapping))
            {
                portalAliasMapping = "CANONICALURL";
            }
            portalAliasModeButtonList.Select(portalAliasMapping, false);

            BindDefaultAlias(aliases);

            //Auto Add Portal Alias
            if (new PortalController().GetPortals().Count > 1)
            {
                chkAutoAddPortalAlias.Enabled = false;
                chkAutoAddPortalAlias.Checked = false;
            }
            else
            {
                chkAutoAddPortalAlias.Checked = HostController.Instance.GetBoolean("AutoAddPortalAlias");
            }
        }
开发者ID:hackoose,项目名称:cfi-team05,代码行数:26,代码来源:SiteSettings.ascx.cs

示例9: DeletePortal

        public static string DeletePortal( PortalInfo portal, string serverPath )
        {
            string strPortalName = null;
            string strMessage = string.Empty;

            // check if this is the last portal
            int portalCount = DataProvider.Instance().GetPortalCount();

            if( portalCount > 1 )
            {
                if( portal != null )
                {
                    // delete custom resource files
                    Globals.DeleteFilesRecursive( serverPath, ".Portal-" + portal.PortalID.ToString() + ".resx" );

                    //If child portal delete child folder
                    PortalAliasController objPortalAliasController = new PortalAliasController();
                    ArrayList arr = objPortalAliasController.GetPortalAliasArrayByPortalID( portal.PortalID );
                    PortalAliasInfo objPortalAliasInfo = (PortalAliasInfo)( arr[0] );
                    strPortalName = Globals.GetPortalDomainName( objPortalAliasInfo.HTTPAlias, null, true );
                    if( Convert.ToBoolean( ( objPortalAliasInfo.HTTPAlias.IndexOf( "/", 0 ) + 1 ) ) )
                    {
                        strPortalName = objPortalAliasInfo.HTTPAlias.Substring( ( objPortalAliasInfo.HTTPAlias.LastIndexOf( "/" ) + 1 ) );
                    }
                    if( strPortalName != "" && Directory.Exists( serverPath + strPortalName ) )
                    {
                        Globals.DeleteFolderRecursive( serverPath + strPortalName );
                    }

                    // delete upload directory
                    Globals.DeleteFolderRecursive( serverPath + "Portals\\" + portal.PortalID.ToString() );
                    string HomeDirectory = portal.HomeDirectoryMapPath;
                    if( Directory.Exists( HomeDirectory ) )
                    {
                        Globals.DeleteFolderRecursive( HomeDirectory );
                    }

                    // remove database references
                    PortalController objPortalController = new PortalController();
                    objPortalController.DeletePortalInfo( portal.PortalID );
                }
            }
            else
            {
                strMessage = Localization.GetString( "LastPortal" );
            }

            return strMessage;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:49,代码来源:PortalController.cs

示例10: IsChildPortal

        private bool IsChildPortal(PortalSettings ps, HttpContext context)
        {
            var isChild = false;
            var aliasController = new PortalAliasController();
            var arr = aliasController.GetPortalAliasArrayByPortalID(ps.PortalId);
            var serverPath = Globals.GetAbsoluteServerPath(context.Request);

            if (arr.Count > 0)
            {
                var portalAlias = (PortalAliasInfo)arr[0];
                var portalName = Globals.GetPortalDomainName(ps.PortalAlias.HTTPAlias, Request, true);
                if (portalAlias.HTTPAlias.IndexOf("/") > -1)
                {
                    portalName = PortalController.GetPortalFolder(portalAlias.HTTPAlias);
                }
                if (!string.IsNullOrEmpty(portalName) && Directory.Exists(serverPath + portalName))
                {
                    isChild = true;
                }
            }
            return isChild;
        }
开发者ID:hackoose,项目名称:cfi-team05,代码行数:22,代码来源:SitemapSettings.ascx.cs

示例11: BindAliases

        private void BindAliases(PortalInfo portal)
        {
            var portalSettings = new PortalSettings(portal);
            var portalAliasController = new PortalAliasController();
            var aliases = portalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID);

            var portalAliasMapping = portalSettings.PortalAliasMappingMode.ToString().ToUpper();
            if (String.IsNullOrEmpty(portalAliasMapping))
            {
                portalAliasMapping = "CANONICALURL";
            }
            portalAliasModeButtonList.Select(portalAliasMapping, false);

            if (portalAliasMapping.ToUpperInvariant() == "NONE")
            {
                defaultAliasRow.Visible = false;
            }
            else
            {
                defaultAliasRow.Visible = true;
                defaultAliasDropDown.DataSource = aliases;
                defaultAliasDropDown.DataBind();

                var defaultAlias = PortalController.GetPortalSetting("DefaultPortalAlias", portal.PortalID, "");
                if (defaultAliasDropDown.Items.FindByValue(defaultAlias) != null)
                {
                    defaultAliasDropDown.Items.FindByValue(defaultAlias).Selected = true;
                }
            }

            //Auto Add Portal Alias
            if (new PortalController().GetPortals().Count > 1)
            {
                chkAutoAddPortalAlias.Enabled = false;
                chkAutoAddPortalAlias.Checked = false;
            }
            else
            {
                chkAutoAddPortalAlias.Checked = HostController.Instance.GetBoolean("AutoAddPortalAlias");
            }
        }
开发者ID:patonomatic,项目名称:VUWTC,代码行数:41,代码来源:SiteSettings.ascx.cs

示例12: UpgradeApplication


//.........这里部分代码省略.........
                if (CoreModuleExists("Feedback"))
                {
                    moduleDefId = GetModuleDefinition("Feedback", "Feedback");
                    AddModuleControl(moduleDefId, "Settings", "Feedback Settings", "DesktopModules/Feedback/Settings.ascx", "", SecurityAccessLevel.Edit, 0);
                }

                if (HostTabExists("Superuser Accounts") == false)
                {
                    //add SuperUser Accounts module and tab
                    DesktopModuleController objDesktopModuleController = new DesktopModuleController();
                    DesktopModuleInfo objDesktopModuleInfo;
                    objDesktopModuleInfo = objDesktopModuleController.GetDesktopModuleByName("User Accounts");
                    ModuleDefinitionController objModuleDefController = new ModuleDefinitionController();
                    moduleDefId = objModuleDefController.GetModuleDefinitionByName(objDesktopModuleInfo.DesktopModuleID, "User Accounts").ModuleDefID;

                    //Create New Host Page (or get existing one)
                    newPage = AddHostPage("Superuser Accounts", "icon_users_16px.gif", true);

                    //Add Module To Page
                    AddModuleToPage(newPage, moduleDefId, "Superuser Accounts", "icon_users_32px.gif");
                }

                //add Skins module and tab to Host menu
                if (HostTabExists("Skins") == false)
                {
                    DesktopModuleController objDesktopModuleController = new DesktopModuleController();
                    DesktopModuleInfo objDesktopModuleInfo;
                    objDesktopModuleInfo = objDesktopModuleController.GetDesktopModuleByName("Skins");
                    ModuleDefinitionController objModuleDefController = new ModuleDefinitionController();
                    moduleDefId = objModuleDefController.GetModuleDefinitionByName(objDesktopModuleInfo.DesktopModuleID, "Skins").ModuleDefID;

                    //Create New Host Page (or get existing one)
                    newPage = AddHostPage("Skins", "icon_skins_16px.gif", true);

                    //Add Module To Page
                    AddModuleToPage(newPage, moduleDefId, "Skins", "");
                }

                //Add Search Skin Object
                AddModuleControl(Null.NullInteger, "SEARCH", Null.NullString, "Admin/Skins/Search.ascx", "", SecurityAccessLevel.SkinObject, Null.NullInteger);

                //Add TreeView Skin Object
                AddModuleControl(Null.NullInteger, "TREEVIEW", Null.NullString, "Admin/Skins/TreeViewMenu.ascx", "", SecurityAccessLevel.SkinObject, Null.NullInteger);

                //Add Private Assembly Packager
                moduleDefId = GetModuleDefinition("Module Definitions", "Module Definitions");
                AddModuleControl(moduleDefId, "Package", "Create Private Assembly", "Admin/ModuleDefinitions/PrivateAssembly.ascx", "icon_moduledefinitions_32px.gif", SecurityAccessLevel.Edit, Null.NullInteger);

                //Add Edit Role Groups
                moduleDefId = GetModuleDefinition("Security Roles", "Security Roles");
                AddModuleControl(moduleDefId, "EditGroup", "Edit Role Groups", "Admin/Security/EditGroups.ascx", "icon_securityroles_32px.gif", SecurityAccessLevel.Edit, Null.NullInteger);
                AddModuleControl(moduleDefId, "UserSettings", "Manage User Settings", "Admin/Users/UserSettings.ascx", "~/images/settings.gif", SecurityAccessLevel.Edit, Null.NullInteger);

                //Add User Accounts Controls
                moduleDefId = GetModuleDefinition("User Accounts", "User Accounts");
                AddModuleControl(moduleDefId, "ManageProfile", "Manage Profile Definition", "Admin/Users/ProfileDefinitions.ascx", "icon_users_32px.gif", SecurityAccessLevel.Edit, Null.NullInteger);
                AddModuleControl(moduleDefId, "EditProfileProperty", "Edit Profile Property Definition", "Admin/Users/EditProfileDefinition.ascx", "icon_users_32px.gif", SecurityAccessLevel.Edit, Null.NullInteger);
                AddModuleControl(moduleDefId, "UserSettings", "Manage User Settings", "Admin/Users/UserSettings.ascx", "~/images/settings.gif", SecurityAccessLevel.Edit, Null.NullInteger);
                AddModuleControl(Null.NullInteger, "Profile", "Profile", "Admin/Users/ManageUsers.ascx", "icon_users_32px.gif", SecurityAccessLevel.Anonymous, Null.NullInteger);
                AddModuleControl(Null.NullInteger, "SendPassword", "Send Password", "Admin/Security/SendPassword.ascx", "", SecurityAccessLevel.Anonymous, Null.NullInteger);
                AddModuleControl(Null.NullInteger, "ViewProfile", "View Profile", "Admin/Users/ViewProfile.ascx", "icon_users_32px.gif", SecurityAccessLevel.Anonymous, Null.NullInteger);

                //Update Child Portal subHost.aspx
                PortalAliasController objAliasController = new PortalAliasController();
                ArrayList arrAliases = objAliasController.GetPortalAliasArrayByPortalID(Null.NullInteger);

                foreach (PortalAliasInfo objAlias in arrAliases)
                {
                    //For the alias to be for a child it must be of the form ...../child
                    if (objAlias.HTTPAlias.LastIndexOf("/") != -1)
                    {
                        string childPath = Globals.ApplicationMapPath + "\\" + objAlias.HTTPAlias.Substring(objAlias.HTTPAlias.LastIndexOf("/") + 1);
                        if (Directory.Exists(childPath))
                        {
                            //Folder exists App/child so upgrade

                            //Rename existing file
                            File.Copy(childPath + "\\" + Globals.glbDefaultPage, childPath + "\\old_" + Globals.glbDefaultPage, true);

                            // create the subhost default.aspx file
                            File.Copy(Globals.HostMapPath + "subhost.aspx", childPath + "\\" + Globals.glbDefaultPage, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                strExceptions += "Error: " + ex.Message + "\r\n";
                try
                {
                    Exceptions.Exceptions.LogException(ex);
                }
                catch
                {
                    // ignore
                }
            }

            return strExceptions;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:101,代码来源:Upgrade.cs

示例13: OnBeginRequest


//.........这里部分代码省略.........
                    // get the alias from the tabid, but only if it is for a tab in that domain
                    PortalAlias = PortalSettings.GetPortalByTab( TabId, DomainName );
                    if( PortalAlias == null || PortalAlias == "" )
                    {
                        //if the TabId is not for the correct domain
                        //see if the correct domain can be found and redirect it
                        objPortalAliasInfo = PortalSettings.GetPortalAliasInfo( DomainName );
                        if( objPortalAliasInfo != null )
                        {
                            if( app.Request.Url.AbsoluteUri.ToLower().StartsWith( "https://" ) )
                            {
                                strURL = "https://" + objPortalAliasInfo.HTTPAlias.Replace( "*.", "" );
                            }
                            else
                            {
                                strURL = "http://" + objPortalAliasInfo.HTTPAlias.Replace( "*.", "" );
                            }
                            if( strURL.ToLower().IndexOf( DomainName.ToLower() ) == - 1 )
                            {
                                strURL += app.Request.Url.PathAndQuery;
                            }
                            Response.Redirect( strURL, true );
                        }
                    }
                }
            }

            // else use the domain name
            if( PortalAlias == null || PortalAlias == "" )
            {
                PortalAlias = DomainName;
            }
            //using the DomainName above will find that alias that is the domainname portion of the Url
            //ie. dotnetnuke.com will be found even if zzz.dotnetnuke.com was entered on the Url
            objPortalAliasInfo = PortalSettings.GetPortalAliasInfo( PortalAlias );
            if( objPortalAliasInfo != null )
            {
                PortalId = objPortalAliasInfo.PortalID;
            }

            // if the portalid is not known
            if( PortalId == - 1 )
            {
                if( !Request.Url.LocalPath.ToLower().EndsWith( Globals.glbDefaultPage.ToLower() ) )
                {
                    // allows requests for aspx pages in custom folder locations to be processed
                    return;
                }
                else
                {
                    //the domain name was not found so try using the host portal's first alias
                    if( Convert.ToString( Globals.HostSettings["HostPortalId"] ) != "" )
                    {
                        PortalId = Convert.ToInt32( Globals.HostSettings["HostPortalId"] );
                        // use the host portal
                        PortalAliasController objPortalAliasController = new PortalAliasController();
                        ArrayList arrPortalAliases;
                        arrPortalAliases = objPortalAliasController.GetPortalAliasArrayByPortalID( int.Parse( Convert.ToString( Globals.HostSettings["HostPortalId"] ) ) );
                        if( arrPortalAliases.Count > 0 )
                        {
                            //Get the first Alias
                            objPortalAliasInfo = (PortalAliasInfo)arrPortalAliases[0];
                            if( app.Request.Url.AbsoluteUri.ToLower().StartsWith( "https://" ) )
                            {
                                strURL = "https://" + objPortalAliasInfo.HTTPAlias.Replace( "*.", "" );
                            }
                            else
                            {
                                strURL = "http://" + objPortalAliasInfo.HTTPAlias.Replace( "*.", "" );
                            }
                            if( TabId != - 1 )
                            {
                                strURL += app.Request.Url.Query;
                            }
                            Response.Redirect( strURL, true );
                        }
                    }
                }
            }

            if( PortalId != - 1 )
            {
                // load the PortalSettings into current context
                PortalSettings _portalSettings = new PortalSettings( TabId, objPortalAliasInfo );
                app.Context.Items.Add( "PortalSettings", _portalSettings );
            }
            else
            {
                // alias does not exist in database
                // and all attempts to find another have failed
                //this should only happen if the HostPortal does not have any aliases
                StreamReader objStreamReader;
                objStreamReader = File.OpenText( Server.MapPath( "~/404.htm" ) );
                string strHTML = objStreamReader.ReadToEnd();
                objStreamReader.Close();
                strHTML = strHTML.Replace( "[DOMAINNAME]", DomainName );
                Response.Write( strHTML );
                Response.End();
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:101,代码来源:UrlRewriteModule.cs

示例14: IsChildPortal

 /// <summary>
 /// Determines whether the portal is child portal.
 /// </summary>
 /// <param name="portal">The portal.</param>
 /// <param name="serverPath">The server path.</param>
 /// <returns>
 ///   <c>true</c> if the portal is child portal; otherwise, <c>false</c>.
 /// </returns>
 public static bool IsChildPortal(PortalInfo portal, string serverPath)
 {
     bool isChild = Null.NullBoolean;
     string portalName;
     PortalAliasController aliasController = new PortalAliasController();
     ArrayList arr = aliasController.GetPortalAliasArrayByPortalID(portal.PortalID);
     if (arr.Count > 0)
     {
         PortalAliasInfo portalAlias = (PortalAliasInfo)arr[0];
         portalName = Globals.GetPortalDomainName(portalAlias.HTTPAlias, null, true);
         if (portalAlias.HTTPAlias.IndexOf("/") > -1)
         {
             portalName = GetPortalFolder(portalAlias.HTTPAlias);
         }
         if (!String.IsNullOrEmpty(portalName) && Directory.Exists(serverPath + portalName))
         {
             isChild = true;
         }
     }
     return isChild;
 }
开发者ID:biganth,项目名称:Curt,代码行数:29,代码来源:PortalController.cs

示例15: UpdateChildPortalsDefaultPage

        private static void UpdateChildPortalsDefaultPage()
        {
            //Update Child Portal subHost.aspx
            var portalAliasController = new PortalAliasController();
            ArrayList aliases = portalAliasController.GetPortalAliasArrayByPortalID(Null.NullInteger);

            foreach (PortalAliasInfo aliasInfo in aliases)
            {
                //For the alias to be for a child it must be of the form ...../child
                int intChild = aliasInfo.HTTPAlias.IndexOf("/");
                if (intChild != -1 && intChild != (aliasInfo.HTTPAlias.Length - 1))
                {
                    var childPath = Globals.ApplicationMapPath + "\\" + aliasInfo.HTTPAlias.Substring(intChild + 1);
                    if (!string.IsNullOrEmpty(Globals.ApplicationPath))
                    {
                        childPath = childPath.Replace("\\", "/");
                        childPath = childPath.Replace(Globals.ApplicationPath, "");
                    }
                    childPath = childPath.Replace("/", "\\");
                    // check if File exists and make sure it's not the site's main default.aspx page
                    string childDefaultPage = childPath + "\\" + Globals.glbDefaultPage;
                    if (childPath != Globals.ApplicationMapPath && File.Exists(childDefaultPage))
                    {
                        var objDefault = new System.IO.FileInfo(childDefaultPage);
                        var objSubHost = new System.IO.FileInfo(Globals.HostMapPath + "subhost.aspx");
                        // check if upgrade is necessary
                        if (objDefault.Length != objSubHost.Length)
                        {
                            //check file is readonly
                            bool wasReadonly = false;
                            FileAttributes attributes = File.GetAttributes(childDefaultPage);
                            if ((attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly)
                            {
                                wasReadonly = true;
                                //remove readonly attribute
                                File.SetAttributes(childDefaultPage, FileAttributes.Normal);
                            }

                            //Rename existing file                                
                            File.Copy(childDefaultPage, childPath + "\\old_" + Globals.glbDefaultPage, true);

                            //copy file
                            File.Copy(Globals.HostMapPath + "subhost.aspx", childDefaultPage, true);

                            //set back the readonly attribute
                            if (wasReadonly)
                            {
                                File.SetAttributes(childDefaultPage, FileAttributes.ReadOnly);
                            }
                        }
                    }
                }
            }
        }
开发者ID:biganth,项目名称:Curt,代码行数:54,代码来源:Upgrade.cs


注:本文中的DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliasArrayByPortalID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。