Changeset 21424
- Timestamp:
- Mar 10, 2013, 2:16:32 AM (12 years ago)
- Location:
- extensions/Register_FluxBB
- Files:
-
- 16 added
- 4 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Register_FluxBB/admin/admin.php
r17457 r21424 1 1 <?php 2 2 3 global $ user, $lang, $conf, $template, $errors;3 global $page, $user, $lang, $conf, $template, $errors; 4 4 5 5 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 6 6 7 if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 8 9 ini_set('error_reporting', E_ALL); 10 ini_set('display_errors', true); 7 check_status(ACCESS_ADMINISTRATOR); 8 9 if(!defined('REGFLUXBB_PATH')) 10 { 11 define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 12 } 11 13 12 14 include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 13 15 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 14 16 15 $my_base_url = get_admin_plugin_menu_link(__FILE__);16 17 load_language('plugin.lang', REGFLUXBB_PATH); 17 18 18 // +-----------------------------------------------------------------------+ 19 // | Tabssheet | 20 // +-----------------------------------------------------------------------+ 21 if (!isset($_GET['tab'])) 22 $page['tab'] = 'info'; 23 else 24 $page['tab'] = $_GET['tab']; 25 26 $tabsheet = new tabsheet(); 27 $tabsheet->add('info', 28 l10n('Tab_Info'), 29 $my_base_url.'&tab=info'); 30 $tabsheet->add('manage', 31 l10n('Tab_Manage'), 32 $my_base_url.'&tab=manage'); 33 $tabsheet->add('Migration', 34 l10n('Tab_Migration'), 35 $my_base_url.'&tab=Migration'); 36 $tabsheet->add('Synchro', 37 l10n('Tab_Synchro'), 38 $my_base_url.'&tab=Synchro'); 39 $tabsheet->select($page['tab']); 40 $tabsheet->assign(); 41 42 43 $page['infos'] = array(); 44 $error = array(); 19 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 45 20 46 21 // +-----------------------------------------------------------------------+ … … 51 26 52 27 // +-----------------------------------------------------------------------+ 53 // | Functions28 // | Actions process | 54 29 // +-----------------------------------------------------------------------+ 55 function Audit_PWG_FluxBB() 56 { 57 global $page, $conf, $errors; 58 59 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 60 30 if (isset($_GET['action']) and ($_GET['action']=='link_dead')) 31 { 32 $query = ' 33 DELETE FROM '.Register_FluxBB_ID_TABLE.' 34 WHERE id_user_FluxBB NOT IN ( 35 SELECT id 36 FROM '.FluxBB_USERS_TABLE.' 37 ) 38 OR id_user_pwg NOT IN ( 39 SELECT id 40 FROM '.USERS_TABLE.' 41 ) 42 ;'; 43 44 $result = pwg_query($query); 45 46 Audit_PWG_FluxBB(); 47 } 48 else if (isset($_GET['action']) and ($_GET['action']=='link_del') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) 49 { 50 $query = ' 51 DELETE FROM '.Register_FluxBB_ID_TABLE.' 52 WHERE id_user_pwg = '.$_GET['pwg_id'].' 53 AND id_user_FluxBB = '.$_GET['bb_id'].' 54 ;'; 55 56 $result = pwg_query($query); 57 58 Audit_PWG_FluxBB(); 59 } 60 else if (isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) 61 { 62 FluxBB_Linkuser($_GET['pwg_id'], $_GET['bb_id']); 63 64 Audit_PWG_FluxBB(); 65 } 66 else if (isset($_GET['action']) and ($_GET['action']=='sync_user') and isset($_GET['username'])) 67 { 68 $query = ' 69 SELECT id AS id_pwg, username, password, mail_address 70 FROM '.USERS_TABLE.' 71 WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'" 72 AND username NOT IN ("18","16") 73 LIMIT 1 74 ;'; 75 76 $data = pwg_db_fetch_assoc(pwg_query($query)); 77 78 if (!empty($data)) 79 { 80 FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']); 81 } 82 83 Audit_PWG_FluxBB(); 84 } 85 else if (isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username'])) 86 { 87 $query = ' 88 SELECT id, username, password, mail_address 89 FROM '.USERS_TABLE.' 90 WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'" 91 AND username NOT IN ("18","16") 92 LIMIT 1 93 ;'; 94 95 $data = pwg_db_fetch_assoc(pwg_query($query)); 96 97 if (!empty($data)) 98 FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 99 100 Audit_PWG_FluxBB(); 101 } 102 else if (isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id'])) 103 { 104 FluxBB_Deluser( $_GET['id'], true ); 105 106 Audit_PWG_FluxBB(); 107 } 108 109 110 // +------------------------------------------------------------------+ 111 // | Plugin settings | 112 // +------------------------------------------------------------------+ 113 if (isset($_POST['submit']) and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details'])) 114 { 115 $_POST['FluxBB_admin'] = stripslashes($_POST['FluxBB_admin']); 116 $_POST['FluxBB_guest'] = stripslashes($_POST['FluxBB_guest']); 117 118 /* Configuration controls */ 119 // Piwigo's admin username control 120 $query = ' 121 SELECT username, id 122 FROM '.USERS_TABLE.' 123 WHERE id = '.$conf['webmaster_id'].' 124 ;'; 125 126 $pwgadmin = pwg_db_fetch_assoc(pwg_query($query)); 127 128 // FluxBB's admin username control 129 $query = ' 130 SELECT username, id 131 FROM '.FluxBB_USERS_TABLE.' 132 WHERE id = 2 133 ;'; 134 135 $fbbadmin = pwg_db_fetch_assoc(pwg_query($query)); 136 137 // FluxBB's Guest username control 138 $query = ' 139 SELECT username, id 140 FROM '.FluxBB_USERS_TABLE.' 141 WHERE id = 1 142 ;'; 143 144 $fbbguest = pwg_db_fetch_assoc(pwg_query($query)); 145 146 // Compute configuration errors 147 if (stripslashes($pwgadmin['username']) != $_POST['FluxBB_admin']) 148 { 149 array_push($page['errors'], l10n('error_config_admin1')); 150 } 151 if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username'])) 152 { 153 array_push($page['errors'], l10n('error_config_admin2')); 154 } 155 if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest'])) 156 { 157 array_push($page['errors'], l10n('error_config_guest')); 158 } 159 elseif (count($page['errors']) == 0) 160 { 161 if (!function_exists('FindAvailableConfirmMailID')) 162 { 163 $_POST['FluxBB_UAM'] = 'false'; 164 $_POST['FluxBB_group'] = '0'; 165 166 $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; 167 $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); 168 $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); 169 $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); 170 $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); 171 $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); 172 $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); 173 $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); 174 $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); 175 } 176 elseif (function_exists('FindAvailableConfirmMailID')) 177 { 178 $conf_UAM = unserialize($conf['UserAdvManager']); 179 180 if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local') and isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] != '-1') 181 { 182 $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; 183 $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); 184 $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); 185 $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); 186 $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); 187 $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); 188 $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); 189 $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); 190 $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); 191 } 192 else 193 { 194 $_POST['FluxBB_UAM'] = 'false'; 195 $_POST['FluxBB_group'] = '0'; 196 197 $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; 198 $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); 199 $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); 200 $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); 201 $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); 202 $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); 203 $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); 204 $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); 205 $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); 206 } 207 } 208 209 $conf['Register_FluxBB'] = serialize($newconf_RegFluxBB); 210 211 conf_update_param('Register_FluxBB', pwg_db_real_escape_string($conf['Register_FluxBB'])); 212 213 array_push($page['infos'], l10n('save_config')); 214 } 215 } 216 217 218 // +------------------------------------------------------------+ 219 // | Migration and Audit | 220 // +------------------------------------------------------------+ 221 if (isset($_POST['Migration'])) 222 { 223 array_push($page['infos'], l10n('Mig_Start').'<br><br>'); 224 225 array_push($page['infos'], l10n('Mig_Del_Link').'<br><br>'); 226 227 $query = 'TRUNCATE '.Register_FluxBB_ID_TABLE.';'; 228 $result = pwg_query($query); 229 230 $msg_Mig_Del_AllUsers = ''; 231 232 $query = ' 233 SELECT username, id 234 FROM '.FluxBB_USERS_TABLE.' 235 ;'; 236 237 $result = pwg_query($query); 238 239 while ($row = pwg_db_fetch_assoc($result)) 240 { 241 if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_GUEST'])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']))) 242 { 243 $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']); 244 245 FluxBB_Deluser($row['id'], false); 246 } 247 } 248 249 array_push($page['infos'], l10n('Mig_Del_AllUsers').$msg_Mig_Del_AllUsers.'<br><br>'); 250 251 $query = ' 252 SELECT id, username, password, mail_address 253 FROM '.USERS_TABLE.' 254 WHERE username NOT IN ("18","16") 255 ;'; 256 257 $result = pwg_query($query); 258 259 $registred = time(); 260 $registred_ip = $_SERVER['REMOTE_ADDR']; 261 262 $msg_Mig_Add_AllUsers = ''; 263 264 while ($row = pwg_db_fetch_assoc($result)) 265 { 266 if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']))) 267 { 268 $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']); 269 270 FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']); 271 } 272 } 273 274 array_push($page['infos'], l10n('Mig_Add_AllUsers').$msg_Mig_Add_AllUsers.'<br><br>'); 275 276 $query = ' 277 SELECT id, username, password, mail_address 278 FROM '.USERS_TABLE.' 279 WHERE username = "'.$conf_Register_FluxBB['FLUXBB_ADMIN'].'" 280 AND username NOT IN ("18","16") 281 ;'; 282 283 $row = pwg_db_fetch_assoc(pwg_query($query)); 284 285 if (!empty($row)) 286 { 287 array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>'); 288 289 FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']); 290 } 291 292 array_push($page['infos'], l10n('Mig_End')); 293 } 294 else if (isset($_POST['Audit'])) 295 { 296 Audit_PWG_FluxBB(); 297 } 298 299 300 // +--------------------------------------------------------+ 301 // | Synch and Audit | 302 // +--------------------------------------------------------+ 303 if ( isset($_POST['Synchro'])) 304 { 61 305 $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__); 62 306 63 64 65 307 $msg_error_PWG_Dup = ''; 66 308 $msg_error_FluxBB_Dup = ''; … … 69 311 $msg_error_Synchro = ''; 70 312 $msg_ok_Synchro = ''; 313 $msg_error_FluxBB2PWG = ''; 71 314 $msg_error_PWG2FluxBB = ''; 72 $msg_error_FluxBB2PWG = ''; 73 74 75 76 $query = " 315 316 317 $query = ' 77 318 SELECT COUNT(*) AS nbr_dup, id, username 78 FROM ".USERS_TABLE." 319 FROM '.USERS_TABLE.' 320 WHERE username NOT IN ("18","16") 79 321 GROUP BY BINARY username 80 322 HAVING COUNT(*) > 1 81 ;"; 323 ;'; 324 82 325 $result = pwg_query($query); 83 326 84 327 while($row = pwg_db_fetch_assoc($result)) 85 328 $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 86 329 87 if ($msg_error_PWG_Dup == '') 88 array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK')); 89 else 90 $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); 91 92 93 94 $query = " 330 if ($msg_error_PWG_Dup <> '') 331 $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); 332 333 $query = ' 95 334 SELECT COUNT(*) AS nbr_dup, username 96 FROM ".FluxBB_USERS_TABLE."335 FROM '.FluxBB_USERS_TABLE.' 97 336 GROUP BY BINARY username 98 337 HAVING COUNT(*) > 1 99 ;"; 338 ;'; 339 100 340 $result = pwg_query($query); 101 341 102 342 while($row = pwg_db_fetch_assoc($result)) 103 343 { 104 344 $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 105 345 106 $subquery = "346 $subquery = ' 107 347 SELECT id, username, email 108 FROM ".FluxBB_USERS_TABLE." 109 WHERE BINARY username = BINARY '".$row['username']."' 110 ;"; 348 FROM '.FluxBB_USERS_TABLE.' 349 WHERE BINARY username = BINARY "'.$row['username'].'" 350 ;'; 351 111 352 $subresult = pwg_query($subquery); 112 353 113 354 while($subrow = pwg_db_fetch_assoc($subresult)) 114 355 { 115 356 $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; 116 357 117 358 $msg_error_FluxBB_Dup .= ' <a href="'; 118 359 119 360 $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array( 120 361 'action' => 'del_user', 121 362 'id' => $subrow['id'], 122 363 )); 123 364 124 365 $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"'; 125 126 $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 127 128 $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>'; 129 } 130 } 131 132 if ($msg_error_FluxBB_Dup == '') 133 array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK')); 134 else 135 $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); 136 137 138 139 $query = " 366 367 $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 368 369 $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>'; 370 } 371 } 372 373 if ($msg_error_FluxBB_Dup <> '') 374 $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); 375 376 if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '') 377 { 378 $query = ' 140 379 SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail 141 FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE."as pwg380 FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg 142 381 WHERE bb.id NOT in ( 143 382 SELECT id_user_FluxBB 144 FROM ".Register_FluxBB_ID_TABLE."383 FROM '.Register_FluxBB_ID_TABLE.' 145 384 ) 146 385 AND pwg.id NOT in ( 147 386 SELECT id_user_pwg 148 FROM ".Register_FluxBB_ID_TABLE."387 FROM '.Register_FluxBB_ID_TABLE.' 149 388 ) 150 389 AND pwg.username = bb.username 390 AND pwg.username NOT IN ("18","16") 151 391 AND pwg.mail_address = bb.email 152 ;"; 153 154 $result = pwg_query($query); 155 156 while($row = pwg_db_fetch_assoc($result)) 157 { 158 $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 159 160 $msg_error_Link_Break .= ' <a href="'; 161 162 $msg_error_Link_Break .= add_url_params($page_Register_FluxBB_admin, array( 163 'action' => 'new_link', 164 'pwg_id' => $row['pwg_id'], 165 'bb_id' => $row['bb_id'], 166 )); 167 168 $msg_error_Link_Break .= '" title="'.l10n('New_Link').stripslashes($row['pwg_user']).'"'; 169 170 $msg_error_Link_Break .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 171 172 $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>'; 173 } 174 175 if ($msg_error_Link_Break == '') 176 array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK')); 177 else 178 $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break; 179 180 181 182 $query = " 392 ;'; 393 394 $result = pwg_query($query); 395 396 while($row = pwg_db_fetch_assoc($result)) 397 { 398 $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 399 FluxBB_Linkuser($row['pwg_id'], $row['bb_id']); 400 } 401 402 if ($msg_error_Link_Break == '') 403 array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK')); 404 else 405 $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break; 406 407 $query = ' 183 408 SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail 184 FROM ".FluxBB_USERS_TABLE." AS bb 185 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id 186 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 187 WHERE pwg.username <> bb.username 188 ;"; 189 190 $result = pwg_query($query); 191 192 while($row = pwg_db_fetch_assoc($result)) 193 { 194 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 195 196 $msg_error_Link_Bad .= ' <a href="'; 197 198 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 199 'action' => 'link_del', 200 'pwg_id' => $row['pwg_id'], 201 'bb_id' => $row['bb_id'], 202 )); 203 204 $msg_error_Link_Bad .= '" title="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; 205 206 $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 207 208 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>'; 209 210 $msg_error_Link_Bad .= ' -- <a href="'; 211 212 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 213 'action' => 'sync_user', 214 'username' => stripslashes($row['pwg_user']), 215 )); 216 217 $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"'; 218 219 $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 220 221 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/arrow_switch.png" alt="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'" /></a>'; 222 } 223 224 225 $query = " 409 FROM '.FluxBB_USERS_TABLE.' AS bb 410 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id 411 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 412 WHERE BINARY pwg.username <> BINARY bb.username 413 AND pwg.username NOT IN ("18","16") 414 ;'; 415 416 $result = pwg_query($query); 417 418 while($row = pwg_db_fetch_assoc($result)) 419 { 420 $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 421 422 $subquery = ' 423 DELETE FROM '.Register_FluxBB_ID_TABLE.' 424 WHERE id_user_pwg = '.$row['pwg_id'].' 425 AND id_user_FluxBB = '.$row['bb_id'].' 426 ;'; 427 428 $subresult = pwg_query($subquery); 429 } 430 431 $query = ' 226 432 SELECT COUNT(*) as nbr_dead 227 FROM ".Register_FluxBB_ID_TABLE."AS Link433 FROM '.Register_FluxBB_ID_TABLE.' AS Link 228 434 WHERE id_user_FluxBB NOT IN ( 229 435 SELECT id 230 FROM ".FluxBB_USERS_TABLE."436 FROM '.FluxBB_USERS_TABLE.' 231 437 ) 232 438 OR id_user_pwg NOT IN ( 233 439 SELECT id 234 FROM ".USERS_TABLE." 235 ) 236 ;"; 237 238 $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 239 240 if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) 241 { 242 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead']; 243 244 $msg_error_Link_Bad .= ' <a href="'; 245 246 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 247 'action' => 'link_dead', 248 )); 249 250 $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"'; 251 252 $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 253 254 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>'; 255 } 256 257 $query = " 440 FROM '.USERS_TABLE.' 441 ) 442 ;'; 443 444 $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 445 446 if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) 447 { 448 $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead']; 449 450 $query = ' 451 DELETE FROM '.Register_FluxBB_ID_TABLE.' 452 WHERE id_user_FluxBB NOT IN ( 453 SELECT id 454 FROM '.FluxBB_USERS_TABLE.' 455 ) 456 OR id_user_pwg NOT IN ( 457 SELECT id 458 FROM '.USERS_TABLE.' 459 ) 460 ;'; 461 462 $result = pwg_query($query); 463 } 464 465 $query = ' 258 466 SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id 259 FROM ".FluxBB_USERS_TABLE." AS bb 260 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id 261 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 467 FROM '.FluxBB_USERS_TABLE.' AS bb 468 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id 469 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 470 WHERE pwg.username NOT IN ("18","16") 262 471 GROUP BY link.id_user_pwg, link.id_user_FluxBB 263 472 HAVING COUNT(*) > 1 264 ;"; 265 266 $result = pwg_query($query); 267 268 while($row = pwg_db_fetch_assoc($result)) 269 { 270 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 271 272 $msg_error_Link_Bad .= ' <a href="'; 273 274 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 275 'action' => 'new_link', 276 'pwg_id' => $row['pwg_id'], 277 'bb_id' => $row['bb_id'], 278 )); 279 280 $msg_error_Link_Bad .= '" title="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; 281 282 $msg_error_Link_Bad .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 283 284 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_error.png" alt="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>'; 285 } 286 287 if ($msg_error_Link_Bad == '') 288 array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK')); 289 else 290 $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad; 473 ;'; 474 475 $result = pwg_query($query); 291 476 292 293 294 $query = " 295 SELECT pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.password as bb_pwd, FluxBB.email as bb_eml 296 FROM ".FluxBB_USERS_TABLE." AS FluxBB 297 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = FluxBB.id 298 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 477 while($row = pwg_db_fetch_assoc($result)) 478 { 479 $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 480 481 FluxBB_Linkuser($row['pwg_id'], $row['bb_id']); 482 } 483 484 if ($msg_error_Link_Bad == '') 485 array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK')); 486 else 487 $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad; 488 489 $query = ' 490 SELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.password as bb_pwd, FluxBB.email as bb_eml 491 FROM '.FluxBB_USERS_TABLE.' AS FluxBB 492 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id 493 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 299 494 AND BINARY pwg.username = BINARY FluxBB.username 300 495 ORDER BY LOWER(pwg.username) 301 ;"; 302 303 $result = pwg_query($query); 304 305 while($row = pwg_db_fetch_assoc($result)) 306 { 307 if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 308 { 309 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']); 310 311 $msg_error_Synchro .= ' <a href="'; 312 313 $msg_error_Synchro .= add_url_params($page_Register_FluxBB_admin, array( 314 'action' => 'sync_user', 315 'username' => stripslashes($row['username']), 496 ;'; 497 498 $result = pwg_query($query); 499 500 while($row = pwg_db_fetch_assoc($result)) 501 { 502 if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 503 { 504 $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']); 505 506 $query = ' 507 SELECT id, username, password, mail_address 508 FROM '.USERS_TABLE.' 509 WHERE BINARY id = "'.$row['pwg_id'].'" 510 AND "'.$row['username'].'" NOT IN ("18","16") 511 ;'; 512 513 $data = pwg_db_fetch_assoc(pwg_query($query)); 514 515 if (!empty($data)) 516 FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 517 } 518 } 519 520 if ($msg_error_Synchro == '') 521 array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK')); 522 else 523 $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro; 524 525 $query = ' 526 SELECT username, mail_address FROM '.USERS_TABLE.' 527 WHERE BINARY username <> BINARY "guest" 528 AND username NOT IN ("18","16") 529 AND id not in ( 530 SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.' 531 ) 532 AND BINARY username not in ( 533 SELECT username FROM '.FluxBB_USERS_TABLE.' 534 ) 535 ORDER BY LOWER(username) 536 ;'; 537 538 $result = pwg_query($query); 539 540 while($row = pwg_db_fetch_assoc($result)) 541 { 542 $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')'; 543 544 $query = ' 545 SELECT id, username, password, mail_address 546 FROM '.USERS_TABLE.' 547 WHERE BINARY username = BINARY "'.$row['username'].'" 548 AND username NOT IN ("18","16") 549 LIMIT 1 550 ;'; 551 552 $data = pwg_db_fetch_assoc(pwg_query($query)); 553 554 if (!empty($data)) 555 FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 556 } 557 558 if ($msg_error_PWG2FluxBB == '') 559 array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK')); 560 else 561 $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB; 562 563 $query = ' 564 SELECT id, username, email FROM '.FluxBB_USERS_TABLE.' 565 WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'" 566 AND id not in ( 567 SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.' 568 ) 569 AND BINARY username not in ( 570 SELECT username FROM '.USERS_TABLE.' 571 ) 572 ORDER BY LOWER(username) 573 ;'; 574 575 $result = pwg_query($query); 576 577 while($row = pwg_db_fetch_assoc($result)) 578 { 579 $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 580 $msg_error_FluxBB2PWG .= ' <a href="'; 581 $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array( 582 'action' => 'del_user', 583 'id' => $row['id'], 316 584 )); 317 585 318 $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"'; 319 320 $msg_error_Synchro .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 321 322 $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>'; 323 324 if ($row['pwg_pwd'] != $row['bb_pwd']) 325 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd'); 326 327 if ($row['pwg_eml'] != $row['bb_eml']) 328 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml']; 329 } 330 else if ($conf_Register_FluxBB[5] == 'true') 331 $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK'); 332 } 333 334 if ($msg_error_Synchro <> '') 335 $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro; 336 337 if ($msg_ok_Synchro <> '') 338 if ($msg_error_Synchro <> '') 339 array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'); 586 $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; 587 588 $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 589 590 $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; 591 } 592 593 if ($msg_error_FluxBB2PWG == '') 594 array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK')); 340 595 else 341 array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK')); 342 343 344 $query = " 345 SELECT username, mail_address FROM ".USERS_TABLE." 346 WHERE BINARY username <> BINARY 'guest' 347 AND id not in ( 348 SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE." 349 ) 350 AND BINARY username not in ( 351 SELECT username FROM ".FluxBB_USERS_TABLE." 352 ) 353 ORDER BY LOWER(username) 354 ;"; 355 356 $result = pwg_query($query); 357 358 while($row = pwg_db_fetch_assoc($result)) 359 { 360 $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')'; 361 362 $msg_error_PWG2FluxBB .= ' <a href="'; 363 364 $msg_error_PWG2FluxBB .= add_url_params($page_Register_FluxBB_admin, array( 365 'action' => 'add_user', 366 'username' => stripslashes($row['username']), 367 )); 368 369 $msg_error_PWG2FluxBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" '; 370 371 $msg_error_PWG2FluxBB .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 372 373 $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>'; 374 } 375 376 if ($msg_error_PWG2FluxBB == '') 377 array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK')); 596 $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG; 597 } 378 598 else 379 $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB; 380 381 382 383 $query = " 384 SELECT id, username, email FROM ".FluxBB_USERS_TABLE." 385 WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."' 386 AND id not in ( 387 SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE." 388 ) 389 AND BINARY username not in ( 390 SELECT username FROM ".USERS_TABLE." 391 ) 392 ORDER BY LOWER(username) 393 ;"; 394 395 $result = pwg_query($query); 396 397 while($row = pwg_db_fetch_assoc($result)) 398 { 399 $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 400 401 $msg_error_FluxBB2PWG .= ' <a href="'; 402 403 $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array( 404 'action' => 'del_user', 405 'id' => $row['id'], 406 )); 407 408 $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; 409 410 $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 411 412 $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; 413 } 414 415 if ($msg_error_FluxBB2PWG == '') 416 array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK')); 417 else 418 $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG; 419 420 599 $errors[] = l10n('Advise_Check_Dup'); 421 600 422 601 if ($msg_error_PWG_Dup <> '') 423 602 $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 424 603 425 604 if ($msg_error_FluxBB_Dup <> '') 426 605 $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); … … 441 620 $errors[] = $msg_error_FluxBB2PWG; 442 621 } 443 444 445 446 447 // +-----------------------------------------------------------------------+ 448 // | Actions process 449 // +-----------------------------------------------------------------------+ 450 451 if (isset($_GET['action']) and ($_GET['action']=='link_dead')) 452 { 453 $query = " 454 DELETE FROM ".Register_FluxBB_ID_TABLE." 455 WHERE id_user_FluxBB NOT IN ( 456 SELECT id 457 FROM ".FluxBB_USERS_TABLE." 458 ) 459 OR id_user_pwg NOT IN ( 460 SELECT id 461 FROM ".USERS_TABLE." 462 ) 463 ;"; 464 465 $result = pwg_query($query); 466 622 else if ( isset($_POST['Audit'])) 623 { 467 624 Audit_PWG_FluxBB(); 468 625 } 469 else if (isset($_GET['action']) and ($_GET['action']=='link_del') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) 470 { 471 $query = " 472 DELETE FROM ".Register_FluxBB_ID_TABLE." 473 WHERE id_user_pwg = ".$_GET['pwg_id']." 474 AND id_user_FluxBB = ".$_GET['bb_id']." 475 ;"; 476 477 $result = pwg_query($query); 478 479 Audit_PWG_FluxBB(); 480 } 481 else if (isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) 482 { 483 FluxBB_Linkuser($_GET['pwg_id'], $_GET['bb_id']); 484 485 Audit_PWG_FluxBB(); 486 } 487 else if (isset($_GET['action']) and ($_GET['action']=='sync_user') and isset($_GET['username'])) 488 { 489 $query = " 490 SELECT id AS id_pwg, username, password, mail_address 491 FROM ".USERS_TABLE." 492 WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."' 493 LIMIT 1 494 ;"; 495 496 $data = pwg_db_fetch_assoc(pwg_query($query)); 497 498 if (!empty($data)) 499 { 500 FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['password'], $data['mail_address']); 501 } 502 503 Audit_PWG_FluxBB(); 504 } 505 else if (isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username'])) 506 { 507 $query = " 508 SELECT id, username, password, mail_address 509 FROM ".USERS_TABLE." 510 WHERE BINARY username = BINARY '".pwg_db_real_escape_string($_GET['username'])."' 511 LIMIT 1 512 ;"; 513 514 $data = pwg_db_fetch_assoc(pwg_query($query)); 515 516 if (!empty($data)) 517 FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 518 519 Audit_PWG_FluxBB(); 520 } 521 else if (isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id'])) 522 { 523 FluxBB_Deluser( $_GET['id'], true ); 524 525 Audit_PWG_FluxBB(); 526 } 527 528 529 // +-----------------------------------------------------------------------+ 530 // | Tabssheet select | 531 // +-----------------------------------------------------------------------+ 532 533 switch ($page['tab']) 534 { 535 case 'info': 536 537 $template->assign( 538 array( 539 'REGFLUXBB_PATH' => REGFLUXBB_PATH, 540 'REGFLUXBB_VERSION' => $version, 541 ) 542 ); 543 544 $template->set_filename('plugin_admin_content', dirname(__FILE__).'/template/info.tpl'); 545 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 546 547 break; 548 549 case 'manage': 550 551 if (isset($_POST['submit']) and isset($_POST['FluxBB_prefix']) and isset($_POST['FluxBB_admin']) and isset($_POST['FluxBB_guest']) and isset($_POST['FluxBB_del_pt']) and isset($_POST['FluxBB_confirm']) and isset($_POST['FluxBB_details'])) 552 { 553 554 /* Configuration controls */ 555 // Piwigo's admin username control 556 $query1 = " 557 SELECT username, id 558 FROM ".USERS_TABLE." 559 WHERE id = ".$conf['webmaster_id']." 560 ;"; 561 562 $pwgadmin = pwg_db_fetch_assoc(pwg_query($query1)); 563 564 // FluxBB's admin username control 565 $query2 = " 566 SELECT username, id 567 FROM ".FluxBB_USERS_TABLE." 568 WHERE id = 2 569 ;"; 570 571 $fbbadmin = pwg_db_fetch_assoc(pwg_query($query2)); 572 573 // FluxBB's Guest username control 574 $query3 = " 575 SELECT username, id 576 FROM ".FluxBB_USERS_TABLE." 577 WHERE id = 1 578 ;"; 579 580 $fbbguest = pwg_db_fetch_assoc(pwg_query($query3)); 581 582 // Compute configuration errors 583 if (stripslashes($pwgadmin['username']) != stripslashes($_POST['FluxBB_admin'])) 584 { 585 array_push($page['errors'], l10n('error_config_admin1')); 586 } 587 if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username'])) 588 { 589 array_push($page['errors'], l10n('error_config_admin2')); 590 } 591 if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest'])) 592 { 593 array_push($page['errors'], l10n('error_config_guest')); 594 } 595 elseif (count($page['errors']) == 0) 596 { 597 if (!function_exists('FindAvailableConfirmMailID')) 598 { 599 $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0'; 600 } 601 elseif (function_exists('FindAvailableConfirmMailID')) 602 { 603 $conf_UAM = unserialize($conf['UserAdvManager']); 604 605 if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and isset($conf_UAM[2]) and $conf_UAM[2] != '-1') 606 { 607 $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';'.$_POST['FluxBB_UAM'].';'.$_POST['FluxBB_group']; 608 } 609 else 610 { 611 $conf['Register_FluxBB'] = $_POST['FluxBB_prefix'].';'.pwg_db_real_escape_string($_POST['FluxBB_admin']).';'.pwg_db_real_escape_string($_POST['FluxBB_guest']).';'.$_POST['FluxBB_del_pt'].';'.$_POST['FluxBB_confirm'].';'.$_POST['FluxBB_details'].';false;0'; 612 } 613 } 614 615 conf_update_param('Register_FluxBB', $conf['Register_FluxBB']); 616 617 array_push($page['infos'], l10n('save_config')); 618 } 619 } 620 621 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 626 627 628 // +---------------------------------------------------------------+ 629 // | Template init | 630 // +---------------------------------------------------------------+ 631 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 622 632 623 633 // If UAM exists and if UAM ConfirmMail is set, we can set this feature 624 if (function_exists('FindAvailableConfirmMailID')) 625 { 626 $conf_UAM = unserialize($conf['UserAdvManager']); 627 628 if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and (isset($conf_UAM[2]) and $conf_UAM[2] <> '-1')) 629 { 630 $UAM_bridge = true; 631 } 632 else $UAM_bridge = false; 633 } 634 635 $template->assign( 636 array 637 ( 638 'REGFLUXBB_PATH' => REGFLUXBB_PATH, 639 'REGFLUXBB_VERSION' => $version, 640 'FluxBB_PREFIX' => $conf_Register_FluxBB[0], 641 'FluxBB_ADMIN' => stripslashes($conf_Register_FluxBB[1]), 642 'FluxBB_GUEST' => stripslashes($conf_Register_FluxBB[2]), 643 'FluxBB_DEL_PT_TRUE' => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'true') ? 'checked="checked"' : '', 644 'FluxBB_DEL_PT_FALSE' => (isset($conf_Register_FluxBB[3]) and $conf_Register_FluxBB[3] == 'false') ? 'checked="checked"' : '', 645 'FluxBB_CONFIRM_TRUE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'true') ? 'checked="checked"' : '', 646 'FluxBB_CONFIRM_FALSE' => (isset($conf_Register_FluxBB[4]) and $conf_Register_FluxBB[4] == 'false') ? 'checked="checked"' : '', 647 'FluxBB_DETAILS_TRUE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'true') ? 'checked="checked"' : '', 648 'FluxBB_DETAILS_FALSE' => (isset($conf_Register_FluxBB[5]) and $conf_Register_FluxBB[5] == 'false') ? 'checked="checked"' : '', 649 'UAM_BRIDGE' => $UAM_bridge, 650 'FluxBB_UAM_LINK_TRUE' => (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') ? 'checked="checked"' : '', 651 'FluxBB_UAM_LINK_FALSE'=> (isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'false') ? 'checked="checked"' : '', 652 'FluxBB_GROUP' => $conf_Register_FluxBB[7], 653 ) 654 ); 655 656 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/manage.tpl'); 657 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 658 659 break; 660 661 case 'Migration': 662 663 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 664 665 if (isset($_POST['Migration'])) 666 { 667 array_push($page['infos'], l10n('Mig_Start').'<br><br>'); 668 669 array_push($page['infos'], l10n('Mig_Del_Link').'<br><br>'); 670 671 $query = "TRUNCATE ".Register_FluxBB_ID_TABLE.";"; 672 $result = pwg_query($query); 673 674 675 $msg_Mig_Del_AllUsers = ''; 676 677 $query = " 678 SELECT username, id 679 FROM ".FluxBB_USERS_TABLE." 680 ;"; 681 682 $result = pwg_query($query); 683 684 while ($row = pwg_db_fetch_assoc($result)) 685 { 686 if((stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[2])) and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1]))) 687 { 688 $msg_Mig_Del_AllUsers .= '<br> - '.l10n('Mig_Del_User').stripslashes($row['username']); 689 690 FluxBB_Deluser($row['id'], false); 691 } 692 } 693 694 array_push($page['infos'], l10n('Mig_Del_AllUsers').$msg_Mig_Del_AllUsers.'<br><br>'); 695 696 697 $query = " 698 SELECT id, username, password, mail_address 699 FROM ".USERS_TABLE." 700 ;"; 701 702 $result = pwg_query($query); 703 704 $registred = time(); 705 $registred_ip = $_SERVER['REMOTE_ADDR']; 706 707 $msg_Mig_Add_AllUsers = ''; 708 709 while ($row = pwg_db_fetch_assoc($result)) 710 { 711 if((stripslashes($row['username']) != 'guest') and (stripslashes($row['username']) != stripslashes($conf_Register_FluxBB[1]))) 712 { 713 $msg_Mig_Add_AllUsers .= '<br> - '.l10n('Mig_Add_User').stripslashes($row['username']); 714 715 FluxBB_Adduser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']); 716 } 717 } 718 719 array_push($page['infos'], l10n('Mig_Add_AllUsers').$msg_Mig_Add_AllUsers.'<br><br>'); 720 721 722 $query = " 723 SELECT id, username, password, mail_address 724 FROM ".USERS_TABLE." 725 WHERE username = '".$conf_Register_FluxBB[1]."' 726 ;"; 727 728 $row = pwg_db_fetch_assoc(pwg_query($query)); 729 730 if (!empty($row)) 731 { 732 array_push($page['infos'], l10n('Sync_User').stripslashes($row['username']).'<br><br>'); 733 734 FluxBB_Updateuser($row['id'], stripslashes($row['username']), $row['password'], $row['mail_address']); 735 } 736 737 array_push($page['infos'], l10n('Mig_End')); 738 } 739 else if ( isset($_POST['Audit'])) 740 { 741 Audit_PWG_FluxBB(); 742 } 743 744 $template->assign( 745 array 746 ( 747 'REGFLUXBB_PATH' => REGFLUXBB_PATH, 748 'REGFLUXBB_VERSION' => $version, 749 ) 750 ); 751 752 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/migration.tpl'); 753 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 754 755 break; 756 757 case 'Synchro': 758 759 if ( isset($_POST['Synchro'])) 760 { 761 global $page,$conf, $errors; 762 763 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 764 765 $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__); 766 767 768 $msg_error_PWG_Dup = ''; 769 $msg_error_FluxBB_Dup = ''; 770 $msg_error_Link_Break = ''; 771 $msg_error_Link_Bad = ''; 772 $msg_error_Synchro = ''; 773 $msg_ok_Synchro = ''; 774 $msg_error_FluxBB2PWG = ''; 775 $msg_error_PWG2FluxBB = ''; 776 777 778 $query = " 779 SELECT COUNT(*) AS nbr_dup, id, username 780 FROM ".USERS_TABLE." 781 GROUP BY BINARY username 782 HAVING COUNT(*) > 1 783 ;"; 784 785 $result = pwg_query($query); 786 787 while($row = pwg_db_fetch_assoc($result)) 788 $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 789 790 if ($msg_error_PWG_Dup <> '') 791 $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); 792 793 794 $query = " 795 SELECT COUNT(*) AS nbr_dup, username 796 FROM ".FluxBB_USERS_TABLE." 797 GROUP BY BINARY username 798 HAVING COUNT(*) > 1 799 ;"; 800 801 $result = pwg_query($query); 802 803 while($row = pwg_db_fetch_assoc($result)) 804 { 805 $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 806 807 $subquery = " 808 SELECT id, username, email 809 FROM ".FluxBB_USERS_TABLE." 810 WHERE BINARY username = BINARY '".$row['username']."' 811 ;"; 812 813 $subresult = pwg_query($subquery); 814 815 while($subrow = pwg_db_fetch_assoc($subresult)) 816 { 817 $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; 818 819 $msg_error_FluxBB_Dup .= ' <a href="'; 820 821 $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array( 822 'action' => 'del_user', 823 'id' => $subrow['id'], 824 )); 825 826 $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"'; 827 828 $msg_error_FluxBB_Dup .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 829 830 $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>'; 831 } 832 } 833 834 if ($msg_error_FluxBB_Dup <> '') 835 $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); 836 837 838 if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '') 839 { 840 $query = " 841 SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail 842 FROM ".FluxBB_USERS_TABLE." AS bb, ".USERS_TABLE." as pwg 843 WHERE bb.id NOT in ( 844 SELECT id_user_FluxBB 845 FROM ".Register_FluxBB_ID_TABLE." 846 ) 847 AND pwg.id NOT in ( 848 SELECT id_user_pwg 849 FROM ".Register_FluxBB_ID_TABLE." 850 ) 851 AND pwg.username = bb.username 852 AND pwg.mail_address = bb.email 853 ;"; 854 855 $result = pwg_query($query); 856 857 while($row = pwg_db_fetch_assoc($result)) 858 { 859 $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 860 861 FluxBB_Linkuser($row['pwg_id'], $row['bb_id']); 862 } 863 864 if ($msg_error_Link_Break == '') 865 array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK')); 866 else 867 $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break; 868 869 870 $query = " 871 SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail 872 FROM ".FluxBB_USERS_TABLE." AS bb 873 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id 874 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 875 WHERE BINARY pwg.username <> BINARY bb.username 876 ;"; 877 878 $result = pwg_query($query); 879 880 while($row = pwg_db_fetch_assoc($result)) 881 { 882 $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 883 884 $subquery = " 885 DELETE FROM ".Register_FluxBB_ID_TABLE." 886 WHERE id_user_pwg = ".$row['pwg_id']." 887 AND id_user_FluxBB = ".$row['bb_id']." 888 ;"; 889 890 $subresult = pwg_query($subquery); 891 } 892 893 894 $query = " 895 SELECT COUNT(*) as nbr_dead 896 FROM ".Register_FluxBB_ID_TABLE." AS Link 897 WHERE id_user_FluxBB NOT IN ( 898 SELECT id 899 FROM ".FluxBB_USERS_TABLE." 900 ) 901 OR id_user_pwg NOT IN ( 902 SELECT id 903 FROM ".USERS_TABLE." 904 ) 905 ;"; 906 907 $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 908 909 if ( !empty($Compteur) and $Compteur['nbr_dead'] > 0) 910 { 911 $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead']; 912 913 $query = " 914 DELETE FROM ".Register_FluxBB_ID_TABLE." 915 WHERE id_user_FluxBB NOT IN ( 916 SELECT id 917 FROM ".FluxBB_USERS_TABLE." 918 ) 919 OR id_user_pwg NOT IN ( 920 SELECT id 921 FROM ".USERS_TABLE." 922 ) 923 ;"; 924 925 $result = pwg_query($query); 926 } 927 928 929 $query = " 930 SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id 931 FROM ".FluxBB_USERS_TABLE." AS bb 932 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = bb.id 933 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 934 GROUP BY link.id_user_pwg, link.id_user_FluxBB 935 HAVING COUNT(*) > 1 936 ;"; 937 938 $result = pwg_query($query); 939 940 while($row = pwg_db_fetch_assoc($result)) 941 { 942 $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 943 944 FluxBB_Linkuser($row['pwg_id'], $row['bb_id']); 945 } 946 947 if ($msg_error_Link_Bad == '') 948 array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK')); 949 else 950 $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad; 951 952 953 $query = " 954 SELECT pwg.id as pwg_id, pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.password as bb_pwd, FluxBB.email as bb_eml 955 FROM ".FluxBB_USERS_TABLE." AS FluxBB 956 INNER JOIN ".Register_FluxBB_ID_TABLE." AS link ON link.id_user_FluxBB = FluxBB.id 957 INNER JOIN ".USERS_TABLE." as pwg ON link.id_user_pwg = pwg.id 958 AND BINARY pwg.username = BINARY FluxBB.username 959 ORDER BY LOWER(pwg.username) 960 ;"; 961 962 $result = pwg_query($query); 963 964 while($row = pwg_db_fetch_assoc($result)) 965 { 966 if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 967 { 968 $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']); 969 970 $query = " 971 SELECT id, username, password, mail_address 972 FROM ".USERS_TABLE." 973 WHERE BINARY id = '".$row['pwg_id']."' 974 ;"; 975 976 $data = pwg_db_fetch_assoc(pwg_query($query)); 977 978 if (!empty($data)) 979 FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 980 } 981 } 982 983 if ($msg_error_Synchro == '') 984 array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK')); 985 else 986 $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro; 987 988 989 $query = " 990 SELECT username, mail_address FROM ".USERS_TABLE." 991 WHERE BINARY username <> BINARY 'guest' 992 AND id not in ( 993 SELECT id_user_pwg FROM ".Register_FluxBB_ID_TABLE." 994 ) 995 AND BINARY username not in ( 996 SELECT username FROM ".FluxBB_USERS_TABLE." 997 ) 998 ORDER BY LOWER(username) 999 ;"; 1000 1001 $result = pwg_query($query); 1002 1003 while($row = pwg_db_fetch_assoc($result)) 1004 { 1005 $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')'; 1006 1007 $query = " 1008 SELECT id, username, password, mail_address 1009 FROM ".USERS_TABLE." 1010 WHERE BINARY username = BINARY '".$row['username']."' 1011 LIMIT 1 1012 ;"; 1013 1014 $data = pwg_db_fetch_assoc(pwg_query($query)); 1015 1016 if (!empty($data)) 1017 FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['password'], $data['mail_address']); 1018 } 1019 1020 if ($msg_error_PWG2FluxBB == '') 1021 array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK')); 1022 else 1023 $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB; 1024 1025 1026 $query = " 1027 SELECT id, username, email FROM ".FluxBB_USERS_TABLE." 1028 WHERE BINARY username <> BINARY '".$conf_Register_FluxBB[2]."' 1029 AND id not in ( 1030 SELECT id_user_FluxBB FROM ".Register_FluxBB_ID_TABLE." 1031 ) 1032 AND BINARY username not in ( 1033 SELECT username FROM ".USERS_TABLE." 1034 ) 1035 ORDER BY LOWER(username) 1036 ;"; 1037 1038 $result = pwg_query($query); 1039 1040 while($row = pwg_db_fetch_assoc($result)) 1041 { 1042 $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 1043 1044 $msg_error_FluxBB2PWG .= ' <a href="'; 1045 1046 $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array( 1047 'action' => 'del_user', 1048 'id' => $row['id'], 1049 )); 1050 1051 $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; 1052 1053 $msg_error_FluxBB2PWG .= $conf_Register_FluxBB[4]=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 1054 1055 $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; 1056 } 1057 1058 if ($msg_error_FluxBB2PWG == '') 1059 array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK')); 1060 else 1061 $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG; 1062 } 1063 else 1064 $errors[] = l10n('Advise_Check_Dup'); 1065 1066 1067 if ($msg_error_PWG_Dup <> '') 1068 $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1069 1070 if ($msg_error_FluxBB_Dup <> '') 1071 $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1072 1073 if ($msg_error_Link_Break <> '') 1074 $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1075 1076 if ($msg_error_Link_Bad <> '') 1077 $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1078 1079 if ($msg_error_Synchro <> '') 1080 $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1081 1082 if ($msg_error_PWG2FluxBB <> '') 1083 $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 1084 1085 if ($msg_error_FluxBB2PWG <> '') 1086 $errors[] = $msg_error_FluxBB2PWG; 1087 } 1088 else if ( isset($_POST['Audit'])) 1089 { 1090 Audit_PWG_FluxBB(); 1091 } 1092 1093 $template->assign( 1094 array 1095 ( 1096 'REGFLUXBB_PATH' => REGFLUXBB_PATH, 1097 'REGFLUXBB_VERSION' => $version, 1098 ) 1099 ); 1100 1101 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/synchro.tpl'); 1102 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1103 1104 break; 1105 } 634 if (function_exists('FindAvailableConfirmMailID')) 635 { 636 $conf_UAM = unserialize($conf['UserAdvManager']); 637 638 if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local') and (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] <> '-1')) 639 { 640 $UAM_bridge = true; 641 } 642 else $UAM_bridge = false; 643 } 644 645 // Save last opened paragraph in configuration tab 646 // ----------------------------------------------- 647 $nb_para=(isset($_POST["nb_para"])) ? $_POST["nb_para"]:""; 648 $nb_para2=(isset($_POST["nb_para2"])) ? $_POST["nb_para2"]:""; 649 650 $themeconf=$template->get_template_vars('themeconf'); 651 $RFBB_theme=$themeconf['id']; 652 653 $template->assign( 654 array 655 ( 656 'nb_para' => $nb_para, 657 'nb_para2' => $nb_para2, 658 'REGFLUXBB_THEME' => $RFBB_theme, 659 'REGFLUXBB_PATH' => REGFLUXBB_PATH, 660 'REGFLUXBB_VERSION' => $conf_Register_FluxBB['REGFLUXBB_VERSION'], 661 'FluxBB_PREFIX' => $conf_Register_FluxBB['FLUXBB_PREFIX'], 662 'FluxBB_ADMIN' => stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']), 663 'FluxBB_GUEST' => stripslashes($conf_Register_FluxBB['FLUXBB_GUEST']), 664 'FluxBB_DEL_PT_TRUE' => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'true' ? 'checked="checked"' : '', 665 'FluxBB_DEL_PT_FALSE' => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'false' ? 'checked="checked"' : '', 666 'FluxBB_CONFIRM_TRUE' => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'true' ? 'checked="checked"' : '', 667 'FluxBB_CONFIRM_FALSE' => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'false' ? 'checked="checked"' : '', 668 'FluxBB_DETAILS_TRUE' => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true' ? 'checked="checked"' : '', 669 'FluxBB_DETAILS_FALSE' => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'false' ? 'checked="checked"' : '', 670 'UAM_BRIDGE' => $UAM_bridge, 671 'FluxBB_UAM_LINK_TRUE' => $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true' ? 'checked="checked"' : '', 672 'FluxBB_UAM_LINK_FALSE'=> $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'false' ? 'checked="checked"' : '', 673 'FluxBB_GROUP' => $conf_Register_FluxBB['FLUXBB_GROUP'], 674 ) 675 ); 676 677 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/admin.tpl'); 678 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1106 679 ?> -
extensions/Register_FluxBB/include/constants.php
r17457 r21424 3 3 global $prefixeTable, $conf; 4 4 5 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();5 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 6 6 7 7 define('Register_FluxBB_ID_TABLE', $prefixeTable.'Register_FluxBB_id'); 8 define('FluxBB_CONFIG_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'config'); 9 define('FluxBB_USERS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'users'); 10 define('FluxBB_POSTS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'posts'); 11 define('FluxBB_TOPICS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'topics'); 12 define('FluxBB_SUBSCRIPTIONS_TABLE', $conf_Register_FluxBB['FLUXBB_PREFIX'].'topic_subscriptions'); 8 13 9 if (isset($conf_Register_FluxBB[0]))10 {11 define('FluxBB_CONFIG_TABLE', $conf_Register_FluxBB[0].'config');12 define('FluxBB_USERS_TABLE', $conf_Register_FluxBB[0].'users');13 define('FluxBB_POSTS_TABLE', $conf_Register_FluxBB[0].'posts');14 define('FluxBB_TOPICS_TABLE', $conf_Register_FluxBB[0].'topics');15 define('FluxBB_SUBSCRIPTIONS_TABLE', $conf_Register_FluxBB[0].'topic_subscriptions');16 }17 14 ?> -
extensions/Register_FluxBB/include/functions.inc.php
r17457 r21424 3 3 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 4 4 include_once (REGFLUXBB_PATH.'include/constants.php'); 5 6 7 function Audit_PWG_FluxBB() 8 { 9 global $page, $conf, $errors; 10 11 $page_Register_FluxBB_admin = get_admin_plugin_menu_link(__FILE__); 12 13 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 14 15 $msg_error_PWG_Dup = ''; 16 $msg_error_FluxBB_Dup = ''; 17 $msg_error_Link_Break = ''; 18 $msg_error_Link_Bad = ''; 19 $msg_error_Synchro = ''; 20 $msg_ok_Synchro = ''; 21 $msg_error_PWG2FluxBB = ''; 22 $msg_error_FluxBB2PWG = ''; 23 24 $query = ' 25 SELECT COUNT(*) AS nbr_dup, id, username 26 FROM '.USERS_TABLE.' 27 WHERE username NOT IN ("18","16") 28 GROUP BY BINARY username 29 HAVING COUNT(*) > 1 30 ;'; 31 $result = pwg_query($query); 32 33 while($row = pwg_db_fetch_assoc($result)) 34 $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 35 36 if ($msg_error_PWG_Dup == '') 37 array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK')); 38 else 39 $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); 40 41 42 43 $query = ' 44 SELECT COUNT(*) AS nbr_dup, username 45 FROM '.FluxBB_USERS_TABLE.' 46 GROUP BY BINARY username 47 HAVING COUNT(*) > 1 48 ;'; 49 $result = pwg_query($query); 50 51 while($row = pwg_db_fetch_assoc($result)) 52 { 53 $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); 54 55 $subquery = ' 56 SELECT id, username, email 57 FROM '.FluxBB_USERS_TABLE.' 58 WHERE BINARY username = BINARY "'.$row['username'].'" 59 ;'; 60 $subresult = pwg_query($subquery); 61 62 while($subrow = pwg_db_fetch_assoc($subresult)) 63 { 64 $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; 65 66 $msg_error_FluxBB_Dup .= ' <a href="'; 67 68 $msg_error_FluxBB_Dup .= add_url_params($page_Register_FluxBB_admin, array( 69 'action' => 'del_user', 70 'id' => $subrow['id'], 71 )); 72 73 $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"'; 74 75 $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 76 77 $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>'; 78 } 79 } 80 81 if ($msg_error_FluxBB_Dup == '') 82 array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK')); 83 else 84 $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); 85 86 87 88 $query = ' 89 SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail 90 FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg 91 WHERE bb.id NOT in ( 92 SELECT id_user_FluxBB 93 FROM '.Register_FluxBB_ID_TABLE.' 94 ) 95 AND pwg.id NOT in ( 96 SELECT id_user_pwg 97 FROM '.Register_FluxBB_ID_TABLE.' 98 ) 99 AND pwg.username = bb.username 100 AND pwg.username NOT IN ("18","16") 101 AND pwg.mail_address = bb.email 102 ;'; 103 104 $result = pwg_query($query); 105 106 while($row = pwg_db_fetch_assoc($result)) 107 { 108 $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; 109 110 $msg_error_Link_Break .= ' <a href="'; 111 112 $msg_error_Link_Break .= add_url_params($page_Register_FluxBB_admin, array( 113 'action' => 'new_link', 114 'pwg_id' => $row['pwg_id'], 115 'bb_id' => $row['bb_id'], 116 )); 117 118 $msg_error_Link_Break .= '" title="'.l10n('New_Link').stripslashes($row['pwg_user']).'"'; 119 120 $msg_error_Link_Break .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 121 122 $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>'; 123 } 124 125 if ($msg_error_Link_Break == '') 126 array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK')); 127 else 128 $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break; 129 130 131 132 $query = ' 133 SELECT pwg.username as pwg_user, pwg.id as pwg_id, pwg.mail_address as pwg_mail, bb.id as bb_id, bb.username as bb_user, bb.email as bb_mail 134 FROM '.FluxBB_USERS_TABLE.' AS bb 135 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id 136 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 137 WHERE pwg.username <> bb.username 138 AND pwg.username NOT IN ("18","16") 139 ;'; 140 141 $result = pwg_query($query); 142 143 while($row = pwg_db_fetch_assoc($result)) 144 { 145 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; 146 147 $msg_error_Link_Bad .= ' <a href="'; 148 149 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 150 'action' => 'link_del', 151 'pwg_id' => $row['pwg_id'], 152 'bb_id' => $row['bb_id'], 153 )); 154 155 $msg_error_Link_Bad .= '" title="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; 156 157 $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 158 159 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>'; 160 161 $msg_error_Link_Bad .= ' -- <a href="'; 162 163 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 164 'action' => 'sync_user', 165 'username' => stripslashes($row['pwg_user']), 166 )); 167 168 $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"'; 169 170 $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 171 172 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/arrow_switch.png" alt="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'" /></a>'; 173 } 174 175 176 $query = ' 177 SELECT COUNT(*) as nbr_dead 178 FROM '.Register_FluxBB_ID_TABLE.' AS Link 179 WHERE id_user_FluxBB NOT IN ( 180 SELECT id 181 FROM '.FluxBB_USERS_TABLE.' 182 ) 183 OR id_user_pwg NOT IN ( 184 SELECT id 185 FROM '.USERS_TABLE.' 186 ) 187 ;'; 188 189 $Compteur = pwg_db_fetch_assoc(pwg_query($query)); 190 191 if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) 192 { 193 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead']; 194 195 $msg_error_Link_Bad .= ' <a href="'; 196 197 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 198 'action' => 'link_dead', 199 )); 200 201 $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"'; 202 203 $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 204 205 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>'; 206 } 207 208 $query = ' 209 SELECT COUNT(*) AS nbr_dup, pwg.id AS pwg_id, pwg.username AS pwg_user, bb.username AS bb_user, bb.id AS bb_id 210 FROM '.FluxBB_USERS_TABLE.' AS bb 211 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id 212 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 213 WHERE pwg.username NOT IN ("18","16") 214 GROUP BY link.id_user_pwg, link.id_user_FluxBB 215 HAVING COUNT(*) > 1 216 ;'; 217 218 $result = pwg_query($query); 219 220 while($row = pwg_db_fetch_assoc($result)) 221 { 222 $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; 223 224 $msg_error_Link_Bad .= ' <a href="'; 225 226 $msg_error_Link_Bad .= add_url_params($page_Register_FluxBB_admin, array( 227 'action' => 'new_link', 228 'pwg_id' => $row['pwg_id'], 229 'bb_id' => $row['bb_id'], 230 )); 231 232 $msg_error_Link_Bad .= '" title="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; 233 234 $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 235 236 $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_error.png" alt="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'" /></a>'; 237 } 238 239 if ($msg_error_Link_Bad == '') 240 array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK')); 241 else 242 $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad; 243 244 245 246 $query = ' 247 SELECT pwg.username as username, pwg.password as pwg_pwd, pwg.mail_address as pwg_eml, FluxBB.password as bb_pwd, FluxBB.email as bb_eml 248 FROM '.FluxBB_USERS_TABLE.' AS FluxBB 249 INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id 250 INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id 251 WHERE BINARY pwg.username = BINARY FluxBB.username 252 AND pwg.username NOT IN ("18","16") 253 ORDER BY LOWER(pwg.username) 254 ;'; 255 256 $result = pwg_query($query); 257 258 while($row = pwg_db_fetch_assoc($result)) 259 { 260 if ( ($row['pwg_pwd'] != $row['bb_pwd']) or ($row['pwg_eml'] != $row['bb_eml']) ) 261 { 262 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']); 263 264 $msg_error_Synchro .= ' <a href="'; 265 266 $msg_error_Synchro .= add_url_params($page_Register_FluxBB_admin, array( 267 'action' => 'sync_user', 268 'username' => stripslashes($row['username']), 269 )); 270 271 $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"'; 272 273 $msg_error_Synchro .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 274 275 $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>'; 276 277 if ($row['pwg_pwd'] != $row['bb_pwd']) 278 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd'); 279 280 if ($row['pwg_eml'] != $row['bb_eml']) 281 $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml']; 282 } 283 else if ($conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true') 284 $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK'); 285 } 286 287 if ($msg_error_Synchro <> '') 288 $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro; 289 290 if ($msg_ok_Synchro <> '') 291 if ($msg_error_Synchro <> '') 292 array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'); 293 else 294 array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK')); 295 296 297 $query = ' 298 SELECT username, mail_address FROM '.USERS_TABLE.' 299 WHERE BINARY username <> BINARY "guest" 300 AND username NOT IN ("18","16") 301 AND id not in ( 302 SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.' 303 ) 304 AND BINARY username not in ( 305 SELECT username FROM '.FluxBB_USERS_TABLE.' 306 ) 307 ORDER BY LOWER(username) 308 ;'; 309 310 $result = pwg_query($query); 311 312 while($row = pwg_db_fetch_assoc($result)) 313 { 314 $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')'; 315 316 $msg_error_PWG2FluxBB .= ' <a href="'; 317 318 $msg_error_PWG2FluxBB .= add_url_params($page_Register_FluxBB_admin, array( 319 'action' => 'add_user', 320 'username' => stripslashes($row['username']), 321 )); 322 323 $msg_error_PWG2FluxBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" '; 324 325 $msg_error_PWG2FluxBB .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 326 327 $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>'; 328 } 329 330 if ($msg_error_PWG2FluxBB == '') 331 array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK')); 332 else 333 $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB; 334 335 336 337 $query = ' 338 SELECT id, username, email FROM '.FluxBB_USERS_TABLE.' 339 WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'" 340 AND id not in ( 341 SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.' 342 ) 343 AND BINARY username not in ( 344 SELECT username FROM '.USERS_TABLE.' 345 ) 346 ORDER BY LOWER(username) 347 ;'; 348 349 $result = pwg_query($query); 350 351 while($row = pwg_db_fetch_assoc($result)) 352 { 353 $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; 354 355 $msg_error_FluxBB2PWG .= ' <a href="'; 356 357 $msg_error_FluxBB2PWG .= add_url_params($page_Register_FluxBB_admin, array( 358 'action' => 'del_user', 359 'id' => $row['id'], 360 )); 361 362 $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; 363 364 $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; 365 366 $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; 367 } 368 369 if ($msg_error_FluxBB2PWG == '') 370 array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK')); 371 else 372 $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG; 373 374 375 376 if ($msg_error_PWG_Dup <> '') 377 $errors[] = $msg_error_PWG_Dup . ( ($msg_error_FluxBB_Dup == '' and $msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 378 379 if ($msg_error_FluxBB_Dup <> '') 380 $errors[] = $msg_error_FluxBB_Dup . ( ($msg_error_Link_Break == '' and $msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 381 382 if ($msg_error_Link_Break <> '') 383 $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 384 385 if ($msg_error_Link_Bad <> '') 386 $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 387 388 if ($msg_error_Synchro <> '') 389 $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 390 391 if ($msg_error_PWG2FluxBB <> '') 392 $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); 393 394 if ($msg_error_FluxBB2PWG <> '') 395 $errors[] = $msg_error_FluxBB2PWG; 396 } 5 397 6 398 … … 47 439 FROM '.USERS_TABLE.' 48 440 WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' 441 AND '.$conf['user_fields']['username'].' NOT IN ("18","16") 49 442 ;'; 50 443 … … 61 454 global $conf, $user; 62 455 63 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();456 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 64 457 65 458 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters … … 73 466 if ($data['status'] <> "admin" and $data['status'] <> "webmaster") 74 467 { 75 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[ 6]) and $conf_Register_FluxBB[6] == 'true')468 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true') 76 469 { 77 470 $conf_UAM = unserialize($conf['UserAdvManager']); 78 471 79 472 // Getting unvalidated users group else Piwigo's default group 80 if (isset($conf_UAM[ 2]) and $conf_UAM[2] != '-1')473 if (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] != '-1') 81 474 { 82 $Waitingroup = $conf_UAM[ 2];475 $Waitingroup = $conf_UAM['NO_CONFIRM_GROUP']; 83 476 } 84 477 else … … 104 497 105 498 // Check if logged in user is in a FluxBB's unvalidated group 106 $query = "499 $query = ' 107 500 SELECT group_id 108 FROM ".FluxBB_USERS_TABLE."109 WHERE id = ".FluxBB_Searchuser($user['id'])."110 ; ";501 FROM '.FluxBB_USERS_TABLE.' 502 WHERE id = '.FluxBB_Searchuser($user['id']).' 503 ;'; 111 504 112 505 $data = pwg_db_fetch_assoc(pwg_query($query)); 113 506 114 // Logged in user switch to the default FluxBB's group if he 'is validated115 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[ 7])507 // Logged in user switch to the default FluxBB's group if he is validated 508 if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB['FLUXBB_GROUP']) 116 509 { 117 $query = "510 $query = ' 118 511 SELECT conf_value 119 FROM ".FluxBB_CONFIG_TABLE."120 WHERE conf_name = 'o_default_user_group'121 ; ";512 FROM '.FluxBB_CONFIG_TABLE.' 513 WHERE conf_name = "o_default_user_group" 514 ;'; 122 515 123 516 $o_user_group = pwg_db_fetch_assoc(pwg_query($query)); 124 517 125 $query = "126 UPDATE ".FluxBB_USERS_TABLE."127 SET group_id = ".$o_user_group['conf_value']."128 WHERE id = ".FluxBB_Searchuser($user['id'])."129 ; ";518 $query = ' 519 UPDATE '.FluxBB_USERS_TABLE.' 520 SET group_id = '.$o_user_group['conf_value'].' 521 WHERE id = '.FluxBB_Searchuser($user['id']).' 522 ;'; 130 523 pwg_query($query); 131 524 } … … 139 532 global $conf; 140 533 141 // Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table534 // Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table 142 535 // If "test" user already exists, "TEST" or "Test" (and so on...) can't register 143 $query = "536 $query = ' 144 537 SELECT username 145 FROM ".FluxBB_USERS_TABLE."146 WHERE LOWER( ".stripslashes('username').") = '".strtolower($user['username'])."'147 ; ";538 FROM '.FluxBB_USERS_TABLE.' 539 WHERE LOWER('.stripslashes('username').') = "'.strtolower($user['username']).'" 540 ;'; 148 541 149 542 $count = pwg_db_num_rows(pwg_query($query)); … … 159 552 function FluxBB_Linkuser($pwg_id, $bb_id) 160 553 { 161 $query = "554 $query = ' 162 555 SELECT pwg.id as pwg_id, bb.id as bb_id 163 FROM ".USERS_TABLE." pwg, ".FluxBB_USERS_TABLE." bb 164 WHERE pwg.id = ".$pwg_id." 165 AND bb.id = ".$bb_id." 166 AND pwg.username = bb.username 167 ;"; 556 FROM '.USERS_TABLE.' pwg, '.FluxBB_USERS_TABLE.' bb 557 WHERE pwg.id = '.$pwg_id.' 558 AND bb.id = '.$bb_id.' 559 AND pwg.username = bb.username 560 AND pwg.username NOT IN ("18","16") 561 ;'; 168 562 169 563 $data = pwg_db_fetch_row(pwg_query($query)); … … 171 565 if (!empty($data)) 172 566 { 173 $subquery = "174 DELETE FROM ".Register_FluxBB_ID_TABLE."175 WHERE id_user_pwg = '".$pwg_id."'176 OR id_user_FluxBB = '".$bb_id."'177 ; ";567 $subquery = ' 568 DELETE FROM '.Register_FluxBB_ID_TABLE.' 569 WHERE id_user_pwg = "'.$pwg_id.'" 570 OR id_user_FluxBB = "'.$bb_id.'" 571 ;'; 178 572 179 573 $subresult = pwg_query($subquery); 180 574 181 $subquery = "182 INSERT INTO ".Register_FluxBB_ID_TABLE."575 $subquery = ' 576 INSERT INTO '.Register_FluxBB_ID_TABLE.' 183 577 (id_user_pwg, id_user_FluxBB) 184 VALUES ( ".$pwg_id.", ".$bb_id.")185 ; ";578 VALUES ('.$pwg_id.', '.$bb_id.') 579 ;'; 186 580 187 581 $subresult = pwg_query($subquery); … … 193 587 function FluxBB_Unlinkuser($bb_id) 194 588 { 195 $query = "196 DELETE FROM ".Register_FluxBB_ID_TABLE."197 WHERE id_user_FluxBB = ".$bb_id."198 ; ";589 $query = ' 590 DELETE FROM '.Register_FluxBB_ID_TABLE.' 591 WHERE id_user_FluxBB = '.$bb_id.' 592 ;'; 199 593 200 594 $result = pwg_query($query); … … 207 601 global $errors, $conf; 208 602 209 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array();603 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 210 604 211 605 $registred = time(); … … 213 607 214 608 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters 215 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[ 6]) and $conf_Register_FluxBB[6] == 'true')216 { 217 $o_default_user_group = $conf_Register_FluxBB[7];609 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true') 610 { 611 $o_default_user_group1 = $conf_Register_FluxBB['FLUXBB_GROUP']; 218 612 } 219 613 else 220 614 { 615 $query = ' 616 SELECT conf_value 617 FROM '.FluxBB_CONFIG_TABLE.' 618 WHERE conf_name = "o_default_user_group" 619 ;'; 620 621 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); 622 } 623 624 // Check for FluxBB version 1.4.x or higher and get the correct value 625 $query1 = ' 626 SELECT conf_value 627 FROM '.FluxBB_CONFIG_TABLE.' 628 WHERE conf_name = "o_default_timezone" 629 ;'; 630 631 $count1 = pwg_db_num_rows(pwg_query($query1)); 632 633 // Check for FluxBB version 1.2.x and get the correct value 634 $query2 = ' 635 SELECT conf_value 636 FROM '.FluxBB_CONFIG_TABLE.' 637 WHERE conf_name = "o_server_timezone" 638 ;'; 639 640 $count2 = pwg_db_num_rows(pwg_query($query2)); 641 642 if ($count1 == 1 and $count2 == 0) 643 { 644 $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1)); 645 } 646 else if ($count1 == 0 and $count2 == 1) 647 { 648 $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2)); 649 } 650 651 652 $query = ' 653 SELECT conf_value 654 FROM '.FluxBB_CONFIG_TABLE.' 655 WHERE conf_name = "o_default_lang" 656 ;'; 657 658 $o_default_lang = pwg_db_fetch_assoc(pwg_query($query)); 659 660 $query = ' 661 SELECT conf_value 662 FROM '.FluxBB_CONFIG_TABLE.' 663 WHERE conf_name = "o_default_style" 664 ;'; 665 666 $o_default_style = pwg_db_fetch_assoc(pwg_query($query)); 667 668 // Check if UAM is installed and if bridge is set - Exception for admins and webmasters 669 if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB['FLUXBB_UAM_LINK']) and $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true') 670 { 221 671 $query = " 222 SELECT conf_value223 FROM ".FluxBB_CONFIG_TABLE."224 WHERE conf_name = 'o_default_user_group'225 ;";226 227 $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query));228 }229 230 // Check for FluxBB version 1.4.x and get the correct value231 $query1 = "232 SELECT conf_value233 FROM ".FluxBB_CONFIG_TABLE."234 WHERE conf_name = 'o_default_timezone'235 ;";236 237 $count1 = pwg_db_num_rows(pwg_query($query1));238 239 // Check for FluxBB version 1.2.x and get the correct value240 $query2 = "241 SELECT conf_value242 FROM ".FluxBB_CONFIG_TABLE."243 WHERE conf_name = 'o_server_timezone'244 ;";245 246 $count2 = pwg_db_num_rows(pwg_query($query2));247 248 if ($count1 == 1 and $count2 == 0)249 {250 $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1));251 }252 else if ($count1 == 0 and $count2 == 1)253 {254 $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2));255 }256 257 258 $query = "259 SELECT conf_value260 FROM ".FluxBB_CONFIG_TABLE."261 WHERE conf_name = 'o_default_lang'262 ;";263 264 $o_default_lang = pwg_db_fetch_assoc(pwg_query($query));265 266 $query = "267 SELECT conf_value268 FROM ".FluxBB_CONFIG_TABLE."269 WHERE conf_name = 'o_default_style'270 ;";271 272 $o_default_style = pwg_db_fetch_assoc(pwg_query($query));273 274 $query = "275 672 INSERT INTO ".FluxBB_USERS_TABLE." ( 276 username, 277 ". ( isset($o_default_user_group ['conf_value']) ? 'group_id' : '' ) .",278 password, 279 email, 673 username, 674 ". ( isset($o_default_user_group1) ? 'group_id' : '' ) .", 675 password, 676 email, 280 677 ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .", 281 678 ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .", 282 679 ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .", 283 registered, 284 registration_ip, 680 registered, 681 registration_ip, 682 last_visit 683 ) 684 VALUES( 685 '".pwg_db_real_escape_string($login)."', 686 ". ( isset($o_default_user_group1) ? "'".$o_default_user_group1."'" : '' ) .", 687 '".$password."', 688 '".$adresse_mail."', 689 ". ( isset($o_default_timezone['conf_value']) ? "'".$o_default_timezone['conf_value']."'" : '' ) .", 690 ". ( isset($o_default_lang['conf_value']) ? "'".$o_default_lang['conf_value']."'" : '' ) .", 691 ". ( isset($o_default_style['conf_value']) ? "'".$o_default_style['conf_value']."'" : '' ) .", 692 '".$registred."', 693 '".$registred_ip."', 694 '".$registred."' 695 );"; 696 697 $result = pwg_query($query); 698 } 699 else 700 { 701 $query = " 702 INSERT INTO ".FluxBB_USERS_TABLE." ( 703 username, 704 ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .", 705 password, 706 email, 707 ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .", 708 ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .", 709 ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .", 710 registered, 711 registration_ip, 285 712 last_visit 286 713 ) … … 298 725 ) 299 726 ;"; 300 301 $result = pwg_query($query);727 $result = pwg_query($query); 728 } 302 729 303 730 $bb_id = pwg_db_insert_id(); … … 310 737 function FluxBB_Searchuser($id_user_pwg) 311 738 { 312 $query = "739 $query = ' 313 740 SELECT id_user_FluxBB, id_user_pwg 314 FROM ".Register_FluxBB_ID_TABLE."315 WHERE id_user_pwg = ".$id_user_pwg."741 FROM '.Register_FluxBB_ID_TABLE.' 742 WHERE id_user_pwg = '.$id_user_pwg.' 316 743 LIMIT 1 317 ; ";744 ;'; 318 745 319 746 $data = pwg_db_fetch_assoc(pwg_query($query)); … … 331 758 global $conf; 332 759 333 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 334 335 $query0 = " 336 SELECT username, id FROM ".FluxBB_USERS_TABLE." 337 WHERE id = ".$id_user_FluxBB." 760 $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); 761 762 $query0 = ' 763 SELECT username, id 764 FROM '.FluxBB_USERS_TABLE.' 765 WHERE id = '.$id_user_FluxBB.' 338 766 LIMIT 1 339 ; ";767 ;'; 340 768 341 769 $data0 = pwg_db_fetch_assoc(pwg_query($query0)); 342 770 343 771 // If True, delete related topics and posts 344 if ($SuppTopicsPosts and $conf_Register_FluxBB[ 3])772 if ($SuppTopicsPosts and $conf_Register_FluxBB['FLUXBB_DEL_PT']) 345 773 { 346 774 // Delete posts and topics of this user 347 $subquery = "348 DELETE FROM ".FluxBB_POSTS_TABLE."349 WHERE poster_id = ".$id_user_FluxBB."350 ; ";775 $subquery = ' 776 DELETE FROM '.FluxBB_POSTS_TABLE.' 777 WHERE poster_id = '.$id_user_FluxBB.' 778 ;'; 351 779 352 780 $subresult = pwg_query($subquery); 353 781 354 782 // Delete topics of this user 355 $subquery = "356 DELETE FROM ".FluxBB_TOPICS_TABLE."357 WHERE BINARY poster = BINARY '".pwg_db_real_escape_string($data0['username'])."'358 ; ";783 $subquery = ' 784 DELETE FROM '.FluxBB_TOPICS_TABLE.' 785 WHERE BINARY poster = BINARY "'.pwg_db_real_escape_string($data0['username']).'" 786 ;'; 359 787 360 788 $subresult = pwg_query($subquery); … … 362 790 363 791 // Delete user's subscriptions 364 $subquery = "365 DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE."366 WHERE user_id = ".$id_user_FluxBB."367 ; ";792 $subquery = ' 793 DELETE FROM '.FluxBB_SUBSCRIPTIONS_TABLE.' 794 WHERE user_id = '.$id_user_FluxBB.' 795 ;'; 368 796 369 797 $subresult = pwg_query($subquery); 370 798 371 799 // Delete user's account 372 $subquery = "373 DELETE FROM ".FluxBB_USERS_TABLE."374 WHERE id = ".$id_user_FluxBB."375 ; ";800 $subquery = ' 801 DELETE FROM '.FluxBB_USERS_TABLE.' 802 WHERE id = '.$id_user_FluxBB.' 803 ;'; 376 804 377 805 $subresult = pwg_query($subquery); … … 386 814 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 387 815 388 $query = "816 $query = ' 389 817 SELECT id_user_FluxBB as FluxBB_id 390 FROM ".Register_FluxBB_ID_TABLE."391 WHERE id_user_pwg = ".$pwg_id."392 ; ";818 FROM '.Register_FluxBB_ID_TABLE.' 819 WHERE id_user_pwg = '.$pwg_id.' 820 ;'; 393 821 394 822 $row = pwg_db_fetch_assoc(pwg_query($query)); … … 396 824 if (!empty($row)) 397 825 { 398 $query = " 399 UPDATE ".FluxBB_USERS_TABLE." 400 SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 401 WHERE id = ".$row['FluxBB_id']." 402 ;"; 826 $query = ' 827 UPDATE '.FluxBB_USERS_TABLE.' 828 SET username = "'.pwg_db_real_escape_string($username).'", email = "'.$adresse_mail.'", password = "'.$password.'" 829 WHERE id = '.$row['FluxBB_id'].' 830 AND "'.pwg_db_real_escape_string($username).'" NOT IN ("18","16") 831 ;'; 403 832 404 833 $result = pwg_query($query); … … 408 837 else 409 838 { 410 $query = "839 $query = ' 411 840 SELECT id as FluxBB_id 412 FROM ".FluxBB_USERS_TABLE."413 WHERE BINARY username = BINARY '".pwg_db_real_escape_string($username)."'414 ; ";841 FROM '.FluxBB_USERS_TABLE.' 842 WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($username).'" 843 ;'; 415 844 416 845 $row = pwg_db_fetch_assoc(pwg_query($query)); … … 418 847 if (!empty($row)) 419 848 { 420 $query = " 421 UPDATE ".FluxBB_USERS_TABLE." 422 SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' 423 WHERE id = ".$row['FluxBB_id']." 424 ;"; 849 $query = ' 850 UPDATE '.FluxBB_USERS_TABLE.' 851 SET username = "'.pwg_db_real_escape_string($username).'", email = "'.$adresse_mail.'", password = "'.$password.'" 852 WHERE id = '.$row['FluxBB_id'].' 853 AND "'.pwg_db_real_escape_string($username).'" NOT IN ("18","16") 854 ;'; 425 855 426 856 $result = pwg_query($query); … … 475 905 return $plugin ; 476 906 } 907 477 908 478 909 function regfluxbb_obsolete_files() … … 493 924 } 494 925 } 926 927 928 /** 929 * Function to update plugin version number in config table 930 * Used everytime a new version is updated even if no database 931 * upgrade is needed 932 */ 933 function RegFluxBB_version_update() 934 { 935 global $conf; 936 937 // Get current plugin version 938 // -------------------------- 939 $plugin = PHInfos(REGFLUXBB_PATH); 940 $version = $plugin['version']; 941 942 // Upgrading options 943 // ----------------- 944 $query = ' 945 SELECT value 946 FROM '.CONFIG_TABLE.' 947 WHERE param = "Register_FluxBB" 948 ;'; 949 950 $result = pwg_query($query); 951 $Conf_RegFluxBB = pwg_db_fetch_assoc($result); 952 953 $Newconf_RegFluxBB = unserialize($Conf_RegFluxBB['value']); 954 955 $Newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; 956 957 $update_conf = serialize($Newconf_RegFluxBB); 958 959 conf_update_param('Register_FluxBB', pwg_db_real_escape_string($update_conf)); 960 961 962 // Check #_plugin table consistency 963 // Only useful if a previous version upgrade has not worked correctly (rare case) 964 // ------------------------------------------------------------------------------ 965 $query = ' 966 SELECT version 967 FROM '.PLUGINS_TABLE.' 968 WHERE id = "Register_FluxBB" 969 ;'; 970 971 $data = pwg_db_fetch_assoc(pwg_query($query)); 972 973 if (empty($data['version']) or $data['version'] <> $version) 974 { 975 $query = ' 976 UPDATE '.PLUGINS_TABLE.' 977 SET version="'.$version.'" 978 WHERE id = "Register_FluxBB" 979 LIMIT 1 980 ;'; 981 982 pwg_query($query); 983 } 984 } 985 986 987 /** 988 * Useful for debugging - 4 vars can be set 989 * Output result to log.txt file 990 * 991 */ 992 function RegFluxBBLog($var1, $var2, $var3, $var4) 993 { 994 $fo=fopen (REGFLUXBB_PATH.'log.txt','a') ; 995 fwrite($fo,"======================\n") ; 996 fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n"); 997 fwrite($fo,$var1 ."\r\n") ; 998 fwrite($fo,$var2 ."\r\n") ; 999 fwrite($fo,$var3 ."\r\n") ; 1000 fwrite($fo,$var4 ."\r\n") ; 1001 fclose($fo) ; 1002 } 495 1003 ?> -
extensions/Register_FluxBB/language/en_UK/plugin.lang.php
r19138 r21424 1 1 <?php 2 $lang['Tab_Info'] = 'Instructions'; 3 $lang['Tab_Manage'] = 'Step 1 : Plugin configuration'; 4 $lang['Tab_Migration'] = 'Step 2 : Accounts migration'; 5 $lang['Tab_Synchro'] = 'Maintenance : Accounts re-synchronization'; 2 $lang['Title'] = 'Register_FluxBB - Version: '; 3 $lang['save_config'] ='Settings saved'; 6 4 7 $lang['Title'] = 'Register FluxBB'; 5 $lang['Instruction_Title'] = 'Instructions (important to read first!)'; 6 $lang['Instruction_Title_d'] = 'Instructions and important information'; 7 $lang['Disclaimer'] = ' 8 *** To begin, follow this 2 steps ***<br/> 9 Step 1 : Configure the plugin parameters related to FluxBB parameters<br/> 10 Step 2 : Migrate users accounts from Piwigo to FluxBB<br/><br/> 11 After these 2 main steps, the plugin is fully functional.<br/><br/> 12 *** For the maintenance of already active connections ***<br/> 13 Maintenance : Synchronize tables (in case an addition, an update or a user deletion mismatched) allows to update passwords and email addresses and shows intruders (But you should not have to use it regularly).<br/><br/> 14 <div class="warning">WARNING !! For safety, be sure to make a backup of your database and especially your ###_user tables before any action.</div> 15 <br/><br/> 16 <div class="warning">Important to know:<br/> 17 By default, <b>FluxBB</b> is case <u>insensitive</u> on usernames. That is, if a user called "test" is already registered, other entries like "Test" or "TEST" or "TEst" (etc. ..) will be rejected.<br/><br/> 18 By default, <b>Piwigo</b> works in reverse and is therefore case <u>sensitive</u> on usernames ("test" will be a different user of "Test" or "TEST", etc. ...).<br/> 19 To avoid problems (even if Piwigo\'s behavior can be easily changed - See configuration options), Register_FluxBB will link the two applications using FluxBB behavior: Being case <u>insensitive</u> for usernames.<br/><br/></div>'; 20 21 22 $lang['About_Reg_Title'] = 'About the registration of users on FluxBB forum'; 23 $lang['About_Reg_Title_d'] = 'Useful instructions for better integration'; 24 $lang['No_Reg_advise'] = ' 25 For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum script</b>): 26 <br/><br/> 27 <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (see: Options - Registration)</b> 28 <br/><br/> 29 <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line: 30 <div class="mod">\'No new regs\' => \'This forum is not accepting new users.\'</div> 31 <b>with :</b> 32 <div class="info">\'No new regs\' => \'<a href="http://[YourPiwigoRoot]/register.php" > Go here to register </a><br/><br/>\'</div> 33 <br/> 34 Of course you should also make the same change for other languages of your FluxBB forum. 35 <br/><br/> 36 <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing around line 64: 37 <div class="mod">message($lang_login[\'Wrong user/pass\'].\'<a href="login.php?action=forget"></div> 38 <b>with :</b> 39 <div class="info">message($lang_login[\'Wrong user/pass\'].\'<a href="../[YourPiwigoRoot]/password.php"></div> 40 <br/> 41 and around line 295: 42 <div class="mod"><a href="login.php?action=forget" tabindex="5"><?php echo $lang_login[\'Forgotten pass\']</a></div> 43 <b>with :</b> 44 <div class="info"><a href="../[YourPiwigoRoot]/password.php" tabindex="5"><?php echo $lang_login[\'Forgotten pass\'] ?></a></div> 45 <br/>'; 46 47 48 $lang['About_Bridge_Title'] = 'About Register_FluxBB / UAM bridge'; 49 $lang['About_Bridge_Title_d'] = 'Instruction about bridge between Register_FluxBB and UserAdvManager plugins'; 50 $lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the linked forum: Registrants can not post until they have validated their registration in the gallery. <br/> 51 Here is the general procedure to apply: 52 <br/> 53 - In the administration panel of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br/> 54 - Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br/> 55 - Remove for the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br/> 56 - Locate the ID of the second group "no_validated".<br/> 57 - Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings. 58 <br/> 59 <b class="mod"><u>Important notes:</u></b> 60 <br/> 61 If you already used an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br/> 62 Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration process from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration.'; 63 8 64 9 65 $lang['Config_Title'] = 'Plugin setup'; 66 $lang['Config_Title_d'] = 'Plugin setup'; 67 $lang['Config_Title1'] = 'Settings of bridge between FluxBB and Piwigo'; 68 $lang['Config_Title2'] = 'Plugin\'s advanced settings'; 69 10 70 $lang['Config_Disclaimer'] = ' 11 Check the settings of your FluxBB installation and correct them if necessary. <br> 12 Change, if any, the behavior of the plugin at your convenience.'; 13 $lang['Prefix'] = 'FluxBB Prefix tables :'; 14 $lang['Guest'] = 'Username of the FluxBB Guest user.'; 15 $lang['Details'] = 'Level of detail in reports of operations.'; 16 $lang['Details_true'] = ' --> View all details of the results of operations.'; 17 $lang['Details_false'] = ' --> Shows that most of the results of operations'; 18 $lang['Del_Pt'] = 'Removal of topics and posts when the user is deleted.'; 71 Check the settings of your FluxBB installation and fix them if necessary.<br/> 72 Change, if necessary, the behavior of the plugin as you want.'; 73 74 $lang['Details'] = 'Level of detail to display in the reports of operations (synchronization and migration)'; 75 $lang['Details_true'] = ' --> Maximum level - Displays all details of the results of synchronization and migration operations'; 76 $lang['Details_false'] = ' --> Minimum Level - Displays only the main results of the synchronization and migration operations'; 77 78 $lang['Confirm'] = 'Confirmation of corrective actions in audit'; 79 $lang['Confirm_true'] = ' --> Do not ask for confirmation'; 80 $lang['Confirm_false'] = ' --> Confirmation required before any action in audit'; 81 82 $lang['Prefix'] = 'FluxBB prefix tables :'; 83 84 $lang['Admin'] = 'Username of Piwigo\'s "Webmaster" account. <b style="color: red">The FluxBB\'s "Administrator" username account must match!</b>'; 85 $lang['error_config_admin1'] = 'ERROR : Piwigo\'s "Webmaster" username is wrong!'; 86 $lang['error_config_admin2'] = 'ERROR : The username of the FluxBB\'s "Administrator" account is different of Piwigo\'s ! Check the configuration of your FluxBB forum and rename the "Administrator" account username in the same way as Piwigo\'s'; 87 88 $lang['Guest'] = 'FluxBB\'s guest username'; 89 $lang['error_config_guest'] = 'ERROR : The username of the FluxBB\'s "Guest" account is wrong!'; 90 91 $lang['Del_Pt'] = 'Deleting user\'s topics and messages from forum when he is deleted from Piwigo'; 19 92 $lang['Del_Pt_true'] = ' --> Delete all'; 20 $lang['Del_Pt_false'] = ' --> Don\'t delete topics and posts'; 21 $lang['Confirm'] = 'Delete confirmation on the administration actions in the audit.'; 22 $lang['Confirm_true'] = ' --> Delete confirmation'; 23 $lang['Confirm_false'] = ' --> Confirmation mandatory before actions in audit'; 93 $lang['Del_Pt_false'] = ' --> Don\'t delete topics and posts from forum'; 24 94 25 $lang['save_config'] ='Settings saved'; 95 $lang['Bridge_UAM'] = 'Validation of access to the forum using UserAdvManager plugin (UAM): Activate here the bridge between the two plugins that allow you to restrict access to your FluxBB forum as the user has not validated its registration in the gallery (the related UAM function must be active)'; 96 $lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM'; 97 $lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)'; 98 99 $lang['FluxBB_Group'] = 'Specify here the ID (format: integer) of <b>a FluxBB\'s users group</b> in which unvalidated users must be located if they have not validated their registration to the gallery. This users group have to be created first in FluxBB. To be effective, this group should not have any permission on the forum (see the section "Instructions" for detailed information)'; 100 101 102 $lang['Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB'; 103 $lang['Mig_Title_d'] = 'USE ONLY IF you have never used the plugin before'; 104 $lang['Mig_Text'] = ' 105 <div class="warning"> USE MIGRATION ONLY IF you never used the plugin to link Piwigo to FluxBB before <u>AND IF</u> your forum is empty of users !!!</b></div><br/> 106 --> In this case, your [PrefixFluxBB]_user table of FluxBB must be empty of any account except the 2 "Guest" and "Administrator" accounts.<br/><br/> 107 - The migration will first remove the links between accounts of Piwigo and FluxBB if any.<br/> 108 - Then <b>ALL FluxBB ACCOUNTS WILL BE DELETE</b> except the 2 "Guest" and "Administrator" accounts.<br/> 109 <br/> 110 <div class="warning">WARNING - IF YOU HAVE ANY SPECIAL USERS ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</div><br/> 111 - Finally, the migration process will create all Piwigo\'s users accounts in FluxBB, except the "Guest".<br/> 112 <br/> 113 If errors occur during operation, a message will warn you and inform you about the problem. Fix the cause of the problem and retry a migration (at the time only you can renew a migration).<br/> 114 You can also run an audit to verify the status of a migration.<br/> 115 <div class="warning"> NEVER PERFORM MIGRATION FOR UPDATING !!!</div><br/>'; 116 $lang['Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>'; 117 $lang['Mig_Del_Link'] = '<b>Deleting links between Piwigo and FluxBB accounts</b>'; 118 $lang['Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>'; 119 $lang['Mig_Del_User'] = '<b>Account deletion:</b> '; 120 $lang['Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>'; 121 $lang['Mig_Add_User'] = '<b>Transferring account:</b> '; 122 $lang['Mig_End'] = '<b>Migration done !</b>'; 123 $lang['Mig_Btn'] = 'Migration'; 124 125 126 $lang['Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB'; 127 $lang['Sync_Title_d'] = 'Use to resynchronize accounts'; 128 $lang['Sync_Text'] = ' 129 <div class="warning">Use this if you are already using this plugin, you have temporarily disabled it and new users registered on the gallery in the meantime</div> 130 <br/> -> This means that your forum already owns users.<br/><br/> 131 - Synchronization compares the usernames, their password (encrypted) and their email address in both tables [PrefixPWG] _users and [PrefixFluxBB] _users<br/> 132 - Then it will update a mapping table as well as the password and email address for each account from Piwigo to FluxBB except the Piwigo\'s "Guest" user and FluxBB\'s "Anonymous" user.<br/> 133 - Finally it will show orphaned accounts errors (which only exist in one of two ###_USERS tables) and will propose a fix.<br/> 134 <br/> 135 At the end of the synchronization, you can perform an AUDIT to check for possible duplicates users in FluxBB. If so, delete the oldest ones (sorting FluxBB users according to their date of registration).<br/>'; 136 $lang['Sync_Check_Dup'] = '<b>Analysis of user tables for duplicates control</b>'; 137 $lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE to continue synchronizing if you have duplicate user accounts in Piwigo or FluxBB. Please correct and try again.</b><br/><br/>'; 138 $lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>'; 139 $lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between Piwigo and FluxBB accounts</b>'; 140 $lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between Piwigo and FluxBB accounts</b>'; 141 $lang['Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo but missing in FluxBB</b>'; 142 $lang['Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB but missing in Piwigo</b>'; 143 $lang['Sync_OK'] = 'Synchronization OK<br/><br/>'; 144 $lang['Sync_Btn'] = 'Synchronization'; 145 26 146 27 147 $lang['Audit_Btn'] = 'Audit'; 28 $lang['Sync_Btn'] = 'Synchronization';29 $lang['Sync_Title'] = 'Synchronize accounts from Piwigo to FluxBB';30 $lang['Sync_Text'] = '31 <div class="warning">You\'ve already used the plugin to link your Piwigo (plugin update) and / or your FluxBB forum is not empty of users!</div>32 <br> -> This means that your forum owns users.<br><br>33 - Synchronization detect the data by comparing the usernames, passwords (encrypted) and their email address in both tables [PrefixPWG]_user and [PrefixFluxBB]_user.<br>34 - Then update the table of correspondence as well as password and email address for each account from Piwigo to FluxBB except Piwigo Guest and FluxBB Anonymous.<br>35 - Finally indicate mislead orphaned accounts that exist only in one of the 2 ###_user tables.<br>36 <br>37 At the end of the operation, launch an audit and check for possible duplicates users in FluxBB. If so, delete the oldest (sorting FluxBB users according to their date of registration).<br>';38 $lang['Sync_Check_Dup'] = '<b>Analyzing tables of user accounts of Piwigo and FluxBB to control duplicates</b>';39 $lang['Advise_Check_Dup'] = '<b>Impossible to continue the synchronization if you have duplicates in the User Account of Piwigo or FluxBB.</b><br><br>';40 $lang['Sync_Link_Break'] = '<b>Analysis of repairable links between accounts in Piwigo and FluxBB</b>';41 $lang['Sync_Link_Bad'] = '<b>Analysis of bad relationships between accounts in Piwigo and FluxBB</b>';42 $lang['Sync_DataUser'] = '<b>Analysis of passwords and email addresses between accounts in Piwigo and FluxBB</b>';43 $lang['Sync_PWG2FluxBB'] = '<b>Analysis of existing accounts in Piwigo and missing in FluxBB</b>';44 $lang['Sync_FluxBB2PWG'] = '<b>Analysis of existing accounts in FluxBB and missing in Piwigo</b>';45 $lang['Sync_OK'] = 'Synchronization OK<br><br>';46 47 148 $lang['Audit_PWG_Dup'] = '<b>Audit of Piwigo\'s accounts table</b>'; 48 149 $lang['Error_PWG_Dup'] = '<b>Error in Piwigo\'s accounts table, there are duplicates:</b> '; 49 $lang['Advise_PWG_Dup'] = '<b>WARNING! You must make these corrections in Piwigo before continuing<br>use Piwigo\'s user manager to resolve the problem.</b>'; 50 150 $lang['Advise_PWG_Dup'] = '<b>WARNING! You must make these corrections in Piwigo before continuing<br/>Use Piwigo\'s user manager to resolve the problem.</b>'; 51 151 $lang['Audit_FluxBB_Dup'] = '<b>Audit of FluxBB\'s accounts table</b>'; 52 152 $lang['Error_FluxBB_Dup'] = '<b>Error in FluxBB\'s accounts table, there are duplicates:</b> '; 53 $lang['Advise_FluxBB_Dup'] = '<b>WARNING! You must make these corrections in FluxBB before continuing<br>use the icons to delete users from FluxBB and resolve the problem.</b>'; 54 153 $lang['Advise_FluxBB_Dup'] = '<b>WARNING! You must make these corrections in FluxBB before continuing<br/>Use the icons to delete users from FluxBB and resolve the problem.</b>'; 55 154 $lang['Audit_Link_Break'] = '<b>Audit of repairable links between Piwigo and FluxBB accounts</b>'; 56 155 $lang['Error_Link_Break'] = '<b>Broken link between Piwigo and FluxBB accounts:</b> '; 57 156 $lang['New_Link'] = 'Account linked: '; 58 59 157 $lang['Audit_Link_Bad'] = '<b>Audit of bad links between Piwigo and FluxBB accounts</b>'; 60 158 $lang['Error_Link_Del'] = '<b>Error in the link table between 2 users:</b> '; … … 64 162 $lang['Error_Link_Dup'] = '<b>Error in the link table, there are duplicates:</b> '; 65 163 $lang['Link_Dup'] = 'Remove of duplicates '; 66 67 164 $lang['Audit_Synchro'] = '<b>Audit of the synchronization of passwords and email addresses between Piwigo and FluxBB accounts</b>'; 68 165 $lang['Error_Synchro'] = '<b>Bad synchronization of account:</b> '; … … 71 168 $lang['Audit_Synchro_OK'] = ' <b>: Data synchronization OK</b>'; 72 169 $lang['Sync_User'] = 'Account synchronization : '; 73 74 170 $lang['Audit_PWG2FluxBB'] = '<b>Audit of the existing accounts in Piwigo and missing in FluxBB</b>'; 75 171 $lang['Error_PWG2FluxBB'] = '<b>The Piwigo account not in FluxBB:</b> '; 76 172 $lang['Add_User'] = 'Adding in FluxBB of account: '; 77 78 173 $lang['Audit_FluxBB2PWG'] = '<b>Audit of the existing accounts in FluxBB and missing in Piwigo</b>'; 79 174 $lang['Error_FluxBB2PWG'] = '<b>The FluxBB account not in Piwigo:</b> '; 80 175 $lang['Del_User'] = 'Removal from FluxBB of account : '; 176 $lang['Audit_OK'] = 'Audit OK<br/><br/>'; 81 177 82 $lang['Audit_OK'] = 'Audit OK<br><br>';83 84 $lang['Mig_Btn'] = 'Migration';85 $lang['Mig_Title'] = 'Migration of accounts from Piwigo to FluxBB';86 $lang['Mig_Text'] = '87 <div class="warning"> USE ONLY IF you have never used the plugin to link Piwigo to FluxBB <u>AND IF</u> your forum is empty of users !!!</b></div><br>88 --> In this case, your table [PrefixFluxBB]_user of FluxBB must be empty of any account except the 2 accounts guest and administrator.<br><br>89 - The migration will first remove the links between accounts of Piwigo and FluxBB.<br>90 - Then <b>WILL DELETE ALL FluxBB ACCOUNTS</b> except the 2 accounts guest and administrator.<br>91 <br>92 <div class="warning">WARNING IF YOU HAVE ANY SPECIAL ACCOUNTS IN FluxBB == DO NOT USE THIS FUNCTION !!!</div><br>93 - Finally, the migration will create all Piwigo\'s accounts in FluxBB, except the guest.<br>94 <br>95 If errors occur during operation, correct the cause of the problem and retry the operation of migration (at the time only you can renew the migration).<br>';96 $lang['Mig_Disclaimer'] = '<div class="warning"> NEVER PERFORM MIGRATION FOR UPDATING !!!</div>';97 $lang['Mig_Start'] = '<b>Migration of accounts from Piwigo to FluxBB</b>';98 $lang['Mig_Del_Link'] = '<b>Deleting links between accounts of Piwigo and FluxBB</b>';99 $lang['Mig_Del_AllUsers'] = '<b>Deleting FluxBB accounts</b>';100 $lang['Mig_Del_User'] = '<b>Deletion of the account:</b> ';101 $lang['Mig_Add_AllUsers'] = '<b>Transferring Piwigo accounts</b>';102 $lang['Mig_Add_User'] = '<b>Transfer of account:</b> ';103 $lang['Mig_End'] = '<b>Migration done !</b>';104 $lang['Title_Tab'] = 'Register_FluxBB - Version: ';105 106 $lang['No_Reg_advise'] = '107 For better integration, it is advisable to make the following changes to your FluxBB forum (<b>Warning: These changes will disappear when updating the forum</b>):108 <br><br>109 <b>* In FluxBB\'s administration panel, change "Allow new registrations" to NO (in: Options - Registration)</b>110 <br><br>111 <b>* Modify the file</b> : [FluxBBRoot]/lang/English/register.php by replacing the following line:112 <div class="mod">\'No new regs\' => \'This forum is not accepting new users.\'</div>113 <b>with :</b>114 <div class="info">\'No new regs\' => \'<a href="http://[YourPiwigoRoot]/register.php" > Go here to register </a><br/><br/>\'</div>115 <br>116 Of course you should also make the same change for other languages of your FluxBB forum.117 <br><br>118 <b>* Modify the file</b> : [FluxBBRoot]/login.php by replacing the line 69:119 <div class="mod">message($lang_login[\'Wrong user/pass\'].\'<a href="login.php?action=forget"></div>120 <b>with :</b>121 <div class="info">message($lang_login[\'Wrong user/pass\'].\'<a href="../[YourPiwigoRoot]/password.php"></div>122 <br>123 and at line 216:124 <div class="mod"><a href="login.php?action=forget" tabindex="5"><?php echo $lang_login[\'Forgotten pass\']</a></div>125 <b>with :</b>126 <div class="info"><a href="../[YourPiwigoRoot]/password.php" tabindex="5"><?php echo $lang_login[\'Forgotten pass\'] ?></a></div>127 <br>';128 $lang['About_Reg'] = 'About the registration of users on the forum FluxBB';129 $lang['Bridge_UAM'] = 'Access validation to the forum via UserAdvManager (UAM) plugin: Turn the bridge on between the two plugins that will allow you to prohibit the access to your FluxBB forum until the user has not validated its registration in the gallery (the function must be active on UAM).';130 $lang['Bridge_UAM_true'] = ' --> Enable bridge Register_FluxBB / UAM';131 $lang['Bridge_UAM_false'] = ' --> Disable bridge Register_FluxBB / UAM (default)';132 $lang['FluxBB_Group'] = 'Specify the ID of <b>FluxBB\' group</b> in which non validated users must be (to be created in advance in FluxBB). To be effective, this group should have no permission on the forum (see the end of this page for details on using this option).';133 $lang['About_Bridge'] = 'About Register_FluxBB / UAM bridge';134 $lang['UAM_Bridge_advice'] = 'The UserAdvManager plugin allows forcing new registrants to confirm their registration before allowing them to access the entire gallery. The joint use of this plugin with Register_FluxBB can do the same on the linked forum: Registrants can not post until they have validated their registration in the gallery. <br>135 Here is the general procedure to apply:136 <br>137 - In the administration of your FluxBB forum, set at least 2 groups of users (for example: "validated" and "no_validated").<br>138 - Give the first group ("validated") access permissions you want on your forum and set it as the default group.<br>139 - Remove the second group ("no_validated") all permissions on your forum (the members of this group can only read public posts).<br>140 - Locate the ID of the second group "no_validated".<br>141 - Enter this ID in Register_FluxBB plugin, activate the bridge and save the settings.142 <br>143 <b class="mod"><u>Important notes:</u></b>144 <br>145 If you already use an earlier version of Register_FluxBB, Piwigo\'s accounts linked between your gallery and your FluxBB forum will not be impacted by the effects of the bridge. Only new registers will be impacted after activation of the bridge.<b><u>Accounts resynchronization function will be void.</u></b><br>146 Similarly, if you\'ve never used Register_FluxBB, the Piwigo\'s accounts migration phase from your gallery to your FluxBB forum will disregard the state validated or not for the accounts at the launch of the migration phase.';147 148 $lang['Admin'] = 'Piwigo\'s administrator username. <b style="color: red">The username of FluxBB\'s administrator account has to be the same!</b>';149 $lang['error_config_admin1'] = 'ERROR : Piwigo\'s admin username is wrong!';150 $lang['error_config_admin2'] = 'ERROR : The name of the FluxBB\'s administrator account is different from that of Piwigo ! Check the configuration of your FluxBB forum and rename the administrator account in the same name as that of Piwigo.';151 $lang['error_config_guest'] = 'ERROR : The name of the FluxBB\'s guest account is wrong!';152 153 $lang['Disclaimer'] = '154 *** To begin, follow this 2 steps ***<br>155 Step 1 : Set plugin with the parameters of FluxBB.<br>156 Step 2 : Migrate user accounts from Piwigo to FluxBB.<br><br>157 After these 2 main steps, the plugin is fully functional and you will not have to return to this pages.<br><br>158 *** For the maintenance of already active connections ***<br>159 Maintenance : Synchronize tables (in case an addition, an update or a user deletion mismatched) allows to update passwords and email addresses and see users intruder (But you should not need to use ).<br><br>160 <div class="warning">WARNING !! For safety, consider making a backup of your database, especially ###_user tables before any action.</div>161 <br><br>162 <div class="warning">Important to know:<br>163 By default, <b>FluxBB</b> is case <u>insensitive</u> on usernames. That is, if a user called "test" is already registered, other entries like "Test" or "TEST" or "TEst" (etc. ..) will be rejected.<br><br>164 By default, <b>Piwigo</b> works in reverse and is therefore case <u>sensitive</u> on logins ("test" will be a different user of "Test" or "TEST", etc. ...).<br>165 To avoid problems (even if Piwigo\'s behavior can be easily changed - See configuration options), Register_FluxBB will link the two applications as FluxBB: Being case <u>insensitive</u> for logins.<br><br></div>';166 178 ?> -
extensions/Register_FluxBB/language/fr_FR/plugin.lang.php
r19138 r21424 1 1 <?php 2 $lang['Tab_Info'] = 'Instructions'; 3 $lang['Tab_Manage'] = 'Etape 1 : Configuration du plugin'; 4 $lang['Tab_Migration'] = 'Etape 2 : Migration des comptes'; 5 $lang['Tab_Synchro'] = 'Maintenance : Resynchronisation des comptes'; 2 $lang['Title'] = 'Register_FluxBB - Version: '; 3 $lang['save_config'] ='Configuration enregistrée.'; 6 4 7 $lang['Title'] = 'Register FluxBB'; 5 $lang['Instruction_Title'] = 'Instructions (important à lire en premier !)'; 6 $lang['Instruction_Title_d'] = 'Notice d\'utilisation et informations importantes'; 7 $lang['Disclaimer'] = ' 8 *** Pour débuter, 2 étapes à suivre ***<br/> 9 1ère étape : Configurez les paramètres du plugin en relation avec les paramètres de FluxBB<br/> 10 2ème étape : Migrez les comptes utilisateurs de Piwigo vers FluxBB<br/><br/> 11 A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel.<br/><br/> 12 *** Pour maintenir les liaisons déjà actives ***<br/> 13 Maintenance : Synchronisez les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur se serait mal déroulée). Cela permet aussi de remettre à jour mots de passe et adresses email et voir intrus (Mais vous ne devriez pas avoir à l\'utiliser régulièrement).<br/><br/> 14 <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toute action par mesure de sécurité.</div> 15 <br/><br/> 16 <div class="warning">A savoir :<br/> 17 Par défaut, <b>FluxBB</b> est <u>insensible</u> à la casse sur les noms d\'utilisateurs. C\'est à dire que si un utilisateur "test" est déjà inscrit, d\'autres inscriptions avec "Test" ou "TEST" ou "TEst" (etc...) seront refusées.<br/><br/> 18 Par défaut, <b>Piwigo</b> fonctionne de manière inverse et est donc <u>sensible</u> à la casse sur les logins ("test" sera un utilisateur différent de "Test" etc...).<br/><br/> 19 Afin d\'éviter des erreurs (même si le comportement de Piwigo peut-être facilement changé - Voir les options de configuration), Register_FluxBB fera le lien entre les deux applications à la manière de FluxBB : En étant <u>insensible</u> à la casse pour les logins.<br/><br/></div>'; 20 21 22 $lang['About_Reg_Title'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB'; 23 $lang['About_Reg_Title_d'] = 'Instructions importantes pour une meilleure intégration'; 24 $lang['No_Reg_advise'] = ' 25 Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du script du forum</b>): 26 <br/><br/> 27 <b>* Modifiez dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b> 28 <br/><br/> 29 <b>* Modifiez le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante: 30 <div class="mod">\'No new regs\' => \'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div> 31 <b>par :</b> 32 <div class="info">\'No new regs\' => \'<a href="http://[VotreRacineDePiwigo]/register.php" > Cliquez ici pour vous inscrire </a><br/><br/>\'</div> 33 <br/> 34 Et reportez cette modification pour toutes les langues gérées sur votre forum. 35 <br/><br/> 36 <b>* Modifiez le fichier</b> : [RacineDeFluxBB]/login.php en remplacant vers la ligne 64 : 37 <div class="mod">message($lang_login[\'Wrong user/pass\'].\'<a href="login.php?action=forget"></div> 38 <b>par :</b> 39 <div class="info">message($lang_login[\'Wrong user/pass\'].\'<a href="../[VotreRacineDePiwigo]/password.php"></div> 40 <br/> 41 et vers la ligne 295: 42 <div class="mod"><a href="login.php?action=forget" tabindex="5"><?php echo $lang_login[\'Forgotten pass\']</a></div> 43 <b>par :</b> 44 <div class="info"><a href="../[VotreRacineDePiwigo]/password.php" tabindex="5"><?php echo $lang_login[\'Forgotten pass\'] ?></a></div> 45 <br/>'; 46 47 48 $lang['About_Bridge_Title'] = 'A propos du pont Register_FluxBB / UAM'; 49 $lang['About_Bridge_Title_d'] = 'Instructions au sujet du pont entre les plugins Register_FluxBB et UserAdvManager'; 50 $lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br/> 51 Voici la procédure générale à appliquer: 52 <br/><br/> 53 - Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br/> 54 - Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br/> 55 - Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br/> 56 - Repérez l\'ID du second groupe "non_validés".<br/> 57 - Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres. 58 <br/><br/> 59 <b class="mod"><u>Notes importantes:</u></b> 60 <br/><br/> 61 Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br/><br/> 62 De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.'; 63 8 64 9 65 $lang['Config_Title'] = 'Configuration du plugin'; 66 $lang['Config_Title_d'] = 'Configuration du plugin'; 67 $lang['Config_Title1'] = 'Paramétrages du pont entre FluxBB et Piwigo'; 68 $lang['Config_Title2'] = 'Paramétrages avancés du plugin'; 69 10 70 $lang['Config_Disclaimer'] = ' 11 Vérifiez les paramètres relatifs à votre installation de FluxBB et corrigez les au besoin.<br >71 Vérifiez les paramètres relatifs à votre installation de FluxBB et corrigez les au besoin.<br/> 12 72 Modifiez, le cas échéant, le comportement du plugin à votre convenance.'; 73 74 $lang['Details'] = 'Niveau de détails à afficher dans les rapports d\'opérations (synchronisation et migration)'; 75 $lang['Details_true'] = ' --> Niveau maximum - Affiche tous les détails des résultats sur les opérations de synchronisation et de migration'; 76 $lang['Details_false'] = ' --> Niveau minimum - N\'affiche que l\'essentiel des résultats sur les opérations de synchronisation et de migration'; 77 78 $lang['Confirm'] = 'Confirmations des actions de correction dans l\'audit'; 79 $lang['Confirm_true'] = ' --> Ne pas demander de confirmations'; 80 $lang['Confirm_false'] = ' --> Confirmation obligatoire avant toute action dans l\'audit'; 81 13 82 $lang['Prefix'] = 'Préfixe des tables de FluxBB :'; 14 $lang['Guest'] = 'Nom d\'utilisateur de l\'invité de FluxBB.';15 $lang['Details'] = 'Niveau de détails dans les rapports d\'opérations.';16 $lang['Details_true'] = ' --> Afficher tous les détails des résultats sur les opérations.';17 $lang['Details_false'] = ' --> N\'affiche que l\'essentiel des résultats sur les opérations';18 $lang['Del_Pt'] = 'Suppression des topics et posts de l\'utilisateur lorsqu\'il est supprimé.';19 $lang['Del_Pt_true'] = ' --> Supprime tout';20 $lang['Del_Pt_false'] = ' --> Ne supprime pas les posts et les topics';21 $lang['Confirm'] = 'Suppression des confirmations sur les actions d\'administration dans l\'audit.';22 $lang['Confirm_true'] = ' --> Supprime les confirmations';23 $lang['Confirm_false'] = ' --> Confirmation obligatoire avant action dans l\'audit';24 83 25 $lang['save_config'] ='Configuration enregistrée.'; 84 $lang['Admin'] = 'Nom d\'utilisateur du compte "Webmaster" de Piwigo. <b style="color: red">Le nom du compte "Administrateur" de FluxBB doit être identique !</b>'; 85 $lang['error_config_admin1'] = 'ERREUR : Le nom du compte "Webmaster" de Piwigo est incorrect !'; 86 $lang['error_config_admin2'] = 'ERREUR : Le nom du compte "Administrateur" de FluxBB est différent du compte "Webmaster" de Piwigo ! Vérifiez la configuration de votre forum FluxBB et nommez le compte "Administrateur" de la même manière que celui de Piwigo'; 26 87 27 $lang['Audit_Btn'] = 'Audit'; 28 $lang['Sync_Btn'] = 'Synchronisation'; 88 $lang['Guest'] = 'Nom d\'utilisateur du compte "invité" de FluxBB'; 89 $lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur ("Guest") de FluxBB est incorrect !'; 90 91 $lang['Del_Pt'] = 'Suppression des sujets et messages de l\'utilisateur sur le forum lorsqu\'il est supprimé de Piwigo'; 92 $lang['Del_Pt_true'] = ' --> Supprimer tout'; 93 $lang['Del_Pt_false'] = ' --> Ne pas supprimer les sujets et messages du forum'; 94 95 $lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdire l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM)'; 96 $lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé'; 97 $lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)'; 98 99 $lang['FluxBB_Group'] = 'Précisez ici l\'ID (format : nombre entier) du <b>groupe d\'utilisateurs FluxBB</b> dans lequel les utilisateurs non validés doivent se trouver lorsqu\'ils n\'ont pas validé leur inscription à la galerie. Ce groupe d\'utilisateurs est à créer au préalable dans FluxBB. Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir dans la section "Instructions" pour les informations détaillées)'; 100 101 102 $lang['Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB'; 103 $lang['Mig_Title_d'] = 'A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin auparavent'; 104 $lang['Mig_Text'] = ' 105 <div class="warning"> A N\'EXECUTER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum ne contient aucun utilisateurs !!!</div><br/> 106 --> Dans ce cas, votre table [PrefixFluxBB]_users de FluxBB doit être vide de tout compte sauf les 2 comptes d\'invité et administrateur.<br/><br/> 107 - La procédure de migration supprimera d\'abord les liens des comptes entre Piwigo et FluxBB si existants<br/> 108 - Puis <b>SUPPRIMERA TOUS LES COMPTES de votre forum FluxBB</b> sauf les 2 comptes d\'invité et d\'administrateur.<br/> 109 <br/> 110 <div class="warning">ATTENTION - SI VOUS AVEZ DES COMPTES D\'UTILISATEURS PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br/> 111 - Enfin la migration créera tout les comptes de Piwigo dans FluxBB sauf l\'invité.<br/> 112 <br/> 113 Si des erreurs se produisent pendant l\'opération, une information s\'affichera. Corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez renouveller une procédure de migration).<br/> 114 Vous pouvez aussi lancer un audit pour vérifier l\'état d\'une migration.<br/> 115 <div class="warning">NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</div><br/>'; 116 $lang['Mig_Start'] = '<b>Migration des comptes de Piwigo vers FluxBB</b>'; 117 $lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>'; 118 $lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>'; 119 $lang['Mig_Del_User'] = '<b>Suppression du compte :</b> '; 120 $lang['Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>'; 121 $lang['Mig_Add_User'] = '<b>Transfert du compte :</b> '; 122 $lang['Mig_End'] = '<b>Migration finie !</b>'; 123 $lang['Mig_Btn'] = 'Migration'; 124 125 29 126 $lang['Sync_Title'] = 'Synchronisation des comptes Piwigo vers FluxBB'; 127 $lang['Sync_Title_d'] = 'A utiliser pour resynchroniser les comptes'; 30 128 $lang['Sync_Text'] = ' 31 <div class="warning"> Vous avez déjà utilisé le plugin pour lier votre Piwigo (mise à jour du plugin) et/ou votre forum FluxBB n\'est pas vide d\'utilisateurs !!!</div><br>32 <br > -> Ceci signifie que votre forum posséde des utilisateurs.<br><br>33 - La synchronisation détectera les données présentes en comparant les noms des utilisateurs, leur mot de passe (crypté) et leur adresse email dans les deux tables [PrefixPWG]_users et [PrefixFluxBB]_users.<br>34 - Puis mettra à jour cette table de correspondance ainsi que le mot de passe et l\'adresse email de chaque compte depuis Piwigo vers FluxBB sauf Piwigo Guest et FluxBB Anonymous.<br>35 - Enfin indiquera en erreur les comptes orphelins qui n\'existent que dans l\'une des 2 tables ###_USERS.<br>36 <br >37 A l\'issue de l\'opération lancez un AUDIT et v euillez vérifier la présence de doublons éventuels dans les utilisateurs de FluxBB, si c\'est le cas, il faut supprimer les plus anciens (tri des utilisateurs FluxBB selon leur date d\'incription).<br>';38 $lang['Sync_Check_Dup'] = '<b>Analyse des tables d es comptes utilisateurs de Piwigo et FluxBB pour contrôlerles doublons</b>';39 $lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE de continuer la synchronisation si vous avez des doublons dans les comptes utilisateurs de Piwigo ou FluxBB. </b><br><br>';129 <div class="warning">A exécuter si vous êtes déjà utilisateur de ce plugin, que vous l\'avez temporairement désactivé et que de nouveaux utilisateurs se sont inscrits sur la galerie entre temps</div><br/> 130 <br/> -> Ceci signifie que votre forum posséde des utilisateurs.<br/><br/> 131 - La synchronisation comparera les noms des utilisateurs, leur mot de passe (crypté) et leur adresse email dans les deux tables [PrefixPWG]_users et [PrefixFluxBB]_users<br/> 132 - Puis mettra à jour une table de correspondances ainsi que le mot de passe et l\'adresse email de chaque compte depuis Piwigo vers FluxBB sauf les utilisateurs "Guest" de Piwigo et "Anonymous" de FluxBB.<br/> 133 - Enfin indiquera en erreur les comptes orphelins (qui n\'existent que dans l\'une des 2 tables ###_USERS) et proposera une résolution des erreurs.<br/> 134 <br/> 135 A l\'issue de l\'opération lancez un AUDIT et vérifiez la présence de doublons éventuels dans les utilisateurs de FluxBB, si c\'est le cas, il faut supprimer les plus anciens (triez des utilisateurs FluxBB selon leur date d\'inscription).<br/>'; 136 $lang['Sync_Check_Dup'] = '<b>Analyse des tables d\'utilisateurs pour contrôle les doublons</b>'; 137 $lang['Advise_Check_Dup'] = '<b>IMPOSSIBLE de continuer la synchronisation si vous avez des doublons dans les comptes utilisateurs de Piwigo ou FluxBB. Veuillez corriger puis réessayez.</b><br/><br/>'; 40 138 $lang['Sync_Link_Break'] = '<b>Analyse des liens réparables entre les comptes Piwigo et FluxBB</b>'; 41 139 $lang['Sync_Link_Bad'] = '<b>Analyse des mauvais liens entre les comptes Piwigo et FluxBB</b>'; 42 140 $lang['Sync_DataUser'] = '<b>Analyse des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>'; 43 $lang['Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo et manquants dans FluxBB</b>'; 44 $lang['Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB et manquants dans Piwigo</b>'; 45 $lang['Sync_OK'] = 'Synchronisation OK<br><br>'; 141 $lang['Sync_PWG2FluxBB'] = '<b>Analyse des comptes existants dans Piwigo mais manquants dans FluxBB</b>'; 142 $lang['Sync_FluxBB2PWG'] = '<b>Analyse des comptes existants dans FluxBB mais manquants dans Piwigo</b>'; 143 $lang['Sync_OK'] = 'Synchronisation OK<br/><br/>'; 144 $lang['Sync_Btn'] = 'Synchronisation'; 46 145 146 147 $lang['Audit_Btn'] = 'Audit'; 47 148 $lang['Audit_PWG_Dup'] = '<b>Audit de la table des comptes de Piwigo</b>'; 48 149 $lang['Error_PWG_Dup'] = '<b>Erreur dans la table des comptes Piwigo, il y a des doublons :</b> '; 49 $lang['Advise_PWG_Dup'] = '<b>ATTENTION ! Vous devez faire ces corrections dans Piwigo avant de continuer<br>utilisez le gestionnaires d\'utilisateurs de Piwigo pour régler le problème.</b>'; 50 150 $lang['Advise_PWG_Dup'] = '<b>ATTENTION ! Vous devez faire ces corrections dans Piwigo avant de continuer<br/>Utilisez le gestionnaire d\'utilisateurs de Piwigo pour régler le problème.</b>'; 51 151 $lang['Audit_FluxBB_Dup'] = '<b>Audit de la table des comptes FluxBB</b>'; 52 152 $lang['Error_FluxBB_Dup'] = '<b>Erreur dans la table des comptes FluxBB, il y a des doublons :</b> '; 53 $lang['Advise_FluxBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans FluxBB avant de continuer<br>utilisez les icones pour supprimer les utilisateurs de FluxBB et régler le problème.</b>'; 54 153 $lang['Advise_FluxBB_Dup'] = '<b>ATTENTION Vous devez faire ces corrections dans FluxBB avant de continuer<br/>utilisez les icones pour supprimer les utilisateurs de FluxBB et régler le problème.</b>'; 55 154 $lang['Audit_Link_Break'] = '<b>Audit des liens réparables entre les comptes Piwigo et FluxBB</b>'; 56 155 $lang['Error_Link_Break'] = '<b>Lien brisé entre les comptes Piwigo et FluxBB :</b> '; 57 156 $lang['New_Link'] = 'Liaison du compte : '; 58 59 157 $lang['Audit_Link_Bad'] = '<b>Audit des mauvais liens entre les comptes Piwigo et FluxBB</b>'; 60 $lang['Error_Link_Del'] = '<b>Erreur dans la table de lien entre les 2 utilisateurs :</b> ';158 $lang['Error_Link_Del'] = '<b>Erreur dans la table de liens entre les 2 utilisateurs :</b> '; 61 159 $lang['Link_Del'] = 'Suppression du lien : '; 62 $lang['Error_Link_Dead'] = '<b>Erreur dans la table de lien , des liens morts existent :</b> ';160 $lang['Error_Link_Dead'] = '<b>Erreur dans la table de liens, des liens morts existent :</b> '; 63 161 $lang['Link_Dead'] = 'Suppression du liens morts '; 64 $lang['Error_Link_Dup'] = '<b>Erreur dans la table de lien , il y a des doublons :</b> ';162 $lang['Error_Link_Dup'] = '<b>Erreur dans la table de liens, il y a des doublons :</b> '; 65 163 $lang['Link_Dup'] = 'Suppression des liens dupliqués '; 66 67 164 $lang['Audit_Synchro'] = '<b>Audit de la synchronisation des mots de passe et des adresses emails entre les comptes Piwigo et FluxBB</b>'; 68 165 $lang['Error_Synchro'] = '<b>Mauvaise synchronisation du compte :</b> '; … … 71 168 $lang['Audit_Synchro_OK'] = ' <b>: Synchro des données OK</b>'; 72 169 $lang['Sync_User'] = 'Synchronisation du compte : '; 73 74 170 $lang['Audit_PWG2FluxBB'] = '<b>Audit des comptes existants dans Piwigo et manquants dans FluxBB</b>'; 75 171 $lang['Error_PWG2FluxBB'] = '<b>Le compte Piwigo n\'existe pas dans FluxBB :</b> '; 76 172 $lang['Add_User'] = 'Ajout dans FluxBB du compte : '; 77 78 173 $lang['Audit_FluxBB2PWG'] = '<b>Audit des comptes existants dans FluxBB et manquants dans Piwigo</b>'; 79 174 $lang['Error_FluxBB2PWG'] = '<b>Le compte FluxBB n\'existe pas dans Piwigo :</b> '; 80 175 $lang['Del_User'] = 'Suppression de FluxBB du compte : '; 176 $lang['Audit_OK'] = 'Audit OK<br/><br/>'; 81 177 82 $lang['Audit_OK'] = 'Audit OK<br><br>';83 84 $lang['Mig_Btn'] = 'Migration';85 $lang['Mig_Title'] = 'Migration des comptes de Piwigo vers FluxBB';86 $lang['Mig_Text'] = '87 <div class="warning"> A N\'UTILISER QUE SI vous n\'avez jamais utilisé le plugin pour lier Piwigo à FluxBB <u>ET SI</u> votre forum est vide d\'utilisateurs !!!</div><br>88 --> Dans ce cas, votre table [PrefixFluxBB]_users de FluxBB doit être vide de tout compte sauf les 2 comptes d\'invité et d\'administrateur.<br><br>89 - La migration va d\'abord supprimer les liens des comptes entre Piwigo et FluxBB.<br>90 - Puis <b>SUPPRIMERA TOUS LES COMPTES FluxBB</b> sauf les 2 comptes d\'invité et d\'administrateur.<br>91 <br>92 <div class="warning">ATTENTION SI VOUS AVEZ DES COMPTES PARTICULIERS DANS FluxBB == NE SURTOUT PAS UTILISER CETTE FONCTION !!!</div><br>93 - Enfin la migration va créer tout les comptes de Piwigo dans FluxBB sauf l\'invité.<br>94 <br>95 Si des erreurs se produisent pendant l\'opération, corrigez la cause du problème et recommencez l\'opération de migration (à ce moment là seulement vous pouvez renouveller la migration).<br>';96 $lang['Mig_Disclaimer'] = '<div class="warning"> NE JAMAIS EFFECTUER DE MIGRATION POUR METTRE A JOUR !!!</div>';97 $lang['Mig_Start'] = '<b>Migration des comptes Piwigo vers FluxBB</b>';98 $lang['Mig_Del_Link'] = '<b>Suppression des liens entre les comptes Piwigo et FluxBB</b>';99 $lang['Mig_Del_AllUsers'] = '<b>Suppression des comptes FluxBB</b>';100 $lang['Mig_Del_User'] = '<b>Suppression du compte :</b> ';101 $lang['Mig_Add_AllUsers'] = '<b>Transfert des comptes Piwigo</b>';102 $lang['Mig_Add_User'] = '<b>Transfert du compte :</b> ';103 $lang['Mig_End'] = '<b>Migration finie !</b>';104 $lang['Title_Tab'] = 'Register_FluxBB - Version: ';105 106 107 // --------- Starting below: New or revised $lang ---- from version 2.3.0108 $lang['No_Reg_advise'] = '109 Pour une meilleur intégration, il est conseillé d\'apporter les modifications suivantes à votre forum FluxBB (<b>Attention! Ces modifications disparaitront en cas de mise à jour du forum</b>):110 <br><br>111 <b>* Modifier dans l\'interface d\'administration de FluxBB l\'option "Autoriser les nouvelles inscriptions" à NON ( dans : Options - Inscriptions )</b>112 <br><br>113 <b>* Modifier le fichier</b> : [RacineDeFluxBB]/lang/French/register.php en remplacant la ligne suivante:114 <div class="mod">\'No new regs\' => \'Ce forum n\\\'accepte pas de nouveaux utilisateurs.\'</div>115 <b>par :</b>116 <div class="info">\'No new regs\' => \'<a href="http://[VotreRacineDePiwigo]/register.php" > Cliquez ici pour vous inscrire </a><br/><br/>\'</div>117 <br>118 Et reporter cette modification pour toutes les langues gérées sur votre forum.119 <br><br>120 <b>* Modifier le fichier</b> : [RacineDeFluxBB]/login.php en remplacant à la ligne 69:121 <div class="mod">message($lang_login[\'Wrong user/pass\'].\'<a href="login.php?action=forget"></div>122 <b>par :</b>123 <div class="info">message($lang_login[\'Wrong user/pass\'].\'<a href="../[VotreRacineDePiwigo]/password.php"></div>124 <br>125 à la ligne 216:126 <div class="mod"><a href="login.php?action=forget" tabindex="5"><?php echo $lang_login[\'Forgotten pass\']</a></div>127 <b>par :</b>128 <div class="info"><a href="../[VotreRacineDePiwigo]/password.php" tabindex="5"><?php echo $lang_login[\'Forgotten pass\'] ?></a></div>129 <br>';130 $lang['About_Reg'] = 'A propos de l\'enregistrement d\'utilisateur sur le forum FluxBB';131 $lang['Bridge_UAM'] = 'Validation d\'accès au forum via le plugin UserAdvManager (UAM): Activez ici le pont entre les deux plugins qui vous permettra d\'interdire l\'accès à votre forum FluxBB tant que l\'utilisateur n\'a pas validé son inscription à la galerie (la fonction correspondante doit être active sur UAM).';132 $lang['Bridge_UAM_true'] = ' --> Pont Register_FluxBB / UAM activé';133 $lang['Bridge_UAM_false'] = ' --> Pont Register_FluxBB / UAM désactivé (par défaut)';134 $lang['FluxBB_Group'] = 'Précisez ici l\'ID du <b>groupe FluxBB</b> dans lequel les utilisateurs non validé doivent se trouver (à créer au préalable dans FluxBB). Pour être efficace, ce groupe ne doit avoir aucune permission sur le forum (voir à la fin de cette page pour les détails d\'utilisation de cette option).';135 $lang['About_Bridge'] = 'A propos du pont Register_FluxBB / UAM';136 $lang['UAM_Bridge_advice'] = 'Le plugin UserAdvManager permet de forcer les nouveaux inscrits à valider leur inscription avant de leur permettre d\'accéder à la totalité de la galerie. L\'utilisation conjointe de ce plugin avec Register_FluxBB permet de faire de même sur le forum lié: Ils ne pourront pas poster tant qu\'ils n\'auront pas validé leur inscription à la galerie.<br>137 Voici la procédure générale à appliquer:138 <br><br>139 - Dans la partie d\'administration de votre forum FluxBB, établissez au minimum 2 groupes d\'utilisateurs (par exemple: "validés" et "non_validés").<br>140 - Attribuez au premier groupe ("validés") les permissions d\'accès souhaitées sur votre forum et définissez le comme groupe par défaut.<br>141 - Retirez au second groupe ("non_validés") toutes les permissions sur votre forum (les membres de ce groupe ne pourront que lire les posts publics).<br>142 - Repérez l\'ID du second groupe "non_validés".<br>143 - Notez l\'ID dans le plugin Register_FluxBB, activez le pont et sauvegardez les paramètres.144 <br><br>145 <b class="mod"><u>Notes importantes:</u></b>146 <br><br>147 Si vous utilisiez déjà Register_FluxBB dans une version antérieur, les comptes liés entre votre galerie Piwigo et votre forum FluxBB ne seront pas impactés par les effets du pont. Seuls les nouveaux inscrits après l\'activation du pont y seront soumis.<b><u>La fonction de resynchronisation des comptes sera sans effet.</u></b><br><br>148 De même, si vous n\'avez jamais utilisé Register_FluxBB, la phase de migration des comptes de votre galerie Piwigo vers votre forum FluxBB ne tiendra pas compte de l\'état validé ou non de vos inscrits au moment du lancement de la phase de migration.';149 // --------- End: New or revised $lang ---- from version 2.3.0150 151 // --------- Starting below: New or revised $lang ---- from version 2.3.3152 $lang['Admin'] = 'Nom d\'utilisateur de l\'administrateur de Piwigo. <b style="color: red">Le nom de l\'administrateur de FluxBB doit être identique !</b>';153 $lang['error_config_admin1'] = 'ERREUR : Le nom du compte administrateur de Piwigo est incorrect !';154 $lang['error_config_admin2'] = 'ERREUR : Le nom du compte administrateur de FluxBB est différent de celui de Piwigo ! Vérifiez la configuration de votre forum FluxBB et nommez le compte administrateur de la même manière que celui de Piwigo.';155 $lang['error_config_guest'] = 'ERREUR : Le nom du compte visiteur (guest) de FluxBB est incorrect !';156 // --------- End: New or revised $lang ---- from version 2.3.3157 158 // --------- Starting below: New or revised $lang ---- from version 2.3.5159 $lang['Disclaimer'] = '160 *** Pour débuter, 2 étapes à suivre ***<br>161 1ère étape : Configurer les paramètres du plugin avec les paramètres de FluxBB.<br>162 2ème étape : Migrer les comptes utilisateurs de Piwigo vers FluxBB.<br><br>163 A l\'issue des 2 étapes principales, le plugin sera pleinement fonctionnel et vous n\'aurez plus à revenir sur cette page.<br><br>164 *** Pour maintenir les liaisons déjà actives ***<br>165 Maintenance : Synchroniser les tables (dans le cas où un ajout, une mise à jour ou une suppression d\'utilisateur s\'est mal déroulée) permet de remettre à jour mots de passe et adresses email et voir les utilisateurs intrus (Mais vous ne devriez pas avoir à l\'utiliser).<br><br>166 <div class="warning">Pensez faire une sauvegarde de votre base et spécialement de vos tables ###_USERS avant toutes actions par mesure de sécurité.</div>167 <br><br>168 <div class="warning">A savoir :<br>169 Par défaut, <b>FluxBB</b> est <u>insensible</u> à la casse sur les noms d\'utilisateurs. C\'est à dire que si un utilisateur "test" est déjà inscrit, d\'autres inscriptions avec, par exemple, "Test" ou "TEST" ou "TEst" (etc...) seront refusées.<br><br>170 Par défaut, <b>Piwigo</b> fonctionne de manière inverse et est donc <u>sensible</u> à la casse sur les logins ("test" sera un utilisateur différent de "Test" etc...).<br><br>171 Afin d\'éviter des erreurs (même si le comportement de Piwigo peut-être facilement changé - Voir les options de configuration), Register_FluxBB fera le lien entre les deux applications à la manière de FluxBB : En étant <u>insensible</u> à la casse pour les logins.<br><br></div>';172 // --------- End: New or revised $lang ---- from version 2.3.5173 178 ?> -
extensions/Register_FluxBB/main.inc.php
r19138 r21424 107 107 - Update pl_PL, thanks to : kuba 108 108 - Bad explanation in inline tips fixed 109 110 2.5.0 - ../../.. - Compliance with Piwigo 2.5 111 - Code refactory : Plugin's configuration vars are now serialized in database 112 - Admin panel refactory : No more tabs 113 - English language reference review 114 - Compliance improved with FluxBB 1.5 109 115 -------------------------------------------------------------------------------- 110 116 */ 111 112 // pour faciliter le debug - make debug easier :o)113 //ini_set('error_reporting', E_ALL);114 //ini_set('display_errors', true);115 117 116 118 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); -
extensions/Register_FluxBB/maintain.inc.php
r17457 r21424 1 1 <?php 2 3 if (!defined('REGFLUXBB_PATH')) define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 4 //ini_set('error_reporting', E_ALL);5 //ini_set('display_errors', true); 2 if(!defined('REGFLUXBB_PATH')) 3 { 4 define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 5 } 6 6 7 7 include_once (PHPWG_ROOT_PATH.'/include/constants.php'); 8 include_once (REGFLUXBB_PATH.'include/constants.php');9 8 include_once (REGFLUXBB_PATH.'include/functions.inc.php'); 10 11 9 12 10 function plugin_install() 13 11 { 14 global $prefixeTable ;12 global $prefixeTable, $conf; 15 13 14 // Set current plugin version in config table 15 $plugin = RegFluxBB_Infos(REGFLUXBB_PATH); 16 $version = $plugin['version']; 17 18 // Default global parameters for RegisterFluxBB conf 19 // ------------------------------------------------- 20 $defaultRegFluxBB = array( 21 'REGFLUXBB_VERSION' => $version, 22 'FLUXBB_PREFIX' => '', 23 'FLUXBB_ADMIN' => '', 24 'FLUXBB_GUEST' => '', 25 'FLUXBB_DEL_PT' => 'false', 26 'FLUXBB_CONFIRM' => 'false', 27 'FLUXBB_DETAIL' => 'false', 28 'FLUXBB_UAM_LINK' => 'false', 29 'FLUXBB_GROUP' => '' 30 ); 31 32 // Create RegisterFluxBB conf if not already exists 33 // ------------------------------------------------ 34 $query = ' 35 SELECT param 36 FROM '.CONFIG_TABLE.' 37 WHERE param = "Register_FluxBB" 38 ;'; 39 $count = pwg_db_num_rows(pwg_query($query)); 40 41 if ($count == 0) 42 { 43 $q = ' 44 INSERT INTO '.CONFIG_TABLE.' (param, value, comment) 45 VALUES ("Register_FluxBB","'.pwg_db_real_escape_string(serialize($defaultRegFluxBB)).'","Register_FluxBB parameters") 46 ;'; 47 pwg_query($q); 48 } 49 50 // Create relation table between FluxBB and Piwigo 51 // ----------------------------------------------- 16 52 $q = ' 17 INSERT INTO '.CONFIG_TABLE.' (param,value,comment) 18 VALUES ("Register_FluxBB","FluxBB_;PhpWebGallery;Guest;false;false;true;false;0","Parametres Register_FluxBB") 19 ;'; 20 21 pwg_query($q); 22 23 $q = " 24 CREATE TABLE IF NOT EXISTS ".Register_FluxBB_ID_TABLE." ( 25 id_user_pwg smallint(5) NOT NULL default '0', 26 id_user_FluxBB int(10) NOT NULL default '0', 53 CREATE TABLE IF NOT EXISTS '.Register_FluxBB_ID_TABLE.' ( 54 id_user_pwg smallint(5) NOT NULL default "0", 55 id_user_FluxBB int(10) NOT NULL default "0", 27 56 PRIMARY KEY (id_user_pwg), 28 57 KEY id_user_pwg (id_user_pwg, id_user_FluxBB) 29 58 ) 30 ; ";59 ;'; 31 60 32 61 pwg_query($q); … … 42 71 regfluxbb_obsolete_files(); 43 72 44 /* Check version < 2.3.0 */ 45 $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 46 47 if (!isset($conf_Register_FluxBB[6]) and !isset($conf_Register_FluxBB[7])) 73 include_once (REGFLUXBB_PATH.'include/upgradedb.inc.php'); 74 75 /* Database upgrade */ 76 /* **************** */ 77 $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); 78 79 if (isset($conf_RegFluxBB[0]) and strpos($conf_RegFluxBB[0],"{") === false) /* Version < 2.5.0 */ 48 80 { 49 $upgrade_RFBB = $conf_Register_FluxBB[0].';'.$conf_Register_FluxBB[1].';'.$conf_Register_FluxBB[2].';'.$conf_Register_FluxBB[3].';'.$conf_Register_FluxBB[4].';'.$conf_Register_FluxBB[5].';false;0'; 81 upgrade_240_250(); 82 } 50 83 51 conf_update_param('Register_FluxBB', pwg_db_real_escape_string($upgrade_RFBB)); 52 } 84 /* Update plugin version number in #_config table */ 85 /* and check consistency of #_plugins table */ 86 /* ********************************************** */ 87 RegFluxBB_version_update(); 88 89 /* Reload plugin parameters */ 90 /* ************************ */ 91 load_conf_from_db('param like \'Register_FluxBB\''); 53 92 } 54 93 … … 66 105 pwg_query($q); 67 106 } 68 107 69 108 $q = 'DROP TABLE '.Register_FluxBB_ID_TABLE.';'; 70 109 pwg_query( $q );
Note: See TracChangeset
for help on using the changeset viewer.