Changeset 4179 for extensions
- Timestamp:
- Nov 4, 2009, 12:28:23 AM (14 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/template/autolog_new.js
r4178 r4179 436 436 ].label 437 437 )[0]; 438 ec_new_user_text = ec_new_user_text.substr(0, 32);438 ec_new_user_text = ec_new_user_text.substr(0, 50); 439 439 t2 = ec_new_user_text; 440 440 break; … … 449 449 else */ ec_new_user_text = ec_reg_cat3.exec(ec_cat_sel)[1]; 450 450 ec_new_user_text = ec_new_user_text.replace(/\s/g, '_'); 451 ec_new_user_text = ec_new_user_text.substr(0, 32);451 ec_new_user_text = ec_new_user_text.substr(0, 50); 452 452 t2 = ec_new_user_text; 453 453 if (ec_selected_action == 'ec_input_action_img') { -
extensions/event_cats/admin/template/autolog_new.tpl
r4173 r4179 153 153 <ul><li> 154 154 <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_name'|@translate}<br> 155 <input type = "text" name = " ec_in_up_usr_txt" id = "ec_in_up_usr_txt_id" maxlength = "32"155 <input type = "text" name = "login" id = "ec_in_up_usr_txt_id" maxlength = "50" 156 156 size = "20" onblur = "ec_new_user_text = this.value; ec_check_user_text();" 157 157 /> 158 158 </label> 159 159 <label class = "ec_block" onclick = "return ec_mark_user('ec_sel_user_new');">{'ec_new_user_pswd'|@translate}<br> 160 <input type = "text" name = " ec_in_up_psd_txt" id = "ec_in_up_psd_txt_id" maxlength = "32"160 <input type = "text" name = "password" id = "ec_in_up_psd_txt_id" maxlength = "32" 161 161 size = "20" onblur = "ec_new_psd_text = this.value; ec_check_pwd_text();" 162 162 /> -
extensions/event_cats/include/evntcats_admin_funcs.inc.php
r4178 r4179 134 134 global $page, $ec_lists; 135 135 136 /*137 138 (139 [ec_act1] => create140 [ec_entry_sel] => -1141 [ec_sel_code] => new142 [ec_in_up_auto_code_length] => 10143 [ec_in_up_code] => 94q0V1067D144 [ec_sel_user] => new145 [ec_in_up_usr_txt] => san_gimi146 [ec_in_up_psd_txt] => 7Mv8QxZV147 [ec_in_up_newgroup] => on148 [ec_in_up_grp_txt] => EC_san_gimi149 [ec_input_action] => cat150 [ec_in_up_cat] => 6151 [ec_in_up_img] =>152 )153 154 (155 [ec_act1] => create156 [ec_entry_sel] => -1157 [ec_sel_code] => new158 [ec_in_up_auto_code_length] => 10159 [ec_in_up_code] => NU1pah0qVJ160 [ec_in_up_usr_txt] =>161 [ec_in_up_psd_txt] =>162 [ec_in_up_grp_txt] =>163 [ec_sel_user] => old164 [ec_in_up_usr_list] => 9165 [ec_input_action] => cat166 [ec_in_up_cat] => 6167 [ec_in_up_img] =>168 )169 170 */171 136 // $_POST validity checks : creation prevented in case of bad arguments 172 /*if (137 if ( 173 138 !isset($_POST['ec_in_up_code']) or 174 139 !ereg('^[a-zA-Z0-9_-]{4,32}$', $_POST['ec_in_up_code']) … … 188 153 if ($_POST['ec_sel_user'] == 'new') { 189 154 if ( 190 !isset($_POST[' ec_in_up_usr_txt']) or191 $_POST[' ec_in_up_usr_txt'] == ''192 ) return ec_end1(' ec_in_up_usr_txt', 'ec_bad_argument1');193 $t1 = (in_array($_POST['ec_in_up_usr_txt'], $ec_lists['user_ids']));194 if ($t1) return ec_end1('ec_in_up_usr_txt', 'ec_bad_argument3');155 !isset($_POST['login']) or 156 $_POST['login'] == '' 157 ) return ec_end1('login', 'ec_bad_argument1'); 158 if (in_array($_POST['login'], $ec_lists['user_ids'])) 159 return ec_end1('login', 'ec_bad_argument3'); 195 160 } 196 161 else { 197 162 if (!isset($_POST['ec_in_up_usr_list'])) 198 return ec_end1(' ec_in_up_usr_txt', 'ec_bad_argument1');163 return ec_end1('login', 'ec_bad_argument1'); 199 164 $ec_user_id = $_POST['ec_in_up_usr_list']; 200 $t1 = (array_key_exists($ec_user_id, $ec_lists['user_ids']));201 if (!$t1)return ec_end1('ec_in_up_usr_list', 'ec_bad_argument6');165 if (!array_key_exists($ec_user_id, $ec_lists['user_ids'])) 166 return ec_end1('ec_in_up_usr_list', 'ec_bad_argument6'); 202 167 } 203 168 … … 207 172 // User creation, as generic 208 173 $page['errors'] = register_user( 209 $_POST[' ec_in_up_usr_txt'], $_POST['ec_in_up_psd_txt'], '', false174 $_POST['login'], $_POST['password'], '', false 210 175 ); 211 176 if ( 212 177 count($page['errors']) != 0 or 213 !($ec_user_id = get_userid($_POST[' ec_in_up_usr_txt']))178 !($ec_user_id = get_userid($_POST['login'])) 214 179 ) { 215 180 array_unshift($page['errors'], l10n('ec_user_create_pb')); … … 217 182 } 218 183 else 219 $page['infos'][] = l10n('ec_user_create_OK').$_POST[' ec_in_up_usr_txt'];184 $page['infos'][] = l10n('ec_user_create_OK').$_POST['login']; 220 185 if ( 221 186 pwg_query(" … … 225 190 ") !== false 226 191 ) 227 $page['infos'][] = l10n('ec_user_generic_OK').$_POST[' ec_in_up_usr_txt'];192 $page['infos'][] = l10n('ec_user_generic_OK').$_POST['login']; 228 193 else 229 $page['errors'][] =l10n('ec_user_generic_pb').$_POST[' ec_in_up_usr_txt'];194 $page['errors'][] =l10n('ec_user_generic_pb').$_POST['login']; 230 195 231 196 // New group creation if required, … … 256 221 if ( 257 222 pwg_query(" 258 INSERT INTO `".USER_GROUP_TABLE."` (`user_id 259 VALUES ('".$ec_user_id."', '".$t3[ 'id']."');223 INSERT INTO `".USER_GROUP_TABLE."` (`user_id`, `group_id`) 224 VALUES ('".$ec_user_id."', '".$t3[0]."'); 260 225 ") === false 261 ) $page['errors'][] = ;226 ) $page['errors'][] = 262 227 l10n('ec_group_create_pb').' (2) ; '. 263 228 'MySQL error '.mysql_errno().', "'.mysql_error().'"'; 264 229 else 265 230 $page['infos'][] = 266 $_POST[' ec_in_up_usr_txt'].231 $_POST['login']. 267 232 l10n('ec_group_create_OK2'). 268 233 $_POST['ec_in_up_grp_txt'] … … 271 236 } 272 237 273 // Creation of new line in DB event_cats table with all arguments238 // Preparation of $arg1, $arg2 and $forced 274 239 $arg1 = ''; $arg2 = ''; 275 240 if (isset($_POST['ec_input_action'])) switch ($_POST['ec_input_action']) { … … 282 247 case 'img': // Image 283 248 if (isset($_POST['ec_in_up_cat'])) { 284 $arg 2= $_POST['ec_in_up_cat'];249 $arg1 = $_POST['ec_in_up_cat']; 285 250 if ($_POST['ec_input_action'] == 'img') { 286 251 if (isset($_POST['ec_in_up_img'])) $arg2 = $_POST['ec_in_up_img']; … … 290 255 else ec_end1('ec_in_up_cat', 'ec_bad_argument1'); 291 256 break; 292 default 257 default: ec_end1('ec_input_action', 'ec_bad_argument1'); 293 258 } 294 259 else ec_end1('ec_input_action', 'ec_bad_argument1'); 295 296 $forced = (isset($_POST['[ec_in_up_forced]'])) ? 'true' : 'false'; 260 $forced = (isset($_POST['ec_in_up_forced'])) ? 'true' : 'false'; 297 261 298 262 // Now we have the code, the user_id, arg1, arg2, and forced arguments 299 */ 263 if ( 264 pwg_query(" 265 INSERT INTO `".EVNTCATS_TABLE."` ( 266 `code`, 267 `user_id`, 268 `action`, 269 `arg1`, `arg2`, `forced` 270 ) 271 VALUES ( 272 '".$_POST['ec_in_up_code']."', 273 '".$ec_user_id."', 274 'ec_ok', 275 '".$arg1."', '".$arg2."', '".$forced."' 276 ); 277 ") === false 278 ) { 279 $page['errors'][] = 280 l10n('ec_entry_create_pb'). 281 'MySQL error '.mysql_errno().', "'.mysql_error().'"' 282 ; 283 return false; 284 } 285 else { 286 build_ec_lists(); 287 $forced = ($forced == 'false') ? '' : l10n('ec_cnfrm_forced'); 288 $page['infos'][] = 289 l10n('ec_entry_create_OK').mysql_insert_id().' : '. 290 $_POST['ec_in_up_code'].' => '. 291 $ec_lists['user_ids'][$ec_user_id].$forced 292 ; 293 return true; 294 } 295 /* 300 296 301 297 $page['errors'][] = 'Y\'a p\'têt\' ben eu une erreur...'; 298 299 */ 302 300 } 303 301 … … 342 340 default: return ec_end1('ec_input_action', 'ec_bad_argument1'); 343 341 } 344 if (pwg_query(" 345 INSERT INTO `".EVNTCATS_TABLE."` 346 (`code`, `user_id`, `action`, `arg1`, `arg2`) 347 VALUES ( 348 '".$ec_lists['ec_table'][$_POST['ec_entry_sel']]['code']."', 349 '".$ec_lists['ec_table'][$_POST['ec_entry_sel']]['user_id']."', 350 'ec_ok', 351 '".$arg1."', 352 '".$arg2."' 353 ); 354 ")) { 342 if ( 343 pwg_query(" 344 INSERT INTO `".EVNTCATS_TABLE."` 345 (`code`, `user_id`, `action`, `arg1`, `arg2`) 346 VALUES ( 347 '".$ec_lists['ec_table'][$_POST['ec_entry_sel']]['code']."', 348 '".$ec_lists['ec_table'][$_POST['ec_entry_sel']]['user_id']."', 349 'ec_ok', 350 '".$arg1."', 351 '".$arg2."' 352 ); 353 ") === false 354 ) { 355 $page['errors'][] = 356 l10n('ec_entry_dup_nok_pre1'). 357 $_POST['ec_entry_sel']. 358 l10n('ec_entry_dup_nok_end1'). 359 'MySQL error '.mysql_errno().', "'.mysql_error().'"' 360 ; 361 return false; 362 } 363 else { 355 364 $page['infos'][] = 356 365 l10n('ec_entry_dup_ok_pre'). … … 361 370 build_ec_table(); 362 371 return true; 363 }364 else {365 $page['errors'][] =366 l10n('ec_entry_dup_nok_pre1').367 $_POST['ec_entry_sel'].368 l10n('ec_entry_dup_nok_end1').369 'MySQL error '.mysql_errno().', "'.mysql_error().'"'370 ;371 return false;372 372 } 373 373 } -
extensions/event_cats/include/evntcats_main_funcs.inc.php
r4173 r4179 211 211 )) - 1; 212 212 $ec_lists['ec_table'][$ec_current_entry]['id'] = $ec_current_entry; 213 if (isset($conf['prior_page'])) { 214 if (array_key_exists($ec_current_code, $conf['prior_page'])) { 215 $ec_lists['ec_table'][$ec_current_entry]['arg2'] = 216 $conf['prior_page'][$ec_current_code]; 217 $ec_lists['ec_table'][$ec_current_entry]['forced'] = 'true'; 218 } 213 if (isset($conf['prior_page'])) 214 if (array_key_exists($ec_current_code, $conf['prior_page'])) { 215 $ec_lists['ec_table'][$ec_current_entry]['arg2'] = 216 $conf['prior_page'][$ec_current_code]; 217 $ec_lists['ec_table'][$ec_current_entry]['forced'] = 'true'; 218 } 219 if (isset($conf['outdated_page'])) 220 if (array_key_exists($ec_current_code, $conf['outdated_page'])) { 221 $ec_lists['ec_table'][$ec_current_entry]['action'] = 'ec_nok'; 222 $ec_lists['ec_table'][$ec_current_entry]['arg2'] = 223 $conf['outdated_page'][$ec_current_code]; 224 $ec_lists['ec_table'][$ec_current_entry]['forced'] = 'true'; 225 } 226 } 227 228 // Inspection of $conf['outdated_page'] 229 if (isset($conf['outdated_page'])) 230 foreach ($conf['outdated_page'] as $ec_current_code => $ec_current_AP) 231 if (!array_key_exists($ec_current_code, $conf['auto_log'])) { 232 $ec_current_entry = array_push($ec_lists['ec_table'], array( 233 'code' => $ec_current_code, 234 'user_id' => '', 235 'action' => 'ec_nok', 236 'arg1' => NULL, 237 'arg2' => $ec_current_AP, 238 'forced' => 'true', 239 )) - 1; 240 $ec_lists['ec_table'][$ec_current_entry]['id'] = $ec_current_entry; 219 241 } 220 if (isset($conf['outdated_page'])) {221 if (array_key_exists($ec_current_code, $conf['outdated_page'])) {222 $ec_lists['ec_table'][$ec_current_entry]['action'] = 'ec_nok';223 $ec_lists['ec_table'][$ec_current_entry]['arg2'] =224 $conf['outdated_page'][$ec_current_code];225 $ec_lists['ec_table'][$ec_current_entry]['forced'] = 'true';226 }227 }228 }229 230 // Inspection of $conf['outdated_page']231 if (isset($conf['outdated_page'])) {232 foreach ($conf['outdated_page'] as $ec_current_code => $ec_current_AP) {233 if (!array_key_exists($ec_current_code, $conf['auto_log'])) {234 $ec_current_entry = array_push($ec_lists['ec_table'], array(235 'code' => $ec_current_code,236 'user_id' => '',237 'action' => 'ec_nok',238 'arg1' => NULL,239 'arg2' => $ec_current_AP,240 'forced' => 'true',241 )) - 1;242 $ec_lists['ec_table'][$ec_current_entry]['id'] = $ec_current_entry;243 }244 }245 }246 242 247 243 } 248 244 else { // in "normal" use ($conf['auto_log'] NOT set), $ec_lists['ec_table'] 249 245 // is built thanks to below code only. A little bit more simple... 250 $q = pwg_query( '251 SELECT * FROM ` '.EVNTCATS_TABLE.'`246 $q = pwg_query(" 247 SELECT * FROM `".EVNTCATS_TABLE."` 252 248 WHERE `code` IS NOT NULL 253 249 ORDER BY `id` 254 '); 255 while ($r = mysql_fetch_assoc($q)) { 256 $ec_lists['ec_table'][intval($r['id'])] = $r; 257 } 250 "); 251 while ($r = mysql_fetch_assoc($q)) 252 $ec_lists['ec_table'][intval($r['id'])] = $r; 258 253 } 259 254 … … 294 289 ) and 295 290 !array_key_exists($ec_entry['arg2'], $ec_lists['add_pages']) 296 ) { 297 $ec_entry['action'].= '_ap_pb'; 298 } 291 ) $ec_entry['action'].= '_ap_pb'; 299 292 break; 300 293 … … 309 302 } 310 303 } 311 else { 312 $ec_entry['action'].= '_cat_pb'; 313 } 304 else $ec_entry['action'].= '_cat_pb'; 314 305 } 315 306 break; -
extensions/event_cats/language/fr_FR/plugin.lang.php
r4178 r4179 119 119 $lang['ec_group_create_OK2'] = ' associé à '; 120 120 $lang['ec_group_create_pb'] = 'Création nouveau groupe impossible : '; 121 $lang['ec_entry_create_OK'] = 'Création entrée '; 122 $lang['ec_entry_create_pb'] = 'Création nouvelle entrée impossible : '; 123 $lang['ec_cnfrm_forced'] = ' (affichage forcé)'; 121 124 $lang['ec_bad_argument1'] = 'Mauvais argument : '; 122 125 $lang['ec_bad_argument2'] = 'Code déjà existant : ';
Note: See TracChangeset
for help on using the changeset viewer.