- Timestamp:
- Mar 10, 2010, 4:47:23 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
r531 r534 156 156 157 157 function GroupeRoleRead() { 158 global $xoops_db, $blog_id; 159 160 if (empty($blog_id)) $blog_id = 1; 161 $table = get_wp_prefix() . 'group_role'; 162 163 $sql= "SELECT * FROM $table WHERE blog_id = $blog_id ORDER BY groupid"; 164 $this->groupe_role = $xoops_db->get_results($sql); 165 } 166 167 function GroupeRoleCheck($blog_id = 1) { 158 168 global $xoops_db; 159 169 160 $table = get_wp_prefix() . 'group_role'; 161 162 $sql= "SELECT * FROM $table"; 163 $this->groupe_role = $xoops_db->get_results($sql); 164 } 165 166 function GroupeRoleCheck() { 167 global $xoops_db; 170 if (empty($blog_id)) $blog_id = 1; 168 171 169 172 $module_id = get_xpress_modid(); … … 173 176 $xoops_group_permission_table = get_xoops_prefix() . 'group_permission'; 174 177 175 176 177 178 $sql = "SELECT * FROM $xoops_group_permission_table WHERE gperm_itemid = $module_id"; 178 179 $gperms = $xoops_db->get_results($sql); 179 180 180 $sql = "SELECT * FROM $xoops_group_table WHERE group_type <> 'Anonymous' ";181 $sql = "SELECT * FROM $xoops_group_table WHERE group_type <> 'Anonymous' ORDER BY groupid"; 181 182 $groupes = $xoops_db->get_results($sql); 182 183 … … 194 195 } 195 196 196 $sql = "SELECT * FROM $group_role_table ";197 $sql = "SELECT * FROM $group_role_table WHERE blog_id = $blog_id"; 197 198 $groupes_role = $xoops_db->get_results($sql); 198 199 … … 214 215 if ($group_type == 'module_admin') $role = 'administrator'; 215 216 if ($group_type == 'module_inhibit') $role = ''; 216 $edit_sql = "UPDATE $group_role_table SET group_type='$group_type',role='$role' WHERE groupid = $groupe->groupid ";217 $edit_sql = "UPDATE $group_role_table SET group_type='$group_type',role='$role' WHERE groupid = $groupe->groupid AND blog_id = $blog_id"; 217 218 $found = true; 218 219 break; … … 224 225 225 226 $edit_sql = "INSERT INTO $group_role_table "; 226 $edit_sql .= "(groupid , name , description , group_type , role , login_all) ";227 $edit_sql .= "(groupid , blog_id , name , description , group_type , role , login_all) "; 227 228 $edit_sql .= "VALUES ("; 228 229 $edit_sql .= $groupe->groupid . ', '; 230 $edit_sql .= $blog_id . ', '; 229 231 $edit_sql .= "'" . $groupe->name . "' , "; 230 232 $edit_sql .= "'" . $groupe->description . "' , "; 231 $edit_sql .= "'" . $ parmission. "' , ";233 $edit_sql .= "'" . $group_type . "' , "; 232 234 $edit_sql .= "'" . $role . "' , '"; 233 235 $edit_sql .= $login_all . "')"; … … 252 254 function ReadPostData($post_data = null) 253 255 { 254 global $xoops_db; 255 256 global $xoops_db, $blog_id; 257 258 if (empty($blog_id)) $blog_id = 1; 256 259 foreach ( (array) $post_data as $index_key => $value ){ 257 260 if (preg_match('/^ch_/',$index_key)){ // case ch_ … … 322 325 $update_sql .= "role = '$role' , "; 323 326 $update_sql .= "login_all = $login_all "; 324 $update_sql .= "WHERE (groupid = '$groupe->groupid' )";327 $update_sql .= "WHERE (groupid = '$groupe->groupid' AND blog_id = $blog_id)"; 325 328 $xoops_db->query($update_sql); 326 329 }
Note: See TracChangeset
for help on using the changeset viewer.