WordPress.org

Make WordPress Core

Ticket #14530: chaetin.patch

File chaetin.patch, 13.9 KB (added by mrmist, 7 years ago)

Replace the cheatin message with a login message

  • wp-admin/admin-ajax.php

     
    12491249 
    12501250        $taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : false; 
    12511251        if ( ! $taxonomy ) 
    1252                 die( __('Cheatin’ uh?') ); 
     1252                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    12531253        $tax = get_taxonomy($taxonomy); 
    12541254 
    12551255        if ( ! current_user_can( $tax->cap->edit_terms ) ) 
    1256                 die( __('Cheatin&#8217; uh?') ); 
     1256                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    12571257 
    12581258        if ( ! isset($_POST['tax_ID']) || ! ( $id = (int) $_POST['tax_ID'] ) ) 
    12591259                die(-1); 
  • wp-admin/edit-comments.php

     
    1010require_once('./admin.php'); 
    1111 
    1212if ( !current_user_can('edit_posts') ) 
    13         wp_die(__('Cheatin&#8217; uh?')); 
     13        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1414 
    1515wp_enqueue_script('admin-comments'); 
    1616enqueue_comment_hotkeys_js(); 
  • wp-admin/edit-link-categories.php

     
    1515        $doaction = $_GET['action'] ? $_GET['action'] : $_GET['action2']; 
    1616 
    1717        if ( !current_user_can('manage_categories') ) 
    18                 wp_die(__('Cheatin&#8217; uh?')); 
     18                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1919 
    2020        if ( 'delete' == $doaction ) { 
    2121                $cats = (array) $_GET['delete']; 
  • wp-admin/edit-tags.php

     
    2020$tax = get_taxonomy($taxonomy); 
    2121 
    2222if ( ! current_user_can($tax->cap->manage_terms) ) 
    23         wp_die(__('Cheatin&#8217; uh?')); 
     23        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2424 
    2525$title = $tax->labels->name; 
    2626 
     
    4545        check_admin_referer('add-tag'); 
    4646 
    4747        if ( !current_user_can($tax->cap->edit_terms) ) 
    48                 wp_die(__('Cheatin&#8217; uh?')); 
     48                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    4949 
    5050        $ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST); 
    5151        $location = 'edit-tags.php?taxonomy=' . $taxonomy; 
     
    8383        check_admin_referer('delete-tag_' .  $tag_ID); 
    8484 
    8585        if ( !current_user_can($tax->cap->delete_terms) ) 
    86                 wp_die(__('Cheatin&#8217; uh?')); 
     86                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    8787 
    8888        wp_delete_term( $tag_ID, $taxonomy); 
    8989 
     
    9797        check_admin_referer('bulk-tags'); 
    9898 
    9999        if ( !current_user_can($tax->cap->delete_terms) ) 
    100                 wp_die(__('Cheatin&#8217; uh?')); 
     100                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    101101 
    102102        $tags = (array) $_GET['delete_tags']; 
    103103        foreach( $tags as $tag_ID ) { 
     
    137137        check_admin_referer('update-tag_' . $tag_ID); 
    138138 
    139139        if ( !current_user_can($tax->cap->edit_terms) ) 
    140                 wp_die(__('Cheatin&#8217; uh?')); 
     140                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    141141 
    142142        $ret = wp_update_term($tag_ID, $taxonomy, $_POST); 
    143143 
  • wp-admin/edit.php

     
    2020$post_type_object = get_post_type_object($post_type); 
    2121 
    2222if ( !current_user_can($post_type_object->cap->edit_posts) ) 
    23         wp_die(__('Cheatin&#8217; uh?')); 
     23                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2424 
    2525// Back-compat for viewing comments of an entry 
    2626if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) { 
  • wp-admin/includes/bookmark.php

     
    2727 */ 
    2828function edit_link( $link_id = '' ) { 
    2929        if (!current_user_can( 'manage_links' )) 
    30                 wp_die( __( 'Cheatin&#8217; uh?' )); 
     30                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    3131 
    3232        $_POST['link_url'] = esc_html( $_POST['link_url'] ); 
    3333        $_POST['link_url'] = esc_url($_POST['link_url']); 
  • wp-admin/link-category.php

     
    2121        check_admin_referer('add-link-category'); 
    2222 
    2323        if ( !current_user_can('manage_categories') ) 
    24                 wp_die(__('Cheatin&#8217; uh?')); 
     24                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2525 
    2626        if ( wp_insert_term($_POST['name'], 'link_category', $_POST ) ) { 
    2727                wp_redirect('edit-link-categories.php?message=1#addcat'); 
     
    3636        check_admin_referer('delete-link-category_' .  $cat_ID); 
    3737 
    3838        if ( !current_user_can('manage_categories') ) 
    39                 wp_die(__('Cheatin&#8217; uh?')); 
     39                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    4040 
    4141        $cat_name = get_term_field('name', $cat_ID, 'link_category'); 
    4242        $default_cat_id = get_option('default_link_category'); 
     
    7777        check_admin_referer('update-link-category_' . $cat_ID); 
    7878 
    7979        if ( !current_user_can('manage_categories') ) 
    80                 wp_die(__('Cheatin&#8217; uh?')); 
     80                wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    8181 
    8282        $location = 'edit-link-categories.php'; 
    8383        if ( $referer = wp_get_original_referer() ) { 
  • wp-admin/nav-menus.php

     
    2020 
    2121// Permissions Check 
    2222if ( ! current_user_can('edit_theme_options') ) 
    23         wp_die( __( 'Cheatin&#8217; uh?' ) ); 
     23        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2424 
    2525// Nav Menu CSS 
    2626wp_admin_css( 'nav-menu' ); 
  • wp-admin/options.php

     
    2828        $option_page = 'options'; 
    2929 
    3030if ( !current_user_can('manage_options') ) 
    31         wp_die(__('Cheatin&#8217; uh?')); 
     31        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    3232 
    3333// Handle admin email change requests 
    3434if ( is_multisite() ) { 
     
    5252} 
    5353 
    5454if ( is_multisite() && !is_super_admin() && 'update' != $action ) 
    55         wp_die(__('Cheatin&#8217; uh?')); 
     55        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    5656 
    5757$whitelist_options = array( 
    5858        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ), 
  • wp-admin/plugins.php

     
    1313                 
    1414        if ( empty( $menu_perms['plugins'] ) ) {  
    1515                if ( ! is_super_admin() ) 
    16                         wp_die( __( 'Cheatin&#8217; uh?' ) ); 
     16                        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1717        } 
    1818} 
    1919 
  • wp-admin/press-this.php

     
    1111header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 
    1212 
    1313if ( ! current_user_can('edit_posts') ) 
    14         wp_die( __( 'Cheatin&#8217; uh?' ) ); 
     14        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1515 
    1616/** 
    1717 * Press It form handler. 
  • wp-admin/sidebar.php

     
    1616require_once('./admin.php'); 
    1717 
    1818if ( ! current_user_can('edit_posts') ) 
    19         wp_die(__('Cheatin&#8217; uh?')); 
     19        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2020 
    2121$post = get_default_post_to_edit(); 
    2222 
  • wp-admin/themes.php

     
    1010require_once('./admin.php'); 
    1111 
    1212if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) 
    13         wp_die( __( 'Cheatin&#8217; uh?' ) ); 
     13        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1414 
    1515if ( current_user_can('switch_themes') && isset($_GET['action']) ) { 
    1616        if ( 'activate' == $_GET['action'] ) { 
     
    2121        } else if ( 'delete' == $_GET['action'] ) { 
    2222                check_admin_referer('delete-theme_' . $_GET['template']); 
    2323                if ( !current_user_can('delete_themes') ) 
    24                         wp_die( __( 'Cheatin&#8217; uh?' ) ); 
     24                        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    2525                delete_theme($_GET['template']); 
    2626                wp_redirect('themes.php?deleted=true'); 
    2727                exit; 
  • wp-admin/user-new.php

     
    1010require_once('./admin.php'); 
    1111 
    1212if ( !current_user_can('create_users') ) 
    13         wp_die(__('Cheatin&#8217; uh?')); 
     13        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1414 
    1515if ( is_multisite() && !get_site_option( 'add_new_users' ) ) 
    16         wp_die( __('Page disabled by the administrator') ); 
     16        wp_die( __('This page has been disabled by the administrator') ); 
    1717 
    1818/** WordPress Registration API */ 
    1919require_once( ABSPATH . WPINC . '/registration.php'); 
  • wp-admin/users.php

     
    1313require_once( ABSPATH . WPINC . '/registration.php'); 
    1414 
    1515if ( !current_user_can('list_users') ) 
    16         wp_die(__('Cheatin&#8217; uh?')); 
     16        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1717 
    1818$title = __('Users'); 
    1919$parent_file = 'users.php'; 
     
    7878 
    7979                // If the user doesn't already belong to the blog, bail. 
    8080                if ( is_multisite() && !is_user_member_of_blog( $id ) ) 
    81                         wp_die(__('Cheatin&#8217; uh?')); 
     81                        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    8282 
    8383                $user = new WP_User($id); 
    8484                $user->set_role($_REQUEST['new_role']); 
  • wp-admin/widgets.php

     
    1313require_once(ABSPATH . 'wp-admin/includes/widgets.php'); 
    1414 
    1515if ( ! current_user_can('edit_theme_options') ) 
    16         wp_die( __( 'Cheatin&#8217; uh?' )); 
     16        wp_die(__('There was a problem loading this page, you may not have the necessary permissions, or may need to <a href="' . get_option('siteurl') . '/wp-login.php">' . __('login') . '</a>.')); 
    1717 
    1818wp_admin_css( 'widgets' ); 
    1919