| punbb-1.2.2/upload/admin_bans.php |
punbb-1.2.17/upload/admin_bans.php |
| 44: if (isset($_GET['add_ban'])) | 44: if (isset($_GET['add_ban'])) |
| 45: { | 45: { |
| 46: $add_ban = intval($_GET['add_ban']); | 46: $add_ban = intval($_GET['add_ban']); |
| 47: if ($add_ban < 1) | 47: if ($add_ban < 2) |
| 48: message($lang_common['Bad request']); | 48: message($lang_common['Bad request']); |
| 49: | 49: |
| 50: $user_id = $add_ban; | 50: $user_id = $add_ban; |
| 61: | 61: |
| 62: if ($ban_user != '') | 62: if ($ban_user != '') |
| 63: { | 63: { |
| 64: $result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 64: $result = $db->query('SELECT id, group_id, username, email FROM '.$db->prefix.'users WHERE username=\''.$db->escape($ban_user).'\' AND id>1') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
| 65: if ($db->num_rows($result)) | 65: if ($db->num_rows($result)) |
| 66: list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result); | 66: list($user_id, $group_id, $ban_user, $ban_email) = $db->fetch_row($result); |
| 67: else | 67: else |
| 192: | 192: |
| 193: if ($ban_user == '' && $ban_ip == '' && $ban_email == '') | 193: if ($ban_user == '' && $ban_ip == '' && $ban_email == '') |
| 194: message('You must enter either a username, an IP address or an e-mail address (at least).'); | 194: message('You must enter either a username, an IP address or an e-mail address (at least).'); |
| | 195: else if (strtolower($ban_user) == 'guest') |
| | 196: message('The guest user cannot be banned.'); |
| 195: | 197: |
| 196: // Validate IP/IP range (it's overkill, I know) | 198: // Validate IP/IP range (it's overkill, I know) |
| 197: if ($ban_ip != '') | 199: if ($ban_ip != '') |
| 244: if ($_POST['mode'] == 'add') | 246: if ($_POST['mode'] == 'add') |
| 245: $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Unable to add ban', __FILE__, __LINE__, $db->error()); | 247: $db->query('INSERT INTO '.$db->prefix.'bans (username, ip, email, message, expire) VALUES('.$ban_user.', '.$ban_ip.', '.$ban_email.', '.$ban_message.', '.$ban_expire.')') or error('Unable to add ban', __FILE__, __LINE__, $db->error()); |
| 246: else | 248: else |
| 247: $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.$_POST['ban_id']) or error('Unable to update ban', __FILE__, __LINE__, $db->error()); | 249: $db->query('UPDATE '.$db->prefix.'bans SET username='.$ban_user.', ip='.$ban_ip.', email='.$ban_email.', message='.$ban_message.', expire='.$ban_expire.' WHERE id='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error()); |
| 248: | 250: |
| 249: // Regenerate the bans cache | 251: // Regenerate the bans cache |
| 250: require_once PUN_ROOT.'include/cache.php'; | 252: require_once PUN_ROOT.'include/cache.php'; |
| punbb-1.2.2/upload/admin_forums.php |
punbb-1.2.17/upload/admin_forums.php |
| 117: </div> | 117: </div> |
| 118: </fieldset> | 118: </fieldset> |
| 119: </div> | 119: </div> |
| 120: <p><input type="submit" name="del_forum_comply" value="Delete" /> <a href="javascript:history.go(-1)" />Go back</a></p> | 120: <p><input type="submit" name="del_forum_comply" value="Delete" /><a href="javascript:history.go(-1)">Go back</a></p> |
| 121: </form> | 121: </form> |
| 122: </div> | 122: </div> |
| 123: </div> | 123: </div> |
| 137: | 137: |
| 138: while (list($forum_id, $disp_position) = @each($_POST['position'])) | 138: while (list($forum_id, $disp_position) = @each($_POST['position'])) |
| 139: { | 139: { |
| 140: if (!preg_match('#^\d+$#', $disp_position)) | 140: if (!@preg_match('#^\d+$#', $disp_position)) |
| 141: message('Position must be a positive integer value.'); | 141: message('Position must be a positive integer value.'); |
| 142: | 142: |
| 143: $db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.$forum_id) or error('Unable to update forum', __FILE__, __LINE__, $db->error()); | 143: $db->query('UPDATE '.$db->prefix.'forums SET disp_position='.$disp_position.' WHERE id='.intval($forum_id)) or error('Unable to update forum', __FILE__, __LINE__, $db->error()); |
| 144: } | 144: } |
| 145: | 145: |
| 146: // Regenerate the quickjump cache | 146: // Regenerate the quickjump cache |
| 186: $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); | 186: $result = $db->query('SELECT g_id, g_read_board, g_post_replies, g_post_topics FROM '.$db->prefix.'groups WHERE g_id!='.PUN_ADMIN) or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); |
| 187: while ($cur_group = $db->fetch_assoc($result)) | 187: while ($cur_group = $db->fetch_assoc($result)) |
| 188: { | 188: { |
| 189: $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? $_POST['read_forum_new'][$cur_group['g_id']] : '0' : $_POST['read_forum_old'][$cur_group['g_id']]; | 189: $read_forum_new = ($cur_group['g_read_board'] == '1') ? isset($_POST['read_forum_new'][$cur_group['g_id']]) ? '1' : '0' : intval($_POST['read_forum_old'][$cur_group['g_id']]); |
| 190: $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? $_POST['post_replies_new'][$cur_group['g_id']] : '0'; | 190: $post_replies_new = isset($_POST['post_replies_new'][$cur_group['g_id']]) ? '1' : '0'; |
| 191: $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? $_POST['post_topics_new'][$cur_group['g_id']] : '0'; | 191: $post_topics_new = isset($_POST['post_topics_new'][$cur_group['g_id']]) ? '1' : '0'; |
| 192: | 192: |
| 193: // Check if the new settings differ from the old | 193: // Check if the new settings differ from the old |
| 194: if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']]) | 194: if ($read_forum_new != $_POST['read_forum_old'][$cur_group['g_id']] || $post_replies_new != $_POST['post_replies_old'][$cur_group['g_id']] || $post_topics_new != $_POST['post_topics_old'][$cur_group['g_id']]) |
| 385: <?php | 385: <?php |
| 386: | 386: |
| 387: $result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error()); | 387: $result = $db->query('SELECT id, cat_name FROM '.$db->prefix.'categories ORDER BY disp_position') or error('Unable to fetch category list', __FILE__, __LINE__, $db->error()); |
| 388: while ($cur_cat = $db->fetch_assoc($result)) | 388: if ($db->num_rows($result) > 0) |
| 389: echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n"; | 389: { |
| | 390: while ($cur_cat = $db->fetch_assoc($result)) |
| | 391: echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_cat['id'].'">'.pun_htmlspecialchars($cur_cat['cat_name']).'</option>'."\n"; |
| | 392: } |
| | 393: else |
| | 394: echo "\t\t\t\t\t\t\t\t\t".'<option value="0" disabled="disabled">No categories exist</option>'."\n"; |
| 390: | 395: |
| 391: ?> | 396: ?> |
| 392: </select> | 397: </select> |
| 399: </div> | 404: </div> |
| 400: </form> | 405: </form> |
| 401: </div> | 406: </div> |
| | 407: <?php |
| | 408: |
| | 409: // Display all the categories and forums |
| | 410: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
| | 411: |
| | 412: if ($db->num_rows($result) > 0) |
| | 413: { |
| 402: | 414: |
| | 415: ?> |
| 403: <h2 class="block2"><span>Edit forums</span></h2> | 416: <h2 class="block2"><span>Edit forums</span></h2> |
| 404: <div class="box"> | 417: <div class="box"> |
| 405: <form id="edforum" method="post" action="admin_forums.php?action=edit"> | 418: <form id="edforum" method="post" action="admin_forums.php?action=edit"> |
| 408: | 421: |
| 409: $tabindex_count = 4; | 422: $tabindex_count = 4; |
| 410: | 423: |
| 411: // Display all the categories and forums | |
| 412: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.disp_position FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | |
| 413: | |
| 414: $cur_category = 0; | 424: $cur_category = 0; |
| 415: while ($cur_forum = $db->fetch_assoc($result)) | 425: while ($cur_forum = $db->fetch_assoc($result)) |
| 416: { | 426: { |
| 449: <p class="submitend"><input type="submit" name="update_positions" value="Update positions" tabindex="<?php echo $tabindex_count ?>" /></p> | 459: <p class="submitend"><input type="submit" name="update_positions" value="Update positions" tabindex="<?php echo $tabindex_count ?>" /></p> |
| 450: </form> | 460: </form> |
| 451: </div> | 461: </div> |
| | 462: <?php |
| | 463: |
| | 464: } |
| | 465: |
| | 466: ?> |
| 452: </div> | 467: </div> |
| 453: <div class="clearer"></div> | 468: <div class="clearer"></div> |
| 454: </div> | 469: </div> |
| punbb-1.2.2/upload/admin_groups.php |
punbb-1.2.17/upload/admin_groups.php |
| 209: | 209: |
| 210: $title = trim($_POST['req_title']); | 210: $title = trim($_POST['req_title']); |
| 211: $user_title = trim($_POST['user_title']); | 211: $user_title = trim($_POST['user_title']); |
| 212: $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1'; | 212: $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1'; |
| 213: $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1'; | 213: $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1'; |
| 214: $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1'; | 214: $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1'; |
| 215: $edit_posts = isset($_POST['edit_posts']) ? $_POST['edit_posts'] : ($is_admin_group) ? '1' : '0'; | 215: $edit_posts = isset($_POST['edit_posts']) ? intval($_POST['edit_posts']) : ($is_admin_group) ? '1' : '0'; |
| 216: $delete_posts = isset($_POST['delete_posts']) ? $_POST['delete_posts'] : ($is_admin_group) ? '1' : '0'; | 216: $delete_posts = isset($_POST['delete_posts']) ? intval($_POST['delete_posts']) : ($is_admin_group) ? '1' : '0'; |
| 217: $delete_topics = isset($_POST['delete_topics']) ? $_POST['delete_topics'] : ($is_admin_group) ? '1' : '0'; | 217: $delete_topics = isset($_POST['delete_topics']) ? intval($_POST['delete_topics']) : ($is_admin_group) ? '1' : '0'; |
| 218: $set_title = isset($_POST['set_title']) ? $_POST['set_title'] : ($is_admin_group) ? '1' : '0'; | 218: $set_title = isset($_POST['set_title']) ? intval($_POST['set_title']) : ($is_admin_group) ? '1' : '0'; |
| 219: $search = isset($_POST['search']) ? $_POST['search'] : '1'; | 219: $search = isset($_POST['search']) ? intval($_POST['search']) : '1'; |
| 220: $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1'; | 220: $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1'; |
| 221: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; | 221: $edit_subjects_interval = isset($_POST['edit_subjects_interval']) ? intval($_POST['edit_subjects_interval']) : '0'; |
| 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; | 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; |
| 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; | 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; |
| 229: | 229: |
| 230: if ($_POST['mode'] == 'add') | 230: if ($_POST['mode'] == 'add') |
| 231: { | 231: { |
| 232: $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); | 232: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\'') or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); |
| 233: if ($db->num_rows()) | 233: if ($db->num_rows($result)) |
| 234: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); | 234: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
| 235: | 235: |
| 236: $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error()); | 236: $db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error()); |
| 242: $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error()); | 242: $db->query('INSERT INTO '.$db->prefix.'forum_perms (group_id, forum_id, read_forum, post_replies, post_topics) VALUES('.$new_group_id.', '.$cur_forum_perm['forum_id'].', '.$cur_forum_perm['read_forum'].', '.$cur_forum_perm['post_replies'].', '.$cur_forum_perm['post_topics'].')') or error('Unable to insert group forum permissions', __FILE__, __LINE__, $db->error()); |
| 243: } | 243: } |
| 244: else | 244: else |
| 245: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error()); | 245: { |
| | 246: $result = $db->query('SELECT 1 FROM '.$db->prefix.'groups WHERE g_title=\''.$db->escape($title).'\' AND g_id!='.intval($_POST['group_id'])) or error('Unable to check group title collision', __FILE__, __LINE__, $db->error()); |
| | 247: if ($db->num_rows($result)) |
| | 248: message('There is already a group with the title \''.pun_htmlspecialchars($title).'\'.'); |
| | 249: |
| | 250: $db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.intval($_POST['group_id'])) or error('Unable to update group', __FILE__, __LINE__, $db->error()); |
| | 251: } |
| 246: | 252: |
| 247: // Regenerate the quickjump cache | 253: // Regenerate the quickjump cache |
| 248: require_once PUN_ROOT.'include/cache.php'; | 254: require_once PUN_ROOT.'include/cache.php'; |
| 258: confirm_referrer('admin_groups.php'); | 264: confirm_referrer('admin_groups.php'); |
| 259: | 265: |
| 260: $group_id = intval($_POST['default_group']); | 266: $group_id = intval($_POST['default_group']); |
| 261: if ($group_id < 1) | 267: if ($group_id < 4) |
| 262: message($lang_common['Bad request']); | 268: message($lang_common['Bad request']); |
| 263: | 269: |
| 264: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); | 270: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$group_id.' WHERE conf_name=\'o_default_user_group\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
| punbb-1.2.2/upload/admin_index.php |
punbb-1.2.17/upload/admin_index.php |
| 64: | 64: |
| 65: | 65: |
| 66: // Show phpinfo() output | 66: // Show phpinfo() output |
| 67: else if ($action == 'phpinfo') | 67: else if ($action == 'phpinfo' && $pun_user['g_id'] == PUN_ADMIN) |
| 68: { | 68: { |
| 69: // Is phpinfo() a disabled function? | 69: // Is phpinfo() a disabled function? |
| 70: if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false) | 70: if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false) |
| 86: $load_averages = @explode(' ', $load_averages); | 86: $load_averages = @explode(' ', $load_averages); |
| 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; | 87: $server_load = isset($load_averages[2]) ? $load_averages[0].' '.$load_averages[1].' '.$load_averages[2] : 'Not available'; |
| 88: } | 88: } |
| 89: else if (preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) | 89: else if (!in_array(PHP_OS, array('WINNT', 'WIN32')) && preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/i', @exec('uptime'), $load_averages)) |
| 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; | 90: $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; |
| 91: else | 91: else |
| 92: $server_load = 'Not available'; | 92: $server_load = 'Not available'; |
| 93: | 93: |
| 94: | 94: |
| 95: // Get number of current visitors | 95: // Get number of current visitors |
| 96: $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error()); | 96: $result = $db->query('SELECT COUNT(user_id) FROM '.$db->prefix.'online WHERE idle=0') or error('Unable to fetch online count', __FILE__, __LINE__, $db->error()); |
| 97: $num_online = $db->result($result); | 97: $num_online = $db->result($result); |
| 98: | 98: |
| 99: | 99: |
| punbb-1.2.2/upload/admin_maintenance.php |
punbb-1.2.17/upload/admin_maintenance.php |
| 52: // This is the only potentially "dangerous" thing we can do here, so we check the referer | 52: // This is the only potentially "dangerous" thing we can do here, so we check the referer |
| 53: confirm_referrer('admin_maintenance.php'); | 53: confirm_referrer('admin_maintenance.php'); |
| 54: | 54: |
| 55: $truncate_sql = ($db_type != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM '; | 55: $truncate_sql = ($db_type != 'sqlite' && $db_type != 'pgsql') ? 'TRUNCATE TABLE ' : 'DELETE FROM '; |
| 56: $db->query($truncate_sql.$db->prefix.'search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $db->error()); | 56: $db->query($truncate_sql.$db->prefix.'search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $db->error()); |
| 57: $db->query($truncate_sql.$db->prefix.'search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $db->error()); | 57: $db->query($truncate_sql.$db->prefix.'search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $db->error()); |
| 58: | 58: |
| 65: break; | 65: break; |
| 66: | 66: |
| 67: case 'pgsql'; | 67: case 'pgsql'; |
| 68: $result = $db->query('SELECT setval(\'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $db->error()); | 68: $result = $db->query('SELECT setval(\''.$db->prefix.'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $db->error()); |
| 69: } | 69: } |
| 70: } | 70: } |
| 71: | 71: |
| 72: $end_at = $start_at + $per_page; | |
| 73: | |
| 74: ?> | 72: ?> |
| 75: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | 73: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 76: | 74: |
| 95: require PUN_ROOT.'include/search_idx.php'; | 93: require PUN_ROOT.'include/search_idx.php'; |
| 96: | 94: |
| 97: // Fetch posts to process | 95: // Fetch posts to process |
| 98: $result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' AND t.id<'.$end_at.' ORDER BY t.id') or error('Unable to fetch topic/post info', __FILE__, __LINE__, $db->error()); | 96: $result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' ORDER BY t.id LIMIT '.$per_page) or error('Unable to fetch topic/post info', __FILE__, __LINE__, $db->error()); |
| 99: | 97: |
| 100: $cur_topic = 0; | 98: $cur_topic = 0; |
| 101: while ($cur_post = $db->fetch_row($result)) | 99: while ($cur_post = $db->fetch_row($result)) |
| 118: } | 116: } |
| 119: | 117: |
| 120: // Check if there is more work to do | 118: // Check if there is more work to do |
| 121: $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); | 119: $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$cur_topic.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); |
| 122: | 120: |
| 123: $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : ''; | 121: $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$db->result($result) : ''; |
| 124: | 122: |
| 125: $db->end_transaction(); | 123: $db->end_transaction(); |
| 126: $db->close(); | 124: $db->close(); |
| punbb-1.2.2/upload/admin_options.php |
punbb-1.2.17/upload/admin_options.php |
| 37: | 37: |
| 38: if (isset($_POST['form_sent'])) | 38: if (isset($_POST['form_sent'])) |
| 39: { | 39: { |
| 40: // Lazy referer check (in case base_url isn't correct) | 40: // Custom referrer check (so we can output a custom error message) |
| 41: if (!preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER'])) | 41: if (!preg_match('#^'.preg_quote(str_replace('www.', '', $pun_config['o_base_url']).'/admin_options.php', '#').'#i', str_replace('www.', '', (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '')))) |
| 42: message($lang_common['Bad referrer']); | 42: message('Bad HTTP_REFERER. If you have moved these forums from one location to another or switched domains, you need to update the Base URL manually in the database (look for o_base_url in the config table) and then clear the cache by deleting all .php files in the /cache directory.'); |
| 43: | 43: |
| 44: $form = array_map('trim', $_POST['form']); | 44: $form = array_map('trim', $_POST['form']); |
| 45: | 45: |
| 46: if ($form['board_title'] == '') | 46: if ($form['board_title'] == '') |
| 47: message('You must enter a board title.'); | 47: message('You must enter a board title.'); |
| 48: | 48: |
| | 49: // Clean default_lang |
| | 50: $form['default_lang'] = preg_replace('#[\.\\\/]#', '', $form['default_lang']); |
| | 51: |
| 49: require PUN_ROOT.'include/email.php'; | 52: require PUN_ROOT.'include/email.php'; |
| 50: | 53: |
| 51: $form['admin_email'] = strtolower($form['admin_email']); | 54: $form['admin_email'] = strtolower($form['admin_email']); |
| 63: if (substr($form['base_url'], -1) == '/') | 66: if (substr($form['base_url'], -1) == '/') |
| 64: $form['base_url'] = substr($form['base_url'], 0, -1); | 67: $form['base_url'] = substr($form['base_url'], 0, -1); |
| 65: | 68: |
| | 69: // Clean avatars_dir |
| | 70: $form['avatars_dir'] = str_replace("\0", '', $form['avatars_dir']); |
| | 71: |
| 66: // Make sure avatars_dir doesn't end with a slash | 72: // Make sure avatars_dir doesn't end with a slash |
| 67: if (substr($form['avatars_dir'], -1) == '/') | 73: if (substr($form['avatars_dir'], -1) == '/') |
| 68: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); | 74: $form['avatars_dir'] = substr($form['avatars_dir'], 0, -1); |
| 117: while (list($key, $input) = @each($form)) | 123: while (list($key, $input) = @each($form)) |
| 118: { | 124: { |
| 119: // Only update values that have changed | 125: // Only update values that have changed |
| 120: if ($pun_config['o_'.$key] != $input) | 126: if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input) |
| 121: { | 127: { |
| 122: if ($input != '' || is_int($input)) | 128: if ($input != '' || is_int($input)) |
| 123: $value = '\''.$db->escape($input).'\''; | 129: $value = '\''.$db->escape($input).'\''; |
| 124: else | 130: else |
| 125: $value = 'NULL'; | 131: $value = 'NULL'; |
| 126: | 132: |
| 127: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); | 133: $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'o_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); |
| 128: } | 134: } |
| 129: } | 135: } |
| 130: | 136: |
| 229: $d = dir(PUN_ROOT.'lang'); | 235: $d = dir(PUN_ROOT.'lang'); |
| 230: while (($entry = $d->read()) !== false) | 236: while (($entry = $d->read()) !== false) |
| 231: { | 237: { |
| 232: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry)) | 238: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php')) |
| 233: $languages[] = $entry; | 239: $languages[] = $entry; |
| 234: } | 240: } |
| 235: $d->close(); | 241: $d->close(); |
| 236: | 242: |
| | 243: @natsort($languages); |
| | 244: |
| 237: while (list(, $temp) = @each($languages)) | 245: while (list(, $temp) = @each($languages)) |
| 238: { | 246: { |
| 239: if ($pun_config['o_default_lang'] == $temp) | 247: if ($pun_config['o_default_lang'] == $temp) |
| 262: } | 270: } |
| 263: $d->close(); | 271: $d->close(); |
| 264: | 272: |
| | 273: @natsort($styles); |
| | 274: |
| 265: while (list(, $temp) = @each($styles)) | 275: while (list(, $temp) = @each($styles)) |
| 266: { | 276: { |
| 267: if ($pun_config['o_default_style'] == $temp) | 277: if ($pun_config['o_default_style'] == $temp) |
| punbb-1.2.2/upload/admin_prune.php |
punbb-1.2.17/upload/admin_prune.php |
| 62: } | 62: } |
| 63: else | 63: else |
| 64: { | 64: { |
| | 65: $prune_from = intval($prune_from); |
| 65: prune($prune_from, $_POST['prune_sticky'], $prune_date); | 66: prune($prune_from, $_POST['prune_sticky'], $prune_date); |
| 66: update_forum($prune_from); | 67: update_forum($prune_from); |
| 67: } | 68: } |
| 83: | 84: |
| 84: | 85: |
| 85: $prune_days = $_POST['req_prune_days']; | 86: $prune_days = $_POST['req_prune_days']; |
| 86: if (!preg_match('#^\d+$#', $prune_days)) | 87: if (!@preg_match('#^\d+$#', $prune_days)) |
| 87: message('Days to prune must be a positive integer.'); | 88: message('Days to prune must be a positive integer.'); |
| 88: | 89: |
| 89: $prune_date = time() - ($prune_days*86400); | 90: $prune_date = time() - ($prune_days*86400); |
| 97: | 98: |
| 98: if ($prune_from != 'all') | 99: if ($prune_from != 'all') |
| 99: { | 100: { |
| | 101: $prune_from = intval($prune_from); |
| 100: $sql .= ' AND forum_id='.$prune_from; | 102: $sql .= ' AND forum_id='.$prune_from; |
| 101: | 103: |
| 102: // Fetch the forum name (just for cosmetic reasons) | 104: // Fetch the forum name (just for cosmetic reasons) |
| 135: </div> | 137: </div> |
| 136: </fieldset> | 138: </fieldset> |
| 137: </div> | 139: </div> |
| 138: <p><input type="submit" name="prune_comply" value="Prune" /> <a href="javascript:history.go(-1)" />Go back</a></p> | 140: <p><input type="submit" name="prune_comply" value="Prune" /><a href="javascript:history.go(-1)">Go back</a></p> |
| 139: </form> | 141: </form> |
| 140: </div> | 142: </div> |
| 141: </div> | 143: </div> |
| punbb-1.2.2/upload/admin_ranks.php |
punbb-1.2.17/upload/admin_ranks.php |
| 46: if ($rank == '') | 46: if ($rank == '') |
| 47: message('You must enter a rank title.'); | 47: message('You must enter a rank title.'); |
| 48: | 48: |
| 49: if (!preg_match('#^\d+$#', $min_posts)) | 49: if (!@preg_match('#^\d+$#', $min_posts)) |
| 50: message('Minimum posts must be a positive integer value.'); | 50: message('Minimum posts must be a positive integer value.'); |
| 51: | 51: |
| 52: // Make sure there isn't already a rank with the same min_posts value | 52: // Make sure there isn't already a rank with the same min_posts value |
| 69: { | 69: { |
| 70: confirm_referrer('admin_ranks.php'); | 70: confirm_referrer('admin_ranks.php'); |
| 71: | 71: |
| 72: $id = key($_POST['update']); | 72: $id = intval(key($_POST['update'])); |
| 73: | 73: |
| 74: $rank = trim($_POST['rank'][$id]); | 74: $rank = trim($_POST['rank'][$id]); |
| 75: $min_posts = trim($_POST['min_posts'][$id]); | 75: $min_posts = trim($_POST['min_posts'][$id]); |
| 77: if ($rank == '') | 77: if ($rank == '') |
| 78: message('You must enter a rank title.'); | 78: message('You must enter a rank title.'); |
| 79: | 79: |
| 80: if (!preg_match('#^\d+$#', $min_posts)) | 80: if (!@preg_match('#^\d+$#', $min_posts)) |
| 81: message('Minimum posts must be a positive integer value.'); | 81: message('Minimum posts must be a positive integer value.'); |
| 82: | 82: |
| 83: // Make sure there isn't already a rank with the same min_posts value | 83: // Make sure there isn't already a rank with the same min_posts value |
| 84: $result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' && min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error()); | 84: $result = $db->query('SELECT 1 FROM '.$db->prefix.'ranks WHERE id!='.$id.' AND min_posts='.$min_posts) or error('Unable to fetch rank info', __FILE__, __LINE__, $db->error()); |
| 85: if ($db->num_rows($result)) | 85: if ($db->num_rows($result)) |
| 86: message('There is already a rank with a minimun posts value of '.$min_posts.'.'); | 86: message('There is already a rank with a minimun posts value of '.$min_posts.'.'); |
| 87: | 87: |
| 100: { | 100: { |
| 101: confirm_referrer('admin_ranks.php'); | 101: confirm_referrer('admin_ranks.php'); |
| 102: | 102: |
| 103: $id = key($_POST['remove']); | 103: $id = intval(key($_POST['remove'])); |
| 104: | 104: |
| 105: $db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error()); | 105: $db->query('DELETE FROM '.$db->prefix.'ranks WHERE id='.$id) or error('Unable to delete rank', __FILE__, __LINE__, $db->error()); |
| 106: | 106: |
| punbb-1.2.2/upload/admin_users.php |
punbb-1.2.17/upload/admin_users.php |
| 49: ?> | 49: ?> |
| 50: <div class="linkst"> | 50: <div class="linkst"> |
| 51: <div class="inbox"> | 51: <div class="inbox"> |
| 52: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 52: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 53: </div> | 53: </div> |
| 54: </div> | 54: </div> |
| 55: | 55: |
| 98: | 98: |
| 99: <div class="linksb"> | 99: <div class="linksb"> |
| 100: <div class="inbox"> | 100: <div class="inbox"> |
| 101: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 101: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 102: </div> | 102: </div> |
| 103: </div> | 103: </div> |
| 104: <?php | 104: <?php |
| 111: { | 111: { |
| 112: $ip = $_GET['show_users']; | 112: $ip = $_GET['show_users']; |
| 113: | 113: |
| 114: if (!preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) | 114: if (!@preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) |
| 115: message('The supplied IP address is not correctly formatted.'); | 115: message('The supplied IP address is not correctly formatted.'); |
| 116: | 116: |
| 117: | 117: |
| 121: ?> | 121: ?> |
| 122: <div class="linkst"> | 122: <div class="linkst"> |
| 123: <div class="inbox"> | 123: <div class="inbox"> |
| 124: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 124: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 125: </div> | 125: </div> |
| 126: </div> | 126: </div> |
| 127: | 127: |
| 202: | 202: |
| 203: <div class="linksb"> | 203: <div class="linksb"> |
| 204: <div class="inbox"> | 204: <div class="inbox"> |
| 205: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 205: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 206: </div> | 206: </div> |
| 207: </div> | 207: </div> |
| 208: <?php | 208: <?php |
| 217: | 217: |
| 218: // trim() all elements in $form | 218: // trim() all elements in $form |
| 219: $form = array_map('trim', $form); | 219: $form = array_map('trim', $form); |
| | 220: $conditions = array(); |
| 220: | 221: |
| 221: $posts_greater = trim($_POST['posts_greater']); | 222: $posts_greater = trim($_POST['posts_greater']); |
| 222: $posts_less = trim($_POST['posts_less']); | 223: $posts_less = trim($_POST['posts_less']); |
| 256: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; | 257: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; |
| 257: while (list($key, $input) = @each($form)) | 258: while (list($key, $input) = @each($form)) |
| 258: { | 259: { |
| 259: if ($input != '') | 260: if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note'))) |
| 260: $conditions[] = 'u.'.$key.' '.$like_command.' \''.str_replace('*', '%', $input).'\''; | 261: $conditions[] = 'u.'.$db->escape($key).' '.$like_command.' \''.$db->escape(str_replace('*', '%', $input)).'\''; |
| 261: } | 262: } |
| 262: | 263: |
| 263: if ($posts_greater != '') | 264: if ($posts_greater != '') |
| 266: $conditions[] = 'u.num_posts<'.$posts_less; | 267: $conditions[] = 'u.num_posts<'.$posts_less; |
| 267: | 268: |
| 268: if ($user_group != 'all') | 269: if ($user_group != 'all') |
| 269: $conditions[] = 'u.group_id='.$user_group; | 270: $conditions[] = 'u.group_id='.intval($user_group); |
| 270: | 271: |
| 271: if (!isset($conditions)) | 272: if (empty($conditions)) |
| 272: message('You didn\'t enter any search terms.'); | 273: message('You didn\'t enter any search terms.'); |
| 273: | 274: |
| 274: | 275: |
| 278: ?> | 279: ?> |
| 279: <div class="linkst"> | 280: <div class="linkst"> |
| 280: <div class="inbox"> | 281: <div class="inbox"> |
| 281: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 282: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 282: </div> | 283: </div> |
| 283: </div> | 284: </div> |
| 284: | 285: |
| 300: <tbody> | 301: <tbody> |
| 301: <?php | 302: <?php |
| 302: | 303: |
| 303: $result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$order_by.' '.$direction) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 304: $result = $db->query('SELECT u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1 AND '.implode(' AND ', $conditions).' ORDER BY '.$db->escape($order_by).' '.$db->escape($direction)) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
| 304: if ($db->num_rows($result)) | 305: if ($db->num_rows($result)) |
| 305: { | 306: { |
| 306: while ($user_data = $db->fetch_assoc($result)) | 307: while ($user_data = $db->fetch_assoc($result)) |
| 338: | 339: |
| 339: <div class="linksb"> | 340: <div class="linksb"> |
| 340: <div class="inbox"> | 341: <div class="inbox"> |
| 341: <div><a href="javascript:history.go(-1)" />Go back</a></div> | 342: <div><a href="javascript:history.go(-1)">Go back</a></div> |
| 342: </div> | 343: </div> |
| 343: </div> | 344: </div> |
| 344: <?php | 345: <?php |
| punbb-1.2.2/upload/edit.php |
punbb-1.2.17/upload/edit.php |
| 175: else if (isset($_POST['preview'])) | 175: else if (isset($_POST['preview'])) |
| 176: { | 176: { |
| 177: require_once PUN_ROOT.'include/parser.php'; | 177: require_once PUN_ROOT.'include/parser.php'; |
| 178: $message = parse_message(trim($_POST['req_message']), $hide_smilies); | 178: $preview_message = parse_message($message, $hide_smilies); |
| 179: | 179: |
| 180: ?> | 180: ?> |
| 181: <div id="postpreview" class="blockpost"> | 181: <div id="postpreview" class="blockpost"> |
| 184: <div class="inbox"> | 184: <div class="inbox"> |
| 185: <div class="postright"> | 185: <div class="postright"> |
| 186: <div class="postmsg"> | 186: <div class="postmsg"> |
| 187: <?php echo $message."\n" ?> | 187: <?php echo $preview_message."\n" ?> |
| 188: </div> | 188: </div> |
| 189: </div> | 189: </div> |
| 190: </div> | 190: </div> |
| 197: | 197: |
| 198: ?> | 198: ?> |
| 199: <div class="blockform"> | 199: <div class="blockform"> |
| 200: <h2><?php echo $lang_post['Edit post'] ?></h2> | 200: <h2><span><?php echo $lang_post['Edit post'] ?></span></h2> |
| 201: <div class="box"> | 201: <div class="box"> |
| 202: <form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&action=edit" onsubmit="return process_form(this)"> | 202: <form id="edit" method="post" action="edit.php?id=<?php echo $id ?>&action=edit" onsubmit="return process_form(this)"> |
| 203: <div class="inform"> | 203: <div class="inform"> |
| 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> | 208: <?php if ($can_edit_subject): ?> <label><?php echo $lang_common['Subject'] ?><br /> |
| 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> | 209: <input class="longinput" type="text" name="req_subject" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" value="<?php echo pun_htmlspecialchars(isset($_POST['req_subject']) ? $_POST['req_subject'] : $cur_post['subject']) ?>" /><br /></label> |
| 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> | 210: <?php endif; ?> <label><?php echo $lang_common['Message'] ?><br /> |
| 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $_POST['req_message'] : $cur_post['message']) ?></textarea><br /></label> | 211: <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo pun_htmlspecialchars(isset($_POST['req_message']) ? $message : $cur_post['message']) ?></textarea><br /></label> |
| 212: <ul class="bblinks"> | 212: <ul class="bblinks"> |
| 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 213: <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> | 214: <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li> |
| punbb-1.2.2/upload/extern.php |
punbb-1.2.17/upload/extern.php |
| 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); | 116: exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run install.php to install PunBB first.'); |
| 117: | 117: |
| 118: | 118: |
| 119: // Disable error reporting for uninitialized variables | 119: // Make sure PHP reports all errors except E_NOTICE |
| 120: error_reporting(E_ALL); | 120: error_reporting(E_ALL ^ E_NOTICE); |
| 121: | 121: |
| 122: // Turn off magic_quotes_runtime | 122: // Turn off magic_quotes_runtime |
| 123: set_magic_quotes_runtime(0); | 123: set_magic_quotes_runtime(0); |
| 129: // Load DB abstraction layer and try to connect | 129: // Load DB abstraction layer and try to connect |
| 130: require PUN_ROOT.'include/dblayer/common_db.php'; | 130: require PUN_ROOT.'include/dblayer/common_db.php'; |
| 131: | 131: |
| 132: // Get the forum config | 132: // Load cached config |
| 133: $result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error()); | 133: @include PUN_ROOT.'cache/cache_config.php'; |
| 134: while ($cur_config_item = $db->fetch_row($result)) | 134: if (!defined('PUN_CONFIG_LOADED')) |
| 135: $pun_config[$cur_config_item[0]] = $cur_config_item[1]; | 135: { |
| | 136: require PUN_ROOT.'include/cache.php'; |
| | 137: generate_config_cache(); |
| | 138: require PUN_ROOT.'cache/cache_config.php'; |
| | 139: } |
| 136: | 140: |
| 137: // Make sure we (guests) have permission to read the forums | 141: // Make sure we (guests) have permission to read the forums |
| 138: $result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error()); | 142: $result = $db->query('SELECT g_read_board FROM '.$db->prefix.'groups WHERE g_id=3') or error('Unable to fetch group info', __FILE__, __LINE__, $db->error()); |
| 145: if (!isset($lang_common)) | 149: if (!isset($lang_common)) |
| 146: exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.'); | 150: exit('There is no valid language pack \''.$pun_config['o_default_lang'].'\' installed. Please reinstall a language of that name.'); |
| 147: | 151: |
| | 152: // Check if we are to display a maintenance message |
| | 153: if ($pun_config['o_maintenance'] && !defined('PUN_TURN_OFF_MAINT')) |
| | 154: maintenance_message(); |
| | 155: |
| 148: if (!isset($_GET['action'])) | 156: if (!isset($_GET['action'])) |
| 149: exit('No parameters supplied. See extern.php for instructions.'); | 157: exit('No parameters supplied. See extern.php for instructions.'); |
| 150: | 158: |