Microsoft Content Management Server - Admin Mode from different Application

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > May 2005 > Admin Mode from different Application





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Admin Mode from different Application
anonymous

2005-05-31, 8:50 pm

Anybody have any idea how I, from a different ASP.NET application, be able
to dirrect a user to a page without having to have them login and have them
be in admin mode?


JR

2005-05-31, 8:50 pm

From an external app, there might be an extra step involved. You would have to send them to a page on the CMS site that they can access without having to login. From within that page, redirect them to the page you want using a CmsApplicationContext.

The code below should build the URL to the edit site for the page you want to go to.

using (CmsApplicationContext cmsContext = new CmsApplicationContext())
{
cmsContext.AuthenticateAsUser("WinNT://YOUR_DOMAIN/ADMIN_ID", "ADMIN_PASSWORD", PublishingMode.Update);

// pick one of the next three lines to determine the posting you want to edit
Posting postingToEdit = (Posting) cmsContext.Searches.GetByGuid(YOUR_POSTING_GUID);
Posting postingToEdit = (Posting) cmsContext.Searches.GetByPath(YOUR_POSTING_PATH);
Posting postingToEdit = (Posting) cmsContext.Searches.GetByUrl(YOUR_POSTING_URL);

// build url
string url = "http://" +
HttpContext.Current.Request.ServerVariables["HTTP_HOST"] +
WebAuthorContext.Current.GetUrlForMode(postingToEdit, WebAuthorContextMode.AuthoringReedit, true);
}

Also, try looking at Stefan's blog for a number of good examples..
http://blogs.technet.com/stefan_gossner/


HTH.


> Anybody have any idea how I, from a different ASP.NET application, be
> able to dirrect a user to a page without having to have them login
> and have them be in admin mode?
>


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com