[5606] | 1 | <?php |
---|
| 2 | |
---|
[7982] | 3 | include_once (PHPWG_ROOT_PATH.'/include/constants.php'); |
---|
| 4 | include_once (REGFLUXBB_PATH.'include/constants.php'); |
---|
[5606] | 5 | |
---|
[7982] | 6 | |
---|
| 7 | function Register_FluxBB_admin_menu($menu) |
---|
| 8 | { |
---|
| 9 | array_push($menu, array( |
---|
| 10 | 'NAME' => 'Register FluxBB', |
---|
| 11 | 'URL' => get_admin_plugin_menu_link(REGFLUXBB_PATH.'admin/admin.php'))); |
---|
| 12 | return $menu; |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | function Register_FluxBB_Adduser($register_user) |
---|
| 17 | { |
---|
| 18 | global $errors, $conf; |
---|
| 19 | |
---|
| 20 | // Exclusion of Adult_Content users |
---|
| 21 | if ($register_user['username'] != "16" and $register_user['username'] != "18") |
---|
| 22 | { |
---|
| 23 | // Warning : FluxBB uses Sha1 hash instead of md5 for Piwigo! |
---|
| 24 | FluxBB_Adduser($register_user['id'], $register_user['username'], sha1($_POST['password']), $register_user['email']); |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | function Register_FluxBB_Deluser($user_id) |
---|
| 30 | { |
---|
| 31 | FluxBB_Deluser(FluxBB_Searchuser($user_id), true); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | function Register_FluxBB_InitPage() |
---|
| 36 | { |
---|
| 37 | global $conf, $user; |
---|
| 38 | |
---|
| 39 | if (isset($_POST['validate']) and !is_admin()) |
---|
| 40 | { |
---|
| 41 | if (!empty($_POST['use_new_pwd'])) |
---|
| 42 | { |
---|
| 43 | $query = ' |
---|
| 44 | SELECT '.$conf['user_fields']['username'].' AS username |
---|
| 45 | FROM '.USERS_TABLE.' |
---|
| 46 | WHERE '.$conf['user_fields']['id'].' = \''.$user['id'].'\' |
---|
| 47 | ;'; |
---|
| 48 | |
---|
| 49 | list($username) = pwg_db_fetch_row(pwg_query($query)); |
---|
| 50 | |
---|
| 51 | FluxBB_Updateuser($user['id'], stripslashes($username), sha1($_POST['use_new_pwd']), $_POST['mail_address']); |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | |
---|
| 57 | function UAM_Bridge() |
---|
| 58 | { |
---|
| 59 | global $conf, $user; |
---|
| 60 | |
---|
| 61 | $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); |
---|
| 62 | |
---|
| 63 | // Check if UAM is installed and if bridge is set - Exception for admins and webmasters |
---|
| 64 | $query =' |
---|
| 65 | SELECT user_id, status |
---|
| 66 | FROM '.USER_INFOS_TABLE.' |
---|
| 67 | WHERE user_id = '.$user['id'].' |
---|
| 68 | ;'; |
---|
| 69 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
| 70 | |
---|
| 71 | if ($data['status'] <> "admin" and $data['status'] <> "webmaster") |
---|
| 72 | { |
---|
| 73 | if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') |
---|
| 74 | { |
---|
| 75 | $conf_UAM = unserialize($conf['UserAdvManager']); |
---|
| 76 | |
---|
| 77 | // Getting unvalidated users group else Piwigo's default group |
---|
| 78 | if (isset($conf_UAM[2]) and $conf_UAM[2] != '-1') |
---|
| 79 | { |
---|
| 80 | $Waitingroup = $conf_UAM[2]; |
---|
| 81 | } |
---|
| 82 | else |
---|
| 83 | { |
---|
| 84 | $query = ' |
---|
| 85 | SELECT id |
---|
| 86 | FROM '.GROUPS_TABLE.' |
---|
| 87 | WHERE is_default = "true" |
---|
| 88 | LIMIT 1 |
---|
| 89 | ;'; |
---|
| 90 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
| 91 | $Waitingroup = $data['id']; |
---|
| 92 | } |
---|
| 93 | |
---|
| 94 | // check if logged in user is in a Piwigo's validated or unvalidated users group |
---|
| 95 | $query = ' |
---|
| 96 | SELECT * |
---|
| 97 | FROM '.USER_GROUP_TABLE.' |
---|
| 98 | WHERE user_id = '.$user['id'].' |
---|
| 99 | AND group_id = '.$Waitingroup.' |
---|
| 100 | ;'; |
---|
| 101 | $count = pwg_db_num_rows(pwg_query($query)); |
---|
| 102 | |
---|
| 103 | // Check if logged in user is in a FluxBB's unvalidated group |
---|
| 104 | $query = " |
---|
| 105 | SELECT group_id |
---|
| 106 | FROM ".FluxBB_USERS_TABLE." |
---|
| 107 | WHERE id = ".FluxBB_Searchuser($user['id'])." |
---|
| 108 | ;"; |
---|
| 109 | |
---|
| 110 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
| 111 | |
---|
| 112 | // Logged in user switch to the default FluxBB's group if he'is validated |
---|
| 113 | if ($count == 0 and $data['group_id'] = $conf_Register_FluxBB[7]) |
---|
| 114 | { |
---|
| 115 | $query = " |
---|
| 116 | SELECT conf_value |
---|
| 117 | FROM ".FluxBB_CONFIG_TABLE." |
---|
| 118 | WHERE conf_name = 'o_default_user_group' |
---|
| 119 | ;"; |
---|
| 120 | |
---|
| 121 | $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); |
---|
| 122 | |
---|
| 123 | $query = " |
---|
| 124 | UPDATE ".FluxBB_USERS_TABLE." |
---|
| 125 | SET group_id = ".$o_default_user_group['conf_value']." |
---|
| 126 | WHERE id = ".FluxBB_Searchuser($user['id'])." |
---|
| 127 | ;"; |
---|
| 128 | pwg_query($query); |
---|
| 129 | } |
---|
| 130 | } |
---|
| 131 | } |
---|
| 132 | } |
---|
| 133 | |
---|
| 134 | |
---|
[8043] | 135 | function Register_FluxBB_RegistrationCheck($errors, $user) |
---|
[7982] | 136 | { |
---|
[8043] | 137 | global $conf; |
---|
[7982] | 138 | |
---|
| 139 | //Because FluxBB is case insensitive on login name, we have to check if a similar login already exists in FluxBB's user table |
---|
| 140 | // If "test" user already exists, "TEST" or "Test" (and so on...) can't register |
---|
| 141 | $query = " |
---|
| 142 | SELECT username |
---|
| 143 | FROM ".FluxBB_USERS_TABLE." |
---|
[8043] | 144 | WHERE LOWER(".stripslashes('username').") = '".strtolower($user['username'])."' |
---|
[7982] | 145 | ;"; |
---|
| 146 | |
---|
[8043] | 147 | $count = pwg_db_num_rows(pwg_query($query)); |
---|
[7982] | 148 | |
---|
[8043] | 149 | if ($count > 0) |
---|
| 150 | { |
---|
| 151 | array_push($errors, l10n('this login is already used')); |
---|
| 152 | } |
---|
| 153 | return $errors; |
---|
[7982] | 154 | } |
---|
| 155 | |
---|
| 156 | |
---|
[5606] | 157 | function FluxBB_Linkuser($pwg_id, $bb_id) |
---|
| 158 | { |
---|
| 159 | $query = " |
---|
| 160 | SELECT pwg.id as pwg_id, bb.id as bb_id |
---|
| 161 | FROM ".USERS_TABLE." pwg, ".FluxBB_USERS_TABLE." bb |
---|
| 162 | WHERE pwg.id = ".$pwg_id." |
---|
| 163 | AND bb.id = ".$bb_id." |
---|
| 164 | AND pwg.username = bb.username |
---|
| 165 | ;"; |
---|
| 166 | |
---|
[5635] | 167 | $data = pwg_db_fetch_row(pwg_query($query)); |
---|
[5606] | 168 | |
---|
| 169 | if (!empty($data)) |
---|
| 170 | { |
---|
| 171 | $subquery = " |
---|
| 172 | DELETE FROM ".Register_FluxBB_ID_TABLE." |
---|
| 173 | WHERE id_user_pwg = '".$pwg_id."' |
---|
| 174 | OR id_user_FluxBB = '".$bb_id."' |
---|
| 175 | ;"; |
---|
| 176 | |
---|
| 177 | $subresult = pwg_query($subquery); |
---|
| 178 | |
---|
| 179 | $subquery = " |
---|
| 180 | INSERT INTO ".Register_FluxBB_ID_TABLE." |
---|
| 181 | (id_user_pwg, id_user_FluxBB) |
---|
| 182 | VALUES (".$pwg_id.", ".$bb_id.") |
---|
| 183 | ;"; |
---|
| 184 | |
---|
| 185 | $subresult = pwg_query($subquery); |
---|
| 186 | } |
---|
| 187 | } |
---|
| 188 | |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | function FluxBB_Unlinkuser($bb_id) |
---|
| 192 | { |
---|
| 193 | $query = " |
---|
| 194 | DELETE FROM ".Register_FluxBB_ID_TABLE." |
---|
| 195 | WHERE id_user_FluxBB = ".$bb_id." |
---|
| 196 | ;"; |
---|
| 197 | |
---|
| 198 | $result = pwg_query($query); |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | function FluxBB_Adduser($pwg_id, $login, $password, $adresse_mail) |
---|
| 204 | { |
---|
[7982] | 205 | global $errors, $conf; |
---|
[5606] | 206 | |
---|
| 207 | $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); |
---|
| 208 | |
---|
| 209 | $registred = time(); |
---|
| 210 | $registred_ip = $_SERVER['REMOTE_ADDR']; |
---|
[6815] | 211 | |
---|
| 212 | // Check if UAM is installed and if bridge is set - Exception for admins and webmasters |
---|
| 213 | if (function_exists('FindAvailableConfirmMailID') and isset($conf_Register_FluxBB[6]) and $conf_Register_FluxBB[6] == 'true') |
---|
| 214 | { |
---|
| 215 | $o_default_user_group = $conf_Register_FluxBB[7]; |
---|
| 216 | } |
---|
| 217 | else |
---|
| 218 | { |
---|
| 219 | $query = " |
---|
[5606] | 220 | SELECT conf_value |
---|
| 221 | FROM ".FluxBB_CONFIG_TABLE." |
---|
| 222 | WHERE conf_name = 'o_default_user_group' |
---|
| 223 | ;"; |
---|
| 224 | |
---|
[6815] | 225 | $o_default_user_group = pwg_db_fetch_assoc(pwg_query($query)); |
---|
| 226 | } |
---|
[6791] | 227 | |
---|
| 228 | // Check for FluxBB version 1.4.x and get the correct value |
---|
| 229 | $query1 = " |
---|
[5606] | 230 | SELECT conf_value |
---|
| 231 | FROM ".FluxBB_CONFIG_TABLE." |
---|
[6791] | 232 | WHERE conf_name = 'o_default_timezone' |
---|
| 233 | ;"; |
---|
| 234 | |
---|
| 235 | $count1 = pwg_db_num_rows(pwg_query($query1)); |
---|
| 236 | |
---|
| 237 | // Check for FluxBB version 1.2.x and get the correct value |
---|
| 238 | $query2 = " |
---|
| 239 | SELECT conf_value |
---|
| 240 | FROM ".FluxBB_CONFIG_TABLE." |
---|
[5606] | 241 | WHERE conf_name = 'o_server_timezone' |
---|
| 242 | ;"; |
---|
| 243 | |
---|
[6791] | 244 | $count2 = pwg_db_num_rows(pwg_query($query2)); |
---|
[5606] | 245 | |
---|
[6791] | 246 | if ($count1 == 1 and $count2 == 0) |
---|
| 247 | { |
---|
| 248 | $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query1)); |
---|
| 249 | } |
---|
| 250 | else if ($count1 == 0 and $count2 == 1) |
---|
| 251 | { |
---|
| 252 | $o_default_timezone = pwg_db_fetch_assoc(pwg_query($query2)); |
---|
| 253 | } |
---|
| 254 | |
---|
| 255 | |
---|
[5606] | 256 | $query = " |
---|
| 257 | SELECT conf_value |
---|
| 258 | FROM ".FluxBB_CONFIG_TABLE." |
---|
| 259 | WHERE conf_name = 'o_default_lang' |
---|
| 260 | ;"; |
---|
| 261 | |
---|
[5635] | 262 | $o_default_lang = pwg_db_fetch_assoc(pwg_query($query)); |
---|
[5606] | 263 | |
---|
| 264 | $query = " |
---|
| 265 | SELECT conf_value |
---|
| 266 | FROM ".FluxBB_CONFIG_TABLE." |
---|
| 267 | WHERE conf_name = 'o_default_style' |
---|
| 268 | ;"; |
---|
| 269 | |
---|
[5635] | 270 | $o_default_style = pwg_db_fetch_assoc(pwg_query($query)); |
---|
[7982] | 271 | |
---|
| 272 | $query = " |
---|
| 273 | INSERT INTO ".FluxBB_USERS_TABLE." ( |
---|
[5606] | 274 | username, |
---|
| 275 | ". ( isset($o_default_user_group['conf_value']) ? 'group_id' : '' ) .", |
---|
| 276 | password, |
---|
| 277 | email, |
---|
[6791] | 278 | ". ( isset($o_default_timezone['conf_value']) ? 'timezone' : '' ) .", |
---|
[5606] | 279 | ". ( isset($o_default_lang['conf_value']) ? 'language' : '' ) .", |
---|
| 280 | ". ( isset($o_default_style['conf_value']) ? 'style' : '' ) .", |
---|
| 281 | registered, |
---|
| 282 | registration_ip, |
---|
| 283 | last_visit |
---|
| 284 | ) |
---|
| 285 | VALUES( |
---|
[5635] | 286 | '".pwg_db_real_escape_string($login)."', |
---|
[5606] | 287 | ". ( isset($o_default_user_group['conf_value']) ? "'".$o_default_user_group['conf_value']."'" : '' ) .", |
---|
| 288 | '".$password."', |
---|
| 289 | '".$adresse_mail."', |
---|
[6791] | 290 | ". ( isset($o_default_timezone['conf_value']) ? "'".$o_default_timezone['conf_value']."'" : '' ) .", |
---|
[5606] | 291 | ". ( isset($o_default_lang['conf_value']) ? "'".$o_default_lang['conf_value']."'" : '' ) .", |
---|
| 292 | ". ( isset($o_default_style['conf_value']) ? "'".$o_default_style['conf_value']."'" : '' ) .", |
---|
| 293 | '".$registred."', |
---|
| 294 | '".$registred_ip."', |
---|
| 295 | '".$registred."' |
---|
| 296 | ) |
---|
| 297 | ;"; |
---|
| 298 | |
---|
| 299 | $result = pwg_query($query); |
---|
| 300 | |
---|
[5635] | 301 | $bb_id = pwg_db_insert_id(); |
---|
[5606] | 302 | |
---|
| 303 | FluxBB_Linkuser($pwg_id, $bb_id); |
---|
| 304 | } |
---|
| 305 | |
---|
| 306 | |
---|
| 307 | |
---|
| 308 | function FluxBB_Searchuser($id_user_pwg) |
---|
| 309 | { |
---|
| 310 | $query = " |
---|
| 311 | SELECT id_user_FluxBB, id_user_pwg FROM ".Register_FluxBB_ID_TABLE." |
---|
| 312 | WHERE id_user_pwg = ".$id_user_pwg." |
---|
| 313 | LIMIT 1 |
---|
| 314 | ;"; |
---|
| 315 | |
---|
[5635] | 316 | $data = pwg_db_fetch_assoc(pwg_query($query)); |
---|
[5606] | 317 | |
---|
| 318 | if (!empty($data)) |
---|
| 319 | return $data['id_user_FluxBB']; |
---|
| 320 | else |
---|
| 321 | return '0'; |
---|
| 322 | } |
---|
| 323 | |
---|
| 324 | |
---|
| 325 | |
---|
| 326 | function FluxBB_Deluser($id_user_FluxBB, $SuppTopicsPosts) |
---|
| 327 | { |
---|
| 328 | global $conf; |
---|
| 329 | |
---|
| 330 | $conf_Register_FluxBB = isset($conf['Register_FluxBB']) ? explode(";" , $conf['Register_FluxBB']) : array(); |
---|
| 331 | |
---|
| 332 | $query0 = " |
---|
| 333 | SELECT username, id FROM ".FluxBB_USERS_TABLE." |
---|
| 334 | WHERE id = ".$id_user_FluxBB." |
---|
| 335 | LIMIT 1 |
---|
| 336 | ;"; |
---|
| 337 | |
---|
[5635] | 338 | $data0 = pwg_db_fetch_assoc(pwg_query($query0)); |
---|
[5606] | 339 | |
---|
[7982] | 340 | // If True, delete related topics and posts |
---|
[5606] | 341 | if ($SuppTopicsPosts and $conf_Register_FluxBB[3]) |
---|
| 342 | { |
---|
[7982] | 343 | // Delete posts and topics of this user |
---|
[5606] | 344 | $subquery = " |
---|
| 345 | DELETE FROM ".FluxBB_POSTS_TABLE." |
---|
| 346 | WHERE poster_id = ".$id_user_FluxBB." |
---|
| 347 | ;"; |
---|
| 348 | |
---|
| 349 | $subresult = pwg_query($subquery); |
---|
| 350 | |
---|
[7982] | 351 | // Delete topics of this user |
---|
[5606] | 352 | $subquery = " |
---|
| 353 | DELETE FROM ".FluxBB_TOPICS_TABLE." |
---|
[5635] | 354 | WHERE BINARY poster = BINARY '".pwg_db_real_escape_string($data0['username'])."' |
---|
[5606] | 355 | ;"; |
---|
| 356 | |
---|
| 357 | $subresult = pwg_query($subquery); |
---|
| 358 | } |
---|
| 359 | |
---|
[7982] | 360 | // Delete user's subscriptions |
---|
[5606] | 361 | $subquery = " |
---|
| 362 | DELETE FROM ".FluxBB_SUBSCRIPTIONS_TABLE." |
---|
| 363 | WHERE user_id = ".$id_user_FluxBB." |
---|
| 364 | ;"; |
---|
| 365 | |
---|
| 366 | $subresult = pwg_query($subquery); |
---|
| 367 | |
---|
[7982] | 368 | // Delete user's account |
---|
[5606] | 369 | $subquery = " |
---|
| 370 | DELETE FROM ".FluxBB_USERS_TABLE." |
---|
| 371 | WHERE id = ".$id_user_FluxBB." |
---|
| 372 | ;"; |
---|
| 373 | |
---|
| 374 | $subresult = pwg_query($subquery); |
---|
| 375 | |
---|
| 376 | FluxBB_Unlinkuser($id_user_FluxBB); |
---|
| 377 | } |
---|
| 378 | |
---|
| 379 | |
---|
| 380 | |
---|
| 381 | function FluxBB_Updateuser($pwg_id, $username, $password, $adresse_mail) |
---|
| 382 | { |
---|
| 383 | include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); |
---|
| 384 | |
---|
| 385 | $query = " |
---|
| 386 | SELECT id_user_FluxBB as FluxBB_id |
---|
| 387 | FROM ".Register_FluxBB_ID_TABLE." |
---|
| 388 | WHERE id_user_pwg = ".$pwg_id." |
---|
| 389 | ;"; |
---|
| 390 | |
---|
[5635] | 391 | $row = pwg_db_fetch_assoc(pwg_query($query)); |
---|
[5606] | 392 | |
---|
| 393 | if (!empty($row)) |
---|
| 394 | { |
---|
| 395 | $query = " |
---|
| 396 | UPDATE ".FluxBB_USERS_TABLE." |
---|
[5635] | 397 | SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' |
---|
[5606] | 398 | WHERE id = ".$row['FluxBB_id']." |
---|
| 399 | ;"; |
---|
| 400 | |
---|
| 401 | $result = pwg_query($query); |
---|
| 402 | |
---|
| 403 | FluxBB_Linkuser($pwg_id, $row['FluxBB_id']); |
---|
| 404 | } |
---|
| 405 | else |
---|
| 406 | { |
---|
| 407 | $query = " |
---|
| 408 | SELECT id as FluxBB_id |
---|
| 409 | FROM ".FluxBB_USERS_TABLE." |
---|
[5635] | 410 | WHERE BINARY username = BINARY '".pwg_db_real_escape_string($username)."' |
---|
[5606] | 411 | ;"; |
---|
| 412 | |
---|
[5635] | 413 | $row = pwg_db_fetch_assoc(pwg_query($query)); |
---|
[5606] | 414 | |
---|
| 415 | if (!empty($row)) |
---|
| 416 | { |
---|
| 417 | $query = " |
---|
| 418 | UPDATE ".FluxBB_USERS_TABLE." |
---|
[5635] | 419 | SET username = '".pwg_db_real_escape_string($username)."', email = '".$adresse_mail."', password = '".$password."' |
---|
[5606] | 420 | WHERE id = ".$row['FluxBB_id']." |
---|
| 421 | ;"; |
---|
| 422 | |
---|
| 423 | $result = pwg_query($query); |
---|
| 424 | |
---|
| 425 | FluxBB_Linkuser($pwg_id, $row['FluxBB_id']); |
---|
| 426 | } |
---|
| 427 | } |
---|
| 428 | } |
---|
| 429 | |
---|
| 430 | |
---|
| 431 | function RegFluxBB_Infos($dir) |
---|
| 432 | { |
---|
| 433 | $path = $dir; |
---|
| 434 | |
---|
| 435 | $plg_data = implode( '', file($path.'main.inc.php') ); |
---|
| 436 | if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) |
---|
| 437 | { |
---|
| 438 | $plugin['name'] = trim( $val[1] ); |
---|
| 439 | } |
---|
| 440 | if (preg_match("|Version: (.*)|", $plg_data, $val)) |
---|
| 441 | { |
---|
| 442 | $plugin['version'] = trim($val[1]); |
---|
| 443 | } |
---|
| 444 | if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) |
---|
| 445 | { |
---|
| 446 | $plugin['uri'] = trim($val[1]); |
---|
| 447 | } |
---|
| 448 | if ($desc = load_language('description.txt', $path.'/', array('return' => true))) |
---|
| 449 | { |
---|
| 450 | $plugin['description'] = trim($desc); |
---|
| 451 | } |
---|
| 452 | elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) |
---|
| 453 | { |
---|
| 454 | $plugin['description'] = trim($val[1]); |
---|
| 455 | } |
---|
| 456 | if ( preg_match("|Author: (.*)|", $plg_data, $val) ) |
---|
| 457 | { |
---|
| 458 | $plugin['author'] = trim($val[1]); |
---|
| 459 | } |
---|
| 460 | if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) |
---|
| 461 | { |
---|
| 462 | $plugin['author uri'] = trim($val[1]); |
---|
| 463 | } |
---|
| 464 | if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) |
---|
| 465 | { |
---|
| 466 | list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); |
---|
| 467 | if (is_numeric($extension)) $plugin['extension'] = $extension; |
---|
| 468 | } |
---|
| 469 | // IMPORTANT SECURITY ! |
---|
| 470 | $plugin = array_map('htmlspecialchars', $plugin); |
---|
| 471 | |
---|
| 472 | return $plugin ; |
---|
| 473 | } |
---|
| 474 | |
---|
| 475 | function regfluxbb_obsolete_files() |
---|
| 476 | { |
---|
| 477 | if (file_exists(REGFLUXBB_PATH.'obsolete.list') |
---|
| 478 | and $old_files = file(REGFLUXBB_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES) |
---|
| 479 | and !empty($old_files)) |
---|
| 480 | { |
---|
| 481 | array_push($old_files, 'obsolete.list'); |
---|
| 482 | foreach($old_files as $old_file) |
---|
| 483 | { |
---|
| 484 | $path = REGFLUXBB_PATH.$old_file; |
---|
| 485 | if (is_file($path)) |
---|
| 486 | { |
---|
| 487 | @unlink($path); |
---|
| 488 | } |
---|
| 489 | } |
---|
| 490 | } |
---|
| 491 | } |
---|
| 492 | ?> |
---|