Plugin Directory

Changeset 875659


Ignore:
Timestamp:
03/14/2014 10:08:03 PM (12 years ago)
Author:
scweber
Message:

Version 2.8.3 - See Changelog (Restructed file system)

Location:
header-login/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • header-login/trunk/headerlogin.php

    r874588 r875659  
    33 *
    44 * @package Header_Login
    5  * @version 2.8.2
     5 * @version 2.8.3
    66 */
    77/*
     
    1111This allows for a user to log into Access Manager and then be automatically logged into Wordpress, without having to navigate to the Admin Console.
    1212Author: Scott Weber and Matthew Ehle
    13 Version: 2.8.2
     13Version: 2.8.3
    1414Author URI: https://github.com/scweber
    1515*/
     
    3333define('HL_NEWUSERROLE', 'subscriber');
    3434
    35 //Activation Hook
    36 function hl_activation_hook() {
    37     //Set Default Settings
    38     update_site_option('hl_userLogin_Header', '');
    39     update_site_option('hl_userEmail_Header', '');
    40     update_site_option('hl_userFirstname_Header', '');
    41     update_site_option('hl_userLastname_Header', '');
    42     update_site_option('hl_userNicename_Header', '');
    43     update_site_option('hl_userDisplayname_Header', '');
    44     update_site_option('hl_authHeader', '');
    45     update_site_option('hl_logoutURL', '');
    46     update_site_option('hl_settingsSaved', '');
    47    
    48         if(is_multisite()) {
    49             global $wpdb;
    50             $blogList = $wpdb->get_results("SELECT blog_id, domain, path FROM ".$wpdb->blogs);
    51             foreach($blogList as $blog) {
    52                 update_site_option('hl_createNewUser'.$blog->blog_id, '');
    53                 update_site_option('hl_defaultRole'.$blog->blog_id, HL_NEWUSERROLE);
    54             }
    55         } else {
    56             update_site_option('hl_createNewUser', '');
    57             update_site_option('hl_defaultRole', HL_NEWUSERROLE);
    58         }
    59 } //End hl_activation_hook
    60 
    61 //Deactivation Hook
    62 function hl_deactivation_hook() {
    63     delete_site_option('hl_userLogin_Header');
    64     delete_site_option('hl_userEmail_Header');
    65     delete_site_option('hl_userFirstname_Header');
    66     delete_site_option('hl_userLastname_Header');
    67     delete_site_option('hl_userNicename_Header');
    68     delete_site_option('hl_userDisplayname_Header');
    69     delete_site_option('hl_authHeader');
    70     delete_site_option('hl_logoutURL');
    71     delete_site_option('hl_settingsSaved');
    72    
    73         if(is_multisite()) {
    74             global $wpdb;
    75             $blogList = $wpdb->get_results("SELECT blog_id, domain, path FROM ".$wpdb->blogs);
    76             foreach($blogList as $blog) {
    77                 delete_site_option('hl_createNewUser'.$blog->blog_id);
    78                 delete_site_option('hl_defaultRole'.$blog->blog_id);
    79             }
    80         } else {
    81             delete_site_option('hl_createNewUser');
    82             delete_site_option('hl_defaultRole');
    83         }
    84 } //End hl_deactivation_hook
    85 
    8635function hl_menu() {
    8736    //Include the CSS and JS files
    88     wp_enqueue_style('headerlogin-stylesheet', plugins_url('headerlogin.css', __FILE__));
    89     wp_enqueue_script('headerlogin-javascript', plugins_url('headerlogin.js', __FILE__), jquery, '1.0', true);       
     37    wp_enqueue_style('headerlogin-stylesheet', plugins_url('css/headerlogin.css', __FILE__));
     38    wp_enqueue_script('headerlogin-javascript', plugins_url('js/headerlogin.js', __FILE__), array('jquery'), '1.0', true);       
    9039
    9140    //If multisite, then get the blog IDs
     
    12271            </div>
    12372            <?php
    124         }
    125         else if($_POST['user-login-header'] == "") {
     73        } else if($_POST['user-login-header'] == "") {
    12674            update_site_option('hl_settingsSaved', 'false');
    12775
     
    13078            </div>
    13179            <?php
    132         }
    133         else if($_POST['user-email-header'] == "") {
     80        } else if($_POST['user-email-header'] == "") {
    13481            update_site_option('hl_settingsSaved', 'false');
    13582
     
    13885            </div>
    13986            <?php
    140         }
    141         else if($_POST['auth-header'] == "") {
     87        } else if($_POST['auth-header'] == "") {
    14288            update_site_option('hl_settingsSaved', 'false');
    14389
     
    14692            </div>
    14793            <?php
    148         }
    149         else if($_POST['logout-url'] == "") {
     94        } else if($_POST['logout-url'] == "") {
    15095            update_site_option('hl_settingsSaved', 'false');
    15196
     
    205150        </p>
    206151        <table class="form-table">
    207             <tr valign-"top">
     152            <tr valign="top">
    208153                <th>
    209154                    <label for="wp-attribute"><strong><?php _e('WordPress Attribute','header-login'); ?></strong></label>
     
    214159                </th>
    215160            </tr>
    216             <tr valign-"top">
     161            <tr valign="top">
    217162                <th scope="row"><label for="user-login-header"><strong><?php _e('Username*','header-login'); ?></strong></label></th>
    218163                <td>
     
    221166                </td>
    222167            </tr>
    223             <tr valign-"top">
     168            <tr valign="top">
    224169                <th scope="row"><label for="user-email-header"><strong><?php _e('E-mail*','header-login'); ?></strong></label></th>
    225170                <td>
     
    228173                </td>
    229174            </tr>
    230             <tr valign-"top">
     175            <tr valign="top">
    231176                <th scope="row"><label for="user-firstname-header"><?php _e('First Name','header-login'); ?></label></th>
    232177                <td>
     
    235180                </td>
    236181            </tr>
    237             <tr valign-"top">
     182            <tr valign="top">
    238183                <th scope="row"><label for="user-lastname-header"><?php _e('Last Name','header-login'); ?></label></th>
    239184                <td>
     
    242187                </td>
    243188            </tr>
    244             <tr valign-"top">
     189            <tr valign="top">
    245190                <th scope="row"><label for="user-nicename-header"><?php _e('Nickname','header-login'); ?></label></th>
    246191                <td>
     
    249194                </td>
    250195            </tr>
    251             <tr valign-"top">
     196            <tr valign="top">
    252197                <th scope="row"><label for="user-displayname-header"><?php _e('Displayname','header-login'); ?></label></th>
    253198                <td>
     
    488433        $errors = "";
    489434
    490         $user_login  = $headers[$user_login_header];
    491         $user_email  = $headers[$user_email_header];
    492         $user_firstname  = $headers[$user_firstname_header];
    493         $user_lastname    = $headers[$user_lastname_header];
    494         $user_nicename    = $headers[$user_nicename_header];
     435        $user_login = $headers[$user_login_header];
     436        $user_email = $headers[$user_email_header];
     437        $user_firstname = $headers[$user_firstname_header];
     438        $user_lastname = $headers[$user_lastname_header];
     439        $user_nicename = $headers[$user_nicename_header];
    495440        $user_displayname = $headers[$user_displayname_header];
    496441       
     
    599544
    600545//Activation Hook
    601 register_activation_hook(__FILE__, 'hl_activation_hook');
     546function hl_activate() {
     547    //Set Default Settings
     548    update_site_option('hl_userLogin_Header', '');
     549    update_site_option('hl_userEmail_Header', '');
     550    update_site_option('hl_userFirstname_Header', '');
     551    update_site_option('hl_userLastname_Header', '');
     552    update_site_option('hl_userNicename_Header', '');
     553    update_site_option('hl_userDisplayname_Header', '');
     554    update_site_option('hl_authHeader', '');
     555    update_site_option('hl_logoutURL', '');
     556    update_site_option('hl_settingsSaved', '');
     557   
     558        if(is_multisite()) {
     559            global $wpdb;
     560            $blogList = $wpdb->get_results("SELECT blog_id, domain, path FROM ".$wpdb->blogs);
     561            foreach($blogList as $blog) {
     562                update_site_option('hl_createNewUser'.$blog->blog_id, '');
     563                update_site_option('hl_defaultRole'.$blog->blog_id, HL_NEWUSERROLE);
     564            }
     565        } else {
     566            update_site_option('hl_createNewUser', '');
     567            update_site_option('hl_defaultRole', HL_NEWUSERROLE);
     568        }
     569} //End hl_activation_hook
     570register_activation_hook(__FILE__, 'hl_activate');
    602571
    603572//Deactivation Hook
    604 register_deactivation_hook(__FILE__, 'hl_deactivation_hook');
     573function hl_uninstall() {
     574    delete_site_option('hl_userLogin_Header');
     575    delete_site_option('hl_userEmail_Header');
     576    delete_site_option('hl_userFirstname_Header');
     577    delete_site_option('hl_userLastname_Header');
     578    delete_site_option('hl_userNicename_Header');
     579    delete_site_option('hl_userDisplayname_Header');
     580    delete_site_option('hl_authHeader');
     581    delete_site_option('hl_logoutURL');
     582    delete_site_option('hl_settingsSaved');
     583   
     584        if(is_multisite()) {
     585            global $wpdb;
     586            $blogList = $wpdb->get_results("SELECT blog_id, domain, path FROM ".$wpdb->blogs);
     587            foreach($blogList as $blog) {
     588                delete_site_option('hl_createNewUser'.$blog->blog_id);
     589                delete_site_option('hl_defaultRole'.$blog->blog_id);
     590            }
     591        } else {
     592            delete_site_option('hl_createNewUser');
     593            delete_site_option('hl_defaultRole');
     594        }
     595} //End hl_deactivation_hook
     596register_uninstall_hook(__FILE__, 'hl_uninstall');
    605597
    606598//Action Hooks
  • header-login/trunk/readme.txt

    r874588 r875659  
    44Requires at least: 3.4.2
    55Tested up to: 3.8.1
    6 Stable tag: 2.8.2
     6Stable tag: 2.8.3
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424
    2525== Installation ==
    26 1. Upload `header-login` directory to the `/wp-content/plugins/` directory
    27 2. Activate the plugin through the 'Plugins' menu in WordPress
    28 3. Set up and customize the plugin through the 'Settings' Menu
     26= Automatic =
     271. Go to your admin area and select Plugins >> Add New from the menu
     282. Search for "Header Login"
     293. Click Install
     304. Click Activate (Network Activate on Multisite)
     315. Setup and customize the plugin through the "Settings" Menu (Network Settings Menu on Multisite)
     32
     33= Manual =
     341. Go to https://wordpress.org/plugins/header-login
     352. Download latest version of Simple Subscribe
     363. Unzip file into WordPress plugins directory
     374. Activate Plugin (Network Activate on Multisite)
     385. Setup and customize the plugin through the "Settings" Menu (Network Settings Menu on Multisite)
    2939
    3040== Changelog ==
     41= 2.8.3 =
     42Enhancements
     43    * Keep settings on deactivation.  Settings are only removed upon uninstallation.
     44
    3145= 2.8.2 =
    3246Bug Fixes
    33   - Minor fix to hide Role dropdown if Create New User is disabled
     47    * Minor fix to hide Role dropdown if Create New User is disabled
    3448
    3549= 2.8.1 =
    3650Bug Fixes
    37   - User's role was being overwritten in a single site
     51    * User's role was being overwritten in a single site
    3852
    3953= 2.8.0 =
    40 Bugfixes
    41   - User's current role on multisite blog was being overridden by user's role on main site.  This did not allow for a user to have varying roles on a multisite install.
    42 Enhancement
    43   - New multisite feature: Allow administrators to choose which subsites will automatically create new users and with what role.
     54Bug Fixes
     55    * User's current role on multisite blog was being overridden by user's role on main site.  This did not allow for a user to have varying roles on a multisite install
     56Enhancements
     57    * New multisite feature: Allow administrators to choose which subsites will automatically create new users and with what role
    4458
    4559= 2.7.3 =
    46 Fixed a bug that was overwriting the User-Defined Display Name and Nicename
     60Bug Fixes
     61    * Bug was overwriting the User-Defined Display Name and Nicename
    4762
    4863= 2.7.2 =
    49 Fixed another user role issue
     64Bug Fixes
     65    * Another user role issue
    5066
    5167= 2.7.1 =
    52 Fixed an issue where the plugin was setting the user's role to null.
     68Bug Fixes
     69    * Issue where the plugin was setting the user's role to null
    5370
    5471= 2.7 =
    55 Fixed the issue of not adding new users to all blogs when user already on Network.
     72Bug Fixes
     73    * Issue of not adding new users to all blogs when user already on Network
    5674
    5775= 2.6 =
    58 If option chosen to add new users and a multi-site, then users are added to each and every blog in network.
     76Enhancements
     77    * If option chosen to add new users and a multi-site, then users are added to each and every blog in network
    5978
    6079= 2.5 =
    6180Bug Fixes
    62  - Blank Admin Bar appearing when not logged in.
     81    * Blank Admin Bar appearing when not logged in
    6382
    6483= 2.4 =
    6584Bug Fixes
    66  - Some users not seeing the Admin Bar after logging in.
     85    * Some users not seeing the Admin Bar after logging in
    6786
    6887= 2.3 =
    69 Security Fixes.
     88Security Fixes
    7089
    7190= 2.2 =
    72 Do not update user info if header is blank.
     91Bug Fixes
     92    * Do not update user info if header is blank
    7393
    7494= 2.1 =
    75 Multi-Site Support.
     95Enhancements
     96    * Multi-Site Support
    7697
    7798= 2.0 =
    7899MAJOR UPDATE!
    79 New Admin User Interface.
    80 Ability to set custom headers to use for creating and authenticating users.
    81 Can choose to automatically create new users.
     100    * New Admin User Interface.
     101    * Ability to set custom headers to use for creating and authenticating users
     102    * Can choose to automatically create new users
    82103
    83104= 1.0 =
    84 This is the first release.
     105This is the first release
Note: See TracChangeset for help on using the changeset viewer.