- Timestamp:
- Apr 15, 2010, 4:32:30 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit/wp-content/plugins/xpressme
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php
r534 r578 47 47 } 48 48 49 $is_multiblog = xpress_is_multiblog(); 50 if (defined('BLOG_ID_CURRENT_SITE')){ 51 $root_blog_id = BLOG_ID_CURRENT_SITE; 52 } else { 53 $root_blog_id = 1; 54 } 55 49 56 $ans_array = array(); 50 57 foreach($blog_id_list as $blog_id){ … … 64 71 //get maximum role 65 72 foreach($user_groups as $user_group){ 66 if ($user_group->group_type == 'Admin'){ 73 $is_blog_root = (!$is_multiblog || ($user_group->blog_id == $root_blog_id)); 74 if ($user_group->group_type == 'Admin' && $is_blog_root){ 67 75 $ans['capabillities'] = 'administrator'; 68 76 if ($user_group->groupid =1){ -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
r572 r578 37 37 var $theme_select; 38 38 var $is_block_error_display; 39 var $admin_set_all_blog_admin; 39 40 //constructor 40 41 function XPressME_Class() … … 85 86 $this->theme_select = 'use_wordpress_select'; 86 87 $this->is_block_error_display = true; 88 $this->admin_set_all_blog_admin = false; 87 89 } 88 90 … … 107 109 { 108 110 global $xoops_config; 109 if($xoops_config->is_wpmu) $this->is_use_xoops_upload_path = false;110 111 111 112 $write_options = array ( … … 143 144 'is_dashboard_forum_disp' => $this->is_dashboard_forum_disp, 144 145 'theme_select' => $this->theme_select, 145 'is_block_error_display' => $this->is_block_error_display 146 'is_block_error_display' => $this->is_block_error_display, 147 'admin_set_all_blog_admin' => $this->admin_set_all_blog_admin 146 148 ); 147 149 if ($mode == 'add_new') { … … 152 154 } 153 155 156 function get_current_setting_option($option_name) 157 { 158 if (empty($option_name)) return null; 159 if (defined('BLOG_ID_CURRENT_SITE')){ 160 $id = BLOG_ID_CURRENT_SITE; 161 } else { 162 $id = 1; 163 } 164 if (xpress_is_multiblog() && !xpress_is_multiblog_root()){ 165 switch_to_blog($id); 166 $options = get_option('xpressme_option'); 167 restore_current_blog(); 168 } else { 169 $options = get_option('xpressme_option'); 170 } 171 $ret = $options[$option_name]; 172 return $ret; 173 } 174 175 function admin_select_groupe_role() { 176 if (xpress_is_multiblog_root()) return false; 177 return !$this->get_current_setting_option('admin_set_all_blog_admin'); 178 } 179 154 180 function GroupeRoleRead() { 155 181 global $xoops_db, $blog_id; … … 172 198 173 199 if (empty($blog_id)) { 174 if (defined( BLOG_ID_CURRENT_SITE)){200 if (defined('BLOG_ID_CURRENT_SITE')){ 175 201 $blog_id = BLOG_ID_CURRENT_SITE; 176 202 } else { … … 179 205 } 180 206 207 if ( xpress_is_multiblog() && $blog_id == BLOG_ID_CURRENT_SITE){ 208 $set_blog_admin = true; 209 } else { 210 $set_blog_admin = !$this->admin_select_groupe_role(); 211 } 212 181 213 $module_id = get_xpress_modid(); 182 214 … … 222 254 if ($groupe_role->groupid == $groupe->groupid){ 223 255 $role = $groupe_role->role; 224 if ($group_type == 'module_admin' ) $role = 'administrator';256 if ($group_type == 'module_admin' && $set_blog_admin) $role = 'administrator'; 225 257 if ($group_type == 'module_inhibit') $role = ''; 226 258 $edit_sql = "UPDATE $group_role_table SET group_type='$group_type',role='$role' WHERE groupid = $groupe->groupid AND blog_id = $blog_id"; … … 515 547 return $form; 516 548 } 517 549 518 550 function groupe_role_option($disible=false){ 519 551 global $wp_roles , $xoops_db; … … 524 556 $form .= '<td>'; 525 557 $form .= "<table>\n"; 558 $form .= "<tr>\n"; 559 560 if (xpress_is_multiblog_root()){ 561 $form .= "<td>" . __('XOOPS administrators role is set as all blog administrators.','xpressme') . "</td>\n"; 562 $form .= "<td>\n"; 563 $form .= $this->yes_no_radio_option_sub('admin_set_all_blog_admin', 564 __('YES','xpressme'), 565 __('NO','xpressme') 566 ); 567 $form .= "</td>\n"; 568 $form .= "</tr>\n"; 569 } 526 570 $form .= '<tr><td>' . __('XOOPS Groupe', 'xpressme') . '</td><td>' . __('WordPress Role', 'xpressme') . '</td><td>' . __('Role is set at each login', 'xpressme') . "</td></tr>\n"; 527 571 foreach ($this->groupe_role as $groupe) { … … 555 599 $selected = ''; 556 600 } 557 if ($groupe->group_type != 'module_admin'|| !empty($selected)) { 601 602 $admin_select_role = $this->admin_select_groupe_role(); 603 604 if ($admin_select_role || $groupe->group_type != 'module_admin'|| !empty($selected)) { 558 605 $role_list .= "<option value=\"{$role}\"{$selected}>{$name}</option>\n"; 559 606 } 560 } 561 if ($groupe->group_type != 'module_admin') { 607 if (!$admin_select_role && $groupe->group_type == 'module_admin'){ 608 if ($role == 'administrator'){ 609 $role_list .= "<option value=\"{$role}\" selected=\"selected\">{$name}</option>\n"; 610 } 611 } 612 } 613 614 if ($this->admin_select_groupe_role() ||$groupe->group_type != 'module_admin') { 562 615 if ( $group_has_role ) { 563 616 $role_list .= '<option value="default">' . __('Default Role of WordPress', 'xpressme') . "</option>\n";
Note: See TracChangeset
for help on using the changeset viewer.