private void updateRoute_ByOwnerMenus(MvcContext ctx, IMember owner) { Boolean homepageCustom = false; if (owner.GetType() == typeof(User)) { // 如果禁止主页自定义 if (!homepageCustom) { return; } } List <IMenu> list = InitHelperFactory.GetHelper(ctx).GetMenus(ctx.owner.obj); String cleanUrlWithoutOwner = ctx.route.getCleanUrlWithoutOwner(ctx); if (cleanUrlWithoutOwner == string.Empty || strUtil.EqualsIgnoreCase(cleanUrlWithoutOwner, "default")) { updateRoute_Menu(ctx, list, "default"); ctx.utils.setIsHome(true); } else { updateRoute_Menu(ctx, list, cleanUrlWithoutOwner); } }
public virtual void Init(MvcContext ctx) { if (ctx.utils.isEnd()) { return; } initPrivate(ctx); if (ctx.app.obj != null) { // 检查app是否停用 Type appType = ctx.app.obj.GetType(); AppInstaller installer = new AppInstallerService().GetByType(appType); if (installer == null || installer.IsInstanceClose(ctx.owner.obj.GetType())) { ctx.utils.endMsg("对不起,本app已经停用", HttpStatus.NotFound_404); return; } if (InitHelperFactory.GetHelper(ctx).IsAppRunning(ctx) == false) // 检查app是否属于暂停状态 { ctx.utils.endMsg(lang.get("exAppNotFound") + ": appType=" + appType + ", appId=" + ctx.app.Id, HttpStatus.NotFound_404); } } }
private void updateRoute_ByOwnerMenus(MvcContext ctx, IMember owner) { List <IMenu> list = InitHelperFactory.GetHelper(ctx).GetMenus(ctx.owner.obj); String cleanUrlWithoutOwner = ctx.route.getCleanUrlWithoutOwner(ctx); if (cleanUrlWithoutOwner == string.Empty || strUtil.EqualsIgnoreCase(cleanUrlWithoutOwner, "default")) { updateRoute_Menu(ctx, list, "default"); ctx.utils.setIsHome(true); } else { updateRoute_Menu(ctx, list, cleanUrlWithoutOwner); } }
public virtual void Init(MvcContext ctx) { if (ctx.utils.isEnd()) { return; } if (strUtil.IsNullOrEmpty(ctx.route.ownerType)) { return; } IMember owner = InitHelperFactory.GetHelper(ctx).getOwnerByUrl(ctx); if (owner == null || owner.Status == MemberStatus.Deleted || owner.Status == MemberStatus.Approving) { ctx.utils.endMsg("owner not found (" + lang.get("exUser") + " )", HttpStatus.NotFound_404); return; } // 检查空间是否禁用 if (spaceStopped(ctx, owner)) { ctx.utils.endMsg("对不起,用户空间已停用", HttpStatus.NotFound_404); return; } // 检查群组是否禁用 if (owner.GetType() == typeof(Group) && Component.IsEnableGroup() == false) { ctx.utils.endMsg("对不起,群组功能已停用", HttpStatus.NotFound_404); return; } OwnerContext context = new OwnerContext(); context.Id = owner.Id; context.obj = owner; ctx.utils.setOwnerContext(context); this.updateRoute_ByOwnerMenus(ctx, owner); initEditorUploadPath(ctx); // 如果是登录用户,则设置编辑的上传路径 }
private void updateRoute_ByOwnerMenus(MvcContext ctx, IMember owner) { String cleanUrlWithoutOwner = ctx.route.getCleanUrlWithoutOwner(ctx); if (isHomePath(cleanUrlWithoutOwner)) { if (isCustomHome(owner) == false) { return; } List <IMenu> list = InitHelperFactory.GetHelper(ctx).GetMenus(ctx.owner.obj); updateRoute_Menu(ctx, list, "default"); ctx.utils.setIsHome(true); } else { List <IMenu> list = InitHelperFactory.GetHelper(ctx).GetMenus(ctx.owner.obj); updateRoute_Menu(ctx, list, cleanUrlWithoutOwner); } }
protected virtual List <String> getFriendlyUrls(MvcContext ctx, IMember owner, String rawUrl) { List <String> furls = new List <String>(); List <IMenu> list = InitHelperFactory.GetHelper(owner.GetType(), ctx).GetMenus(owner); foreach (IMenu menu in list) { if (getFullUrl(menu.RawUrl).Equals(rawUrl)) { String urlKey = "/" + menu.Url + MvcConfig.Instance.UrlExt; furls.Add(urlKey); if (menu.Url == "default") // 在静态页面的时候,有多种结果:/和/Default.aspx { furls.Add("/"); furls.Add("/Default" + MvcConfig.Instance.UrlExt); } } } return(furls); }
public void Init(MvcContext ctx) { if (ctx.utils.isEnd()) { return; } initPrivate(ctx); if (ctx.app.obj != null) { // 检查app是否停用 Type appType = ctx.app.obj.GetType(); AppInstaller installer = new AppInstallerService().GetByType(appType); if (installer == null || installer.IsInstanceClose(ctx.owner.obj.GetType())) { ctx.utils.endMsg("对不起,本app已经停用", HttpStatus.NotFound_404); return; } InitHelperFactory.GetHelper(ctx).IsAppRunning(ctx); // 检查app是否属于暂停状态 } }