punbb-1.1/upload/admin_users.php |
punbb-1.1.1/upload/admin_users.php |
362: <tr> | 362: <tr> |
363: <td class="punright" style="width: 35%">Username</td> | 363: <td class="punright" style="width: 35%">Username</td> |
364: <td style="width: 35%"><input type="text" name="username" size="25" maxlength="25" tabindex="1"></td> | 364: <td style="width: 35%"><input type="text" name="username" size="25" maxlength="25" tabindex="1"></td> |
365: <td style="width: 30%" rowspan="16"><input type="submit" name="find_user" value=" Find " tabindex="21"></td> | 365: <td style="width: 30%" rowspan="16"><input type="submit" name="find_user" value=" Find " tabindex="22"></td> |
366: </tr> | 366: </tr> |
367: <tr> | 367: <tr> |
368: <td class="punright" style="width: 35%">E-mail address</td> | 368: <td class="punright" style="width: 35%">E-mail address</td> |
385: <td style="width: 35%"><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="6"></td> | 385: <td style="width: 35%"><input type="text" name="form[icq]" size="12" maxlength="12" tabindex="6"></td> |
386: </tr> | 386: </tr> |
387: <tr> | 387: <tr> |
| 388: <td class="punright" style="width: 35%">MSN Messenger</td> |
| 389: <td style="width: 35%"><input type="text" name="form[msn]" size="30" maxlength="50" tabindex="7"></td> |
| 390: </tr> |
| 391: <tr> |
388: <td class="punright" style="width: 35%">AOL IM</td> | 392: <td class="punright" style="width: 35%">AOL IM</td> |
389: <td style="width: 35%"><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="7"></td> | 393: <td style="width: 35%"><input type="text" name="form[aim]" size="20" maxlength="20" tabindex="8"></td> |
390: </tr> | 394: </tr> |
391: <tr> | 395: <tr> |
392: <td class="punright" style="width: 35%">Yahoo! Messenger</td> | 396: <td class="punright" style="width: 35%">Yahoo! Messenger</td> |
393: <td style="width: 35%"><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="8"></td> | 397: <td style="width: 35%"><input type="text" name="form[yahoo]" size="20" maxlength="20" tabindex="9"></td> |
394: </tr> | 398: </tr> |
395: <tr> | 399: <tr> |
396: <td class="punright" style="width: 35%">Location</td> | 400: <td class="punright" style="width: 35%">Location</td> |
397: <td style="width: 35%"><input type="text" name="form[location]" size="30" maxlength="30" tabindex="9"></td> | 401: <td style="width: 35%"><input type="text" name="form[location]" size="30" maxlength="30" tabindex="10"></td> |
398: </tr> | 402: </tr> |
399: <tr> | 403: <tr> |
400: <td class="punright" style="width: 35%">Signature</td> | 404: <td class="punright" style="width: 35%">Signature</td> |
401: <td style="width: 35%"><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="10"></td> | 405: <td style="width: 35%"><input type="text" name="form[signature]" size="35" maxlength="512" tabindex="11"></td> |
402: </tr> | 406: </tr> |
403: <tr> | 407: <tr> |
404: <td class="punright" style="width: 35%">Admin note</td> | 408: <td class="punright" style="width: 35%">Admin note</td> |
405: <td style="width: 35%"><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="11"></td> | 409: <td style="width: 35%"><input type="text" name="form[admin_note]" size="30" maxlength="30" tabindex="12"></td> |
406: </tr> | 410: </tr> |
407: <tr> | 411: <tr> |
408: <td class="punright" style="width: 35%">Number of posts greater than</td> | 412: <td class="punright" style="width: 35%">Number of posts greater than</td> |
409: <td style="width: 35%"><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="12"></td> | 413: <td style="width: 35%"><input type="text" name="posts_greater" size="5" maxlength="8" tabindex="13"></td> |
410: </tr> | 414: </tr> |
411: <tr> | 415: <tr> |
412: <td class="punright" style="width: 35%">Number of posts less than</td> | 416: <td class="punright" style="width: 35%">Number of posts less than</td> |
413: <td style="width: 35%"><input type="text" name="posts_less" size="5" maxlength="8" tabindex="13"></td> | 417: <td style="width: 35%"><input type="text" name="posts_less" size="5" maxlength="8" tabindex="14"></td> |
414: </tr> | 418: </tr> |
415: <tr> | 419: <tr> |
416: <td class="punright" style="width: 35%">Last post is after<br>(yyyy-mm-dd hh:mm:ss)</td> | 420: <td class="punright" style="width: 35%">Last post is after<br>(yyyy-mm-dd hh:mm:ss)</td> |
417: <td style="width: 35%"><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="14"></td> | 421: <td style="width: 35%"><input type="text" name="last_post_after" size="24" maxlength="19" tabindex="15"></td> |
418: </tr> | 422: </tr> |
419: <tr> | 423: <tr> |
420: <td class="punright" style="width: 35%">Last post is before<br>(yyyy-mm-dd hh:mm:ss)</td> | 424: <td class="punright" style="width: 35%">Last post is before<br>(yyyy-mm-dd hh:mm:ss)</td> |
421: <td style="width: 35%"><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="15"></td> | 425: <td style="width: 35%"><input type="text" name="last_post_before" size="24" maxlength="19" tabindex="16"></td> |
422: </tr> | 426: </tr> |
423: <tr> | 427: <tr> |
424: <td class="punright" style="width: 35%">Registered after<br>(yyyy-mm-dd hh:mm:ss)</td> | 428: <td class="punright" style="width: 35%">Registered after<br>(yyyy-mm-dd hh:mm:ss)</td> |
425: <td style="width: 35%"><input type="text" name="registered_after" size="24" maxlength="19" tabindex="16"></td> | 429: <td style="width: 35%"><input type="text" name="registered_after" size="24" maxlength="19" tabindex="17"></td> |
426: </tr> | 430: </tr> |
427: <tr> | 431: <tr> |
428: <td class="punright" style="width: 35%">Registered before<br>(yyyy-mm-dd hh:mm:ss)</td> | 432: <td class="punright" style="width: 35%">Registered before<br>(yyyy-mm-dd hh:mm:ss)</td> |
429: <td style="width: 35%"><input type="text" name="registered_before" size="24" maxlength="19" tabindex="17"></td> | 433: <td style="width: 35%"><input type="text" name="registered_before" size="24" maxlength="19" tabindex="18"></td> |
430: </tr> | 434: </tr> |
431: <tr> | 435: <tr> |
432: <td class="punright" style="width: 35%">Order by</td> | 436: <td class="punright" style="width: 35%">Order by</td> |
433: <td style="width: 35%"> | 437: <td style="width: 35%"> |
434: <select name="order_by" tabindex="18"> | 438: <select name="order_by" tabindex="19"> |
435: <option value="username" selected>username</option> | 439: <option value="username" selected>username</option> |
436: <option value="email">e-mail</option> | 440: <option value="email">e-mail</option> |
437: <option value="num_posts">posts</option> | 441: <option value="num_posts">posts</option> |
438: <option value="last_post">last post</option> | 442: <option value="last_post">last post</option> |
439: <option value="registered">registered</option> | 443: <option value="registered">registered</option> |
440: </select> <select name="direction" tabindex="19"> | 444: </select> <select name="direction" tabindex="20"> |
441: <option value="ASC" selected>ascending</option> | 445: <option value="ASC" selected>ascending</option> |
442: <option value="DESC">descending</option> | 446: <option value="DESC">descending</option> |
443: </select> | 447: </select> |
446: <tr> | 450: <tr> |
447: <td class="punright" style="width: 35%">User group</td> | 451: <td class="punright" style="width: 35%">User group</td> |
448: <td style="width: 35%"> | 452: <td style="width: 35%"> |
449: <select name="user_group" tabindex="20"> | 453: <select name="user_group" tabindex="21"> |
450: <option value="all" selected>All groups</option> | 454: <option value="all" selected>All groups</option> |
451: <option value="<?php echo PUN_USER ?>">Users</option> | 455: <option value="<?php echo PUN_USER ?>">Users</option> |
452: <option value="<?php echo PUN_MOD ?>">Moderators</option> | 456: <option value="<?php echo PUN_MOD ?>">Moderators</option> |
474: <table class="punplain" cellspacing="0" cellpadding="4"> | 478: <table class="punplain" cellspacing="0" cellpadding="4"> |
475: <tr> | 479: <tr> |
476: <td class="punright" style="width: 35%"><b>IP address</b><br>The IP address to search for in the post database.</td> | 480: <td class="punright" style="width: 35%"><b>IP address</b><br>The IP address to search for in the post database.</td> |
477: <td style="width: 35%"><input type="text" name="show_users" size="18" maxlength="15" tabindex="22"></td> | 481: <td style="width: 35%"><input type="text" name="show_users" size="18" maxlength="15" tabindex="23"></td> |
478: <td style="width: 30%"><input type="submit" value=" Find " tabindex="23"></td> | 482: <td style="width: 30%"><input type="submit" value=" Find " tabindex="24"></td> |
479: </tr> | 483: </tr> |
480: </table> | 484: </table> |
481: </td> | 485: </td> |
punbb-1.1/upload/include/dblayer/pgsql.php |
punbb-1.1.1/upload/include/dblayer/pgsql.php |
23: ************************************************************************/ | 23: ************************************************************************/ |
24: | 24: |
25: | 25: |
26: // Make sure we have built in support for MySQL | 26: // Make sure we have built in support for PostgreSQL |
27: if (!function_exists('pg_connect')) | 27: if (!function_exists('pg_connect')) |
28: exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.'); | 28: exit('This PHP environment doesn\'t have PostgreSQL support built in. PostgreSQL support is required if you want to use a PostgreSQL database to run this forum. Consult the PHP documentation for further assistance.'); |
29: | 29: |
111: if (defined('PUN_SHOW_QUERIES')) | 111: if (defined('PUN_SHOW_QUERIES')) |
112: $this->saved_queries[] = array('BEGIN', 0); | 112: $this->saved_queries[] = array('BEGIN', 0); |
113: | 113: |
114: if (!@pg_exec($this->link_id, 'BEGIN')) | 114: if (!@pg_query($this->link_id, 'BEGIN')) |
115: return false; | 115: return false; |
116: } | 116: } |
117: | 117: |
118: if (defined('PUN_SHOW_QUERIES')) | 118: if (defined('PUN_SHOW_QUERIES')) |
119: $q_start = get_microtime(); | 119: $q_start = get_microtime(); |
120: | 120: |
121: $this->query_result = @pg_exec($this->link_id, $sql); | 121: $this->query_result = @pg_query($this->link_id, $sql); |
122: if ($this->query_result) | 122: if ($this->query_result) |
123: { | 123: { |
124: if (defined('PUN_SHOW_QUERIES')) | 124: if (defined('PUN_SHOW_QUERIES')) |
131: if (defined('PUN_SHOW_QUERIES')) | 131: if (defined('PUN_SHOW_QUERIES')) |
132: $this->saved_queries[] = array('COMMIT', 0); | 132: $this->saved_queries[] = array('COMMIT', 0); |
133: | 133: |
134: if (!@pg_exec($this->link_id, 'COMMIT')) | 134: if (!@pg_query($this->link_id, 'COMMIT')) |
135: { | 135: { |
136: if (defined('PUN_SHOW_QUERIES')) | 136: if (defined('PUN_SHOW_QUERIES')) |
137: $this->saved_queries[] = array('ROLLBACK', 0); | 137: $this->saved_queries[] = array('ROLLBACK', 0); |
138: | 138: |
139: @pg_exec($this->link_id, 'ROLLBACK'); | 139: @pg_query($this->link_id, 'ROLLBACK'); |
140: return false; | 140: return false; |
141: } | 141: } |
142: } | 142: } |
154: $this->saved_queries[] = array('ROLLBACK', 0); | 154: $this->saved_queries[] = array('ROLLBACK', 0); |
155: | 155: |
156: if ($this->in_transaction) | 156: if ($this->in_transaction) |
157: @pg_exec($this->link_id, 'ROLLBACK'); | 157: @pg_query($this->link_id, 'ROLLBACK'); |
158: | 158: |
159: $this->in_transaction = false; | 159: $this->in_transaction = false; |
160: | 160: |
170: if (defined('PUN_SHOW_QUERIES')) | 170: if (defined('PUN_SHOW_QUERIES')) |
171: $this->saved_queries[] = array('COMMIT', 0); | 171: $this->saved_queries[] = array('COMMIT', 0); |
172: | 172: |
173: if (!@pg_exec($this->link_id, 'COMMIT')) | 173: if (!@pg_query($this->link_id, 'COMMIT')) |
174: { | 174: { |
175: if (defined('PUN_SHOW_QUERIES')) | 175: if (defined('PUN_SHOW_QUERIES')) |
176: $this->saved_queries[] = array('ROLLBACK', 0); | 176: $this->saved_queries[] = array('ROLLBACK', 0); |
177: | 177: |
178: @pg_exec($this->link_id, 'ROLLBACK'); | 178: @pg_query($this->link_id, 'ROLLBACK'); |
179: return false; | 179: return false; |
180: } | 180: } |
181: } | 181: } |
260: function num_rows($query_id = 0) | 260: function num_rows($query_id = 0) |
261: { | 261: { |
262: if (!$query_id) | 262: if (!$query_id) |
263: { | |
264: $query_id = $this->query_result; | 263: $query_id = $this->query_result; |
265: } | |
266: | 264: |
267: return ($query_id) ? @pg_num_rows($query_id) : false; | 265: return ($query_id) ? @pg_num_rows($query_id) : false; |
268: } | 266: } |
286: if (preg_match('/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $tablename)) | 284: if (preg_match('/^INSERT[\t\n ]+INTO[\t\n ]+([a-z0-9\_\-]+)/is', $this->last_query_text[$query_id], $tablename)) |
287: { | 285: { |
288: $sql = 'SELECT currval(\''.$tablename[1].'_id_seq\') AS lastval'; | 286: $sql = 'SELECT currval(\''.$tablename[1].'_id_seq\') AS lastval'; |
289: $temp_q_id = @pg_exec($this->link_id, $sql); | 287: $temp_q_id = @pg_query($this->link_id, $sql); |
290: | 288: |
291: if (!$temp_q_id) | 289: if (!$temp_q_id) |
292: return false; | 290: return false; |
318: if (!$query_id) | 316: if (!$query_id) |
319: $query_id = $this->query_result; | 317: $query_id = $this->query_result; |
320: | 318: |
321: return ($query_id) ? @pg_freeresult($query_id) : false; | 319: return ($query_id) ? @pg_free_result($query_id) : false; |
322: } | 320: } |
323: | 321: |
324: | 322: |
343: if (defined('PUN_SHOW_QUERIES')) | 341: if (defined('PUN_SHOW_QUERIES')) |
344: $this->saved_queries[] = array('COMMIT', 0); | 342: $this->saved_queries[] = array('COMMIT', 0); |
345: | 343: |
346: @pg_exec($this->link_id, 'COMMIT'); | 344: @pg_query($this->link_id, 'COMMIT'); |
347: } | 345: } |
348: | 346: |
349: if ($this->query_result) | 347: if ($this->query_result) |
350: @pg_freeresult($this->query_result); | 348: @pg_free_result($this->query_result); |
351: | 349: |
352: return @pg_close($this->link_id); | 350: return @pg_close($this->link_id); |
353: } | 351: } |
punbb-1.1/upload/include/parser.php |
punbb-1.1.1/upload/include/parser.php |
72: { | 72: { |
73: global $lang_common; | 73: global $lang_common; |
74: | 74: |
75: set_time_limit(3); | |
76: | |
77: // The maximum allowed quote depth | 75: // The maximum allowed quote depth |
78: $max_depth = 3; | 76: $max_depth = 3; |
79: | 77: |
207: '#\[email=(.*?)\](.*?)\[/email\]#', | 205: '#\[email=(.*?)\](.*?)\[/email\]#', |
208: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); | 206: '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s'); |
209: | 207: |
210: $replace = array('<b>$1</b>', | 208: $replace = array('<strong>$1</strong>', |
211: '<i>$1</i>', | 209: '<em>$1</em>', |
212: '<u>$1</u>', | 210: '<u>$1</u>', |
213: 'truncate_url("$1")', | 211: 'truncate_url(\'$1\')', |
214: 'truncate_url("$1", "$2")', | 212: 'truncate_url(\'$1\', \'$2\')', |
215: '<a href="mailto:$1">$1</a>', | 213: '<a href="mailto:$1">$1</a>', |
216: '<a href="mailto:$1">$2</a>', | 214: '<a href="mailto:$1">$2</a>', |
217: '<span style="color: $1">$2</span>'); | 215: '<span style="color: $1">$2</span>'); |
239: | 237: |
240: $message = ' '.$message; | 238: $message = ' '.$message; |
241: | 239: |
242: $message = preg_replace('#([\t\n\(\) ])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ "\(\)\n\r\t<]*)?)#ie', '"$1".truncate_url("$2://$3")', $message); | 240: $message = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.truncate_url(\'$2://$3\')', $message); |
243: $message = preg_replace('#([\t\n\(\) ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ "\(\)\n\r\t<]*)?)#ie', '"$1".truncate_url("$2.$3", "$2.$3")', $message); | 241: $message = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.truncate_url(\'$2.$3\', \'$2.$3\')', $message); |
244: | 242: |
245: return substr($message, 1); | 243: return substr($message, 1); |
246: } | 244: } |
punbb-1.1/upload/post.php |
punbb-1.1.1/upload/post.php |
116: require $pun_root.'lang/'.$language.'/'.$language.'_prof_reg.php'; | 116: require $pun_root.'lang/'.$language.'/'.$language.'_prof_reg.php'; |
117: require $pun_root.'lang/'.$language.'/'.$language.'_register.php'; | 117: require $pun_root.'lang/'.$language.'/'.$language.'_register.php'; |
118: | 118: |
119: // It's a guest, so we have to check the username | 119: // It's a guest, so we have to validate the username |
120: if (strlen($username) < 2) | 120: if (strlen($username) < 2) |
121: message($lang_prof_reg['Username too short']); | 121: message($lang_prof_reg['Username too short']); |
122: else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest'])) | 122: else if (!strcasecmp($username, 'Guest') || !strcasecmp($username, $lang_common['Guest'])) |
123: message($lang_prof_reg['Username guest']); | 123: message($lang_prof_reg['Username guest']); |
124: else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username)) | 124: else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username)) |
125: message($lang_prof_reg['Username IP']); | 125: message($lang_prof_reg['Username IP']); |
126: else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) | 126: else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false) |
| 127: message($lang_prof_reg['Username reserved chars']); |
| 128: else if (preg_match('#\[b\]|\[/b\]|\[u\]|\[/u\]|\[i\]|\[/i\]|\[color|\[/color\]|\[quote\]|\[quote=|\[/quote\]|\[code\]|\[/code\]|\[img\]|\[/img\]|\[url|\[/url\]|\[email|\[/email\]#i', $username)) |
127: message($lang_prof_reg['Username BBCode']); | 129: message($lang_prof_reg['Username BBCode']); |
128: | 130: |
129: // Check username for any censored words | 131: // Check username for any censored words |
364: if (strpos($q_poster, '[') !== false || strpos($q_poster, ']') !== false) | 366: if (strpos($q_poster, '[') !== false || strpos($q_poster, ']') !== false) |
365: { | 367: { |
366: if (strpos($q_poster, '\'') !== false) | 368: if (strpos($q_poster, '\'') !== false) |
367: $q_poster = '"'.$q_poster.'"'; | 369: $q_poster = '"'.$q_poster.'"'; |
368: else | 370: else |
369: $q_poster = '\''.$q_poster.'\''; | 371: $q_poster = '\''.$q_poster.'\''; |
370: } | 372: } |
| 373: else |
| 374: { |
| 375: // Get the characters at the start and end of $q_poster |
| 376: $ends = substr($q_poster, 0, 1).substr($q_poster, -1, 1); |
| 377: |
| 378: // Deal with quoting "Username" or 'Username' (becomes '"Username"' or "'Username'") |
| 379: if ($ends == '\'\'') |
| 380: $q_poster = '"'.$q_poster.'"'; |
| 381: else if ($ends == '""') |
| 382: $q_poster = '\''.$q_poster.'\''; |
| 383: } |
371: | 384: |
372: $quote = '[quote='.$q_poster.']'.$q_message.'[/quote]'."\n"; | 385: $quote = '[quote='.$q_poster.']'.$q_message.'[/quote]'."\n"; |
373: } | 386: } |
374: else | 387: else |
375: $quote = '> '.$q_poster.' '.$lang_post['wrote'].':'."\n\n".'> '.$q_message."\n"; | 388: $quote = '> '.$q_poster.' '.$lang_common['wrote'].':'."\n\n".'> '.$q_message."\n"; |
376: } | 389: } |
377: | 390: |
378: // We have to fetch the forum name in order to display Title / Forum / Topic | 391: // We have to fetch the forum name in order to display Title / Forum / Topic |
525: ?> | 538: ?> |
526: <tr> | 539: <tr> |
527: <td class="puncon1" style="width: 140px; vertical-align: top"><?php echo pun_htmlspecialchars($cur_post['poster']) ?></td> | 540: <td class="puncon1" style="width: 140px; vertical-align: top"><?php echo pun_htmlspecialchars($cur_post['poster']) ?></td> |
528: <td class="puncon2"><?php echo $cur_post['message'] ?></td> | 541: <td class="puncon2"><span class="puntext"><?php echo $cur_post['message'] ?></span></td> |
529: </tr> | 542: </tr> |
530: <?php | 543: <?php |
531: | 544: |