From: <axe...@us...> - 2011-03-23 11:48:56
|
Revision: 121 http://wpmu-ldap.svn.sourceforge.net/wpmu-ldap/?rev=121&view=rev Author: axelseaa Date: 2011-03-23 11:48:50 +0000 (Wed, 23 Mar 2011) Log Message: ----------- fixed is_super_admin calls 3234877 - fixed ldap/local role setting not appearing on user profile page Modified Paths: -------------- trunk/ldap/lib/wpmu_ldap.functions.php trunk/ldap/lib/wpmu_ldap_adduser.functions.php trunk/ldap/lib/wpmu_ldap_admin.functions.php trunk/ldap_auth.php Modified: trunk/ldap/lib/wpmu_ldap.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap.functions.php 2011-02-25 05:41:17 UTC (rev 120) +++ trunk/ldap/lib/wpmu_ldap.functions.php 2011-03-23 11:48:50 UTC (rev 121) @@ -193,7 +193,7 @@ } // Handle blog removal for various reasons - if(is_super_admin($username) === false) { + if(is_super_admin($loginObj->ID) === false) { if ($primary_blog = get_usermeta($loginObj->ID, "primary_blog")) { $details = get_blog_details( $primary_blog ); if( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) { Modified: trunk/ldap/lib/wpmu_ldap_adduser.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap_adduser.functions.php 2011-02-25 05:41:17 UTC (rev 120) +++ trunk/ldap/lib/wpmu_ldap_adduser.functions.php 2011-03-23 11:48:50 UTC (rev 121) @@ -107,7 +107,7 @@ if ($result[0]) { wp_new_user_notification($result[1]); ldapAddUserResult(array('updated' => 'true','action' => 'add','username' => $username)); - } elseif ($ldapCreateLocalUser || is_super_admin($current_user->username)) { + } elseif ($ldapCreateLocalUser || is_super_admin()) { ?> <div id='message' class='updated'> <form method='post'> @@ -135,7 +135,7 @@ } elseif ($_POST['addUserBulk']) { // Check Access $ldapBulkAdd = get_site_option('ldapBulkAdd'); - if (is_super_admin($current_user->username) || ($ldapBulkAdd && is_admin($current_user->username))) { + if (is_super_admin() || ($ldapBulkAdd && is_admin())) { $user = $_POST['user']; $usernames = array(); if ( !empty($user['bulk_username']) ) { @@ -177,7 +177,7 @@ } elseif ($_POST['addLocalUser']) { check_admin_referer('add-local-user'); $ldapCreateLocalUser = get_site_option('ldapCreateLocalUser'); - if ($ldapCreateLocalUser || is_super_admin($current_user->username)) { + if ($ldapCreateLocalUser || is_super_admin()) { $user = $_POST['user']; if ( empty($user['username']) && empty($user['email']) ) { wp_die( __("<p>Missing username and email.</p>") ); @@ -251,7 +251,7 @@ <!-- Bulk Add User --> <?php $ldapBulkAdd = get_site_option('ldapBulkAdd'); - if (is_super_admin($current_user->username) || ($ldapBulkAdd && is_admin($current_user->username))) { + if (is_super_admin() || ($ldapBulkAdd && is_admin())) { ?> <h2><?php _e('Add Bulk Users') ?></h2> <p>Using the below fields, you can bulk add LDAP users. Separate multiple users by a new line. Local user creation is not available in bulk. The auto create blog for new users function will be disabled for bulk adds.</p> Modified: trunk/ldap/lib/wpmu_ldap_admin.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap_admin.functions.php 2011-02-25 05:41:17 UTC (rev 120) +++ trunk/ldap/lib/wpmu_ldap_admin.functions.php 2011-03-23 11:48:50 UTC (rev 121) @@ -676,10 +676,7 @@ * @return null - does not actively return a value */ function ldap_addmenu() { - $objCurrUser = wp_get_current_user(); - $objUser = wp_cache_get($objCurrUser->id, 'users'); - - if (function_exists('add_submenu_page') && is_super_admin($objUser->user_login)) { + if (function_exists('add_submenu_page') && is_super_admin()) { // does not use add_options_page, because it is site-wide configuration, // not blog-specific config, but side-wide add_submenu_page('settings.php', 'LDAP Options', 'LDAP Options', '', basename(__FILE__), 'ldapOptionsPanel'); @@ -828,7 +825,7 @@ <tr> <th><?php _e('Account Authentication Type'); ?></th> <td class="regular-text"> - <?php if (is_super_admin($current_user->username) && $user_id > 1) { ?> + <?php if (is_super_admin() && $user_id > 1) { ?> <select name="ldapAccountType"> <option<?php if ($ldap_login == 'true') echo ' selected="selected"'; ?> value="LDAP"><?php _e('LDAP'); ?></option> <option<?php if ($ldap_login != 'true') echo ' selected="selected"'; ?> value="Local"><?php _e('Local'); ?></option> @@ -857,7 +854,7 @@ function wpmuUserFormLdapOptionUpdate() { global $user_id, $current_user; - if ($user_id == 1 || !is_super_admin($current_user->username)) + if ($user_id == 1 || !is_super_admin()) return; if ($_POST['ldapAccountType'] == 'LDAP') Modified: trunk/ldap_auth.php =================================================================== --- trunk/ldap_auth.php 2011-02-25 05:41:17 UTC (rev 120) +++ trunk/ldap_auth.php 2011-03-23 11:48:50 UTC (rev 121) @@ -3,7 +3,7 @@ Plugin Name: LDAP Authentication Plug-in Plugin URI: http://wpmuldap.tuxdocs.net Description: A plugin to override the core Wordpress MU authentication method so as to use an LDAP server for authentication. -Version: 3.1 +Version: 3.1.1 Author: Aaron Axelsen (http://www.frozenpc.net) Sean Wedig (http://www.thecodelife.net) Dexter Arver @@ -37,6 +37,8 @@ // Add radio buttons for switching individual users between LDAP accounts and non-LDAP accounts add_action('edit_user_profile', 'wpmuUserFormLdapOption'); add_action('edit_user_profile_update', 'wpmuUserFormLdapOptionUpdate'); + add_action('show_user_profile', 'wpmuUserFormLdapOption'); + add_action('personal_options_update', 'wpmuUserFormLdapOptionUpdate'); // *** End Admin Config Functions *** // This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |