protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { rawUrl = Intelligencia.UrlRewriter.RewriterHttpModule.RawUrl; CustomProfileCommon profile = new CustomProfileCommon(); string userName = profile.GetUserName(); string fileName = string.Format("~/App_Data/AdminData/{0}.xml", userName); string path = Server.MapPath(VirtualPathUtility.GetDirectory(fileName)); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } userFile = Server.MapPath(fileName); if (!File.Exists(userFile)) { if (mnBll == null) { mnBll = new BLL.MenuNav(); } mnBll.Create(userFile, "~/Admin/Default.aspx"); } if (mnBll == null) { mnBll = new BLL.MenuNav(); } mnBll.RequestSave(Request.AppRelativeCurrentExecutionFilePath, rawUrl, userFile); } }
/// <summary> /// 获取当前客户端对应的菜单导航文件 /// </summary> /// <returns></returns> private string GetMenuNavFile() { context = HttpContext.Current; CustomProfileCommon profile = new CustomProfileCommon(); string userName = profile.GetUserName(); return(context.Server.MapPath(string.Format("~/App_Data/AdminData/{0}.xml", userName))); }
public List <Model.MenuNav> GetTabs() { BLL.MenuNav mnBll = new BLL.MenuNav(); CustomProfileCommon profile = new CustomProfileCommon(); string fileName = string.Format("~/App_Data/AdminData/{0}.xml", profile.GetUserName()); return(mnBll.GetList(Server.MapPath(fileName))); }
public void SetAnonymousLogin() { if (ConfigHelper.GetValueByKey("RunMode") != "saas") { HttpContext.Current.Response.Redirect("~/u/t.html"); } else { if (HttpContext.Current.User.Identity.IsAuthenticated) { return; } CustomProfileCommon Profile = new CustomProfileCommon(); FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, "新用户", DateTime.Now, DateTime.Now.Add(FormsAuthentication.Timeout), true, Profile.GetUserName(), FormsAuthentication.FormsCookiePath); string encTicket = FormsAuthentication.Encrypt(ticket); HttpContext.Current.Response.Cookies.Add(new HttpCookie(FormsAuthentication.FormsCookieName, encTicket)); HttpContext.Current.Response.Redirect("~/u/t.html"); } }