From: <axe...@us...> - 2009-11-25 16:29:02
|
Revision: 99 http://wpmu-ldap.svn.sourceforge.net/wpmu-ldap/?rev=99&view=rev Author: axelseaa Date: 2009-11-25 15:52:12 +0000 (Wed, 25 Nov 2009) Log Message: ----------- added ability for add user option to be disabled for non siteadmin users Modified Paths: -------------- trunk/ldap/lib/wpmu_ldap_adduser.functions.php trunk/ldap/lib/wpmu_ldap_admin.functions.php Modified: trunk/ldap/lib/wpmu_ldap_adduser.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap_adduser.functions.php 2009-10-05 15:52:11 UTC (rev 98) +++ trunk/ldap/lib/wpmu_ldap_adduser.functions.php 2009-11-25 15:52:12 UTC (rev 99) @@ -7,8 +7,14 @@ if (function_exists('add_submenu_page')) { // does not use add_options_page, because it is site-wide configuration, // not blog-specific config, but side-wide - add_submenu_page('wpmu-admin.php', 'LDAP Add User', 'Add User', 9, 'wpmu_ldap_adduser.functions.php', 'ldapAddUserOptions'); - add_submenu_page('users.php', 'LDAP Add User', 'Add User', 9, 'wpmu_ldap_adduser.functions.php', 'ldapAddUserOptions'); + $ldapAddUser = get_site_option('ldapAddUser'); + $ldapBulkAdd = get_site_option('ldapBulkAdd'); + if (is_site_admin() || + ($ldapAddUser == 'enabled' || empty($ldapAddUser)) || + ($ldapBulkAdd && is_admin($current_user->username))) { + add_submenu_page('wpmu-admin.php', 'LDAP Add User', 'Add User', 9, 'wpmu_ldap_adduser.functions.php', 'ldapAddUserOptions'); + add_submenu_page('users.php', 'LDAP Add User', 'Add User', 9, 'wpmu_ldap_adduser.functions.php', 'ldapAddUserOptions'); + } } } @@ -174,6 +180,11 @@ ?> <div class="wrap"> + <?php + // Add User + $ldapAddUser = get_site_option('ldapAddUser'); + if (is_site_admin() || ($ldapAddUser == 'enabled' || empty($ldapAddUser))) { + ?> <h2><?php _e('Add User') ?></h2> <?php $ldapCreateLocalUser = get_site_option('ldapCreateLocalUser'); @@ -206,7 +217,7 @@ </p> </fieldset> </form> - + <?php } ?> <!-- Bulk Add User --> <?php $ldapBulkAdd = get_site_option('ldapBulkAdd'); Modified: trunk/ldap/lib/wpmu_ldap_admin.functions.php =================================================================== --- trunk/ldap/lib/wpmu_ldap_admin.functions.php 2009-10-05 15:52:11 UTC (rev 98) +++ trunk/ldap/lib/wpmu_ldap_admin.functions.php 2009-11-25 15:52:12 UTC (rev 99) @@ -144,6 +144,7 @@ $ret['ldapfixmetafor15'] = get_site_option('ldapfixmetafor15'); $ret['ldapfixdisplayname'] = get_site_option('ldapfixdisplayname'); $ret['ldapBulkAdd'] = get_site_option('ldapBulkAdd'); + $ret['ldapAddUser'] = get_site_option('ldapAddUser'); $ret['ldapPublicDisplayName'] = get_site_option('ldapPublicDisplayName'); $ret['ldapAttributeMail'] = get_site_option('ldapAttributeMail',LDAP_DEFAULT_ATTRIBUTE_MAIL); $ret['ldapAttributeGivenname'] = get_site_option('ldapAttributeGivenname',LDAP_DEFAULT_ATTRIBUTE_GIVENNAME); @@ -180,6 +181,9 @@ if($ldapBulkAdd) $tBulkAdd = "checked='checked'"; else $fBulkAdd = "checked='checked'"; + if($ldapAddUser == 'enabled' || empty($ldapAddUser)) $tAddUser = "checked='checked'"; + else $fAddUser = "checked='checked'"; + if($ldapDisableSignup) $tDisableSignup = "checked='checked'"; else $fDisableSignup = "checked='checked'"; @@ -248,6 +252,15 @@ </td> </tr> <tr valign="top"> + <th scope="row">Allow blog admins to add users?</th> + <td> + <input type='radio' name='ldapAddUser' id='adduseryes' value='enabled' <?php echo $tAddUser; ?>/> <label for="adduseryes">Yes</label> + <input type='radio' name='ldapAddUser' id='adduserno' value='disabled' <?php echo $fAddUser; ?>/> <label for="adduserno">No</label> + <br/> + This option specifies whether or not the individual blog admins are able to add users. + </td> + </tr> + <tr valign="top"> <th scope="row">Allow blog admins to bulk add?</th> <td> <input type='radio' name='ldapBulkAdd' id='bulkaddyes' value='1' <?php echo $tBulkAdd; ?>/> <label for="bulkaddyes">Yes</label> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |