Changeset 3971 for extensions/event_cats/main.inc.php
- Timestamp:
- Oct 2, 2009, 11:26:21 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/main.inc.php
r3970 r3971 39 39 40 40 global 41 $conf, $prefixeTable, $ec_conf,41 $conf, $prefixeTable, 42 42 $ec_ap_ok; // whether Additional Pages is installed and activated 43 43 … … 51 51 if (!isset($ec_lists)) { 52 52 $ec_lists = array(); 53 }54 55 // $ec_conf initalization / check56 if ($t = mysql_fetch_row(pwg_query("57 SELECT `value`58 FROM `".CONFIG_TABLE."`59 WHERE `param` = 'event_cats';60 "))) {61 $ec_conf = explode(',' , $t[0]);62 }63 else {64 $ec_conf = array();65 53 } 66 54 … … 93 81 ) ? $popup_help_content.$help_content : $popup_help_content; 94 82 } 95 // Mettre en place l'autoid, qu'on voie si ça marche !96 83 97 84 //---------------------------------- … … 110 97 111 98 function auto_log_user() { 112 global $ec_ conf, $ec_lists;99 global $ec_lists; 113 100 114 101 $ec_ap = NULL; … … 116 103 $ec_img = NULL; 117 104 118 if (isset($_GET['autolog']) and ( $ec_conf['activated']== 1)) {119 if (!is_a_guest()) logout_user();105 if (isset($_GET['autolog']) and (read_ec_conf('activated') == 1)) { 106 // if (!is_a_guest()) logout_user(); 120 107 build_ec_lists(); 121 108 foreach ($ec_lists['ec_table'] as $ec_entry) { … … 123 110 } 124 111 if ($code_exists) { 125 if (isset($_GET['ap'])) $ec_ap = $_GET['ap'];126 112 if (strpos($ec_entry['action'], 'ec_ok') !== false) { 127 113 log_user($ec_entry['user_id'], false); 114 if (isset($_GET['ap'])) $ec_ap = $_GET['ap']; 128 115 if (isset($_GET['cat'])) $ec_cat = $_GET['cat']; 129 116 if (isset($_GET['img'])) $ec_img = $_GET['img']; … … 161 148 } 162 149 } 150 redirect(make_index_url()); 151 } 152 else { 153 if ( 154 $ec_entry['action'] == 'ec_nok' or 155 $ec_entry['action'] == 'ec_nok_ap_pb' 156 ) { 157 if ($ec_entry['action'] == 'ec_nok_ap_pb') access_denied(); 158 $ec_ap = $ec_entry['arg2']; 159 if (array_key_exists($ec_ap, $ec_lists['add_pages'])) { 160 redirect( 161 PHPWG_ROOT_PATH.'index.php?/additional_page/'.$ec_ap); 162 } 163 access_denied(); 164 } 163 165 else { 164 166 redirect(make_index_url()); 165 167 } 166 168 } 167 else {168 if ($ec_entry['action'] == 'ec_nok') {169 if (isset($ec_ap)) {170 if (array_key_exists($ec_ap,$ec_lists['add_pages'])) {171 redirect(172 PHPWG_ROOT_PATH.'index.php?/additional_page/'.$ec_ap);173 }174 }175 access_denied();176 }177 else {178 redirect(make_index_url());179 }180 }181 169 } 182 170 else { 183 171 if ( 184 $ec_conf['unknown_code']== 2 and172 read_ec_conf('unknown_code') == 2 and 185 173 array_key_exists( 186 $ec_conf['unknown_code_ap_id'], $ec_lists['add_pages']174 read_ec_conf('unknown_code_ap_id'), $ec_lists['add_pages'] 187 175 ) 188 176 ) { 189 177 redirect( 190 178 PHPWG_ROOT_PATH. 191 'index.php?/additional_page/'. $ec_conf['unknown_code_ap_id']179 'index.php?/additional_page/'.read_ec_conf('unknown_code_ap_id') 192 180 ); 193 181 } 194 elseif ( $ec_conf['unknown_code']== 1 or195 $ec_conf['unknown_code']== 2) {182 elseif (read_ec_conf('unknown_code') == 1 or 183 read_ec_conf('unknown_code') == 2) { 196 184 access_denied(); 197 185 } … … 216 204 217 205 function assign_perm_for_new_user($new_user) 218 { /*206 { 219 207 global $user; 220 208 … … 260 248 pwg_query($query); 261 249 } 262 } */250 } 263 251 } 264 252 … … 274 262 add_event_handler('blockmanager_apply', 'duplicate_account_url'); 275 263 276 function duplicate_account_url() 277 { /* 278 global $conf, $lang, $template; 279 280 if ($conf['allow_user_registration'] and !is_admin() and !is_a_guest()) 281 and !is_admin() and !is_a_guest()) 282 { 264 function duplicate_account_url() { 265 global $lang, $template; 266 267 if (!is_admin() and !is_a_guest()) { 283 268 $template->assign( 'U_REGISTER', get_root_url().'register.php'); 284 269 $lang['Create a new account'] = l10n('Duplicate account'); 285 270 $lang['Register'] = l10n('Duplicate'); 286 } */ 287 } 288 289 // copying/pasting the following lines from same file in plugin LLGBO2, 290 // because it looks like it's useful :-/ ..... 291 /* 292 add_event_handler('render_element_content', 293 array(&$obj,'MyPictureOptions'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 ); */ 271 } 272 } 273 294 274 add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') ); 295 275 set_plugin_data($plugin['id'], $obj);
Note: See TracChangeset
for help on using the changeset viewer.