Plugin Directory

Changeset 1090494


Ignore:
Timestamp:
02/15/2015 01:22:16 PM (11 years ago)
Author:
ozh
Message:

Prettier stuff - 1.1

Location:
no-login/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • no-login/trunk/nologin.php

    r892400 r1090494  
    55Description: Never authenticate, you're always the admin. Obviously for test sites!
    66Author: Ozh
    7 Version: 1.0.2
     7Version: 1.1
    88Author URI: http://planetozh.com/
    99*/
    1010
    11 /**/
    1211if (!function_exists('wp_validate_auth_cookie')) {
    13        function wp_validate_auth_cookie() {
    14                return 1;
    15        }
    16        add_action( 'admin_enqueue_scripts', 'ozh_nologin_enqueue' );
    17        add_action( 'admin_notices', 'ozh_nologin_warn' );
     12    function wp_validate_auth_cookie() {
     13       return 1;
     14    }
     15    add_action( 'admin_head', 'ozh_nologin_admin_css' );
     16    add_action( 'wp_before_admin_bar_render', 'ozh_nologin_custom_toolbar', 999 );
    1817}
    1918
    20 function ozh_nologin_enqueue() {
    21     wp_enqueue_script('jquery');
     19
     20function ozh_nologin_admin_css() {
     21    echo '
     22    <style>
     23    #wp-admin-bar-debug-bar-no-login > .ab-item {
     24        color:red;
     25        font-weight:bolder;
     26        background-color: #ffa;
     27        background: rgb(254,252,234);
     28        background: -moz-linear-gradient(top,  rgb(254,252,234) 0%, rgb(241,218,54) 100%);
     29        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(254,252,234)), color-stop(100%,rgb(241,218,54)));
     30        background: -webkit-linear-gradient(top,  rgb(254,252,234) 0%,rgb(241,218,54) 100%);
     31        background: -o-linear-gradient(top,  rgb(254,252,234) 0%,rgb(241,218,54) 100%);
     32        background: -ms-linear-gradient(top,  rgb(254,252,234) 0%,rgb(241,218,54) 100%);
     33        background: linear-gradient(to bottom,  rgb(254,252,234) 0%,rgb(241,218,54) 100%);
     34        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#fefcea", endColorstr="#f1da36",GradientType=0 );
     35    }
     36   
     37    #wp-admin-bar-debug-bar-no-login .ab-submenu .ab-item{
     38        color:#ffa;
     39        background:red;
     40    }
     41
     42    #wp-admin-bar-debug-bar-no-login > .ab-item:before {
     43        content: "\f348";
     44        color:red;
     45        display: inline-block;
     46        -webkit-font-smoothing: antialiased;
     47    }   
     48    </style>
     49    ';
    2250}
    2351
    24 function ozh_nologin_warn() {
    25     echo '<div class="updated fade" id="ozh_nologin" style="background:#ff0;text-align:center;color: red;"><p><strong>No Login <u>activated</u> - anybody gets admin rights!</strong> <span onclick="javascript:jQuery(this).parent().parent().slideToggle(200)" style="cursor:pointer">[dismiss]</span> </p></div>';
     52function ozh_nologin_custom_toolbar() {
     53    global $wp_admin_bar;
     54
     55    $args = array(
     56        'id'     => 'debug-bar-no-login',
     57        'title'  => 'No Login Mode !',
     58    );
     59    $wp_admin_bar->add_menu( $args );
     60
     61    $args = array(
     62        'id'     => 'debug-bar-no-login-child',
     63        'parent' => 'debug-bar-no-login',
     64        'title'  => 'Everybody gets admin rights. Do not use on live sites!',
     65    );
     66    $wp_admin_bar->add_menu( $args );
     67
    2668}
    2769
  • no-login/trunk/readme.txt

    r641604 r1090494  
    33Tags: ozh, login, auth, admin, nologin
    44Contributors: ozh
    5 Requires at least: 2.0
     5Requires at least: 3.3
    66Tested up to: 9.9
    77Stable tag: trunk
Note: See TracChangeset for help on using the changeset viewer.