public static string Update(int ID) { int _currentMember = umbraco.cms.businesslogic.member.Member.CurrentMemberId(); string _body = HttpContext.Current.Request["body"]; string _title = HttpContext.Current.Request["title"]; string _keywords = HttpContext.Current.Request["keywords"]; bool isAdmin = (Library.Xslt.IsInGroup("admin") || Library.Xslt.IsInGroup("wiki editor")); if (ID > 0 && _currentMember > 0 && _body.Trim() != "" && _title.Trim() != "") { Businesslogic.WikiPage wp = new uWiki.Businesslogic.WikiPage(ID); if (wp.Exists && (isAdmin || !wp.Locked)) { wp.Title = _title; wp.Author = _currentMember; wp.Body = _body; wp.Keywords = _keywords; wp.Save(); return(umbraco.library.NiceUrl(wp.NodeId)); } return("not allowed " + isAdmin.ToString() + " " + wp.Locked + " " + wp.Exists); } return(""); }
public static WikiPage Create(int parentId, int authorId, string body, string title, string keywords) { WikiPage wp = new WikiPage(); wp.Exists = false; wp.ParentId = parentId; wp.Author = authorId; wp.Body = body; wp.Title = title; wp.Keywords = keywords; wp.Save(); return(wp); }
public static string Rollback(int ID, string guid) { int _currentMember = HttpContext.Current.User.Identity.IsAuthenticated ? (int)Membership.GetUser().ProviderUserKey : 0; umbraco.cms.businesslogic.web.Document olddoc = new umbraco.cms.businesslogic.web.Document(ID, new Guid(guid)); Businesslogic.WikiPage wp = new uWiki.Businesslogic.WikiPage(ID); if (olddoc != null && wp.Exists && !wp.Locked && _currentMember > 0 && wp.Version.ToString() != guid) { wp.Body = olddoc.getProperty("bodyText").Value.ToString(); wp.Title = olddoc.Text; wp.Author = _currentMember; wp.Save(); return(umbraco.library.NiceUrl(wp.NodeId)); } return(""); }
public static string Update(int ID) { int _currentMember = umbraco.cms.businesslogic.member.Member.CurrentMemberId(); string _body = HttpContext.Current.Request["body"]; string _title = HttpContext.Current.Request["title"]; string _keywords = HttpContext.Current.Request["keywords"]; bool isAdmin = (Library.Xslt.IsInGroup("admin") || Library.Xslt.IsInGroup("wiki editor")); if (ID > 0 && _currentMember > 0 && _body.Trim() != "" && _title.Trim() != "") { Businesslogic.WikiPage wp = new uWiki.Businesslogic.WikiPage(ID); if (wp.Exists && (isAdmin || !wp.Locked)) { wp.Title = _title; wp.Author = _currentMember; wp.Body = _body; wp.Keywords = _keywords; wp.Save(); return umbraco.library.NiceUrl(wp.NodeId); } return "not allowed " + isAdmin.ToString() + " " + wp.Locked + " " + wp.Exists; } return ""; }
public static string Rollback(int ID, string guid) { int _currentMember = HttpContext.Current.User.Identity.IsAuthenticated ? (int)Membership.GetUser().ProviderUserKey : 0; umbraco.cms.businesslogic.web.Document olddoc = new umbraco.cms.businesslogic.web.Document(ID, new Guid(guid)); Businesslogic.WikiPage wp = new uWiki.Businesslogic.WikiPage(ID); if (olddoc != null && wp.Exists && !wp.Locked && _currentMember > 0 && wp.Version.ToString() != guid) { wp.Body = olddoc.getProperty("bodyText").Value.ToString(); wp.Title = olddoc.Text; wp.Author = _currentMember; wp.Save(); return umbraco.library.NiceUrl(wp.NodeId); } return ""; }