Changeset 4178 for extensions
- Timestamp:
- Nov 3, 2009, 11:17:17 AM (15 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/template/autolog_new.js
r4173 r4178 630 630 } 631 631 if ((!ec_is_creation && !t1) || 632 de('ec_in_up_forced_id').checked != ''632 (de('ec_in_up_forced_id').checked != '' && de('ec_sel_code_old').checked != '') 633 633 ) return confirm(ec_JS_message['ec_confirm_del_other']); 634 634 return true; -
extensions/event_cats/include/evntcats_admin_funcs.inc.php
r4173 r4178 50 50 function ec_end1($pst, $msg) { 51 51 global $page; 52 $page['errors'][] = 53 l10n($msg). 54 '$_POST[\''.$pst.'\'] = '. 55 $_POST[$pst] 56 ; 52 if (isset($_POST[$pst])) 53 $page['errors'][] = 54 l10n($msg). 55 '$_POST[\''.$pst.'\'] = '. 56 $_POST[$pst]; 57 else 58 $page['errors'][] = 59 l10n($msg). 60 '$_POST[\''.$pst.'\'] unset'; 57 61 return false; 58 62 } … … 70 74 function ec_end2($msg, $num) { 71 75 global $page; 72 $page['errors'][] = 73 l10n($msg).' ('.$num.') '. 74 'MySQL error '.mysql_errno().', "'.mysql_error().'"' 75 ; 76 76 77 return false; 77 78 } … … 203 204 // code and user_id (if needed) are OK, creation can be done 204 205 if ($_POST['ec_sel_user'] == 'new') { 206 207 // User creation, as generic 205 208 $page['errors'] = register_user( 206 209 $_POST['ec_in_up_usr_txt'], $_POST['ec_in_up_psd_txt'], '', false … … 208 211 if ( 209 212 count($page['errors']) != 0 or 210 !($ec_user_id = get_userid($_POST['ec_in_up_usr_txt'])) or 211 !pwg_query(" 213 !($ec_user_id = get_userid($_POST['ec_in_up_usr_txt'])) 214 ) { 215 array_unshift($page['errors'], l10n('ec_user_create_pb')); 216 return false; 217 } 218 else 219 $page['infos'][] = l10n('ec_user_create_OK').$_POST['ec_in_up_usr_txt']; 220 if ( 221 pwg_query(" 212 222 UPDATE `".USER_INFOS_TABLE."` 213 223 SET `status` = 'generic' 214 224 WHERE `user_id` = ".$ec_user_id."; 215 ") 216 ) { 217 array_unshift($page['errors'], l10n('ec_user_create_pb')); 218 return false; 219 } 220 else $page['infos'][] = l10n('ec_user_create_OK').$ec_user_id; 225 ") !== false 226 ) 227 $page['infos'][] = l10n('ec_user_generic_OK').$_POST['ec_in_up_usr_txt']; 228 else 229 $page['errors'][] =l10n('ec_user_generic_pb').$_POST['ec_in_up_usr_txt']; 230 231 // New group creation if required, 232 // and association with user_id at the same time 221 233 if ( 222 234 isset($_POST['ec_in_up_newgroup']) and 223 235 isset($_POST['ec_in_up_grp_txt']) and 224 236 $_POST['ec_in_up_grp_txt'] != '' 225 ) { // New group creation, and association with user_id at the same time 226 if ( 227 !($t = mysql_fetch_row(pwg_query(" 237 ) { 238 $t2 = 0; $t4 = false; 239 while ( 240 !($t3 = mysql_fetch_row(pwg_query(" 228 241 SELECT `id` 229 242 FROM `".GROUPS_TABLE."` 230 243 WHERE `name` = '".$_POST['ec_in_up_grp_txt']."'; 231 "))) 232 ) { 233 if ( 234 !pwg_query(" 235 INSERT INTO `".GROUPS_TABLE."` (`name`, `is_default`) 236 VALUES ('".$_POST['ec_in_up_grp_txt']."', 'false'); 237 ") 238 ) return ec_end2('ec_group_create_pb', '1'); 239 if ( 240 !($t = mysql_fetch_row(pwg_query(" 241 SELECT `id` 242 FROM `".GROUPS_TABLE."` 243 WHERE `name` = '".$_POST['ec_in_up_grp_txt']."'; 244 "))) 245 ) return ec_end2('ec_group_create_pb', '2'); 244 "))) and 245 $t2++ == 0 246 ) $t4 = pwg_query(" 247 INSERT INTO `".GROUPS_TABLE."` (`name`, `is_default`) 248 VALUES ('".$_POST['ec_in_up_grp_txt']."', 'false'); 249 "); 250 if ($t4) 251 $page['infos'][]=l10n('ec_group_create_OK').$_POST['ec_in_up_grp_txt']; 252 if (!$t3) 253 $page['errors'][] = 254 l10n('ec_group_create_pb').' (1) ; '. 255 'MySQL error '.mysql_errno().', "'.mysql_error().'"'; 256 if ( 257 pwg_query(" 258 INSERT INTO `".USER_GROUP_TABLE."` (`user_id `, `group_id`) 259 VALUES ('".$ec_user_id."', '".$t3['id']."'); 260 ") === false 261 ) $page['errors'][] = ; 262 l10n('ec_group_create_pb').' (2) ; '. 263 'MySQL error '.mysql_errno().', "'.mysql_error().'"'; 264 else 265 $page['infos'][] = 266 $_POST['ec_in_up_usr_txt']. 267 l10n('ec_group_create_OK2'). 268 $_POST['ec_in_up_grp_txt'] 269 ; 270 } 271 } 272 273 // Creation of new line in DB event_cats table with all arguments 274 $arg1 = ''; $arg2 = ''; 275 if (isset($_POST['ec_input_action'])) switch ($_POST['ec_input_action']) { 276 // case 'home': // Home : nothing to do : "arg"s are '' 277 case 'add_p': // Additional Page 278 if (isset($_POST['ec_in_up_aps'])) $arg2 = $_POST['ec_in_up_aps']; 279 else ec_end1('ec_in_up_aps', 'ec_bad_argument1'); 280 break; 281 case 'cat': // Category 282 case 'img': // Image 283 if (isset($_POST['ec_in_up_cat'])) { 284 $arg2 = $_POST['ec_in_up_cat']; 285 if ($_POST['ec_input_action'] == 'img') { 286 if (isset($_POST['ec_in_up_img'])) $arg2 = $_POST['ec_in_up_img']; 287 else ec_end1('ec_in_up_img', 'ec_bad_argument1'); 288 } 246 289 } 247 if ( 248 !(pwg_query(" 249 INSERT INTO `".USER_GROUP_TABLE."` (`user_id `, `group_id`) 250 VALUES ('".$ec_user_id."', '".$t['id']."'); 251 ")) 252 ) return ec_end2('ec_group_create_pb', '3'); 253 } 254 } 255 else { 256 if ($t1) { 257 258 $arg1 = ''; $arg2 = ''; 259 switch ($_POST['ec_input_action']) { 260 // case 'home': // Home : nothing to do : "arg"s are '' 261 case 'add_p': // Additional Page 262 break; 263 case 'cat': // Category 264 case 'img': // Image 265 break; 266 default : return ec_end1('ec_input_action', 'ec_bad_argument1'); 267 } 268 269 else return ec_end1('ec_in_up_code', 'ec_bad_argument7'); 270 } 271 else return ec_end1('ec_in_up_usr_txt', 'ec_bad_argument6'); 272 } 290 else ec_end1('ec_in_up_cat', 'ec_bad_argument1'); 291 break; 292 default : ec_end1('ec_input_action', 'ec_bad_argument1'); 293 } 294 else ec_end1('ec_input_action', 'ec_bad_argument1'); 295 296 $forced = (isset($_POST['[ec_in_up_forced]'])) ? 'true' : 'false'; 297 298 // Now we have the code, the user_id, arg1, arg2, and forced arguments 273 299 */ 274 300 -
extensions/event_cats/language/fr_FR/plugin.lang.php
r4173 r4178 112 112 $lang['ec_entry_dis_nok_pre3'] = 'Problème avec tentative de rendre périmée entrée '; 113 113 $lang['ec_entry_dis_nok_end3'] = ' (arg1 = NULL)'; 114 $lang['ec_user_create_OK'] = 'Création utilisateur '; 114 115 $lang['ec_user_create_pb'] = 'Création nouvel utilisateur impossible'; 115 $lang['ec_user_create_OK'] = 'Création utilisateur '; 116 $lang['ec_user_generic_OK'] = 'Utilisateur générique : '; 117 $lang['ec_user_generic_pb'] = 'Problème passage utilisateur générique : '; 118 $lang['ec_group_create_OK'] = 'Création nouveau groupe '; 119 $lang['ec_group_create_OK2'] = ' associé à '; 116 120 $lang['ec_group_create_pb'] = 'Création nouveau groupe impossible : '; 117 121 $lang['ec_bad_argument1'] = 'Mauvais argument : ';
Note: See TracChangeset
for help on using the changeset viewer.