Ejemplo n.º 1
0
        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("");
        }
Ejemplo n.º 2
0
        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("");
        }
Ejemplo n.º 3
0
        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 "";
        }
Ejemplo n.º 4
0
        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 "";
        }