Changeset 4092 for extensions/event_cats/include
- Timestamp:
- Oct 23, 2009, 1:48:54 AM (15 years ago)
- Location:
- extensions/event_cats/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/include/ec_conf.inc.php
r4027 r4092 33 33 _ the number of digits when creating a new code automatically 34 34 ($ec_conf[2] <=> read_ec_conf('auto_code_dg_nb')) ; 35 _ whether the "how to" banner has already been displayed or not 36 ($ec_conf[3] <=> read_ec_conf('howto')) ; 35 37 _ what to do in case an unknown code is used with "autolog" parameter 36 ($ec_conf[ 3] <=> read_ec_conf('unknown_code')) :38 ($ec_conf[4] <=> read_ec_conf('unknown_code')) : 37 39 0 : nothing ("goto" home page, index.php (not logged in of course)) ; 38 40 1 : redirected to "access denied" page ; 39 41 2 : redirected to an Additional Page precised below. 40 42 _ the id of the Additional Page which must be used in case of usage of an 41 unknow code ($ec_conf[ 4] <=> read_ec_conf('unknown_code_ap_id')).43 unknow code ($ec_conf[5] <=> read_ec_conf('unknown_code_ap_id')). 42 44 *****************************************************************************/ 43 45 … … 53 55 } 54 56 else { 55 $ec_conf = explode(',' , '0,1,10,0,0 ');57 $ec_conf = explode(',' , '0,1,10,0,0,0'); 56 58 change_ec_conf('activated', 0); 57 59 } … … 80 82 $ec_conf[2] = $v; 81 83 break; 82 case ' unknown_code':84 case 'howto': 83 85 $ec_conf[3] = $v; 84 86 break; 87 case 'unknown_code': 88 $ec_conf[4] = $v; 89 break; 85 90 case 'unknown_code_ap_id': 86 $ec_conf[ 4] = $v;91 $ec_conf[5] = $v; 87 92 break; 88 93 default: return false; … … 110 115 case 'dup_allow' : return $ec_conf[1]; 111 116 case 'auto_code_dg_nb' : return $ec_conf[2]; 112 case 'unknown_code' : return $ec_conf[3]; 113 case 'unknown_code_ap_id': return $ec_conf[4]; 117 case 'howto' : return $ec_conf[3]; 118 case 'unknown_code' : return $ec_conf[4]; 119 case 'unknown_code_ap_id': return $ec_conf[5]; 114 120 default : return false; 115 121 } -
extensions/event_cats/include/evntcats_funcs.inc.php
r4058 r4092 121 121 * (no return value) 122 122 */ 123 function ec_inpect($checked_item, $new_action, 124 $check_ec_nok = false, $check_forced = false) { 123 function ec_inpect($checked_item, $new_action, $check_ec_nok = true) { 125 124 global $ec_lists; 126 125 $first = array(); 127 126 $to_correct = array(); 128 127 129 // $to_correct is needed because following code would not work anywhere :128 // $to_correct is needed cause following code would not work everywhere : 130 129 /* 131 130 foreach ($table as $value) { … … 154 153 if ( 155 154 $first[$ec_current_code] != $ec_entry[$checked_item] or 156 ($ check_forcedand $ec_entry[$checked_item] == 'true')155 ($new_action == '' and $ec_entry[$checked_item] == 'true') 157 156 ) { 158 157 $to_correct[$ec_current_code] = true; // value not used in fact … … 166 165 foreach ($ec_lists['ec_table'] as &$ec_entry) { // & is needed here 167 166 if (isset($to_correct[$ec_entry['code']])) { 168 $ec_entry['action'] = ($check_forced) ? 169 $ec_entry['action'].$new_action : $new_action; 167 if ($new_action == '') { 168 if ( 169 pwg_query(' 170 UPDATE `'.EVNTCATS_TABLE.'` 171 SET `forced` = "false" 172 WHERE `id` = '.$ec_entry['id'] 173 ) == null 174 ) die('Could not fix a "_f_pb"'); 175 $ec_entry['forced'] = 'false'; 176 } 177 else $ec_entry['action'] = $new_action; 170 178 } 171 179 } … … 173 181 174 182 // Multiple action params for a single code check 175 ec_inpect('action', 'ec_nok_action_pb' , true);183 ec_inpect('action', 'ec_nok_action_pb'); 176 184 177 185 // Multiple user_ids for a single code check 178 ec_inpect('user_id', 'ec_nok_userid_pb' );186 ec_inpect('user_id', 'ec_nok_userid_pb', false); 179 187 180 188 // Multiple "forced" params for a single code check 181 ec_inpect('forced', ' _f_pb', true, true);189 ec_inpect('forced', ''); 182 190 183 191 // User id and associated page validities checks … … 308 316 */ 309 317 function ec_create_entry_OK() { 318 global $page; 319 $page['errors'][] = 'Y\'a p\'têt\' ben eu une erreur...'; 310 320 return false; 311 321 } … … 322 332 */ 323 333 function ec_duplicate_entry_OK() { 334 global $page; 335 $page['errors'][] = 'Y\'a sûrement eu une erreur...'; 324 336 return false; 325 337 } … … 336 348 */ 337 349 function ec_modify_entry_OK() { 350 global $page; 351 $page['errors'][] = 'Y\'a pas eu une erreur ?...'; 338 352 return false; 339 353 }
Note: See TracChangeset
for help on using the changeset viewer.