1 | <?php |
---|
2 | |
---|
3 | global $page, $user, $lang, $conf, $template, $errors; |
---|
4 | |
---|
5 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
6 | |
---|
7 | check_status(ACCESS_ADMINISTRATOR); |
---|
8 | |
---|
9 | if(!defined('REGFLUXBB_PATH')) |
---|
10 | { |
---|
11 | define('REGFLUXBB_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
12 | } |
---|
13 | |
---|
14 | include_once (PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
15 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
16 | |
---|
17 | load_language('plugin.lang', REGFLUXBB_PATH); |
---|
18 | |
---|
19 | $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); |
---|
20 | |
---|
21 | // +-----------------------------------------------------------------------+ |
---|
22 | // | Getting plugin version | |
---|
23 | // +-----------------------------------------------------------------------+ |
---|
24 | $plugin = RegFluxBB_Infos(REGFLUXBB_PATH); |
---|
25 | $version = $plugin['version'] ; |
---|
26 | |
---|
27 | // +------------------------------------------------------------------+ |
---|
28 | // | Plugin settings | |
---|
29 | // +------------------------------------------------------------------+ |
---|
30 | 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'])) |
---|
31 | { |
---|
32 | $_POST['FluxBB_admin'] = stripslashes($_POST['FluxBB_admin']); |
---|
33 | $_POST['FluxBB_guest'] = stripslashes($_POST['FluxBB_guest']); |
---|
34 | |
---|
35 | /* Configuration controls */ |
---|
36 | // Piwigo's admin username control |
---|
37 | $query = ' |
---|
38 | SELECT username, id |
---|
39 | FROM '.USERS_TABLE.' |
---|
40 | WHERE id = '.$conf['webmaster_id'].' |
---|
41 | ;'; |
---|
42 | |
---|
43 | $pwgadmin = pwg_db_fetch_assoc(pwg_query($query)); |
---|
44 | |
---|
45 | if (isset($_POST['FluxBB_prefix']) and $_POST['FluxBB_prefix'] <>'') |
---|
46 | { |
---|
47 | // FluxBB's admin username control |
---|
48 | $query = ' |
---|
49 | SELECT username, id |
---|
50 | FROM '.$_POST['FluxBB_prefix'].'users'.' |
---|
51 | WHERE id = 2 |
---|
52 | ;'; |
---|
53 | |
---|
54 | $fbbadmin = pwg_db_fetch_assoc(pwg_query($query)); |
---|
55 | |
---|
56 | // FluxBB's Guest username control |
---|
57 | $query = ' |
---|
58 | SELECT username, id |
---|
59 | FROM '.$_POST['FluxBB_prefix'].'users'.' |
---|
60 | WHERE id = 1 |
---|
61 | ;'; |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | $fbbguest = pwg_db_fetch_assoc(pwg_query($query)); |
---|
66 | |
---|
67 | // Compute configuration errors |
---|
68 | if (stripslashes($pwgadmin['username']) != $_POST['FluxBB_admin']) |
---|
69 | { |
---|
70 | array_push($page['errors'], l10n('error_config_admin1')); |
---|
71 | } |
---|
72 | if (stripslashes($pwgadmin['username']) != stripslashes($fbbadmin['username'])) |
---|
73 | { |
---|
74 | array_push($page['errors'], l10n('error_config_admin2')); |
---|
75 | } |
---|
76 | if (stripslashes($fbbguest['username']) != stripslashes($_POST['FluxBB_guest'])) |
---|
77 | { |
---|
78 | array_push($page['errors'], l10n('error_config_guest')); |
---|
79 | } |
---|
80 | elseif (count($page['errors']) == 0) |
---|
81 | { |
---|
82 | if (!function_exists('FindAvailableConfirmMailID')) |
---|
83 | { |
---|
84 | $_POST['FluxBB_UAM'] = 'false'; |
---|
85 | $_POST['FluxBB_group'] = '0'; |
---|
86 | |
---|
87 | $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; |
---|
88 | $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); |
---|
89 | $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); |
---|
90 | $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); |
---|
91 | $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); |
---|
92 | $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); |
---|
93 | $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); |
---|
94 | $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); |
---|
95 | $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); |
---|
96 | } |
---|
97 | elseif (function_exists('FindAvailableConfirmMailID')) |
---|
98 | { |
---|
99 | $conf_UAM = unserialize($conf['UserAdvManager']); |
---|
100 | |
---|
101 | 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') |
---|
102 | { |
---|
103 | $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; |
---|
104 | $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); |
---|
105 | $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); |
---|
106 | $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); |
---|
107 | $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); |
---|
108 | $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); |
---|
109 | $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); |
---|
110 | $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); |
---|
111 | $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); |
---|
112 | } |
---|
113 | else |
---|
114 | { |
---|
115 | $_POST['FluxBB_UAM'] = 'false'; |
---|
116 | $_POST['FluxBB_group'] = '0'; |
---|
117 | |
---|
118 | $newconf_RegFluxBB['REGFLUXBB_VERSION'] = $version; |
---|
119 | $newconf_RegFluxBB['FLUXBB_PREFIX'] = (isset($_POST['FluxBB_prefix']) ? $_POST['FluxBB_prefix'] : ''); |
---|
120 | $newconf_RegFluxBB['FLUXBB_ADMIN'] = (isset($_POST['FluxBB_admin']) ? $_POST['FluxBB_admin'] : ''); |
---|
121 | $newconf_RegFluxBB['FLUXBB_GUEST'] = (isset($_POST['FluxBB_guest']) ? $_POST['FluxBB_guest'] : ''); |
---|
122 | $newconf_RegFluxBB['FLUXBB_DEL_PT'] = (isset($_POST['FluxBB_del_pt']) ? $_POST['FluxBB_del_pt'] : 'false'); |
---|
123 | $newconf_RegFluxBB['FLUXBB_CONFIRM'] = (isset($_POST['FluxBB_confirm']) ? $_POST['FluxBB_confirm'] : 'false'); |
---|
124 | $newconf_RegFluxBB['FLUXBB_DETAIL'] = (isset($_POST['FluxBB_details']) ? $_POST['FluxBB_details'] : 'false'); |
---|
125 | $newconf_RegFluxBB['FLUXBB_UAM_LINK'] = (isset($_POST['FluxBB_UAM']) ? $_POST['FluxBB_UAM'] : 'false'); |
---|
126 | $newconf_RegFluxBB['FLUXBB_GROUP'] = (isset($_POST['FluxBB_group']) ? $_POST['FluxBB_group'] : ''); |
---|
127 | } |
---|
128 | } |
---|
129 | |
---|
130 | $conf['Register_FluxBB'] = serialize($newconf_RegFluxBB); |
---|
131 | |
---|
132 | conf_update_param('Register_FluxBB', pwg_db_real_escape_string($conf['Register_FluxBB'])); |
---|
133 | |
---|
134 | array_push($page['infos'], l10n('save_config')); |
---|
135 | } |
---|
136 | } |
---|
137 | |
---|
138 | |
---|
139 | // +--------------------------------------------------------+ |
---|
140 | // | Synch and Audit | |
---|
141 | // +--------------------------------------------------------+ |
---|
142 | if ( isset($_POST['Synchro'])) |
---|
143 | { |
---|
144 | $msg_error_PWG_Dup = ''; |
---|
145 | $msg_error_FluxBB_Dup = ''; |
---|
146 | $msg_error_Link_Break = ''; |
---|
147 | $msg_error_Link_Bad = ''; |
---|
148 | $msg_error_Synchro = ''; |
---|
149 | $msg_ok_Synchro = ''; |
---|
150 | $msg_error_FluxBB2PWG = ''; |
---|
151 | $msg_error_PWG2FluxBB = ''; |
---|
152 | |
---|
153 | |
---|
154 | $query = ' |
---|
155 | SELECT COUNT(*) AS nbr_dup, id, username |
---|
156 | FROM '.USERS_TABLE.' |
---|
157 | WHERE username NOT IN ("18","16") |
---|
158 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
159 | GROUP BY BINARY username |
---|
160 | HAVING COUNT(*) > 1 |
---|
161 | ;'; |
---|
162 | |
---|
163 | $result = pwg_query($query); |
---|
164 | |
---|
165 | while($row = pwg_db_fetch_assoc($result)) |
---|
166 | $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); |
---|
167 | |
---|
168 | if ($msg_error_PWG_Dup <> '') |
---|
169 | $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); |
---|
170 | |
---|
171 | $query = ' |
---|
172 | SELECT COUNT(*) AS nbr_dup, username |
---|
173 | FROM '.FluxBB_USERS_TABLE.' |
---|
174 | GROUP BY BINARY username |
---|
175 | HAVING COUNT(*) > 1 |
---|
176 | ;'; |
---|
177 | |
---|
178 | $result = pwg_query($query); |
---|
179 | |
---|
180 | while($row = pwg_db_fetch_assoc($result)) |
---|
181 | { |
---|
182 | $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); |
---|
183 | |
---|
184 | $subquery = ' |
---|
185 | SELECT id, username, email |
---|
186 | FROM '.FluxBB_USERS_TABLE.' |
---|
187 | WHERE BINARY username = BINARY "'.$row['username'].'" |
---|
188 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
189 | ;'; |
---|
190 | |
---|
191 | $subresult = pwg_query($subquery); |
---|
192 | |
---|
193 | while($subrow = pwg_db_fetch_assoc($subresult)) |
---|
194 | { |
---|
195 | $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; |
---|
196 | |
---|
197 | $msg_error_FluxBB_Dup .= ' <a href="'; |
---|
198 | |
---|
199 | $msg_error_FluxBB_Dup .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
200 | 'action' => 'del_user', |
---|
201 | 'id' => $subrow['id'], |
---|
202 | )); |
---|
203 | |
---|
204 | $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"'; |
---|
205 | |
---|
206 | $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
207 | |
---|
208 | $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($subrow['username']).'" /></a>'; |
---|
209 | } |
---|
210 | } |
---|
211 | |
---|
212 | if ($msg_error_FluxBB_Dup <> '') |
---|
213 | $msg_error_FluxBB_Dup = l10n('Sync_Check_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); |
---|
214 | |
---|
215 | if ($msg_error_FluxBB_Dup == '' and $msg_error_PWG_Dup == '') |
---|
216 | { |
---|
217 | $query = ' |
---|
218 | SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail |
---|
219 | FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg |
---|
220 | WHERE bb.id NOT in ( |
---|
221 | SELECT id_user_FluxBB |
---|
222 | FROM '.Register_FluxBB_ID_TABLE.' |
---|
223 | ) |
---|
224 | AND pwg.id NOT in ( |
---|
225 | SELECT id_user_pwg |
---|
226 | FROM '.Register_FluxBB_ID_TABLE.' |
---|
227 | ) |
---|
228 | AND pwg.username = bb.username |
---|
229 | AND pwg.username NOT IN ("18","16") |
---|
230 | AND pwg.username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
231 | AND pwg.mail_address = bb.email |
---|
232 | ;'; |
---|
233 | |
---|
234 | $result = pwg_query($query); |
---|
235 | |
---|
236 | while($row = pwg_db_fetch_assoc($result)) |
---|
237 | { |
---|
238 | $msg_error_Link_Break .= '<br>'.l10n('New_Link').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; |
---|
239 | FluxBB_Linkuser($row['pwg_id'], $row['bb_id'], "NOK"); |
---|
240 | } |
---|
241 | |
---|
242 | if ($msg_error_Link_Break == '') |
---|
243 | array_push($page['infos'], l10n('Sync_Link_Break').'<br>'.l10n('Sync_OK')); |
---|
244 | else |
---|
245 | $msg_error_Link_Break = l10n('Sync_Link_Break').$msg_error_Link_Break; |
---|
246 | |
---|
247 | $query = ' |
---|
248 | 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 |
---|
249 | FROM '.FluxBB_USERS_TABLE.' AS bb |
---|
250 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id |
---|
251 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
252 | WHERE BINARY pwg.username <> BINARY bb.username |
---|
253 | AND pwg.username NOT IN ("18","16") |
---|
254 | AND pwg.username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
255 | ;'; |
---|
256 | |
---|
257 | $result = pwg_query($query); |
---|
258 | |
---|
259 | while($row = pwg_db_fetch_assoc($result)) |
---|
260 | { |
---|
261 | $msg_error_Link_Bad .= '<br>'.l10n('Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; |
---|
262 | |
---|
263 | $subquery = ' |
---|
264 | DELETE FROM '.Register_FluxBB_ID_TABLE.' |
---|
265 | WHERE id_user_pwg = '.$row['pwg_id'].' |
---|
266 | AND id_user_FluxBB = '.$row['bb_id'].' |
---|
267 | ;'; |
---|
268 | |
---|
269 | $subresult = pwg_query($subquery); |
---|
270 | } |
---|
271 | |
---|
272 | $query = ' |
---|
273 | SELECT COUNT(*) as nbr_dead |
---|
274 | FROM '.Register_FluxBB_ID_TABLE.' AS Link |
---|
275 | WHERE id_user_FluxBB NOT IN ( |
---|
276 | SELECT id |
---|
277 | FROM '.FluxBB_USERS_TABLE.' |
---|
278 | ) |
---|
279 | OR id_user_pwg NOT IN ( |
---|
280 | SELECT id |
---|
281 | FROM '.USERS_TABLE.' |
---|
282 | ) |
---|
283 | ;'; |
---|
284 | |
---|
285 | $Compteur = pwg_db_fetch_assoc(pwg_query($query)); |
---|
286 | |
---|
287 | if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) |
---|
288 | { |
---|
289 | $msg_error_Link_Bad .= '<br>'.l10n('Link_Dead').$Compteur['nbr_dead']; |
---|
290 | |
---|
291 | $query = ' |
---|
292 | DELETE FROM '.Register_FluxBB_ID_TABLE.' |
---|
293 | WHERE id_user_FluxBB NOT IN ( |
---|
294 | SELECT id |
---|
295 | FROM '.FluxBB_USERS_TABLE.' |
---|
296 | ) |
---|
297 | OR id_user_pwg NOT IN ( |
---|
298 | SELECT id |
---|
299 | FROM '.USERS_TABLE.' |
---|
300 | ) |
---|
301 | ;'; |
---|
302 | |
---|
303 | $result = pwg_query($query); |
---|
304 | } |
---|
305 | |
---|
306 | $query = ' |
---|
307 | 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 |
---|
308 | FROM '.FluxBB_USERS_TABLE.' AS bb |
---|
309 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id |
---|
310 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
311 | WHERE pwg.username NOT IN ("18","16") |
---|
312 | AND pwg.username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
313 | GROUP BY link.id_user_pwg, link.id_user_FluxBB |
---|
314 | HAVING COUNT(*) > 1 |
---|
315 | ;'; |
---|
316 | |
---|
317 | $result = pwg_query($query); |
---|
318 | |
---|
319 | while($row = pwg_db_fetch_assoc($result)) |
---|
320 | { |
---|
321 | $msg_error_Link_Bad .= '<br>'.l10n('Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; |
---|
322 | |
---|
323 | FluxBB_Linkuser($row['pwg_id'], $row['bb_id'], "NOK"); |
---|
324 | } |
---|
325 | |
---|
326 | if ($msg_error_Link_Bad == '') |
---|
327 | array_push($page['infos'], l10n('Sync_Link_Bad').'<br>'.l10n('Sync_OK')); |
---|
328 | else |
---|
329 | $msg_error_Link_Bad = l10n('Sync_Link_Bad').$msg_error_Link_Bad; |
---|
330 | |
---|
331 | $query = ' |
---|
332 | SELECT pwg.id as pwg_id, pwg.username as username, pwg.mail_address as pwg_eml, FluxBB.id as bb_id, FluxBB.email as bb_eml |
---|
333 | FROM '.FluxBB_USERS_TABLE.' AS FluxBB |
---|
334 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id |
---|
335 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
336 | AND BINARY pwg.username = BINARY FluxBB.username |
---|
337 | AND pwg.username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
338 | ORDER BY LOWER(pwg.username) |
---|
339 | ;'; |
---|
340 | |
---|
341 | $result = pwg_query($query); |
---|
342 | |
---|
343 | while($row = pwg_db_fetch_assoc($result)) |
---|
344 | { |
---|
345 | if ($row['pwg_eml'] != $row['bb_eml']) |
---|
346 | { |
---|
347 | $msg_error_Synchro .= '<br>'.l10n('Sync_User').stripslashes($row['username']); |
---|
348 | |
---|
349 | $query = ' |
---|
350 | SELECT id, username, mail_address |
---|
351 | FROM '.USERS_TABLE.' |
---|
352 | WHERE BINARY id = "'.$row['pwg_id'].'" |
---|
353 | AND "'.$row['username'].'" NOT IN ("18","16") |
---|
354 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
355 | ;'; |
---|
356 | |
---|
357 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
358 | |
---|
359 | if (!empty($data)) |
---|
360 | Synch_FluxBB_Updateuser($data['id'], stripslashes($data['username']), $data['mail_address']); |
---|
361 | } |
---|
362 | } |
---|
363 | |
---|
364 | if ($msg_error_Synchro == '') |
---|
365 | array_push($page['infos'], l10n('Sync_DataUser').'<br>'.l10n('Sync_OK')); |
---|
366 | else |
---|
367 | $msg_error_Synchro = l10n('Sync_DataUser').$msg_error_Synchro; |
---|
368 | |
---|
369 | $query = ' |
---|
370 | SELECT username, mail_address FROM '.USERS_TABLE.' |
---|
371 | WHERE BINARY username <> BINARY "guest" |
---|
372 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
373 | AND username NOT IN ("18","16") |
---|
374 | AND id not in ( |
---|
375 | SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.' |
---|
376 | ) |
---|
377 | AND BINARY username not in ( |
---|
378 | SELECT username FROM '.FluxBB_USERS_TABLE.' |
---|
379 | ) |
---|
380 | ORDER BY LOWER(username) |
---|
381 | ;'; |
---|
382 | |
---|
383 | $result = pwg_query($query); |
---|
384 | |
---|
385 | while($row = pwg_db_fetch_assoc($result)) |
---|
386 | { |
---|
387 | $msg_error_PWG2FluxBB .= '<br>'.l10n('Add_User').stripslashes($row['username']).' ('.$row['mail_address'].')'; |
---|
388 | |
---|
389 | $query = ' |
---|
390 | SELECT id, username, mail_address |
---|
391 | FROM '.USERS_TABLE.' |
---|
392 | WHERE BINARY username = BINARY "'.$row['username'].'" |
---|
393 | AND username NOT IN ("18","16") |
---|
394 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
395 | LIMIT 1 |
---|
396 | ;'; |
---|
397 | |
---|
398 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
399 | |
---|
400 | if (!empty($data)) |
---|
401 | Synch_FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['mail_address']); |
---|
402 | } |
---|
403 | |
---|
404 | if ($msg_error_PWG2FluxBB == '') |
---|
405 | array_push($page['infos'], l10n('Sync_PWG2FluxBB').'<br>'.l10n('Sync_OK')); |
---|
406 | else |
---|
407 | $msg_error_PWG2FluxBB = l10n('Sync_PWG2FluxBB').$msg_error_PWG2FluxBB; |
---|
408 | |
---|
409 | $query = ' |
---|
410 | SELECT id, username, email FROM '.FluxBB_USERS_TABLE.' |
---|
411 | WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'" |
---|
412 | AND username <> "'.stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']).'" |
---|
413 | AND id not in ( |
---|
414 | SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.' |
---|
415 | ) |
---|
416 | AND BINARY username not in ( |
---|
417 | SELECT username FROM '.USERS_TABLE.' |
---|
418 | ) |
---|
419 | ORDER BY LOWER(username) |
---|
420 | ;'; |
---|
421 | |
---|
422 | $result = pwg_query($query); |
---|
423 | |
---|
424 | while($row = pwg_db_fetch_assoc($result)) |
---|
425 | { |
---|
426 | $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; |
---|
427 | $msg_error_FluxBB2PWG .= ' <a href="'; |
---|
428 | $msg_error_FluxBB2PWG .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
429 | 'action' => 'del_user', |
---|
430 | 'id' => $row['id'], |
---|
431 | )); |
---|
432 | |
---|
433 | $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; |
---|
434 | |
---|
435 | $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
436 | |
---|
437 | $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; |
---|
438 | } |
---|
439 | |
---|
440 | if ($msg_error_FluxBB2PWG == '') |
---|
441 | array_push($page['infos'], l10n('Sync_FluxBB2PWG').'<br>'.l10n('Sync_OK')); |
---|
442 | else |
---|
443 | $msg_error_FluxBB2PWG = l10n('Sync_FluxBB2PWG').$msg_error_FluxBB2PWG; |
---|
444 | } |
---|
445 | else |
---|
446 | $errors[] = l10n('Advise_Check_Dup'); |
---|
447 | |
---|
448 | if ($msg_error_PWG_Dup <> '') |
---|
449 | $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>' ); |
---|
450 | |
---|
451 | if ($msg_error_FluxBB_Dup <> '') |
---|
452 | $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>' ); |
---|
453 | |
---|
454 | if ($msg_error_Link_Break <> '') |
---|
455 | $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
456 | |
---|
457 | if ($msg_error_Link_Bad <> '') |
---|
458 | $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
459 | |
---|
460 | if ($msg_error_Synchro <> '') |
---|
461 | $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
462 | |
---|
463 | if ($msg_error_PWG2FluxBB <> '') |
---|
464 | $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
465 | |
---|
466 | if ($msg_error_FluxBB2PWG <> '') |
---|
467 | $errors[] = $msg_error_FluxBB2PWG; |
---|
468 | } |
---|
469 | else if ( isset($_POST['Audit'])) |
---|
470 | { |
---|
471 | Audit_PWG_FluxBB(); |
---|
472 | } |
---|
473 | |
---|
474 | |
---|
475 | // +---------------------------------------------------------------+ |
---|
476 | // | Audit function | |
---|
477 | // +---------------------------------------------------------------+ |
---|
478 | function Audit_PWG_FluxBB() |
---|
479 | { |
---|
480 | global $page, $conf, $errors; |
---|
481 | |
---|
482 | $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); |
---|
483 | |
---|
484 | $msg_error_PWG_Dup = ''; |
---|
485 | $msg_error_FluxBB_Dup = ''; |
---|
486 | $msg_error_Link_Break = ''; |
---|
487 | $msg_error_Link_Bad = ''; |
---|
488 | $msg_error_Synchro = ''; |
---|
489 | $msg_ok_Synchro = ''; |
---|
490 | $msg_error_PWG2FluxBB = ''; |
---|
491 | $msg_error_FluxBB2PWG = ''; |
---|
492 | |
---|
493 | // Check duplicate accounts in Piwigo users table |
---|
494 | // ---------------------------------------------- |
---|
495 | $query = ' |
---|
496 | SELECT COUNT(*) AS nbr_dup, id, username |
---|
497 | FROM '.USERS_TABLE.' |
---|
498 | WHERE username NOT IN ("18","16") |
---|
499 | GROUP BY BINARY username |
---|
500 | HAVING COUNT(*) > 1 |
---|
501 | ;'; |
---|
502 | $result = pwg_query($query); |
---|
503 | |
---|
504 | while($row = pwg_db_fetch_assoc($result)) |
---|
505 | $msg_error_PWG_Dup .= '<br>'.l10n('Error_PWG_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); |
---|
506 | |
---|
507 | // Display OK message or build errors |
---|
508 | if ($msg_error_PWG_Dup == '') |
---|
509 | array_push($page['infos'], l10n('Audit_PWG_Dup').'<br>'.l10n('Audit_OK')); |
---|
510 | else |
---|
511 | $msg_error_PWG_Dup = l10n('Audit_PWG_Dup').$msg_error_PWG_Dup.'<br>'.l10n('Advise_PWG_Dup'); |
---|
512 | |
---|
513 | |
---|
514 | // Check duplicate accounts in FluxBB users table |
---|
515 | // ---------------------------------------------- |
---|
516 | $query = ' |
---|
517 | SELECT COUNT(*) AS nbr_dup, username |
---|
518 | FROM '.FluxBB_USERS_TABLE.' |
---|
519 | GROUP BY BINARY username |
---|
520 | HAVING COUNT(*) > 1 |
---|
521 | ;'; |
---|
522 | $result = pwg_query($query); |
---|
523 | |
---|
524 | while($row = pwg_db_fetch_assoc($result)) |
---|
525 | { |
---|
526 | $msg_error_FluxBB_Dup .= '<br>'.l10n('Error_FluxBB_Dup').$row['nbr_dup'].' x '.stripslashes($row['username']); |
---|
527 | |
---|
528 | $subquery = ' |
---|
529 | SELECT id, username, email |
---|
530 | FROM '.FluxBB_USERS_TABLE.' |
---|
531 | WHERE BINARY username = BINARY "'.$row['username'].'" |
---|
532 | ;'; |
---|
533 | $subresult = pwg_query($subquery); |
---|
534 | |
---|
535 | while($subrow = pwg_db_fetch_assoc($subresult)) |
---|
536 | { |
---|
537 | $msg_error_FluxBB_Dup .= '<br>id:'.$subrow['id'].'='.stripslashes($subrow['username']).' ('.$subrow['email'].')'; |
---|
538 | |
---|
539 | // Action : Delete duplicate user from FluxBB |
---|
540 | $msg_error_FluxBB_Dup .= ' <a href="'; |
---|
541 | $msg_error_FluxBB_Dup .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
542 | 'action' => 'del_user', |
---|
543 | 'id' => $subrow['id'], |
---|
544 | )); |
---|
545 | $msg_error_FluxBB_Dup .= '" title="'.l10n('Del_User').stripslashes($subrow['username']).'"'; |
---|
546 | $msg_error_FluxBB_Dup .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
547 | $msg_error_FluxBB_Dup .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').$subrow['username'].'" /></a>'; |
---|
548 | } |
---|
549 | } |
---|
550 | |
---|
551 | // Display OK message or build errors |
---|
552 | if ($msg_error_FluxBB_Dup == '') |
---|
553 | array_push($page['infos'], l10n('Audit_FluxBB_Dup').'<br>'.l10n('Audit_OK')); |
---|
554 | else |
---|
555 | $msg_error_FluxBB_Dup = l10n('Audit_FluxBB_Dup').$msg_error_FluxBB_Dup.'<br>'.l10n('Advise_FluxBB_Dup'); |
---|
556 | |
---|
557 | |
---|
558 | // Check links between Piwigo and FluxBB users |
---|
559 | // ------------------------------------------- |
---|
560 | // Check fixable broken links between Piwigo and FluxBB users |
---|
561 | // ---------------------------------------------------------- |
---|
562 | $query = ' |
---|
563 | SELECT pwg.id as pwg_id, bb.id as bb_id, pwg.username as pwg_user, pwg.mail_address as pwg_mail |
---|
564 | FROM '.FluxBB_USERS_TABLE.' AS bb, '.USERS_TABLE.' as pwg |
---|
565 | WHERE bb.id NOT in ( |
---|
566 | SELECT id_user_FluxBB |
---|
567 | FROM '.Register_FluxBB_ID_TABLE.' |
---|
568 | ) |
---|
569 | AND pwg.id NOT in ( |
---|
570 | SELECT id_user_pwg |
---|
571 | FROM '.Register_FluxBB_ID_TABLE.' |
---|
572 | ) |
---|
573 | AND pwg.username = bb.username |
---|
574 | AND pwg.username NOT IN ("18","16") |
---|
575 | AND pwg.mail_address = bb.email |
---|
576 | ;'; |
---|
577 | |
---|
578 | $result = pwg_query($query); |
---|
579 | |
---|
580 | while($row = pwg_db_fetch_assoc($result)) |
---|
581 | { |
---|
582 | $msg_error_Link_Break .= '<br>'.l10n('Error_Link_Break').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'; |
---|
583 | |
---|
584 | // Action : Create new link |
---|
585 | $msg_error_Link_Break .= ' <a href="'; |
---|
586 | $msg_error_Link_Break .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
587 | 'action' => 'new_link', |
---|
588 | 'pwg_id' => $row['pwg_id'], |
---|
589 | 'bb_id' => $row['bb_id'], |
---|
590 | )); |
---|
591 | $msg_error_Link_Break .= '" title="'.l10n('New_Link').stripslashes($row['pwg_user']).'"'; |
---|
592 | $msg_error_Link_Break .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
593 | $msg_error_Link_Break .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_break.png" alt="'.l10n('New_Link').stripslashes($row['pwg_user']).'" /></a>'; |
---|
594 | } |
---|
595 | |
---|
596 | // Display OK message or build errors |
---|
597 | if ($msg_error_Link_Break == '') |
---|
598 | array_push($page['infos'], l10n('Audit_Link_Break').'<br>'.l10n('Audit_OK')); |
---|
599 | else |
---|
600 | $msg_error_Link_Break = l10n('Audit_Link_Break').$msg_error_Link_Break; |
---|
601 | |
---|
602 | |
---|
603 | // Check not fixable broken links between Piwigo and FluxBB users |
---|
604 | // -------------------------------------------------------------- |
---|
605 | $query = ' |
---|
606 | 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 |
---|
607 | FROM '.FluxBB_USERS_TABLE.' AS bb |
---|
608 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id |
---|
609 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
610 | WHERE pwg.username <> bb.username |
---|
611 | AND pwg.username NOT IN ("18","16") |
---|
612 | ;'; |
---|
613 | |
---|
614 | $result = pwg_query($query); |
---|
615 | |
---|
616 | while($row = pwg_db_fetch_assoc($result)) |
---|
617 | { |
---|
618 | $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Del').stripslashes($row['pwg_user']).' ('.$row['pwg_mail'].')'.' -- '.stripslashes($row['bb_user']).' ('.$row['bb_mail'].')'; |
---|
619 | |
---|
620 | // Action : Delete obsolete links |
---|
621 | $msg_error_Link_Bad .= ' <a href="'; |
---|
622 | $msg_error_Link_Bad .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
623 | 'action' => 'link_del', |
---|
624 | 'pwg_id' => $row['pwg_id'], |
---|
625 | 'bb_id' => $row['bb_id'], |
---|
626 | )); |
---|
627 | $msg_error_Link_Bad .= '" title="'.l10n('Link_Del').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; |
---|
628 | $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
629 | $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>'; |
---|
630 | |
---|
631 | // Action : Synch users data |
---|
632 | $msg_error_Link_Bad .= ' -- <a href="'; |
---|
633 | $msg_error_Link_Bad .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
634 | 'action' => 'sync_user', |
---|
635 | 'username' => stripslashes($row['pwg_user']), |
---|
636 | )); |
---|
637 | $msg_error_Link_Bad .= '" title="'.l10n('Sync_User').stripslashes($row['pwg_user']).' --> '.stripslashes($row['bb_user']).'"'; |
---|
638 | $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
639 | $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>'; |
---|
640 | } |
---|
641 | |
---|
642 | |
---|
643 | // Check dead links between Piwigo and FluxBB users |
---|
644 | // ------------------------------------------------ |
---|
645 | $query = ' |
---|
646 | SELECT COUNT(*) as nbr_dead |
---|
647 | FROM '.Register_FluxBB_ID_TABLE.' AS Link |
---|
648 | WHERE id_user_FluxBB NOT IN ( |
---|
649 | SELECT id |
---|
650 | FROM '.FluxBB_USERS_TABLE.' |
---|
651 | ) |
---|
652 | OR id_user_pwg NOT IN ( |
---|
653 | SELECT id |
---|
654 | FROM '.USERS_TABLE.' |
---|
655 | ) |
---|
656 | ;'; |
---|
657 | |
---|
658 | $Compteur = pwg_db_fetch_assoc(pwg_query($query)); |
---|
659 | |
---|
660 | if (!empty($Compteur) and $Compteur['nbr_dead'] > 0) |
---|
661 | { |
---|
662 | $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dead').$Compteur['nbr_dead']; |
---|
663 | |
---|
664 | // Action : Repair dead links |
---|
665 | $msg_error_Link_Bad .= ' <a href="'; |
---|
666 | $msg_error_Link_Bad .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
667 | 'action' => 'link_dead', |
---|
668 | )); |
---|
669 | $msg_error_Link_Bad .= '" title="'.l10n('Link_Dead').$Compteur['nbr_dead'].'"'; |
---|
670 | $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
671 | $msg_error_Link_Bad .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/link_delete.png" alt="'.l10n('Link_Dead').$Compteur['nbr_dead'].'" /></a>'; |
---|
672 | } |
---|
673 | |
---|
674 | |
---|
675 | // Check duplicated links between Piwigo and FluxBB users |
---|
676 | // ------------------------------------------------------ |
---|
677 | $query = ' |
---|
678 | 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 |
---|
679 | FROM '.FluxBB_USERS_TABLE.' AS bb |
---|
680 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = bb.id |
---|
681 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
682 | WHERE pwg.username NOT IN ("18","16") |
---|
683 | GROUP BY link.id_user_pwg, link.id_user_FluxBB |
---|
684 | HAVING COUNT(*) > 1 |
---|
685 | ;'; |
---|
686 | |
---|
687 | $result = pwg_query($query); |
---|
688 | |
---|
689 | while($row = pwg_db_fetch_assoc($result)) |
---|
690 | { |
---|
691 | $msg_error_Link_Bad .= '<br>'.l10n('Error_Link_Dup').$row['nbr_dup'].' = '.stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).')'; |
---|
692 | |
---|
693 | // Action : Repair links |
---|
694 | $msg_error_Link_Bad .= ' <a href="'; |
---|
695 | $msg_error_Link_Bad .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
696 | 'action' => 'new_link', |
---|
697 | 'pwg_id' => $row['pwg_id'], |
---|
698 | 'bb_id' => $row['bb_id'], |
---|
699 | )); |
---|
700 | $msg_error_Link_Bad .= '" title="'.l10n('Link_Dup').stripslashes($row['pwg_user']).' -- '.stripslashes($row['bb_user']).'"'; |
---|
701 | $msg_error_Link_Bad .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
702 | $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>'; |
---|
703 | } |
---|
704 | |
---|
705 | // Display OK message or build errors |
---|
706 | if ($msg_error_Link_Bad == '') |
---|
707 | array_push($page['infos'], l10n('Audit_Link_Bad').'<br>'.l10n('Audit_OK')); |
---|
708 | else |
---|
709 | $msg_error_Link_Bad = l10n('Audit_Link_Bad').$msg_error_Link_Bad; |
---|
710 | |
---|
711 | |
---|
712 | // Check synch between Piwigo and FluxBB users |
---|
713 | // ------------------------------------------- |
---|
714 | $query = ' |
---|
715 | SELECT pwg.id as pwg_id, pwg.username as username, pwg.mail_address as pwg_eml, FluxBB.email as bb_eml |
---|
716 | FROM '.FluxBB_USERS_TABLE.' AS FluxBB |
---|
717 | INNER JOIN '.Register_FluxBB_ID_TABLE.' AS link ON link.id_user_FluxBB = FluxBB.id |
---|
718 | INNER JOIN '.USERS_TABLE.' as pwg ON link.id_user_pwg = pwg.id |
---|
719 | WHERE BINARY pwg.username = BINARY FluxBB.username |
---|
720 | AND pwg.username NOT IN ("18","16") |
---|
721 | ORDER BY LOWER(pwg.username) |
---|
722 | ;'; |
---|
723 | |
---|
724 | $result = pwg_query($query); |
---|
725 | |
---|
726 | while($row = pwg_db_fetch_assoc($result)) |
---|
727 | { |
---|
728 | if (($row['pwg_eml'] != $row['bb_eml']) or Reg_FluxBB_PwdSynch($row['pwg_id'])) |
---|
729 | { |
---|
730 | if ($row['pwg_eml'] != $row['bb_eml'] and Reg_FluxBB_PwdSynch($row['pwg_id'])) // If passwords are synch |
---|
731 | { |
---|
732 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']); |
---|
733 | |
---|
734 | // Action : Synch users data from Piwigo to FluxBB |
---|
735 | $msg_error_Synchro .= ' <a href="'; |
---|
736 | $msg_error_Synchro .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
737 | 'action' => 'sync_user', |
---|
738 | 'username' => stripslashes($row['username']), |
---|
739 | )); |
---|
740 | $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"'; |
---|
741 | $msg_error_Synchro .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
742 | $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>'; |
---|
743 | |
---|
744 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml']; |
---|
745 | |
---|
746 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd'); |
---|
747 | } |
---|
748 | elseif ($row['pwg_eml'] != $row['bb_eml'] and !Reg_FluxBB_PwdSynch($row['pwg_id'])) // If passwords are NOT synch |
---|
749 | { |
---|
750 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']); |
---|
751 | |
---|
752 | // Action : Synch users data from Piwigo to FluxBB |
---|
753 | $msg_error_Synchro .= ' <a href="'; |
---|
754 | $msg_error_Synchro .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
755 | 'action' => 'sync_user', |
---|
756 | 'username' => stripslashes($row['username']), |
---|
757 | )); |
---|
758 | $msg_error_Synchro .= '" title="'.l10n('Sync_User').stripslashes($row['username']).'"'; |
---|
759 | $msg_error_Synchro .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
760 | $msg_error_Synchro .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_refresh.png" alt="'.l10n('Sync_User').stripslashes($row['username']).'" /></a>'; |
---|
761 | |
---|
762 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Mail').'<br>-- PWG = '.$row['pwg_eml'].'<br>-- FluxBB = '.$row['bb_eml']; |
---|
763 | } |
---|
764 | elseif ($row['pwg_eml'] = $row['bb_eml'] and Reg_FluxBB_PwdSynch($row['pwg_id'])) |
---|
765 | { |
---|
766 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro').stripslashes($row['username']); |
---|
767 | $msg_error_Synchro .= '<br>'.l10n('Error_Synchro_Pswd'); |
---|
768 | } |
---|
769 | } |
---|
770 | else if ($conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true') |
---|
771 | $msg_ok_Synchro .= '<br> - '.stripslashes($row['username']).' ('.$row['pwg_eml'].')'.l10n('Audit_Synchro_OK'); |
---|
772 | } |
---|
773 | |
---|
774 | // Display OK message or build errors |
---|
775 | if ($msg_error_Synchro <> '') |
---|
776 | $msg_error_Synchro = l10n('Audit_Synchro').$msg_error_Synchro; |
---|
777 | |
---|
778 | if ($msg_ok_Synchro <> '') |
---|
779 | if ($msg_error_Synchro <> '') |
---|
780 | array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'); |
---|
781 | else |
---|
782 | array_push($page['infos'], l10n('Audit_Synchro').$msg_ok_Synchro.'<br><br>'.l10n('Audit_OK')); |
---|
783 | |
---|
784 | |
---|
785 | // Check Piwigo accounts not in FluxBB |
---|
786 | // ----------------------------------- |
---|
787 | $query = ' |
---|
788 | SELECT username, mail_address FROM '.USERS_TABLE.' |
---|
789 | WHERE BINARY username <> BINARY "guest" |
---|
790 | AND username NOT IN ("18","16") |
---|
791 | AND id not in ( |
---|
792 | SELECT id_user_pwg FROM '.Register_FluxBB_ID_TABLE.' |
---|
793 | ) |
---|
794 | AND BINARY username not in ( |
---|
795 | SELECT username FROM '.FluxBB_USERS_TABLE.' |
---|
796 | ) |
---|
797 | ORDER BY LOWER(username) |
---|
798 | ;'; |
---|
799 | |
---|
800 | $result = pwg_query($query); |
---|
801 | |
---|
802 | while($row = pwg_db_fetch_assoc($result)) |
---|
803 | { |
---|
804 | $msg_error_PWG2FluxBB .= '<br>'.l10n('Error_PWG2FluxBB').stripslashes($row['username']).' ('.$row['mail_address'].')'; |
---|
805 | |
---|
806 | // Action : Add user to FluxBB |
---|
807 | $msg_error_PWG2FluxBB .= ' <a href="'; |
---|
808 | $msg_error_PWG2FluxBB .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
809 | 'action' => 'add_user', |
---|
810 | 'username' => stripslashes($row['username']), |
---|
811 | )); |
---|
812 | $msg_error_PWG2FluxBB .= '" title="'.l10n('Add_User').stripslashes($row['username']).'" '; |
---|
813 | $msg_error_PWG2FluxBB .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
814 | $msg_error_PWG2FluxBB .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User').stripslashes($row['username']).'" /></a>'; |
---|
815 | } |
---|
816 | |
---|
817 | // Display OK message or build errors |
---|
818 | if ($msg_error_PWG2FluxBB == '') |
---|
819 | array_push($page['infos'], l10n('Audit_PWG2FluxBB').'<br>'.l10n('Audit_OK')); |
---|
820 | else |
---|
821 | $msg_error_PWG2FluxBB = l10n('Audit_PWG2FluxBB').$msg_error_PWG2FluxBB; |
---|
822 | |
---|
823 | |
---|
824 | // Check FluxBB accounts not in Piwigo |
---|
825 | // ----------------------------------- |
---|
826 | $query = ' |
---|
827 | SELECT id, username, email FROM '.FluxBB_USERS_TABLE.' |
---|
828 | WHERE BINARY username <> BINARY "'.$conf_Register_FluxBB['FLUXBB_GUEST'].'" |
---|
829 | AND id not in ( |
---|
830 | SELECT id_user_FluxBB FROM '.Register_FluxBB_ID_TABLE.' |
---|
831 | ) |
---|
832 | AND BINARY username not in ( |
---|
833 | SELECT username FROM '.USERS_TABLE.' |
---|
834 | ) |
---|
835 | ORDER BY LOWER(username) |
---|
836 | ;'; |
---|
837 | |
---|
838 | $result = pwg_query($query); |
---|
839 | |
---|
840 | while($row = pwg_db_fetch_assoc($result)) |
---|
841 | { |
---|
842 | $msg_error_FluxBB2PWG .= '<br>'.l10n('Error_FluxBB2PWG').stripslashes($row['username']).' ('.$row['email'].')'; |
---|
843 | |
---|
844 | // Action : Delete user from FluxBB |
---|
845 | $msg_error_FluxBB2PWG .= ' <a href="'; |
---|
846 | $msg_error_FluxBB2PWG .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
847 | 'action' => 'del_user', |
---|
848 | 'id' => $row['id'], |
---|
849 | )); |
---|
850 | $msg_error_FluxBB2PWG .= '" title="'.l10n('Del_User').stripslashes($row['username']).'"'; |
---|
851 | $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
852 | $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_delete.png" alt="'.l10n('Del_User').stripslashes($row['username']).'" /></a>'; |
---|
853 | |
---|
854 | // Action : Add user from FluxBB to Piwigo |
---|
855 | $msg_error_FluxBB2PWG .= ' <a href="'; |
---|
856 | $msg_error_FluxBB2PWG .= add_url_params(REGFLUXBB_ADMIN, array( |
---|
857 | 'action' => 'add2pwg', |
---|
858 | 'id' => $row['id'], |
---|
859 | 'username' => $row['username'], |
---|
860 | 'email' => $row['email'], |
---|
861 | )); |
---|
862 | |
---|
863 | $msg_error_FluxBB2PWG .= '" title="'.l10n('Add_User2pwg').stripslashes($row['username']).'"'; |
---|
864 | |
---|
865 | $msg_error_FluxBB2PWG .= $conf_Register_FluxBB['FLUXBB_CONFIRM']=='false' ? ' onclick="return confirm(\''.l10n('Are you sure?').'\');" ' : ' '; |
---|
866 | |
---|
867 | $msg_error_FluxBB2PWG .= '><img src="'.REGFLUXBB_PATH.'/admin/template/icon/user_add.png" alt="'.l10n('Add_User2pwg').stripslashes($row['username']).'" /></a>'; |
---|
868 | } |
---|
869 | |
---|
870 | // Display OK message or build errors |
---|
871 | if ($msg_error_FluxBB2PWG == '') |
---|
872 | array_push($page['infos'], l10n('Audit_FluxBB2PWG').'<br>'.l10n('Audit_OK')); |
---|
873 | else |
---|
874 | $msg_error_FluxBB2PWG = l10n('Audit_FluxBB2PWG').$msg_error_FluxBB2PWG; |
---|
875 | |
---|
876 | |
---|
877 | |
---|
878 | if ($msg_error_PWG_Dup <> '') |
---|
879 | $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>' ); |
---|
880 | |
---|
881 | if ($msg_error_FluxBB_Dup <> '') |
---|
882 | $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>' ); |
---|
883 | |
---|
884 | if ($msg_error_Link_Break <> '') |
---|
885 | $errors[] = $msg_error_Link_Break . ( ($msg_error_Link_Bad == '' and $msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
886 | |
---|
887 | if ($msg_error_Link_Bad <> '') |
---|
888 | $errors[] = $msg_error_Link_Bad . ( ($msg_error_Synchro == '' and $msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
889 | |
---|
890 | if ($msg_error_Synchro <> '') |
---|
891 | $errors[] = $msg_error_Synchro . ( ($msg_error_PWG2FluxBB == '' and $msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
892 | |
---|
893 | if ($msg_error_PWG2FluxBB <> '') |
---|
894 | $errors[] = $msg_error_PWG2FluxBB . ( ($msg_error_FluxBB2PWG == '') ? '' : '<br><br>' ); |
---|
895 | |
---|
896 | if ($msg_error_FluxBB2PWG <> '') |
---|
897 | $errors[] = $msg_error_FluxBB2PWG; |
---|
898 | |
---|
899 | if (isset ($errors) and count($errors) != 0) |
---|
900 | { |
---|
901 | foreach ($errors as $error) |
---|
902 | { |
---|
903 | array_push($page['errors'], $error); |
---|
904 | } |
---|
905 | } |
---|
906 | } |
---|
907 | |
---|
908 | // +-----------------------------------------------------------------------+ |
---|
909 | // | Audit actions process | |
---|
910 | // +-----------------------------------------------------------------------+ |
---|
911 | |
---|
912 | // Action : Delete dead link |
---|
913 | // ------------------------- |
---|
914 | if (isset($_GET['action']) and ($_GET['action']=='link_dead')) |
---|
915 | { |
---|
916 | $query = ' |
---|
917 | DELETE FROM '.Register_FluxBB_ID_TABLE.' |
---|
918 | WHERE id_user_FluxBB NOT IN ( |
---|
919 | SELECT id |
---|
920 | FROM '.FluxBB_USERS_TABLE.' |
---|
921 | ) |
---|
922 | OR id_user_pwg NOT IN ( |
---|
923 | SELECT id |
---|
924 | FROM '.USERS_TABLE.' |
---|
925 | ) |
---|
926 | ;'; |
---|
927 | |
---|
928 | $result = pwg_query($query); |
---|
929 | |
---|
930 | Audit_PWG_FluxBB(); |
---|
931 | } |
---|
932 | // Action : Delete duplicate link |
---|
933 | // ------------------------------ |
---|
934 | else if (isset($_GET['action']) and ($_GET['action']=='link_del') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) |
---|
935 | { |
---|
936 | $query = ' |
---|
937 | DELETE FROM '.Register_FluxBB_ID_TABLE.' |
---|
938 | WHERE id_user_pwg = '.$_GET['pwg_id'].' |
---|
939 | AND id_user_FluxBB = '.$_GET['bb_id'].' |
---|
940 | ;'; |
---|
941 | |
---|
942 | $result = pwg_query($query); |
---|
943 | |
---|
944 | Audit_PWG_FluxBB(); |
---|
945 | } |
---|
946 | // Action : Rebuild link |
---|
947 | // --------------------- |
---|
948 | else if (isset($_GET['action']) and ($_GET['action']=='new_link') and isset($_GET['pwg_id']) and isset($_GET['bb_id'])) |
---|
949 | { |
---|
950 | FluxBB_Linkuser($_GET['pwg_id'], $_GET['bb_id'], "NOK"); |
---|
951 | |
---|
952 | Audit_PWG_FluxBB(); |
---|
953 | } |
---|
954 | // Action : Synch users data |
---|
955 | // ------------------------- |
---|
956 | else if (isset($_GET['action']) and ($_GET['action']=='sync_user') and isset($_GET['username'])) |
---|
957 | { |
---|
958 | $query = ' |
---|
959 | SELECT id AS id_pwg, username, mail_address |
---|
960 | FROM '.USERS_TABLE.' |
---|
961 | WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'" |
---|
962 | AND username NOT IN ("18","16") |
---|
963 | LIMIT 1 |
---|
964 | ;'; |
---|
965 | |
---|
966 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
967 | |
---|
968 | if (!empty($data)) |
---|
969 | { |
---|
970 | Synch_FluxBB_Updateuser($data['id_pwg'], stripslashes($data['username']), $data['mail_address']); |
---|
971 | } |
---|
972 | |
---|
973 | Audit_PWG_FluxBB(); |
---|
974 | } |
---|
975 | // Action : Add user to FluxBB |
---|
976 | // --------------------------- |
---|
977 | else if (isset($_GET['action']) and ($_GET['action']=='add_user') and isset($_GET['username'])) |
---|
978 | { |
---|
979 | $query = ' |
---|
980 | SELECT id, username, mail_address |
---|
981 | FROM '.USERS_TABLE.' |
---|
982 | WHERE BINARY username = BINARY "'.pwg_db_real_escape_string($_GET['username']).'" |
---|
983 | AND username NOT IN ("18","16") |
---|
984 | LIMIT 1 |
---|
985 | ;'; |
---|
986 | |
---|
987 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
988 | |
---|
989 | if (!empty($data)) |
---|
990 | Synch_FluxBB_Adduser($data['id'], stripslashes($data['username']), $data['mail_address']); |
---|
991 | |
---|
992 | Audit_PWG_FluxBB(); |
---|
993 | } |
---|
994 | // Action : Delete user |
---|
995 | // -------------------- |
---|
996 | else if (isset($_GET['action']) and ($_GET['action']=='del_user') and isset($_GET['id'])) |
---|
997 | { |
---|
998 | FluxBB_Deluser($_GET['id'], true); |
---|
999 | |
---|
1000 | Audit_PWG_FluxBB(); |
---|
1001 | } |
---|
1002 | // Action : Add user to Piwigo |
---|
1003 | // --------------------------- |
---|
1004 | else if (isset($_GET['action']) and ($_GET['action']=='add2pwg') and isset($_GET['id']) and isset($_GET['username']) and isset($_GET['email'])) |
---|
1005 | { |
---|
1006 | $emails_to_create = array(); |
---|
1007 | $emails_rejected = array(); |
---|
1008 | $emails_already_exist = array(); |
---|
1009 | $emails_created = array(); |
---|
1010 | $emails_on_error = array(); |
---|
1011 | |
---|
1012 | $email = trim($_GET['email']); |
---|
1013 | $username = $_GET['username']; |
---|
1014 | $fluxbb_id = $_GET['id']; |
---|
1015 | |
---|
1016 | // this test requires PHP 5.2+ |
---|
1017 | if (filter_var($email, FILTER_VALIDATE_EMAIL) !== false) |
---|
1018 | { |
---|
1019 | $emails_to_check[] = $email; |
---|
1020 | |
---|
1021 | if (!get_userid_by_email($email)) |
---|
1022 | { |
---|
1023 | $emails_to_create[] = $email; |
---|
1024 | } |
---|
1025 | else |
---|
1026 | { |
---|
1027 | $emails_existing[] = $email; |
---|
1028 | } |
---|
1029 | } |
---|
1030 | elseif (!empty($email)) |
---|
1031 | { |
---|
1032 | $emails_rejected[] = $email; |
---|
1033 | } |
---|
1034 | |
---|
1035 | // find a password |
---|
1036 | $password = generate_key(8); |
---|
1037 | |
---|
1038 | $Piwigo_Adduser_Errors = Synch_Piwigo_Adduser($fluxbb_id, $username, $password, $email); |
---|
1039 | |
---|
1040 | if (!empty($Piwigo_Adduser_Errors)) |
---|
1041 | { |
---|
1042 | $emails_on_error[] = $email; |
---|
1043 | } |
---|
1044 | else |
---|
1045 | { |
---|
1046 | $emails_created[] = $email; |
---|
1047 | } |
---|
1048 | |
---|
1049 | $emails_for_form = array(); |
---|
1050 | |
---|
1051 | if (!empty($emails_created)) |
---|
1052 | { |
---|
1053 | array_push( |
---|
1054 | $page['infos'], |
---|
1055 | sprintf( |
---|
1056 | l10n('%d users registered'), |
---|
1057 | count($emails_created) |
---|
1058 | ) |
---|
1059 | ); |
---|
1060 | } |
---|
1061 | |
---|
1062 | if (!empty($emails_on_error)) |
---|
1063 | { |
---|
1064 | array_push( |
---|
1065 | $page['errors'], |
---|
1066 | sprintf( |
---|
1067 | l10n('%d registrations on error: %s'), |
---|
1068 | count($emails_on_error), |
---|
1069 | implode(', ', $emails_on_error) |
---|
1070 | ) |
---|
1071 | ); |
---|
1072 | |
---|
1073 | $emails_for_form = array_merge($emails_for_form, $emails_on_error); |
---|
1074 | } |
---|
1075 | |
---|
1076 | if (!empty($emails_rejected)) |
---|
1077 | { |
---|
1078 | array_push( |
---|
1079 | $page['errors'], |
---|
1080 | sprintf( |
---|
1081 | l10n('%d email addresses rejected: %s'), |
---|
1082 | count($emails_rejected), |
---|
1083 | implode(', ', $emails_rejected) |
---|
1084 | ) |
---|
1085 | ); |
---|
1086 | |
---|
1087 | $emails_for_form = array_merge($emails_for_form, $emails_rejected); |
---|
1088 | } |
---|
1089 | |
---|
1090 | if (!empty($emails_existing)) |
---|
1091 | { |
---|
1092 | array_push( |
---|
1093 | $page['warnings'], |
---|
1094 | sprintf( |
---|
1095 | l10n('%d email addresses already exist: %s'), |
---|
1096 | count($emails_existing), |
---|
1097 | implode(', ', $emails_existing) |
---|
1098 | ) |
---|
1099 | ); |
---|
1100 | } |
---|
1101 | } |
---|
1102 | |
---|
1103 | |
---|
1104 | // +---------------------------------------------------------------+ |
---|
1105 | // | Template init | |
---|
1106 | // +---------------------------------------------------------------+ |
---|
1107 | $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']); |
---|
1108 | |
---|
1109 | // If UAM exists and if UAM ConfirmMail is set, we can set this feature |
---|
1110 | if (function_exists('FindAvailableConfirmMailID')) |
---|
1111 | { |
---|
1112 | $conf_UAM = unserialize($conf['UserAdvManager']); |
---|
1113 | |
---|
1114 | 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')) |
---|
1115 | { |
---|
1116 | $UAM_bridge = true; |
---|
1117 | } |
---|
1118 | else $UAM_bridge = false; |
---|
1119 | } |
---|
1120 | else $UAM_bridge = false; |
---|
1121 | |
---|
1122 | // Save last opened paragraph in configuration tab |
---|
1123 | // ----------------------------------------------- |
---|
1124 | $nb_para=(isset($_POST["nb_para"])) ? $_POST["nb_para"]:""; |
---|
1125 | $nb_para2=(isset($_POST["nb_para2"])) ? $_POST["nb_para2"]:""; |
---|
1126 | |
---|
1127 | $themeconf=$template->get_template_vars('themeconf'); |
---|
1128 | $RFBB_theme=$themeconf['id']; |
---|
1129 | |
---|
1130 | $template->assign( |
---|
1131 | array |
---|
1132 | ( |
---|
1133 | 'nb_para' => $nb_para, |
---|
1134 | 'nb_para2' => $nb_para2, |
---|
1135 | 'REGFLUXBB_THEME' => $RFBB_theme, |
---|
1136 | 'REGFLUXBB_PATH' => REGFLUXBB_PATH, |
---|
1137 | 'REGFLUXBB_VERSION' => $conf_Register_FluxBB['REGFLUXBB_VERSION'], |
---|
1138 | 'FluxBB_PREFIX' => $conf_Register_FluxBB['FLUXBB_PREFIX'], |
---|
1139 | 'FluxBB_ADMIN' => stripslashes($conf_Register_FluxBB['FLUXBB_ADMIN']), |
---|
1140 | 'FluxBB_GUEST' => stripslashes($conf_Register_FluxBB['FLUXBB_GUEST']), |
---|
1141 | 'FluxBB_DEL_PT_TRUE' => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'true' ? 'checked="checked"' : '', |
---|
1142 | 'FluxBB_DEL_PT_FALSE' => $conf_Register_FluxBB['FLUXBB_DEL_PT'] == 'false' ? 'checked="checked"' : '', |
---|
1143 | 'FluxBB_CONFIRM_TRUE' => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'true' ? 'checked="checked"' : '', |
---|
1144 | 'FluxBB_CONFIRM_FALSE' => $conf_Register_FluxBB['FLUXBB_CONFIRM'] == 'false' ? 'checked="checked"' : '', |
---|
1145 | 'FluxBB_DETAILS_TRUE' => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'true' ? 'checked="checked"' : '', |
---|
1146 | 'FluxBB_DETAILS_FALSE' => $conf_Register_FluxBB['FLUXBB_DETAIL'] == 'false' ? 'checked="checked"' : '', |
---|
1147 | 'UAM_BRIDGE' => $UAM_bridge, |
---|
1148 | 'FluxBB_UAM_LINK_TRUE' => $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'true' ? 'checked="checked"' : '', |
---|
1149 | 'FluxBB_UAM_LINK_FALSE'=> $conf_Register_FluxBB['FLUXBB_UAM_LINK'] == 'false' ? 'checked="checked"' : '', |
---|
1150 | 'FluxBB_GROUP' => $conf_Register_FluxBB['FLUXBB_GROUP'], |
---|
1151 | ) |
---|
1152 | ); |
---|
1153 | |
---|
1154 | $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/admin.tpl'); |
---|
1155 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
1156 | ?> |
---|