<?php

class CsrfUrls{
        // Two modes of operation:
        // 1. Takes in an Op and returns whether it should be protected (true) or not (false)
        // 2. Called without an op, returns entire array of protected URLs
    function getProtectedOps($op=""){
        $protected = array(
            "previewPost",
            "addPost",
            "addArticleCategory",
            "addArticleCategoryAjax",
            "updateBlogSettings",
            "deletePost",
            "deletePosts",
            "changePostsStatus",
            "changePostsCategory",
            "addLinkCategory",
            "addLink",
            "updatePost",
            "deleteArticleCategory",
            "deleteArticleCategories",
            "editArticleCategory",
            "updateArticleCategory",
            "deleteLink",
            "deleteLinks",
            "changeLinksCategory",
            "deleteLinkCategory",
            "deleteLinkCategories",
            "updateLink",
            "updateLinkCategory",
            "deleteComment",
            "deleteComments",
            "changeCommentsStatus",
            "updateUserSettings",
            "sendTrackbacks",
            "deleteUsers",
            "deleteUser",
            "updateGlobalSettings",
            "updateUserProfile",
            "addUser",
            "addBlog",
            "updateEditBlog",
            "updateBlogUsers",
            "addBlogUser",
            "deleteBlogUserPermissions",
            "deleteBlogUsersPermissions",
            "deleteLocales",
            "deleteLocale",
            "uploadLocale",
            "scanLocales",
            "deleteTemplates",
            "deleteTemplate",
            "addTemplateUpload",
            "scanTemplates",
            "addBlogTemplate",
            "scanBlogTemplates",
            "deleteBlogTemplate",
            "deleteBlogTemplates",
            "deleteBlogs",
            "deleteBlog",
            "purgePosts",
            "addResourceAlbum",
            "addResource",
            "updateResource",
            "deleteResource",
            "updateResourceAlbum",
            "deleteResourceAlbum",
            "deleteResourceItems",
            "changeGalleryItemsAlbum",
            "markComment",
            "markTrackback",
            "purgeSpamComments",
            "regeneratePreview",
            "addCustomField",
            "deleteCustomFields",
            "deleteCustomField",
            "updateCustomField",
            "saveDraftArticleAjax",
            "deleteTrackback",
            "deleteTrackbacks",
            "changeTrackbacksStatus",
            "deleteReferrer",
            "deleteReferrers",
            "deleteArticleReferrer",
            "deleteArticleReferrers",
            "doCleanUp",
            "purgeUsers",
            "purgeBlogs",
            "finishRegisterBlog",
            "addBlogCategory",
            "deleteBlogCategory",
            "deleteBlogCategories",
            "addGlobalArticleCategory",
            "deleteGlobalArticleCategory",
            "deleteGlobalArticleCategories",
            "updateGlobalArticleCategory",
            "resendConfirmation",
            "adminBlogSelect",
            "updateBlogCategory",
            "deletePermission",
            "deletePermissions",
            "updatePermission",
            "updatePermission",
            "addPermission",
            "updateBlogUser",
            "updatePluginSettings",
            "changeBlogStatus",
            "changeUserStatus",
                     );
        if($op)
            return in_array($op, $protected);
        else
            return $protected;
    }
}