| punbb-1.2.1/upload/admin_bans.php |
punbb-1.2.11/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 |
| 244: if ($_POST['mode'] == 'add') | 244: 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()); | 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()); |
| 246: else | 246: 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()); | 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='.intval($_POST['ban_id'])) or error('Unable to update ban', __FILE__, __LINE__, $db->error()); |
| 248: | 248: |
| 249: // Regenerate the bans cache | 249: // Regenerate the bans cache |
| 250: require_once PUN_ROOT.'include/cache.php'; | 250: require_once PUN_ROOT.'include/cache.php'; |
| punbb-1.2.1/upload/admin_groups.php |
punbb-1.2.11/upload/admin_groups.php |
| 54: message($lang_common['Bad request']); | 54: message($lang_common['Bad request']); |
| 55: | 55: |
| 56: $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error()); | 56: $result = $db->query('SELECT * FROM '.$db->prefix.'groups WHERE g_id='.$group_id) or error('Unable to fetch user group info', __FILE__, __LINE__, $db->error()); |
| | 57: if (!$db->num_rows($result)) |
| | 58: message($lang_common['Bad request']); |
| | 59: |
| 57: $group = $db->fetch_assoc($result); | 60: $group = $db->fetch_assoc($result); |
| 58: | 61: |
| 59: $mode = 'edit'; | 62: $mode = 'edit'; |
| 206: | 209: |
| 207: $title = trim($_POST['req_title']); | 210: $title = trim($_POST['req_title']); |
| 208: $user_title = trim($_POST['user_title']); | 211: $user_title = trim($_POST['user_title']); |
| 209: $read_board = isset($_POST['read_board']) ? $_POST['read_board'] : '1'; | 212: $read_board = isset($_POST['read_board']) ? intval($_POST['read_board']) : '1'; |
| 210: $post_replies = isset($_POST['post_replies']) ? $_POST['post_replies'] : '1'; | 213: $post_replies = isset($_POST['post_replies']) ? intval($_POST['post_replies']) : '1'; |
| 211: $post_topics = isset($_POST['post_topics']) ? $_POST['post_topics'] : '1'; | 214: $post_topics = isset($_POST['post_topics']) ? intval($_POST['post_topics']) : '1'; |
| 212: $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'; |
| 213: $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'; |
| 214: $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'; |
| 215: $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'; |
| 216: $search = isset($_POST['search']) ? $_POST['search'] : '1'; | 219: $search = isset($_POST['search']) ? intval($_POST['search']) : '1'; |
| 217: $search_users = isset($_POST['search_users']) ? $_POST['search_users'] : '1'; | 220: $search_users = isset($_POST['search_users']) ? intval($_POST['search_users']) : '1'; |
| 218: $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'; |
| 219: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; | 222: $post_flood = isset($_POST['post_flood']) ? intval($_POST['post_flood']) : '0'; |
| 220: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; | 223: $search_flood = isset($_POST['search_flood']) ? intval($_POST['search_flood']) : '0'; |
| 226: | 229: |
| 227: if ($_POST['mode'] == 'add') | 230: if ($_POST['mode'] == 'add') |
| 228: { | 231: { |
| 229: $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()); |
| 230: if ($db->num_rows()) | 233: if ($db->num_rows($result)) |
| 231: 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).'\'.'); |
| 232: | 235: |
| 233: $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()); |
| 239: $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()); |
| 240: } | 243: } |
| 241: else | 244: else |
| 242: $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: } |
| 243: | 252: |
| 244: // Regenerate the quickjump cache | 253: // Regenerate the quickjump cache |
| 245: require_once PUN_ROOT.'include/cache.php'; | 254: require_once PUN_ROOT.'include/cache.php'; |
| punbb-1.2.1/upload/admin_index.php |
punbb-1.2.11/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.1/upload/admin_options.php |
punbb-1.2.11/upload/admin_options.php |
| 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: // Lazy referer check (in case base_url isn't correct) |
| 41: if (!preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER'])) | 41: if (!isset($_SERVER['HTTP_REFERER']) || !preg_match('#/admin_options\.php#i', $_SERVER['HTTP_REFERER'])) |
| 42: message($lang_common['Bad referrer']); | 42: message($lang_common['Bad referrer']); |
| 43: | 43: |
| 44: $form = array_map('trim', $_POST['form']); | 44: $form = array_map('trim', $_POST['form']); |
| 117: while (list($key, $input) = @each($form)) | 117: while (list($key, $input) = @each($form)) |
| 118: { | 118: { |
| 119: // Only update values that have changed | 119: // Only update values that have changed |
| 120: if ($pun_config['o_'.$key] != $input) | 120: if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input) |
| 121: { | 121: { |
| 122: if ($input != '' || is_int($input)) | 122: if ($input != '' || is_int($input)) |
| 123: $value = '\''.$db->escape($input).'\''; | 123: $value = '\''.$db->escape($input).'\''; |
| 124: else | 124: else |
| 125: $value = 'NULL'; | 125: $value = 'NULL'; |
| 126: | 126: |
| 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()); | 127: $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: } | 128: } |
| 129: } | 129: } |
| 130: | 130: |
| 229: $d = dir(PUN_ROOT.'lang'); | 229: $d = dir(PUN_ROOT.'lang'); |
| 230: while (($entry = $d->read()) !== false) | 230: while (($entry = $d->read()) !== false) |
| 231: { | 231: { |
| 232: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry)) | 232: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php')) |
| 233: $languages[] = $entry; | 233: $languages[] = $entry; |
| 234: } | 234: } |
| 235: $d->close(); | 235: $d->close(); |
| 236: | 236: |
| | 237: @natsort($languages); |
| | 238: |
| 237: while (list(, $temp) = @each($languages)) | 239: while (list(, $temp) = @each($languages)) |
| 238: { | 240: { |
| 239: if ($pun_config['o_default_lang'] == $temp) | 241: if ($pun_config['o_default_lang'] == $temp) |
| 261: $styles[] = substr($entry, 0, strlen($entry)-4); | 263: $styles[] = substr($entry, 0, strlen($entry)-4); |
| 262: } | 264: } |
| 263: $d->close(); | 265: $d->close(); |
| | 266: |
| | 267: @natsort($styles); |
| 264: | 268: |
| 265: while (list(, $temp) = @each($styles)) | 269: while (list(, $temp) = @each($styles)) |
| 266: { | 270: { |
| punbb-1.2.1/upload/admin_users.php |
punbb-1.2.11/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 |
| 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']); |
| 257: while (list($key, $input) = @each($form)) | 258: while (list($key, $input) = @each($form)) |
| 258: { | 259: { |
| 259: if ($input != '') | 260: if ($input != '') |
| 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='.$db->escape($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.1/upload/edit.php |
punbb-1.2.11/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> |
| 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.1/upload/extern.php |
punbb-1.2.11/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()); |
| punbb-1.2.1/upload/header.php |
punbb-1.2.11/upload/header.php |
| 15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16: GNU General Public License for more details. | 16: GNU General Public License for more details. |
| 17: | 17: |
| 18: You should have received a copy of the GNU G>eneral Public License | 18: You should have received a copy of the GNU General Public License |
| 19: along with this program; if not, write to the Free Software | 19: along with this program; if not, write to the Free Software |
| 20: Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 20: Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21: MA 02111-1307 USA | 21: MA 02111-1307 USA |
| 68: if (defined('PUN_ADMIN_CONSOLE')) | 68: if (defined('PUN_ADMIN_CONSOLE')) |
| 69: echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; | 69: echo '<link rel="stylesheet" type="text/css" href="style/imports/base_admin.css" />'."\n"; |
| 70: | 70: |
| 71: if (isset($destination_url)) | 71: if (isset($required_fields)) |
| 72: echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'" />'."\n"; | |
| 73: | |
| 74: else if (isset($required_fields)) | |
| 75: { | 72: { |
| 76: // Output JavaScript to validate form (make sure required fields are filled out) | 73: // Output JavaScript to validate form (make sure required fields are filled out) |
| 77: | 74: |
| 134: | 131: |
| 135: | 132: |
| 136: // START SUBST - <pun_page> | 133: // START SUBST - <pun_page> |
| 137: $tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main); | 134: $tpl_main = str_replace('<pun_page>', htmlspecialchars(basename($_SERVER['PHP_SELF'], '.php')), $tpl_main); |
| 138: // END SUBST - <pun_title> | 135: // END SUBST - <pun_title> |
| 139: | 136: |
| 140: | 137: |
| 171: $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>'; | 168: $tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>'; |
| 172: } | 169: } |
| 173: | 170: |
| 174: if (basename($_SERVER['PHP_SELF']) == 'index.php') | 171: if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php'))) |
| 175: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | 172: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
| 176: else if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] == 'action=show_new') | |
| 177: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<p class="conr"><a href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></p>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | |
| 178: else | 173: else |
| 179: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; | 174: $tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>'; |
| 180: } | 175: } |
| punbb-1.2.1/upload/include/common.php |
punbb-1.2.11/upload/include/common.php |
| 32: if (!defined('PUN_ROOT')) | 32: if (!defined('PUN_ROOT')) |
| 33: exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.'); | 33: exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.'); |
| 34: | 34: |
| | 35: |
| | 36: // Load the functions script |
| | 37: require PUN_ROOT.'include/functions.php'; |
| | 38: |
| | 39: // Reverse the effect of register_globals |
| | 40: if (@ini_get('register_globals')) |
| | 41: unregister_globals(); |
| | 42: |
| | 43: |
| 35: @include PUN_ROOT.'config.php'; | 44: @include PUN_ROOT.'config.php'; |
| 36: | 45: |
| 37: // If PUN isn't defined, config.php is missing or corrupt | 46: // If PUN isn't defined, config.php is missing or corrupt |
| 43: list($usec, $sec) = explode(' ', microtime()); | 52: list($usec, $sec) = explode(' ', microtime()); |
| 44: $pun_start = ((float)$usec + (float)$sec); | 53: $pun_start = ((float)$usec + (float)$sec); |
| 45: | 54: |
| 46: // Enable full error, warning and notice reporting | 55: // Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not. |
| 47: error_reporting(E_ALL); | 56: error_reporting(E_ALL ^ E_NOTICE); |
| 48: | 57: |
| 49: // Turn off magic_quotes_runtime | 58: // Turn off magic_quotes_runtime |
| 50: set_magic_quotes_runtime(0); | 59: set_magic_quotes_runtime(0); |
| 77: define('PUN_MEMBER', 4); | 86: define('PUN_MEMBER', 4); |
| 78: | 87: |
| 79: | 88: |
| 80: // Load the functions script | |
| 81: require PUN_ROOT.'include/functions.php'; | |
| 82: | |
| 83: // Load DB abstraction layer and connect | 89: // Load DB abstraction layer and connect |
| 84: require PUN_ROOT.'include/dblayer/common_db.php'; | 90: require PUN_ROOT.'include/dblayer/common_db.php'; |
| 85: | 91: |
| 117: // Attempt to load the common language file | 123: // Attempt to load the common language file |
| 118: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'; | 124: @include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'; |
| 119: if (!isset($lang_common)) | 125: if (!isset($lang_common)) |
| 120: exit('There is no valid language pack \''.$pun_user['language'].'\' installed. Please reinstall a language of that name.'); | 126: exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.'); |
| 121: | 127: |
| 122: // Check if we are to display a maintenance message | 128: // Check if we are to display a maintenance message |
| 123: if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) | 129: if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) |
| punbb-1.2.1/upload/include/email.php |
punbb-1.2.11/upload/include/email.php |
| 33: // | 33: // |
| 34: function is_valid_email($email) | 34: function is_valid_email($email) |
| 35: { | 35: { |
| 36: return preg_match('#^.{1,}@.{2,}\..{2,}$#', $email); | 36: if (strlen($email) > 50) |
| | 37: return false; |
| | 38: |
| | 39: return preg_match('/^(([^<>()[\]\\.,;:\s@"\']+(\.[^<>()[\]\\.,;:\s@"\']+)*)|("[^"\']+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\d\-]+\.)+[a-zA-Z]{2,}))$/', $email); |
| 37: } | 40: } |
| 38: | 41: |
| 39: | 42: |
| 65: | 68: |
| 66: // Default sender/return address | 69: // Default sender/return address |
| 67: if (!$from) | 70: if (!$from) |
| 68: $from = '"'.$pun_config['o_board_title'].' '.$lang_common['Mailer'].'" <'.$pun_config['o_webmaster_email'].'>'; | 71: $from = '"'.str_replace('"', '', $pun_config['o_board_title'].' '.$lang_common['Mailer']).'" <'.$pun_config['o_webmaster_email'].'>'; |
| 69: | |
| 70: // Make sure the from line doesn't contain a colon (the character, that is :D) | |
| 71: $from = str_replace(':', ' ', $from); | |
| 72: | 72: |
| 73: // Detect what linebreak we should use for the headers | 73: // Do a little spring cleaning |
| 74: if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 74: $to = trim(preg_replace('#[\n\r]+#s', '', $to)); |
| 75: $eol = "\r\n"; | 75: $subject = trim(preg_replace('#[\n\r]+#s', '', $subject)); |
| 76: else if (strtoupper(substr(PHP_OS, 0, 3) == 'MAC')) | 76: $from = trim(preg_replace('#[\n\r:]+#s', '', $from)); |
| 77: $eol = "\r"; | |
| 78: else | |
| 79: $eol = "\n"; | |
| 80: | 77: |
| 81: $headers = 'From: '.$from.$eol.'Date: '.date('r').$eol.'MIME-Version: 1.0'.$eol.'Content-transfer-encoding: 8bit'.$eol.'Content-type: text/plain; charset='.$lang_common['lang_encoding'].$eol.'X-Mailer: PunBB Mailer'; | 78: $headers = 'From: '.$from."\r\n".'Date: '.date('r')."\r\n".'MIME-Version: 1.0'."\r\n".'Content-transfer-encoding: 8bit'."\r\n".'Content-type: text/plain; charset='.$lang_common['lang_encoding']."\r\n".'X-Mailer: PunBB Mailer'; |
| 82: | 79: |
| 83: // Make sure all linebreaks are CRLF in message | 80: // Make sure all linebreaks are CRLF in message |
| 84: $message = str_replace("\n", "\r\n", pun_linebreaks($message)); | 81: $message = str_replace("\n", "\r\n", pun_linebreaks($message)); |
| 86: if ($pun_config['o_smtp_host'] != '') | 83: if ($pun_config['o_smtp_host'] != '') |
| 87: smtp_mail($to, $subject, $message, $headers); | 84: smtp_mail($to, $subject, $message, $headers); |
| 88: else | 85: else |
| | 86: { |
| | 87: // Change the linebreaks used in the headers according to OS |
| | 88: if (strtoupper(substr(PHP_OS, 0, 3)) == 'MAC') |
| | 89: $headers = str_replace("\r\n", "\r", $headers); |
| | 90: else if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') |
| | 91: $headers = str_replace("\r\n", "\n", $headers); |
| | 92: |
| 89: mail($to, $subject, $message, $headers); | 93: mail($to, $subject, $message, $headers); |
| | 94: } |
| 90: } | 95: } |
| 91: | 96: |
| 92: | 97: |
| punbb-1.2.1/upload/include/functions.php |
punbb-1.2.11/upload/include/functions.php |
| 46: $pun_user = $db->fetch_assoc($result); | 46: $pun_user = $db->fetch_assoc($result); |
| 47: | 47: |
| 48: // If user authorisation failed | 48: // If user authorisation failed |
| 49: if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) != $cookie['password_hash']) | 49: if (!isset($pun_user['id']) || md5($cookie_seed.$pun_user['password']) !== $cookie['password_hash']) |
| 50: { | 50: { |
| 51: pun_setcookie(0, random_pass(8), $expire); | 51: pun_setcookie(0, random_pass(8), $expire); |
| 52: set_default_user(); | 52: set_default_user(); |
| 108: | 108: |
| 109: // Fetch guest user | 109: // Fetch guest user |
| 110: $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error()); | 110: $result = $db->query('SELECT u.*, g.*, o.logged FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'groups AS g ON u.group_id=g.g_id LEFT JOIN '.$db->prefix.'online AS o ON o.ident=\''.$remote_addr.'\' WHERE u.id=1') or error('Unable to fetch guest information', __FILE__, __LINE__, $db->error()); |
| | 111: if (!$db->num_rows($result)) |
| | 112: exit('Unable to fetch guest information. The table \''.$db->prefix.'users\' must contain an entry with id = 1 that represents anonymous users.'); |
| | 113: |
| 111: $pun_user = $db->fetch_assoc($result); | 114: $pun_user = $db->fetch_assoc($result); |
| 112: | 115: |
| 113: // Update online list | 116: // Update online list |
| 165: } | 168: } |
| 166: | 169: |
| 167: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) | 170: if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username'])) |
| | 171: { |
| | 172: $db->query('DELETE FROM '.$db->prefix.'online WHERE ident=\''.$db->escape($pun_user['username']).'\'') or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); |
| 168: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); | 173: message($lang_common['Ban message'].' '.(($cur_ban['expire'] != '') ? $lang_common['Ban message 2'].' '.strtolower(format_time($cur_ban['expire'], true)).'. ' : '').(($cur_ban['message'] != '') ? $lang_common['Ban message 3'].'<br /><br /><strong>'.pun_htmlspecialchars($cur_ban['message']).'</strong><br /><br />' : '<br /><br />').$lang_common['Ban message 4'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.', true); |
| | 174: } |
| 169: | 175:&nb |