punbb-1.2.5/upload/admin_bans.php |
punbb-1.2.6/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.5/upload/admin_groups.php |
punbb-1.2.6/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'; |
punbb-1.2.5/upload/admin_options.php |
punbb-1.2.6/upload/admin_options.php |
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 (isset($pun_config['o_'.$key]) && $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.5/upload/include/functions.php |
punbb-1.2.6/upload/include/functions.php |
803: | 803: |
804: | 804: |
805: // START SUBST - <pun_include "*"> | 805: // START SUBST - <pun_include "*"> |
806: while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include)) | 806: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include)) |
807: { | 807: { |
| 808: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1])) |
| 809: error('Unable to process user include <pun_include "'.htmlspecialchars($cur_include[1]).'"> from template maintenance.tpl. There is no such file in folder /include/user/'); |
| 810: |
808: ob_start(); | 811: ob_start(); |
809: include PUN_ROOT.$cur_include[1]; | 812: include PUN_ROOT.'include/user/'.$cur_include[1]; |
810: $tpl_temp = ob_get_contents(); | 813: $tpl_temp = ob_get_contents(); |
811: $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint); | 814: $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint); |
812: ob_end_clean(); | 815: ob_end_clean(); |
813: } | 816: } |
814: // END SUBST - <pun_include "*"> | 817: // END SUBST - <pun_include "*"> |
854: ob_start(); | 857: ob_start(); |
855: | 858: |
856: ?> | 859: ?> |
857: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" /> | 860: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('<', '>', '"'), $destination_url) ?>" /> |
858: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> | 861: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title> |
859: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> | 862: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" /> |
860: <?php | 863: <?php |
893: | 896: |
894: | 897: |
895: // START SUBST - <pun_include "*"> | 898: // START SUBST - <pun_include "*"> |
896: while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include)) | 899: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_redir, $cur_include)) |
897: { | 900: { |
| 901: if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1])) |
| 902: error('Unable to process user include <pun_include "'.htmlspecialchars($cur_include[1]).'"> from template redirect.tpl. There is no such file in folder /include/user/'); |
| 903: |
898: ob_start(); | 904: ob_start(); |
899: include PUN_ROOT.$cur_include[1]; | 905: include PUN_ROOT.'include/user/'.$cur_include[1]; |
900: $tpl_temp = ob_get_contents(); | 906: $tpl_temp = ob_get_contents(); |
901: $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir); | 907: $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir); |
902: ob_end_clean(); | 908: ob_end_clean(); |
903: } | 909: } |
904: // END SUBST - <pun_include "*"> | 910: // END SUBST - <pun_include "*"> |
punbb-1.2.5/upload/include/parser.php |
punbb-1.2.6/upload/include/parser.php |
184: { | 184: { |
185: // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag | 185: // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag |
186: $tmp = strpos($text, '[/code]'); | 186: $tmp = strpos($text, '[/code]'); |
187: $tmp2 = strpos(substr($text, 6), '[code]'); | 187: $tmp2 = strpos(substr($text, $c_start+6), '[code]'); |
| 188: if ($tmp2 !== false) |
| 189: $tmp2 += $c_start+6; |
| 190: |
188: if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp)) | 191: if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp)) |
189: { | 192: { |
190: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; | 193: $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2']; |
301: { | 304: { |
302: global $lang_common, $pun_user; | 305: global $lang_common, $pun_user; |
303: | 306: |
| 307: if (strpos($text, 'quote') !== false) |
| 308: { |
| 309: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); |
| 310: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'[\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); |
| 311: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); |
| 312: } |
| 313: |
304: $pattern = array('#\[b\](.*?)\[/b\]#s', | 314: $pattern = array('#\[b\](.*?)\[/b\]#s', |
305: '#\[i\](.*?)\[/i\]#s', | 315: '#\[i\](.*?)\[/i\]#s', |
306: '#\[u\](.*?)\[/u\]#s', | 316: '#\[u\](.*?)\[/u\]#s', |
321: | 331: |
322: // This thing takes a while! :) | 332: // This thing takes a while! :) |
323: $text = preg_replace($pattern, $replace, $text); | 333: $text = preg_replace($pattern, $replace, $text); |
324: | |
325: if (strpos($text, 'quote') !== false) | |
326: { | |
327: $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); | |
328: $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); | |
329: $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); | |
330: } | |
331: | 334: |
332: return $text; | 335: return $text; |
333: } | 336: } |
punbb-1.2.5/upload/include/search_idx.php |
punbb-1.2.6/upload/include/search_idx.php |
43: | 43: |
44: if (empty($noise_match)) | 44: if (empty($noise_match)) |
45: { | 45: { |
46: $noise_match = array('quote', 'code', 'url', 'img', 'email', 'color', 'colour', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); | 46: $noise_match = array('[quote', '[code', '[url', '[img', '[email', '[color', '[colour', 'quote]', 'code]', 'url]', 'img]', 'email]', 'color]', 'colour]', '^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '+', '[', ']', '{', '}', ':', '\\', '/', '=', '#', ';', '!', '*'); |
47: $noise_replace = array('', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); | 47: $noise_replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' , ' ', ' ', ' ', ' ', ' ', ' '); |
48: | 48: |
49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); | 49: $stopwords = (array)@file(PUN_ROOT.'lang/'.$pun_user['language'].'/stopwords.txt'); |
50: $stopwords = array_map('trim', $stopwords); | 50: $stopwords = array_map('trim', $stopwords); |
punbb-1.2.5/upload/install.php |
punbb-1.2.6/upload/install.php |
24: | 24: |
25: | 25: |
26: // The PunBB version this script installs | 26: // The PunBB version this script installs |
27: $punbb_version = '1.2.5'; | 27: $punbb_version = '1.2.6'; |
28: | 28: |
29: | 29: |
30: define('PUN_ROOT', './'); | 30: define('PUN_ROOT', './'); |
165: <fieldset> | 165: <fieldset> |
166: <legend>Enter then name of your database</legend> | 166: <legend>Enter then name of your database</legend> |
167: <div class="infldset"> | 167: <div class="infldset"> |
168: <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If it doesn't exists, PunBB will attempt to create it.</p> | 168: <p>The name of the database that PunBB will be installed into. The database must exist. For SQLite, this is the relative path to the database file. If the SQLite database file does not exist, PunBB will attempt to create it.</p> |
169: <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label> | 169: <label for="req_db_name"><strong>Database name</strong><br /><input id="req_db_name" type="text" name="req_db_name" size="30" maxlength="50" /><br /></label> |
170: </div> | 170: </div> |
171: </fieldset> | 171: </fieldset> |
324: if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) | 324: if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) |
325: error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.'); | 325: error('Usernames may not contain any of the text formatting tags (BBCode) that the forum uses. Please go back and correct.'); |
326: | 326: |
327: if (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/', $email)) | 327: if (strlen($email) > 50 || !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)) |
328: error('The administrator e-mail address you entered is invalid. Please go back and correct.'); | 328: error('The administrator e-mail address you entered is invalid. Please go back and correct.'); |
329: | 329: |
330: | 330: |
346: case 'sqlite': | 346: case 'sqlite': |
347: require PUN_ROOT.'include/dblayer/sqlite.php'; | 347: require PUN_ROOT.'include/dblayer/sqlite.php'; |
348: break; | 348: break; |
| 349: |
| 350: default: |
| 351: error('\''.$db_type.'\' is not a valid database type.'); |
349: } | 352: } |
350: | 353: |
351: // Create the database object (and connect/select db) | 354: // Create the database object (and connect/select db) |
1420: <div class="fakeform"> | 1423: <div class="fakeform"> |
1421: <div class="inform"> | 1424: <div class="inform"> |
1422: <div class="forminfo"> | 1425: <div class="forminfo"> |
1423: <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before <?php and after ?> in the file. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p> | 1426: <p>To finalize the installation all you need to do is to <strong>copy and paste the text in the text box below into a file called config.php and then upload this file to the root directory of your PunBB installation</strong>. Make sure there are no linebreaks or spaces before <?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p> |
1424: <?php if ($alerts != ''): ?> <?php echo $alerts."\n" ?> | 1427: <?php if ($alerts != ''): ?> <?php echo $alerts."\n" ?> |
1425: <?php endif; ?> </div> | 1428: <?php endif; ?> </div> |
1426: <fieldset> | 1429: <fieldset> |
punbb-1.2.5/upload/profile.php |
punbb-1.2.6/upload/profile.php |
530: $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 530: $result = $db->query('SELECT group_id, username FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
531: list($group_id, $username) = $db->fetch_row($result); | 531: list($group_id, $username) = $db->fetch_row($result); |
532: | 532: |
| 533: if ($group_id == PUN_ADMIN) |
| 534: message('Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group.'); |
| 535: |
533: if (isset($_POST['delete_user_comply'])) | 536: if (isset($_POST['delete_user_comply'])) |
534: { | 537: { |
535: // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well | 538: // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well |
798: { | 801: { |
799: $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post')); | 802: $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post')); |
800: | 803: |
801: $form['email_setting'] == intval($form['email_setting']); | 804: $form['email_setting'] = intval($form['email_setting']); |
802: if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1; | 805: if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1; |
803: | 806: |
804: if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0'; | 807: if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0'; |
820: | 823: |
821: | 824: |
822: // Singlequotes around non-empty values and NULL for empty values | 825: // Singlequotes around non-empty values and NULL for empty values |
| 826: $temp = array(); |
823: while (list($key, $input) = @each($form)) | 827: while (list($key, $input) = @each($form)) |
824: { | 828: { |
825: $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL'; | 829: $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL'; |
827: $temp[] = $key.'='.$value; | 831: $temp[] = $key.'='.$value; |
828: } | 832: } |
829: | 833: |
| 834: if (empty($temp)) |
| 835: message($lang_common['Bad request']); |
| 836: |
830: | 837: |
831: $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error()); | 838: $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error()); |
832: | 839: |
867: } | 874: } |
868: | 875: |
869: | 876: |
870: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, 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='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); | 877: $result = $db->query('SELECT u.username, u.email, u.title, u.realname, u.url, u.jabber, u.icq, u.msn, u.aim, u.yahoo, u.location, u.use_avatar, u.signature, u.disp_topics, u.disp_posts, u.email_setting, u.save_pass, u.notify_with_post, u.show_smilies, u.show_img, u.show_img_sig, u.show_avatars, u.show_sig, u.timezone, u.language, u.style, u.num_posts, u.last_post, u.registered, u.registration_ip, 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='.$id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); |
871: if (!$db->num_rows($result)) | 878: if (!$db->num_rows($result)) |
872: message($lang_common['Bad request']); | 879: message($lang_common['Bad request']); |
873: | 880: |
1131: $d = dir(PUN_ROOT.'lang'); | 1138: $d = dir(PUN_ROOT.'lang'); |
1132: while (($entry = $d->read()) !== false) | 1139: while (($entry = $d->read()) !== false) |
1133: { | 1140: { |
1134: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry)) | 1141: if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php')) |
1135: $languages[] = $entry; | 1142: $languages[] = $entry; |
1136: } | 1143: } |
1137: $d->close(); | 1144: $d->close(); |
1139: // Only display the language selection box if there's more than one language available | 1146: // Only display the language selection box if there's more than one language available |
1140: if (count($languages) > 1) | 1147: if (count($languages) > 1) |
1141: { | 1148: { |
| 1149: natsort($languages); |
1142: | 1150: |
1143: ?> | 1151: ?> |
1144: <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?> | 1152: <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?> |
1147: | 1155: |
1148: while (list(, $temp) = @each($languages)) | 1156: while (list(, $temp) = @each($languages)) |
1149: { | 1157: { |
1150: if ($pun_user['language'] == $temp) | 1158: if ($user['language'] == $temp) |
1151: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n"; | 1159: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n"; |
1152: else | 1160: else |
1153: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n"; | 1161: echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n"; |
1350: echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n"; | 1358: echo "\t\t\t".'<div><input type="hidden" name="form[style]" value="'.$styles[0].'" /></div>'."\n"; |
1351: else if (count($styles) > 1) | 1359: else if (count($styles) > 1) |
1352: { | 1360: { |
| 1361: natsort($styles); |
1353: | 1362: |
1354: ?> | 1363: ?> |
1355: <div class="inform"> | 1364: <div class="inform"> |
1488: } | 1497: } |
1489: else | 1498: else |
1490: { | 1499: { |
| 1500: if ($pun_user['id'] != $id) |
| 1501: { |
1491: | 1502: |
1492: ?> | 1503: ?> |
1493: <legend><?php echo $lang_profile['Group membership legend'] ?></legend> | 1504: <legend><?php echo $lang_profile['Group membership legend'] ?></legend> |
1495: <select id="group_id" name="group_id"> | 1506: <select id="group_id" name="group_id"> |
1496: <?php | 1507: <?php |
1497: | 1508: |
1498: $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); | 1509: $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id!='.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error()); |
1499: | 1510: |
1500: while ($cur_group = $db->fetch_assoc($result)) | 1511: while ($cur_group = $db->fetch_assoc($result)) |
1501: { | 1512: { |
1502: if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == '')) | 1513: if ($cur_group['g_id'] == $user['g_id'] || ($cur_group['g_id'] == $pun_config['o_default_user_group'] && $user['g_id'] == '')) |
1503: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; | 1514: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; |
1504: else | 1515: else |
1505: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; | 1516: echo "\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n"; |
1506: } | 1517: } |
1507: | 1518: |
1508: ?> | 1519: ?> |
1509: </select> | 1520: </select> |
1513: </div> | 1524: </div> |
1514: <div class="inform"> | 1525: <div class="inform"> |
1515: <fieldset> | 1526: <fieldset> |
| 1527: <?php |
| 1528: |
| 1529: } |
| 1530: |
| 1531: ?> |
1516: <legend><?php echo $lang_profile['Delete ban legend'] ?></legend> | 1532: <legend><?php echo $lang_profile['Delete ban legend'] ?></legend> |
1517: <div class="infldset"> | 1533: <div class="infldset"> |
1518: <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" /> <input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" /> | 1534: <input type="submit" name="delete_user" value="<?php echo $lang_profile['Delete user'] ?>" /> <input type="submit" name="ban" value="<?php echo $lang_profile['Ban user'] ?>" /> |
punbb-1.2.5/upload/search.php |
punbb-1.2.6/upload/search.php |
65: $keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null; | 65: $keywords = (isset($_GET['keywords'])) ? strtolower(trim($_GET['keywords'])) : null; |
66: $author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null; | 66: $author = (isset($_GET['author'])) ? strtolower(trim($_GET['author'])) : null; |
67: | 67: |
| 68: if (preg_match('#^[\*%]+$#', $keywords) || strlen(str_replace(array('*', '%'), '', $keywords)) < 3) |
| 69: $keywords = ''; |
| 70: |
| 71: if (preg_match('#^[\*%]+$#', $author) || strlen(str_replace(array('*', '%'), '', $author)) < 3) |
| 72: $author = ''; |
| 73: |
68: if (!$keywords && !$author) | 74: if (!$keywords && !$author) |
69: message($lang_search['No terms']); | 75: message($lang_search['No terms']); |
70: | 76: |
704: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST) | 710: if ($pun_config['o_search_all_forums'] == '1' || $pun_user['g_id'] < PUN_GUEST) |
705: echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; | 711: echo "\t\t\t\t\t\t\t".'<option value="-1">'.$lang_search['All forums'].'</option>'."\n"; |
706: | 712: |
707: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['group_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); | 713: $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.redirect_url FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error()); |
708: | 714: |
709: $cur_category = 0; | 715: $cur_category = 0; |
710: while ($cur_forum = $db->fetch_assoc($result)) | 716: while ($cur_forum = $db->fetch_assoc($result)) |
punbb-1.2.5/upload/viewtopic.php |
punbb-1.2.6/upload/viewtopic.php |
183: $post_count = 0; // Keep track of post numbers | 183: $post_count = 0; // Keep track of post numbers |
184: | 184: |
185: // Retrieve the posts (and their respective poster/online status) | 185: // Retrieve the posts (and their respective poster/online status) |
186: $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); | 186: $result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); |
187: while ($cur_post = $db->fetch_assoc($result)) | 187: while ($cur_post = $db->fetch_assoc($result)) |
188: { | 188: { |
189: $post_count++; | 189: $post_count++; |