Changeset 875659
- Timestamp:
- 03/14/2014 10:08:03 PM (12 years ago)
- Location:
- header-login/trunk
- Files:
-
- 2 edited
-
headerlogin.php (modified) (16 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
header-login/trunk/headerlogin.php
r874588 r875659 3 3 * 4 4 * @package Header_Login 5 * @version 2.8. 25 * @version 2.8.3 6 6 */ 7 7 /* … … 11 11 This allows for a user to log into Access Manager and then be automatically logged into Wordpress, without having to navigate to the Admin Console. 12 12 Author: Scott Weber and Matthew Ehle 13 Version: 2.8. 213 Version: 2.8.3 14 14 Author URI: https://github.com/scweber 15 15 */ … … 33 33 define('HL_NEWUSERROLE', 'subscriber'); 34 34 35 //Activation Hook36 function hl_activation_hook() {37 //Set Default Settings38 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_hook60 61 //Deactivation Hook62 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_hook85 86 35 function hl_menu() { 87 36 //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); 90 39 91 40 //If multisite, then get the blog IDs … … 122 71 </div> 123 72 <?php 124 } 125 else if($_POST['user-login-header'] == "") { 73 } else if($_POST['user-login-header'] == "") { 126 74 update_site_option('hl_settingsSaved', 'false'); 127 75 … … 130 78 </div> 131 79 <?php 132 } 133 else if($_POST['user-email-header'] == "") { 80 } else if($_POST['user-email-header'] == "") { 134 81 update_site_option('hl_settingsSaved', 'false'); 135 82 … … 138 85 </div> 139 86 <?php 140 } 141 else if($_POST['auth-header'] == "") { 87 } else if($_POST['auth-header'] == "") { 142 88 update_site_option('hl_settingsSaved', 'false'); 143 89 … … 146 92 </div> 147 93 <?php 148 } 149 else if($_POST['logout-url'] == "") { 94 } else if($_POST['logout-url'] == "") { 150 95 update_site_option('hl_settingsSaved', 'false'); 151 96 … … 205 150 </p> 206 151 <table class="form-table"> 207 <tr valign -"top">152 <tr valign="top"> 208 153 <th> 209 154 <label for="wp-attribute"><strong><?php _e('WordPress Attribute','header-login'); ?></strong></label> … … 214 159 </th> 215 160 </tr> 216 <tr valign -"top">161 <tr valign="top"> 217 162 <th scope="row"><label for="user-login-header"><strong><?php _e('Username*','header-login'); ?></strong></label></th> 218 163 <td> … … 221 166 </td> 222 167 </tr> 223 <tr valign -"top">168 <tr valign="top"> 224 169 <th scope="row"><label for="user-email-header"><strong><?php _e('E-mail*','header-login'); ?></strong></label></th> 225 170 <td> … … 228 173 </td> 229 174 </tr> 230 <tr valign -"top">175 <tr valign="top"> 231 176 <th scope="row"><label for="user-firstname-header"><?php _e('First Name','header-login'); ?></label></th> 232 177 <td> … … 235 180 </td> 236 181 </tr> 237 <tr valign -"top">182 <tr valign="top"> 238 183 <th scope="row"><label for="user-lastname-header"><?php _e('Last Name','header-login'); ?></label></th> 239 184 <td> … … 242 187 </td> 243 188 </tr> 244 <tr valign -"top">189 <tr valign="top"> 245 190 <th scope="row"><label for="user-nicename-header"><?php _e('Nickname','header-login'); ?></label></th> 246 191 <td> … … 249 194 </td> 250 195 </tr> 251 <tr valign -"top">196 <tr valign="top"> 252 197 <th scope="row"><label for="user-displayname-header"><?php _e('Displayname','header-login'); ?></label></th> 253 198 <td> … … 488 433 $errors = ""; 489 434 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]; 495 440 $user_displayname = $headers[$user_displayname_header]; 496 441 … … 599 544 600 545 //Activation Hook 601 register_activation_hook(__FILE__, 'hl_activation_hook'); 546 function 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 570 register_activation_hook(__FILE__, 'hl_activate'); 602 571 603 572 //Deactivation Hook 604 register_deactivation_hook(__FILE__, 'hl_deactivation_hook'); 573 function 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 596 register_uninstall_hook(__FILE__, 'hl_uninstall'); 605 597 606 598 //Action Hooks -
header-login/trunk/readme.txt
r874588 r875659 4 4 Requires at least: 3.4.2 5 5 Tested up to: 3.8.1 6 Stable tag: 2.8. 26 Stable tag: 2.8.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 25 25 == 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 = 27 1. Go to your admin area and select Plugins >> Add New from the menu 28 2. Search for "Header Login" 29 3. Click Install 30 4. Click Activate (Network Activate on Multisite) 31 5. Setup and customize the plugin through the "Settings" Menu (Network Settings Menu on Multisite) 32 33 = Manual = 34 1. Go to https://wordpress.org/plugins/header-login 35 2. Download latest version of Simple Subscribe 36 3. Unzip file into WordPress plugins directory 37 4. Activate Plugin (Network Activate on Multisite) 38 5. Setup and customize the plugin through the "Settings" Menu (Network Settings Menu on Multisite) 29 39 30 40 == Changelog == 41 = 2.8.3 = 42 Enhancements 43 * Keep settings on deactivation. Settings are only removed upon uninstallation. 44 31 45 = 2.8.2 = 32 46 Bug Fixes 33 -Minor fix to hide Role dropdown if Create New User is disabled47 * Minor fix to hide Role dropdown if Create New User is disabled 34 48 35 49 = 2.8.1 = 36 50 Bug Fixes 37 -User's role was being overwritten in a single site51 * User's role was being overwritten in a single site 38 52 39 53 = 2.8.0 = 40 Bug fixes41 - 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.54 Bug 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 56 Enhancements 57 * New multisite feature: Allow administrators to choose which subsites will automatically create new users and with what role 44 58 45 59 = 2.7.3 = 46 Fixed a bug that was overwriting the User-Defined Display Name and Nicename 60 Bug Fixes 61 * Bug was overwriting the User-Defined Display Name and Nicename 47 62 48 63 = 2.7.2 = 49 Fixed another user role issue 64 Bug Fixes 65 * Another user role issue 50 66 51 67 = 2.7.1 = 52 Fixed an issue where the plugin was setting the user's role to null. 68 Bug Fixes 69 * Issue where the plugin was setting the user's role to null 53 70 54 71 = 2.7 = 55 Fixed the issue of not adding new users to all blogs when user already on Network. 72 Bug Fixes 73 * Issue of not adding new users to all blogs when user already on Network 56 74 57 75 = 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. 76 Enhancements 77 * If option chosen to add new users and a multi-site, then users are added to each and every blog in network 59 78 60 79 = 2.5 = 61 80 Bug Fixes 62 - Blank Admin Bar appearing when not logged in.81 * Blank Admin Bar appearing when not logged in 63 82 64 83 = 2.4 = 65 84 Bug Fixes 66 - Some users not seeing the Admin Bar after logging in.85 * Some users not seeing the Admin Bar after logging in 67 86 68 87 = 2.3 = 69 Security Fixes .88 Security Fixes 70 89 71 90 = 2.2 = 72 Do not update user info if header is blank. 91 Bug Fixes 92 * Do not update user info if header is blank 73 93 74 94 = 2.1 = 75 Multi-Site Support. 95 Enhancements 96 * Multi-Site Support 76 97 77 98 = 2.0 = 78 99 MAJOR 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 82 103 83 104 = 1.0 = 84 This is the first release .105 This is the first release
Note: See TracChangeset
for help on using the changeset viewer.