Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I am using umbraco 4.7. We are hosting multiple websites in a single installation. So in a cutom section me want to get all the hostnames installed.
Sections are available based on user rights. Hostnames don't play into section authorization.
You could write code to filter that.
Hope I understood that... if not please explain what you mean by "get all the hostnames installed"
Hi Daniel,
Actually we are hosting multiple websites in a single installation and i want to get all the host names assigned.
Me want something like this described in http://our.umbraco.org/forum/developers/api-questions/9606-get-hostname(s)
But umbraco.cms.businesslogic.web.Domain.GetDomains() is not working. I can't find a method like GetDomains().
Hi mahesh
Please look on this post http://our.umbraco.org/forum/developers/extending-umbraco/18643-Get-all-host-name. May be this will help you
GetDomains() is an internal method.
Here's the code:
internal static List<Domain> GetDomains() { return Cache.GetCacheItem<List<Domain>>("UmbracoDomainList", getDomainsSyncLock, TimeSpan.FromMinutes(30.0), delegate { List<Domain> list = new List<Domain>(); using (IRecordsReader reader = SqlHelper.ExecuteReader("select id, domainName from umbracoDomains", new IParameter[0])) { while (reader.Read()) { string domainName = reader.GetString("domainName"); int id = reader.GetInt("id"); if (list.Find(d => d.Name == domainName) == null) { list.Add(new Domain(id)); } else { Log.Add(LogTypes.Error, User.GetUser(0), -1, string.Format("Domain already exists in list ({0})", domainName)); } } } return list; }); }
Hi Daniel ,
Me got answer http://our.umbraco.org/forum/developers/extending-umbraco/18643-Get-all-host-name
thanks for your reply
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get all host name
Hi,
I am using umbraco 4.7. We are hosting multiple websites in a single installation. So in a cutom section me want to get all the hostnames installed.
Sections are available based on user rights. Hostnames don't play into section authorization.
You could write code to filter that.
Hope I understood that... if not please explain what you mean by "get all the hostnames installed"
Hi Daniel,
Actually we are hosting multiple websites in a single installation and i want to get all the host names assigned.
Me want something like this described in http://our.umbraco.org/forum/developers/api-questions/9606-get-hostname(s)
But umbraco.cms.businesslogic.web.Domain.GetDomains() is not working. I can't find a method like GetDomains().
Hi mahesh
Please look on this post http://our.umbraco.org/forum/developers/extending-umbraco/18643-Get-all-host-name. May be this will help you
GetDomains() is an internal method.
Here's the code:
Hi Daniel ,
Me got answer http://our.umbraco.org/forum/developers/extending-umbraco/18643-Get-all-host-name
thanks for your reply
is working on a reply...