Changeset 4371 for extensions/event_cats/main.inc.php
- Timestamp:
- Nov 26, 2009, 11:08:34 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/main.inc.php
r4342 r4371 84 84 function ec_popup_help_content($popup_help_content, $page) { 85 85 return ( 86 $help_content = (is_admin() and in_array($page, array( 87 'ec_help_new', 'ec_help_mod', 'ec_help_ent', 'ec_help_cfg', 'ec_help_dup' 88 ))) ? 86 $help_content = (is_admin() and $page = '') ? 89 87 load_language($page.'.html', EVNTCATS_PATH, array('return' => true)) : false 90 88 ) ? $popup_help_content.$help_content : $popup_help_content; … … 178 176 else { 179 177 if ( 180 read_ec_conf('unknown_code') == 2and178 read_ec_conf('unknown_code') == '2' and 181 179 array_key_exists( 182 180 read_ec_conf('unknown_code_ap_id'), $ec_lists['add_pages'] … … 188 186 ); 189 187 } 190 elseif (read_ec_conf('unknown_code') == 1or191 read_ec_conf('unknown_code') == 2) {188 elseif (read_ec_conf('unknown_code') == '1' or 189 read_ec_conf('unknown_code') == '2') { 192 190 access_denied(); 193 191 } … … 211 209 add_event_handler('register_user', 'assign_perm_for_new_user'); 212 210 213 function assign_perm_for_new_user($new_user) 214 { 211 function assign_perm_for_new_user($new_user) { 215 212 global $user; 216 213 217 if (!is_a_guest() and !is_admin()) 218 { 214 if (!is_a_guest() and !is_admin()) if ( 215 read_ec_conf('dup_allow') == '1' or ( 216 read_ec_conf('dup_allow') == '2' and 217 dup_allowed($user['id']) 218 ) 219 ) { 219 220 // User access 220 $query = 'SELECT cat_id FROM '.USER_ACCESS_TABLE.' WHERE user_id = '.$user['id'].';'; 221 $result = pwg_query($query); 221 $result = pwg_query(" 222 SELECT `cat_id` 223 FROM `".USER_ACCESS_TABLE."` 224 WHERE `user_id` = ".$user['id']."; 225 "); 222 226 $insert = array(); 223 227 while ($row = mysql_fetch_assoc($result)) 224 { 225 $insert[] = '('.$new_user['id'].','.$row['cat_id'].')'; 226 } 227 if (!empty($insert)) 228 { 229 pwg_query('INSERT INTO '.USER_ACCESS_TABLE.' VALUES '.implode(',', $insert).';'); 230 } 228 $insert[] = "(".$new_user['id'].",".$row['cat_id'].")"; 229 if (!empty($insert)) pwg_query(" 230 INSERT INTO `".USER_ACCESS_TABLE."` 231 VALUES ".implode(',', $insert)."; 232 "); 231 233 232 234 // User groups 233 $query = 'SELECT group_id FROM '.USER_GROUP_TABLE.' WHERE user_id = '.$user['id'].';'; 234 $result = pwg_query($query); 235 $result = pwg_query(" 236 SELECT `group_id` 237 FROM `".USER_GROUP_TABLE."` 238 WHERE `user_id` = ".$user['id']."; 239 "); 235 240 $insert = array(); 236 241 while ($row = mysql_fetch_assoc($result)) 237 { 238 $insert[] = '('.$new_user['id'].','.$row['group_id'].')'; 239 } 240 if (!empty($insert)) 241 { 242 pwg_query('INSERT INTO '.USER_GROUP_TABLE.' VALUES '.implode(',', $insert).';'); 243 } 242 $insert[] = "(".$new_user['id'].",".$row['group_id'].")"; 243 if (!empty($insert)) pwg_query(" 244 INSERT INTO `".USER_GROUP_TABLE."` 245 VALUES ".implode(',', $insert)."; 246 "); 244 247 245 248 // User infos 246 $query = 'SELECT level FROM '.USER_INFOS_TABLE.' WHERE user_id = '.$user['id'].';'; 247 $result = pwg_query($query); 249 $result = pwg_query(" 250 SELECT `level` 251 FROM `".USER_INFOS_TABLE."` 252 WHERE `user_id` = ".$user['id']."; 253 "); 248 254 $insert = array(); 249 255 while ($row = mysql_fetch_assoc($result)) 250 { 251 $insert[] = '('.$new_user['id'].','.$row['level'].')'; 252 } 253 if (!empty($insert)) 254 { 255 $query = 'UPDATE '.USER_INFOS_TABLE.' SET level = '.$user['level'].' WHERE user_id = '.$new_user['id'].';'; 256 pwg_query($query); 257 } 256 $insert[] = "(".$new_user['id'].",".$row['level'].")"; 257 if (!empty($insert)) pwg_query(" 258 UPDATE `".USER_INFOS_TABLE."` 259 SET `level` = ".$user['level']." 260 WHERE `user_id` = ".$new_user['id']."; 261 "); 258 262 } 259 263 }
Note: See TracChangeset
for help on using the changeset viewer.