PunBB 1.2 to 1.2.14 changes Legend
Lines removed 
Lines changed
 Lines added

punbb-1.2/upload/admin_bans.php punbb-1.2.14/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
140:                                     </td>140:                                     </td>
141:                                 </tr>141:                                 </tr>
142:                             </table>142:                             </table>
143:                             <p class="topspace"><strong class="showhot">You should be very careful when banning an IP-range because of the possibility of multiple users matching the same partial IP.</strong></p>143:                             <p class="topspace"><strong class="warntext">You should be very careful when banning an IP-range because of the possibility of multiple users matching the same partial IP.</strong></p>
144:                         </div>144:                         </div>
145:                     </fieldset>145:                     </fieldset>
146:                 </div>146:                 </div>
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:     else248:     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 cache251:     // Regenerate the bans cache
250:     require_once PUN_ROOT.'include/cache.php';252:     require_once PUN_ROOT.'include/cache.php';


punbb-1.2/upload/admin_categories.php punbb-1.2.14/upload/admin_categories.php
123:                         </div>123:                         </div>
124:                     </fieldset>124:                     </fieldset>
125:                 </div>125:                 </div>
126:                 <p><input type="submit" name="del_cat_comply" value="Delete" />&nbsp;&nbsp;&nbsp;<a href="javascript:history.go(-1)" />Go back</a></p>126:                 <p><input type="submit" name="del_cat_comply" value="Delete" /><a href="javascript:history.go(-1)">Go back</a></p>
127:             </form>127:             </form>
128:         </div>128:         </div>
129:     </div>129:     </div>


punbb-1.2/upload/admin_censoring.php punbb-1.2.14/upload/admin_censoring.php
 57: { 57: {
 58:     confirm_referrer('admin_censoring.php'); 58:     confirm_referrer('admin_censoring.php');
 59:  59: 
 60:     $id = key($_POST['update']); 60:     $id = intval(key($_POST['update']));
 61:  61: 
 62:     $search_for = trim($_POST['search_for'][$id]); 62:     $search_for = trim($_POST['search_for'][$id]);
 63:     $replace_with = trim($_POST['replace_with'][$id]); 63:     $replace_with = trim($_POST['replace_with'][$id]);
 76: { 76: {
 77:     confirm_referrer('admin_censoring.php'); 77:     confirm_referrer('admin_censoring.php');
 78:  78: 
 79:     $id = key($_POST['remove']); 79:     $id = intval(key($_POST['remove']));
 80:  80: 
 81:     $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error()); 81:     $db->query('DELETE FROM '.$db->prefix.'censoring WHERE id='.$id) or error('Unable to delete censor word', __FILE__, __LINE__, $db->error());
 82:  82: 


punbb-1.2/upload/admin_forums.php punbb-1.2.14/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" />&nbsp;&nbsp;&nbsp;<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>
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 cache146:     // 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 old193:                 // 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']])
229: 229: 
230:     // Fetch forum info230:     // Fetch forum info
231:     $result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());231:     $result = $db->query('SELECT id, forum_name, forum_desc, redirect_url, num_topics, sort_by, cat_id FROM '.$db->prefix.'forums WHERE id='.$forum_id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error());
 232:     if (!$db->num_rows($result))
 233:         message($lang_common['Bad request']);
 234: 
232:     $cur_forum = $db->fetch_assoc($result);235:     $cur_forum = $db->fetch_assoc($result);
233: 236: 
234: 237: 


punbb-1.2/upload/admin_groups.php punbb-1.2.14/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';
180:                                     </td>183:                                     </td>
181:                                 </tr>184:                                 </tr>
182: <?php endif; ?><?php endif; ?>                            </table>185: <?php endif; ?><?php endif; ?>                            </table>
183: <?php if ($group['g_id'] == PUN_MOD ): ?>                            <p class="showhot">Please note that in order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user's profile.</p>186: <?php if ($group['g_id'] == PUN_MOD ): ?>                            <p class="warntext">Please note that in order for a user in this group to have moderator abilities, he/she must be assigned to moderate one or more forums. This is done via the user administration page of the user's profile.</p>
184: <?php endif; ?>                        </div>187: <?php endif; ?>                        </div>
185:                     </fieldset>188:                     </fieldset>
186:                 </div>189:                 </div>
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:     else244:     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 cache253:     // Regenerate the quickjump cache
245:     require_once PUN_ROOT.'include/cache.php';254:     require_once PUN_ROOT.'include/cache.php';
255:     confirm_referrer('admin_groups.php');264:     confirm_referrer('admin_groups.php');
256: 265: 
257:     $group_id = intval($_POST['default_group']);266:     $group_id = intval($_POST['default_group']);
258:     if ($group_id < 1)267:     if ($group_id < 4)
259:         message($lang_common['Bad request']);268:         message($lang_common['Bad request']);
260: 269: 
261:     $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/upload/admin_index.php punbb-1.2.14/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?
  70:     if (strpos(strtolower((string)@ini_get('disable_functions')), 'phpinfo') !== false)
  71:         message('The PHP function phpinfo() has been disabled on this server.');
  72: 
 69:     phpinfo(); 73:     phpinfo();
 70:     exit; 74:     exit;
 71: } 75: }
 72:  76: 
 73:  77: 
 74: // Get the server load averages (if possible) 78: // Get the server load averages (if possible)
 75: if (@file_exists('/proc/loadavg')) 79: if (@file_exists('/proc/loadavg') && is_readable('/proc/loadavg'))
 76: { 80: {
 77:     // We use @ just in case 81:     // We use @ just in case
 78:     $fh = @fopen('/proc/loadavg', 'r'); 82:     $fh = @fopen('/proc/loadavg', 'r');
 80:     @fclose($fh); 84:     @fclose($fh);
 81:  85: 
 82:     $load_averages = @explode(' ', $load_averages); 86:     $load_averages = @explode(' ', $load_averages);
 83:     $server_load = isset($load_averages[0]) ? $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';
 84: } 88: }
 85: 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))
 86:     $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3]; 90:     $server_load = $load_averages[1].' '.$load_averages[2].' '.$load_averages[3];
 87: else 91: else
 88:     $server_load = 'Not available'; 92:     $server_load = 'Not available';
 89:  93: 
 90:  94: 
 91: // Get number of current visitors 95: // Get number of current visitors
 92: $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());
 93: $num_online = $db->result($result); 97: $num_online = $db->result($result);
 94:  98: 
 95:  99: 


punbb-1.2/upload/admin_loader.php punbb-1.2.14/upload/admin_loader.php
 36:  36: 
 37:  37: 
 38: // The plugin to load should be supplied via GET 38: // The plugin to load should be supplied via GET
 39: $plugin = isset($_GET['plugin']) ? $_GET['plugin'] : null; 39: $plugin = isset($_GET['plugin']) ? $_GET['plugin'] : '';
 40: if (!$plugin) 40: if (!preg_match('/^AM?P_(\w*?)\.php$/i', $plugin))
 41:     message($lang_common['Bad request']); 41:     message($lang_common['Bad request']);
 42:  42: 
 43: // AP_ == Admins only, AMP_ == admins and moderators 43: // AP_ == Admins only, AMP_ == admins and moderators
 49: if (!file_exists(PUN_ROOT.'plugins/'.$plugin)) 49: if (!file_exists(PUN_ROOT.'plugins/'.$plugin))
 50:     message('There is no plugin called \''.$plugin.'\' in the plugin directory.'); 50:     message('There is no plugin called \''.$plugin.'\' in the plugin directory.');
 51:  51: 
  52: // Construct REQUEST_URI if it isn't set
  53: if (!isset($_SERVER['REQUEST_URI']))
  54:     $_SERVER['REQUEST_URI'] = (isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '').'?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '');
 52:  55: 
 53: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin; 56: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / '.$plugin;
 54: require PUN_ROOT.'header.php'; 57: require PUN_ROOT.'header.php';


punbb-1.2/upload/admin_maintenance.php punbb-1.2.14/upload/admin_maintenance.php
 60:         switch ($db_type) 60:         switch ($db_type)
 61:         { 61:         {
 62:             case 'mysql': 62:             case 'mysql':
  63:             case 'mysqli':
 63:                 $result = $db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $db->error()); 64:                 $result = $db->query('ALTER TABLE '.$db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $db->error());
 64:                 break; 65:                 break;
 65:  66: 
147:                     <fieldset>148:                     <fieldset>
148:                         <legend>Rebuild search index</legend>149:                         <legend>Rebuild search index</legend>
149:                         <div class="infldset">150:                         <div class="infldset">
150:                             <p>If you've added, edited or removed posts manually in the database or if you've switched language packs while there were posts in the database, you should rebuild the search index (to remove stopwords). For best performance you should put the forum in maintenance mode during rebuilding. <strong>Rebuilding the search index can take a long time and will increase server load during the rebuild process!</strong></p>151:                             <p>If you've added, edited or removed posts manually in the database or if you're having problems searching, you should rebuild the search index. For best performance you should put the forum in maintenance mode during rebuilding. <strong>Rebuilding the search index can take a long time and will increase server load during the rebuild process!</strong></p>
151:                             <table class="aligntop" cellspacing="0">152:                             <table class="aligntop" cellspacing="0">
152:                                 <tr>153:                                 <tr>
153:                                     <th scope="row">Topics per cycle</th>154:                                     <th scope="row">Topics per cycle</th>


punbb-1.2/upload/admin_options.php punbb-1.2.14/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']);
 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);
 69:  75: 
  76:     if ($form['additional_navlinks'] != '')
  77:         $form['additional_navlinks'] = trim(pun_linebreaks($form['additional_navlinks']));
  78: 
 70:     if ($form['announcement_message'] != '') 79:     if ($form['announcement_message'] != '')
 71:         $form['announcement_message'] = pun_linebreaks($form['announcement_message']); 80:         $form['announcement_message'] = pun_linebreaks($form['announcement_message']);
 72:     else 81:     else
114:     while (list($key, $input) = @each($form))123:     while (list($key, $input) = @each($form))
115:     {124:     {
116:         // Only update values that have changed125:         // Only update values that have changed
117:         if ($pun_config['o_'.$key] != $input)126:         if (array_key_exists('o_'.$key, $pun_config) && $pun_config['o_'.$key] != $input)
118:         {127:         {
119:             if ($input != '' || is_int($input))128:             if ($input != '' || is_int($input))
120:                 $value = '\''.$db->escape($input).'\'';129:                 $value = '\''.$db->escape($input).'\'';
121:             else130:             else
122:                 $value = 'NULL';131:                 $value = 'NULL';
123: 132: 
124:             $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());
125:         }134:         }
126:     }135:     }
127: 136: 
166:                                     </td>175:                                     </td>
167:                                 </tr>176:                                 </tr>
168:                                 <tr>177:                                 <tr>
 178:                                     <th scope="row">Base URL</th>
 179:                                     <td>
 180:                                         <input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" />
 181:                                         <span>The complete URL of the forum without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it's probably incorrect.</span>
 182:                                     </td>
 183:                                 </tr>
 184:                                 <tr>
169:                                     <th scope="row">Server timezone</th>185:                                     <th scope="row">Server timezone</th>
170:                                     <td>186:                                     <td>
171:                                         <select name="form[server_timezone]">187:                                         <select name="form[server_timezone]">
219:         $d = dir(PUN_ROOT.'lang');235:         $d = dir(PUN_ROOT.'lang');
220:         while (($entry = $d->read()) !== false)236:         while (($entry = $d->read()) !== false)
221:         {237:         {
222:             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'))
223:                 $languages[] = $entry;239:                 $languages[] = $entry;
224:         }240:         }
225:         $d->close();241:         $d->close();
226: 242: 
 243:         @natsort($languages);
 244: 
227:         while (list(, $temp) = @each($languages))245:         while (list(, $temp) = @each($languages))
228:         {246:         {
229:             if ($pun_config['o_default_lang'] == $temp)247:             if ($pun_config['o_default_lang'] == $temp)
252:         }270:         }
253:         $d->close();271:         $d->close();
254: 272: 
 273:         @natsort($styles);
 274: 
255:         while (list(, $temp) = @each($styles))275:         while (list(, $temp) = @each($styles))
256:         {276:         {
257:             if ($pun_config['o_default_style'] == $temp)277:             if ($pun_config['o_default_style'] == $temp)
264:                                         </select>284:                                         </select>
265:                                         <span>This is the default style used for guests and users who haven't changed from the default in their profile.</span></td>285:                                         <span>This is the default style used for guests and users who haven't changed from the default in their profile.</span></td>
266:                                 </tr>286:                                 </tr>
267:                                 <tr> 
268:                                     <th scope="row">Base URL</th> 
269:                                     <td> 
270:                                         <input type="text" name="form[base_url]" size="50" maxlength="100" value="<?php echo $pun_config['o_base_url'] ?>" /> 
271:                                         <span>The complete URL of the forum without trailing slash (i.e. http://www.mydomain.com/forums). This <strong>must</strong> be correct in order for all admin and moderator features to work. If you get "Bad referer" errors, it's probably incorrect.</span> 
272:                                     </td> 
273:                                 </tr> 
274:                             </table>287:                             </table>
275:                         </div>288:                         </div>
276:                     </fieldset>289:                     </fieldset>
457:                                     <td>470:                                     <td>
458:                                         <input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>471:                                         <input type="radio" name="form[search_all_forums]" value="1"<?php if ($pun_config['o_search_all_forums'] == '1') echo ' checked="checked"' ?> />&nbsp;<strong>Yes</strong>&nbsp;&nbsp;&nbsp;<input type="radio" name="form[search_all_forums]" value="0"<?php if ($pun_config['o_search_all_forums'] == '0') echo ' checked="checked"' ?> />&nbsp;<strong>No</strong>
459:                                         <span>When disabled, searches will only be allowed in one forum at a time. Disable if server load is high due to excessive searching.</span>472:                                         <span>When disabled, searches will only be allowed in one forum at a time. Disable if server load is high due to excessive searching.</span>
 473:                                     </td>
 474:                                 </tr>
 475:                                 <tr>
 476:                                     <th scope="row">Additional menu items</th>
 477:                                     <td>
 478:                                         <textarea name="form[additional_navlinks]" rows="3" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_additional_navlinks']) ?></textarea>
 479:                                         <span>By entering HTML hyperlinks into this textbox, any number of items can be added to the navigation menu at the top of all pages. The format for adding new links is X = &lt;a href="URL"&gt;LINK&lt;/a&gt; where X is the position at which the link should be inserted (e.g. 0 to insert at the beginning and 2 to insert after "User list"). Separate entries with a linebreak.</span>
460:                                     </td>480:                                     </td>
461:                                 </tr>481:                                 </tr>
462:                             </table>482:                             </table>


punbb-1.2/upload/admin_permissions.php punbb-1.2.14/upload/admin_permissions.php
 39: { 39: {
 40:     confirm_referrer('admin_permissions.php'); 40:     confirm_referrer('admin_permissions.php');
 41:  41: 
 42:     $form = array_map('trim', $_POST['form']); 42:     $form = array_map('intval', $_POST['form']);
 43:  
 44:     $form['sig_length'] = intval($form['sig_length']); 
 45:     $form['sig_lines'] = intval($form['sig_lines']); 
 46:  43: 
 47:     while (list($key, $input) = @each($form)) 44:     while (list($key, $input) = @each($form))
 48:     { 45:     {
 49:         // Only update values that have changed 46:         // Only update values that have changed
 50:         if ($pun_config['p_'.$key] != $input) 47:         if (array_key_exists('p_'.$key, $pun_config) && $pun_config['p_'.$key] != $input)
 51:         { 48:             $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$input.' WHERE conf_name=\'p_'.$db->escape($key).'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error());
 52:             if ($input != '' || is_int($input)) 
 53:                 $value = '\''.$db->escape($input).'\''; 
 54:             else 
 55:                 $value = 'NULL'; 
 56:  
 57:             $db->query('UPDATE '.$db->prefix.'config SET conf_value='.$value.' WHERE conf_name=\'p_'.$key.'\'') or error('Unable to update board config', __FILE__, __LINE__, $db->error()); 
 58:         } 
 59:     } 49:     }
 60:  50: 
 61:     // Regenerate the config cache 51:     // Regenerate the config cache


punbb-1.2/upload/admin_prune.php punbb-1.2.14/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:         }
 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" />&nbsp;&nbsp;&nbsp;<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/upload/admin_ranks.php punbb-1.2.14/upload/admin_ranks.php
 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]);
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/upload/admin_reports.php punbb-1.2.14/upload/admin_reports.php
 40: { 40: {
 41:     confirm_referrer('admin_reports.php'); 41:     confirm_referrer('admin_reports.php');
 42:  42: 
 43:     $zap_id = key($_POST['zap_id']); 43:     $zap_id = intval(key($_POST['zap_id']));
 44:  44: 
 45:     $result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error()); 45:     $result = $db->query('SELECT zapped FROM '.$db->prefix.'reports WHERE id='.$zap_id) or error('Unable to fetch report info', __FILE__, __LINE__, $db->error());
 46:     $zapped = $db->result($result); 46:     $zapped = $db->result($result);


punbb-1.2/upload/admin_users.php punbb-1.2.14/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: <?php104: <?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: <?php208: <?php
217: 217: 
218:     // trim() all elements in $form218:     // 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: <?php302: <?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))
309: 310: 
310:             // This script is a special case in that we want to display "Not verified" for non-verified users311:             // This script is a special case in that we want to display "Not verified" for non-verified users
311:             if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])312:             if (($user_data['g_id'] == '' || $user_data['g_id'] == PUN_UNVERIFIED) && $user_title != $lang_common['Banned'])
312:                 $user_title = '<span class="showhot">Not verified</span>';313:                 $user_title = '<span class="warntext">Not verified</span>';
313: 314: 
314:             $actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';315:             $actions = '<a href="admin_users.php?ip_stats='.$user_data['id'].'">View IP stats</a> - <a href="search.php?action=show_user&amp;user_id='.$user_data['id'].'">Show posts</a>';
315: 316: 
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: <?php345: <?php


punbb-1.2/upload/delete.php punbb-1.2.14/upload/delete.php
109:         <form method="post" action="delete.php?id=<?php echo $id ?>">109:         <form method="post" action="delete.php?id=<?php echo $id ?>">
110:             <div class="inform">110:             <div class="inform">
111:                 <fieldset>111:                 <fieldset>
112:                     <legend class="showhot"><?php echo $lang_delete['Warning'] ?></legend>112:                     <legend class="warntext"><?php echo $lang_delete['Warning'] ?></legend>
113:                     <div class="infldset">113:                     <div class="infldset">
114:                         <div class="postmsg">114:                         <div class="postmsg">
115:                             <p><?php echo $lang_common['Author'] ?>: <strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></p>115:                             <p><?php echo $lang_common['Author'] ?>: <strong><?php echo pun_htmlspecialchars($cur_post['poster']) ?></strong></p>


punbb-1.2/upload/edit.php punbb-1.2.14/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/upload/extern.php punbb-1.2.14/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 variables119: // 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_runtime122: // 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 connect129: // 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 config132: // 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 forums141: // 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/upload/footer.php punbb-1.2.14/upload/footer.php
140: 140: 
141: 141: 
142: // START SUBST - <pun_include "*">142: // START SUBST - <pun_include "*">
143: while (preg_match('<pun_include "(.*?)">', $tpl_main, $cur_include))143: while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_main, $cur_include))
144: {144: {
 145:     if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 146:         error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template main.tpl. There is no such file in folder /include/user/');
 147: 
145:     ob_start();148:     ob_start();
146:     include PUN_ROOT.$cur_include[1];149:     include PUN_ROOT.'include/user/'.$cur_include[1];
147:     $tpl_temp = ob_get_contents();150:     $tpl_temp = ob_get_contents();
148:     $tpl_main = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_main);151:     $tpl_main = str_replace($cur_include[0], $tpl_temp, $tpl_main);
149:     ob_end_clean();152:     ob_end_clean();
150: }153: }
151: // END SUBST - <pun_include "*">154: // END SUBST - <pun_include "*">


punbb-1.2/upload/header.php punbb-1.2.14/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: 
114: 111: 
115: }112: }
116: 113: 
 114: $user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
 115: if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') === false)
 116:     echo '<script type="text/javascript" src="style/imports/minmax.js"></script>';
 117: 
117: $tpl_temp = trim(ob_get_contents());118: $tpl_temp = trim(ob_get_contents());
118: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);119: $tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);
119: ob_end_clean();120: ob_end_clean();
123: // START SUBST - <body>124: // START SUBST - <body>
124: if (isset($focus_element))125: if (isset($focus_element))
125: {126: {
126:     $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);127:     $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
127:     $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);128:     $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
128: }129: }
129: // END SUBST - <body>130: // END SUBST - <body>
130: 131: 
131: 132: 
132: // START SUBST - <pun_page>133: // START SUBST - <pun_page>
133: $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);
134: // END SUBST - <pun_title>135: // END SUBST - <pun_title>
135: 136: 
136: 137: 
154:     $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';155:     $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged in'].'</p>'."\n\t\t".'</div>';
155: else156: else
156: {157: {
157:     $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p class="conl">'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong><br />'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']);158:     $tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].' <strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].': '.format_time($pun_user['last_visit']).'</li>';
158: 159: 
159:     if ($pun_user['g_id'] < PUN_GUEST)160:     if ($pun_user['g_id'] < PUN_GUEST)
160:     {161:     {
161:         $result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());162:         $result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
162: 163: 
163:         if ($db->result($result_header))164:         if ($db->result($result_header))
164:             $tpl_temp .= '<br /><strong><a href="admin_reports.php">There are new reports</a></strong>';165:             $tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new reports</a></strong></li>';
165: 166: 
166:         if ($pun_config['o_maintenance'] == '1')167:         if ($pun_config['o_maintenance'] == '1')
167:             $tpl_temp .= '<br /><strong><a class="showhot" href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong>';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>';
168:     }169:     }
169: 170: 
170:     if (basename($_SERVER['PHP_SELF']) == 'index.php')171:     if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
171:         $tpl_temp .= '</p>'."\n\t\t\t".'<p class="conr"><a href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a><br /><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>';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>';
172:     else if ($_SERVER['QUERY_STRING'] == 'action=show_new') 
173:         $tpl_temp .= '</p>'."\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>'; 
174:     else173:     else
175:         $tpl_temp .= '</p>'."\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>';
176: }175: }
177: 176: 
178: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);177: $tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);


punbb-1.2/upload/help.php punbb-1.2.14/upload/help.php
 37: // Load the help.php language file 37: // Load the help.php language file
 38: require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php'; 38: require PUN_ROOT.'lang/'.$pun_user['language'].'/help.php';
 39:  39: 
 40: // Determine what style to use (for the [img] example) 
 41: if ($pun_user['style'] != '' && @file_exists(PUN_ROOT.'style/'.$pun_user['style'].'.css')) 
 42:     $img_url = $pun_config['o_base_url'].'/img/'.$pun_user['style'].'_new.png'; 
 43: else 
 44:     $img_url = $pun_config['o_base_url'].'/img/'.$pun_config['o_default_style'].'_new.png'; 
 45:  
 46:  40: 
 47: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help']; 41: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_help['Help'];
 48: require PUN_ROOT.'header.php'; 42: require PUN_ROOT.'header.php';
 76:         [email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br /> 70:         [email=myname@mydomain.com]<?php echo $lang_help['My e-mail address'] ?>[/email] <?php echo $lang_help['produces'] ?> <a href="mailto:myname@mydomain.com"><?php echo $lang_help['My e-mail address'] ?></a><br /><br />
 77:     </div> 71:     </div>
 78:     <p><a name="img"></a><?php echo $lang_help['Images info'] ?></p> 72:     <p><a name="img"></a><?php echo $lang_help['Images info'] ?></p>
 79:     <div>[img]<?php echo $img_url ?>[/img] <?php echo $lang_help['produces'] ?> <img src="<?php echo $img_url ?>"   alt="" /></div> 73:     <div>[img]http://www.punbb.org/img/small_logo.png[/img] <?php echo $lang_help['produces'] ?> <img src="http://www.punbb.org/img/small_logo.png" alt="http://www.punbb.org/img/small_logo.png" /></div>
 80: </div> 74: </div>
 81: <h2><?php echo $lang_help['Quotes'] ?></h2> 75: <h2><?php echo $lang_help['Quotes'] ?></h2>
 82: <div class="box"> 76: <div class="box">
 92:         &nbsp;&nbsp;&nbsp;&nbsp;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br /> 86:         &nbsp;&nbsp;&nbsp;&nbsp;[quote]<?php echo $lang_help['Quote text'] ?>[/quote]<br /><br />
 93:         <?php echo $lang_help['produces quote box'] ?><br /><br /> 87:         <?php echo $lang_help['produces quote box'] ?><br /><br />
 94:         <div class="postmsg"> 88:         <div class="postmsg">
 95:             <blockquote><div class="incqbox"></h4><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote> 89:             <blockquote><div class="incqbox"><p><?php echo $lang_help['Quote text'] ?></p></div></blockquote>
 96:         </div> 90:         </div>
 97:     </div> 91:     </div>
 98: </div> 92: </div>
141:     for ($next = $i + 1; $next < $num_smilies; ++$next)135:     for ($next = $i + 1; $next < $num_smilies; ++$next)
142:     {136:     {
143:         // Did we find a dupe?137:         // Did we find a dupe?
144:         if ($smiley_img[$i] == $smiley_img[$next])138:         if (isset($smiley_img[$next]) && $smiley_img[$i] == $smiley_img[$next])
145:         {139:         {
146:             echo ' '.$lang_common['and'].' '.$smiley_text[$next];140:             echo ' '.$lang_common['and'].' '.$smiley_text[$next];
147: 141: 


punbb-1.2/upload/include/cache.php punbb-1.2.14/upload/include/cache.php
129:     global $db;129:     global $db;
130: 130: 
131:     // Get the rank list from the DB131:     // Get the rank list from the DB
132:     $result = $db->query('SELECT * FROM '.$db->prefix.'ranks', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());132:     $result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());
133: 133: 
134:     $output = array();134:     $output = array();
135:     while ($cur_rank = $db->fetch_assoc($result))135:     while ($cur_rank = $db->fetch_assoc($result))
136:         $output[] = $cur_rank;136:         $output[] = $cur_rank;
137: 137: 
138:     // Output ban list as PHP code138:     // Output ranks list as PHP code
139:     $fh = @fopen(PUN_ROOT.'cache/cache_ranks.php', 'wb');139:     $fh = @fopen(PUN_ROOT.'cache/cache_ranks.php', 'wb');
140:     if (!$fh)140:     if (!$fh)
141:         error('Unable to write ranks cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);141:         error('Unable to write ranks cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
174:         if (!$fh)174:         if (!$fh)
175:             error('Unable to write quickjump cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);175:             error('Unable to write quickjump cache file to cache directory. Please make sure PHP has write access to the directory \'cache\'', __FILE__, __LINE__);
176: 176: 
177:         $output = '<?php'."\n\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';177:         $output = '<?php'."\n\n".'if (!defined(\'PUN\')) exit;'."\n".'define(\'PUN_QJ_LOADED\', 1);'."\n\n".'?>';
178:         $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";178:         $output .= "\t\t\t\t".'<form id="qjump" method="get" action="viewforum.php">'."\n\t\t\t\t\t".'<div><label><?php echo $lang_common[\'Jump to\'] ?>'."\n\n\t\t\t\t\t".'<br /><select name="id" onchange="window.location=(\'viewforum.php?id=\'+this.options[this.selectedIndex].value)">'."\n";
179: 179: 
180: 180: 


punbb-1.2/upload/include/common.php punbb-1.2.14/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 file123: // 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 message128: // 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/upload/include/dblayer/common_db.php punbb-1.2.14/upload/include/dblayer/common_db.php
 23: ************************************************************************/ 23: ************************************************************************/
 24:  24: 
 25:  25: 
  26: // Make sure no one attempts to run this script "directly"
  27: if (!defined('PUN'))
  28:     exit;
  29: 
  30: 
 26: // 31: //
 27: // Return current timestamp (with microseconds) as a float (used in dblayer) 32: // Return current timestamp (with microseconds) as a float (used in dblayer)
 28: // 33: //


punbb-1.2/upload/include/dblayer/pgsql.php punbb-1.2.14/upload/include/dblayer/pgsql.php
167:     }167:     }
168: 168: 
169: 169: 
170:     function affected_rows($query_id = 0)170:     function affected_rows()
171:     {171:     {
172:         return ($query_id) ? @pg_affected_rows($query_id) : false;172:         return ($this->query_result) ? @pg_affected_rows($this->query_result) : false;
173:     }173:     }
174: 174: 
175: 175: 


punbb-1.2/upload/include/dblayer/sqlite.php punbb-1.2.14/upload/include/dblayer/sqlite.php
187:     }187:     }
188: 188: 
189: 189: 
190:     function affected_rows($query_id = 0)190:     function affected_rows()
191:     {191:     {
192:         return ($query_id) ? @sqlite_changes($query_id) : false;192:         return ($this->query_result) ? @sqlite_changes($this->query_result) : false;
193:     }193:     }
194: 194: 
195: 195: 


punbb-1.2/upload/include/email.php punbb-1.2.14/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/upload/include/functions.php punbb-1.2.14/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 user109:     // 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 list116:     // Update online list
135:     // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)138:     // Enable sending of a P3P header by removing // from the following line (try this if login is failing in IE6)
136: //    @header('P3P: CP="CUR ADM"');139: //    @header('P3P: CP="CUR ADM"');
137: 140: 
138:     setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure);141:     if (version_compare(PHP_VERSION, '5.2.0', '>='))
 142:         setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
 143:     else
 144:         setcookie($cookie_name, serialize(array($user_id, md5($cookie_seed.$password_hash))), $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
139: }145: }
140: 146: 
141: 147: 
165:         }171:         }
166: 172: 
167:         if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))173:         if ($cur_ban['username'] != '' && !strcasecmp($pun_user['username'], $cur_ban['username']))
 174:         {
 175:             $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);176:             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);
 177:         }
169: 178: 
170:         if ($cur_ban['ip'] != '')179:         if ($cur_ban['ip'] != '')
171:         {180:         {
176:                 $cur_ban_ips[$i] = $cur_ban_ips[$i].'.';185:                 $cur_ban_ips[$i] = $cur_ban_ips[$i].'.';
177: 186: 
178:                 if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])187:                 if (substr($user_ip, 0, strlen($cur_ban_ips[$i])) == $cur_ban_ips[$i])
 188:                 {
 189:                     $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());
179:                     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);190:                     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);
 191:                 }
180:             }192:             }
181:         }193:         }
182:     }194:     }
200:     $now = time();212:     $now = time();
201: 213: 
202:     // Fetch all online list entries that are older than "o_timeout_online"214:     // Fetch all online list entries that are older than "o_timeout_online"
203:     $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());215:     $result = $db->query('SELECT * FROM '.$db->prefix.'online WHERE logged<'.($now-$pun_config['o_timeout_online'])) or error('Unable to fetch old entries from online list', __FILE__, __LINE__, $db->error());
204:     while ($cur_user = $db->fetch_assoc($result))216:     while ($cur_user = $db->fetch_assoc($result))
205:     {217:     {
206:         // If the entry is a guest, delete it218:         // If the entry is a guest, delete it
229:     global $pun_config, $lang_common, $pun_user;241:     global $pun_config, $lang_common, $pun_user;
230: 242: 
231:     // Index and Userlist should always be displayed243:     // Index and Userlist should always be displayed
232:     $links[] = '<li><a href="index.php">'.$lang_common['Index'].'</a>';244:     $links[] = '<li id="navindex"><a href="index.php">'.$lang_common['Index'].'</a>';
233:     $links[] = '<li><a href="userlist.php">'.$lang_common['User list'].'</a>';245:     $links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';
234: 246: 
235:     if ($pun_config['o_rules'] == '1')247:     if ($pun_config['o_rules'] == '1')
236:         $links[] = '<li><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';248:         $links[] = '<li id="navrules"><a href="misc.php?action=rules">'.$lang_common['Rules'].'</a>';
237: 249: 
238:     if ($pun_user['is_guest'])250:     if ($pun_user['is_guest'])
239:     {251:     {
240:         if ($pun_user['g_search'] == '1')252:         if ($pun_user['g_search'] == '1')
241:             $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>';253:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
242: 254: 
243:         $links[] = '<li><a href="register.php">'.$lang_common['Register'].'</a>'.$lang_common['Link separator'].'</li><li><a href="login.php">'.$lang_common['Login'].'</a>';255:         $links[] = '<li id="navregister"><a href="register.php">'.$lang_common['Register'].'</a>';
 256:         $links[] = '<li id="navlogin"><a href="login.php">'.$lang_common['Login'].'</a>';
244: 257: 
245:         $info = $lang_common['Not logged in'];258:         $info = $lang_common['Not logged in'];
246:     }259:     }
249:         if ($pun_user['g_id'] > PUN_MOD)262:         if ($pun_user['g_id'] > PUN_MOD)
250:         {263:         {
251:             if ($pun_user['g_search'] == '1')264:             if ($pun_user['g_search'] == '1')
252:                 $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>';265:                 $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
253: 266: 
254:             $links[] = '<li><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';267:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
255:             $links[] = '<li><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';268:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
256:         }269:         }
257:         else270:         else
258:         {271:         {
259:             $links[] = '<li><a href="search.php">'.$lang_common['Search'].'</a>';272:             $links[] = '<li id="navsearch"><a href="search.php">'.$lang_common['Search'].'</a>';
260:             $links[] = '<li><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';273:             $links[] = '<li id="navprofile"><a href="profile.php?id='.$pun_user['id'].'">'.$lang_common['Profile'].'</a>';
261:             $links[] = '<li><a href="admin_index.php">'.$lang_common['Admin'].'</a>';274:             $links[] = '<li id="navadmin"><a href="admin_index.php">'.$lang_common['Admin'].'</a>';
262:             $links[] = '<li><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';275:             $links[] = '<li id="navlogout"><a href="login.php?action=out&amp;id='.$pun_user['id'].'">'.$lang_common['Logout'].'</a>';
 276:         }
 277:     }
 278: 
 279:     // Are there any additional navlinks we should insert into the array before imploding it?
 280:     if ($pun_config['o_additional_navlinks'] != '')
 281:     {
 282:         if (preg_match_all('#([0-9]+)\s*=\s*(.*?)\n#s', $pun_config['o_additional_navlinks']."\n", $extra_links))
 283:         {
 284:             // Insert any additional links into the $links array (at the correct index)
 285:             for ($i = 0; $i < count($extra_links[1]); ++$i)
 286:                 array_splice($links, $extra_links[1][$i], 0, array('<li id="navextra'.($i + 1).'">'.$extra_links[2][$i]));
263:         }287:         }
264:     }288:     }
265: 289: 
266:     return '<ul>'.implode($lang_common['Link separator'].'</li>', $links).'</li></ul>';290:     return '<ul>'."\n\t\t\t\t".implode($lang_common['Link separator'].'</li>'."\n\t\t\t\t", $links).'</li>'."\n\t\t\t".'</ul>';
267: }291: }
268: 292: 
269: 293: 
660: //684: //
661: function get_remote_address()685: function get_remote_address()
662: {686: {
663:     $remote_address = $_SERVER['REMOTE_ADDR'];687:     return $_SERVER['REMOTE_ADDR'];
664:  
665:     // If HTTP_X_FORWARDED_FOR is set, we try to grab the first non-LAN IP 
666:     if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) 
667:     { 
668:         if (preg_match_all('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $_SERVER['HTTP_X_FORWARDED_FOR'], $address_list)) 
669:         { 
670:             $lan_ips = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.((1[6-9])|(2[0-9])|(3[0-1]))\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/'); 
671:             $address_list = preg_replace($lan_ips, null, $address_list[0]); 
672:  
673:             while (list(, $cur_address) = each($address_list)) 
674:             { 
675:                 if ($cur_address) 
676:                 { 
677:                     $remote_address = $cur_address; 
678:                     break; 
679:                 } 
680:             } 
681:         } 
682:     } 
683:  
684:     return $remote_address; 
685: }688: }
686: 689: 
687: 690: 
720: //723: //
721: function pun_trim($str)724: function pun_trim($str)
722: {725: {
723:     $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA), '&nbsp;');726:     global $lang_common;
724: 727: 
725:     return trim(str_replace($fishy_chars, ' ', $str));728:     if (strpos($lang_common['lang_encoding'], '8859') !== false)
 729:     {
 730:         $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0));
 731:         return trim(str_replace($fishy_chars, ' ', $str));
 732:     }
 733:     else
 734:         return trim($str);
726: }735: }
727: 736: 
728: 737: 
782: 791: 
783: 792: 
784:     // START SUBST - <pun_include "*">793:     // START SUBST - <pun_include "*">
785:     while (preg_match('<pun_include "(.*?)">', $tpl_maint, $cur_include))794:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_maint, $cur_include))
786:     {795:     {
 796:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 797:             error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template maintenance.tpl. There is no such file in folder /include/user/');
 798: 
787:         ob_start();799:         ob_start();
788:         include PUN_ROOT.$cur_include[1];800:         include PUN_ROOT.'include/user/'.$cur_include[1];
789:         $tpl_temp = ob_get_contents();801:         $tpl_temp = ob_get_contents();
790:         $tpl_maint = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_maint);802:         $tpl_maint = str_replace($cur_include[0], $tpl_temp, $tpl_maint);
791:         ob_end_clean();803:         ob_end_clean();
792:     }804:     }
793:     // END SUBST - <pun_include "*">805:     // END SUBST - <pun_include "*">
812: 824: 
813:     // If the delay is 0 seconds, we might as well skip the redirect all together825:     // If the delay is 0 seconds, we might as well skip the redirect all together
814:     if ($pun_config['o_redirect_delay'] == '0')826:     if ($pun_config['o_redirect_delay'] == '0')
815:         header('Location: '.$destination_url);827:         header('Location: '.str_replace('&amp;', '&', $destination_url));
816: 828: 
817: 829: 
818:     // Load the redirect template830:     // Load the redirect template
833:     ob_start();845:     ob_start();
834: 846: 
835: ?>847: ?>
836: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo $destination_url ?>" />848: <meta http-equiv="refresh" content="<?php echo $pun_config['o_redirect_delay'] ?>;URL=<?php echo str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $destination_url) ?>" />
837: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>849: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Redirecting'] ?></title>
838: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />850: <link rel="stylesheet" type="text/css" href="style/<?php echo $pun_user['style'].'.css' ?>" />
839: <?php851: <?php
872: 884: 
873: 885: 
874:     // START SUBST - <pun_include "*">886:     // START SUBST - <pun_include "*">
875:     while (preg_match('<pun_include "(.*?)">', $tpl_redir, $cur_include))887:     while (preg_match('#<pun_include "([^/\\\\]*?)">#', $tpl_redir, $cur_include))
876:     {888:     {
 889:         if (!file_exists(PUN_ROOT.'include/user/'.$cur_include[1]))
 890:             error('Unable to process user include &lt;pun_include "'.htmlspecialchars($cur_include[1]).'"&gt; from template redirect.tpl. There is no such file in folder /include/user/');
 891: 
877:         ob_start();892:         ob_start();
878:         include PUN_ROOT.$cur_include[1];893:         include PUN_ROOT.'include/user/'.$cur_include[1];
879:         $tpl_temp = ob_get_contents();894:         $tpl_temp = ob_get_contents();
880:         $tpl_redir = str_replace('<'.$cur_include[0].'>', $tpl_temp, $tpl_redir);895:         $tpl_redir = str_replace($cur_include[0], $tpl_temp, $tpl_redir);
881:         ob_end_clean();896:         ob_end_clean();
882:     }897:     }
883:     // END SUBST - <pun_include "*">898:     // END SUBST - <pun_include "*">
916: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title>931: <title><?php echo pun_htmlspecialchars($pun_config['o_board_title']) ?> / Error</title>
917: <style type="text/css">932: <style type="text/css">
918: <!--933: <!--
919: BODY {margin: 20px 20%; font: 10px Verdana, Arial, Helvetica, sans-serif;}934: BODY {MARGIN: 10% 20% auto 20%; font: 10px Verdana, Arial, Helvetica, sans-serif}
920: #errorbox {border: 1px solid #000;}935: #errorbox {BORDER: 1px solid #B84623}
921: H2 {margin: 0; color: #FFFFFF; background-color: #D25028; font-size: 1.1em; padding: 5px 4px; border-bottom: 1px solid #000;}936: H2 {MARGIN: 0; COLOR: #FFFFFF; BACKGROUND-COLOR: #B84623; FONT-SIZE: 1.1em; PADDING: 5px 4px}
922: #errorbox DIV {padding: 6px 5px; background-color: #dedfdf}937: #errorbox DIV {PADDING: 6px 5px; BACKGROUND-COLOR: #F1F1F1}
923: -->938: -->
924: </style>939: </style>
925: </head>940: </head>
926: <body>941: <body>
927:     <div id="errorbox">942: 
928:         <h2>An error was encountered</h2>943: <div id="errorbox">
929:         <div>944:     <h2>An error was encountered</h2>
 945:     <div>
930: <?php946: <?php
931: 947: 
932:     if (defined('PUN_DEBUG'))948:     if (defined('PUN_DEBUG'))
933:     {949:     {
934:         echo "\t\t\t".'<strong>File:</strong> '.$file.'<br />'."\n\t\t\t".'<strong>Line:</strong> '.$line.'<br /><br />'."\n\t\t\t".'<strong>PunBB reported</strong>: '.$message."\n";950:         echo "\t\t".'<strong>File:</strong> '.$file.'<br />'."\n\t\t".'<strong>Line:</strong> '.$line.'<br /><br />'."\n\t\t".'<strong>PunBB reported</strong>: '.$message."\n";
935: 951: 
936:         if ($db_error)952:         if ($db_error)
937:         {953:         {
938:             echo "\t\t\t".'<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n";954:             echo "\t\t".'<br /><br /><strong>Database reported:</strong> '.pun_htmlspecialchars($db_error['error_msg']).(($db_error['error_no']) ? ' (Errno: '.$db_error['error_no'].')' : '')."\n";
939: 955: 
940:             if ($db_error['error_sql'] != '')956:             if ($db_error['error_sql'] != '')
941:                 echo "\t\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n";957:                 echo "\t\t".'<br /><br /><strong>Failed query:</strong> '.pun_htmlspecialchars($db_error['error_sql'])."\n";
942:         }958:         }
943:     }959:     }
944:     else960:     else
945:         echo "\t\t\t".'Error: <strong>'.$message.'.</strong>'."\n";961:         echo "\t\t".'Error: <strong>'.$message.'.</strong>'."\n";
946: 962: 
947: ?>963: ?>
948:         </div> 
949:     </div>964:     </div>
 965: </div>
 966: 
950: </body>967: </body>
951: </html>968: </html>
952: <?php969: <?php
1011: </div>1028: </div>
1012: <?php1029: <?php
1013: 1030: 
 1031: }
 1032: 
 1033: 
 1034: //
 1035: // Unset any variables instantiated as a result of register_globals being enabled
 1036: //
 1037: function unregister_globals()
 1038: {
 1039:     // Prevent script.php?GLOBALS[foo]=bar
 1040:     if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS']))
 1041:         exit('I\'ll have a steak sandwich and... a steak sandwich.');
 1042:     
 1043:     // Variables that shouldn't be unset
 1044:     $no_unset = array('GLOBALS', '_GET', '_POST', '_COOKIE', '_REQUEST', '_SERVER', '_ENV', '_FILES');
 1045: 
 1046:     // Remove elements in $GLOBALS that are present in any of the superglobals
 1047:     $input = array_merge($_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset($_SESSION) && is_array($_SESSION) ? $_SESSION : array());
 1048:     foreach ($input as $k => $v)
 1049:     {
 1050:         if (!in_array($k, $no_unset) && isset($GLOBALS[$k]))
 1051:         {
 1052:             unset($GLOBALS[$k]);
 1053:             unset($GLOBALS[$k]);    // Double unset to circumvent the zend_hash_del_key_or_index hole in PHP <4.4.3 and <5.1.4
 1054:         }
 1055:     }
1014: }1056: }
1015: 1057: 
1016: 1058: 


punbb-1.2/upload/include/parser.php punbb-1.2.14/upload/include/parser.php
 45:     $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]'); 45:     $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
 46:     $text = str_replace($a, $b, $text); 46:     $text = str_replace($a, $b, $text);
 47:  47: 
 48:     // Do the more complex BBCodes (and strip excessive whitespace) 48:     // Do the more complex BBCodes (also strip excessive whitespace and useless quotes)
 49:     $a = array( '#\[url=(.*?)\]\s*#i', 49:     $a = array( '#\[url=("|\'|)(.*?)\\1\]\s*#i',
 50:                 '#\[url\]\s*#i', 50:                 '#\[url\]\s*#i',
 51:                 '#\s*\[/url\]#i', 51:                 '#\s*\[/url\]#i',
 52:                 '#\[email=(.*?)\]\s*#i', 52:                 '#\[email=("|\'|)(.*?)\\1\]\s*#i',
 53:                 '#\[email\]\s*#i', 53:                 '#\[email\]\s*#i',
 54:                 '#\s*\[/email\]#i', 54:                 '#\s*\[/email\]#i',
 55:                 '#\[img\]\s*(.*?)\s*\[/img\]#is', 55:                 '#\[img\]\s*(.*?)\s*\[/img\]#is',
 56:                 '#\[colou?r=(.*?)\](.*?)\[/colou?r\]#is'); 56:                 '#\[colou?r=("|\'|)(.*?)\\1\](.*?)\[/colou?r\]#is');
 57:  57: 
 58:     $b = array(    '[url=$1]', 58:     $b = array(    '[url=$2]',
 59:                 '[url]', 59:                 '[url]',
 60:                 '[/url]', 60:                 '[/url]',
 61:                 '[email=$1]', 61:                 '[email=$2]',
 62:                 '[email]', 62:                 '[email]',
 63:                 '[/email]', 63:                 '[/email]',
 64:                 '[img]$1[/img]', 64:                 '[img]$1[/img]',
 65:                 '[color=$1]$2[/color]'); 65:                 '[color=$2]$3[/color]');
 66:  66: 
 67:     if (!$is_signature) 67:     if (!$is_signature)
 68:     { 68:     {
 69:         // For non-signatures, we have to do the quote and code tags as well 69:         // For non-signatures, we have to do the quote and code tags as well
 70:         $a[] = '#\[quote=(&quot;|"|\'|)(.{2,25})\\1\]\s*#i'; 70:         $a[] = '#\[quote=(&quot;|"|\'|)(.*?)\\1\]\s*#i';
 71:         $a[] = '#\[quote\]\s*#i'; 71:         $a[] = '#\[quote\]\s*#i';
 72:         $a[] = '#\s*\[/quote\]\s*#i'; 72:         $a[] = '#\s*\[/quote\]\s*#i';
 73:         $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is'; 73:         $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';
126:         $q_end = strpos($text, '[/quote]');126:         $q_end = strpos($text, '[/quote]');
127: 127: 
128:         // Look for [quote=username] style quote tags128:         // Look for [quote=username] style quote tags
129:         if (preg_match('#\[quote=(&quot;|"|\'|)(.{2,25})\\1\]#sU', $text, $matches))129:         if (preg_match('#\[quote=(&quot;|"|\'|)(.*)\\1\]#sU', $text, $matches))
130:             $q2_start = strpos($text, $matches[0]);130:             $q2_start = strpos($text, $matches[0]);
131:         else131:         else
132:             $q2_start = 65536;132:             $q2_start = 65536;
182:         // We found a [code]182:         // We found a [code]
183:         else if ($c_start < min($c_end, $q_start, $q_end))183:         else if ($c_start < min($c_end, $q_start, $q_end))
184:         {184:         {
 185:             // Make sure there's a [/code] and that any new [code] doesn't occur before the end tag
185:             $tmp = strpos($text, '[/code]');186:             $tmp = strpos($text, '[/code]');
186:             if ($tmp === false)187:             $tmp2 = strpos(substr($text, $c_start+6), '[code]');
 188:             if ($tmp2 !== false)
 189:                 $tmp2 += $c_start+6;
 190: 
 191:             if ($tmp === false || ($tmp2 !== false && $tmp2 < $tmp))
187:             {192:             {
188:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];193:                 $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
189:                 return;194:                 return;
259: {264: {
260:     global $pun_user;265:     global $pun_user;
261: 266: 
262:     $full_url = str_replace(' ', '%20', $url);267:     $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
263:     if (strpos($url, 'www.') === 0)            // If it starts with www, we add http://268:     if (strpos($url, 'www.') === 0)            // If it starts with www, we add http://
264:         $full_url = 'http://'.$full_url;269:         $full_url = 'http://'.$full_url;
265:     else if (strpos($url, 'ftp.') === 0)    // Else if it starts with ftp, we add ftp://270:     else if (strpos($url, 'ftp.') === 0)    // Else if it starts with ftp, we add ftp://
280: function handle_img_tag($url, $is_signature = false)285: function handle_img_tag($url, $is_signature = false)
281: {286: {
282:     global $lang_common, $pun_config, $pun_user;287:     global $lang_common, $pun_config, $pun_user;
283:  
284:     $img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>'; 
285: 288: 
286:     if ($is_signature && $pun_user['show_img_sig'] != '0')289:     $img_tag = '<a href="'.$url.'">&lt;'.$lang_common['Image link'].'&gt;</a>';
287:         $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';290: 
288:     else if (!$is_signature && $pun_user['show_img'] != '0')291:     if ($is_signature && $pun_user['show_img_sig'] != '0')
289:         $img_tag = '</p><div class="imgbox"><div class="scrollbox"><img src="'.$url.'" alt="'.htmlspecialchars($url).'" /></div></div><p>';292:         $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
290: 293:     else if (!$is_signature && $pun_user['show_img'] != '0')
291:     return $img_tag;294:         $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
 295: 
 296:     return $img_tag;
292: }297: }
293: 298: 
294: 299: 
299: {304: {
300:     global $lang_common, $pun_user;305:     global $lang_common, $pun_user;
301: 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=(&quot;|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(array(\'[\', \'\\"\'), array(\'&#91;\', \'"\'), \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
 311:         $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
 312:     }
 313: 
302:     $pattern = array('#\[b\](.*?)\[/b\]#s',314:     $pattern = array('#\[b\](.*?)\[/b\]#s',
303:                      '#\[i\](.*?)\[/i\]#s',315:                      '#\[i\](.*?)\[/i\]#s',
304:                      '#\[u\](.*?)\[/u\]#s',316:                      '#\[u\](.*?)\[/u\]#s',
305:                      '#\[url\](.*?)\[/url\]#e',317:                      '#\[url\]([^\[]*?)\[/url\]#e',
306:                      '#\[url=(.*?)\](.*?)\[/url\]#e',318:                      '#\[url=([^\[]*?)\](.*?)\[/url\]#e',
307:                      '#\[email\](.*?)\[/email\]#',319:                      '#\[email\]([^\[]*?)\[/email\]#',
308:                      '#\[email=(.*?)\](.*?)\[/email\]#',320:                      '#\[email=([^\[]*?)\](.*?)\[/email\]#',
309:                      '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');321:                      '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');
310: 322: 
311:     $replace = array('<strong>$1</strong>',323:     $replace = array('<strong>$1</strong>',
319: 331: 
320:     // This thing takes a while! :)332:     // This thing takes a while! :)
321:     $text = preg_replace($pattern, $replace, $text);333:     $text = preg_replace($pattern, $replace, $text);
322:  
323:     if (strpos($text, 'quote') !== false) 
324:     { 
325:         $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text); 
326:         $text = preg_replace('#\[quote=(&quot;|"|\'|)(.{2,25})\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'&#91;\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text); 
327:         $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text); 
328:     } 
329: 334: 
330:     return $text;335:     return $text;
331: }336: }


punbb-1.2/upload/include/search_idx.php punbb-1.2.14/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);
 69:     { 69:     {
 70:         while (list($i, $word) = @each($words)) 70:         while (list($i, $word) = @each($words))
 71:         { 71:         {
  72:             $words[$i] = trim($word, '.');
 72:             $num_chars = pun_strlen($word); 73:             $num_chars = pun_strlen($word);
 73:  74: 
 74:             if (strrpos($word, '.') == ($num_chars-1)) 
 75:                 $words[$i] = substr($word, 0, -1); 
 76:  
 77:             if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords)) 75:             if ($num_chars < 3 || $num_chars > 20 || in_array($word, $stopwords))
 78:                 unset($words[$i]); 76:                 unset($words[$i]);
 79:         } 77:         }
147:             switch ($db_type)145:             switch ($db_type)
148:             {146:             {
149:                 case 'mysql':147:                 case 'mysql':
 148:                 case 'mysqli':
150:                     $db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Unable to insert search index words', __FILE__, __LINE__, $db->error());149:                     $db->query('INSERT INTO '.$db->prefix.'search_words (word) VALUES'.implode(',', preg_replace('#^(.*)$#', '(\'\1\')', $new_words))) or error('Unable to insert search index words', __FILE__, __LINE__, $db->error());
151:                     break;150:                     break;
152: 151: 
198:     switch ($db_type)197:     switch ($db_type)
199:     {198:     {
200:         case 'mysql':199:         case 'mysql':
 200:         case 'mysqli':
201:         {201:         {
202:             $result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());202:             $result = $db->query('SELECT word_id FROM '.$db->prefix.'search_matches WHERE post_id IN('.$post_ids.') GROUP BY word_id') or error('Unable to fetch search index word match', __FILE__, __LINE__, $db->error());
203: 203: 


punbb-1.2/upload/index.php punbb-1.2.14/upload/index.php
 60:     <div class="box"> 60:     <div class="box">
 61:         <div class="inbox"> 61:         <div class="inbox">
 62:             <table cellspacing="0"> 62:             <table cellspacing="0">
 63:             <colgroup> 
 64:                 <col class="tcl" /> 
 65:                 <col class="tc2" /> 
 66:                 <col class="tc3" /> 
 67:                 <col class="tcr" /> 
 68:             </colgroup> 
 69:             <thead> 63:             <thead>
 70:                 <tr> 64:                 <tr>
 71:                     <th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th> 65:                     <th class="tcl" scope="col"><?php echo $lang_common['Forum'] ?></th>
 80:         $cur_category = $cur_forum['cid']; 74:         $cur_category = $cur_forum['cid'];
 81:     } 75:     }
 82:  76: 
 83:     $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n"; 77:     $item_status = '';
  78:     $icon_text = $lang_common['Normal icon'];
  79:     $icon_type = 'icon';
 84:  80: 
 85:     // Are there new posts? 81:     // Are there new posts?
 86:     if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit']) 82:     if (!$pun_user['is_guest'] && $cur_forum['last_post'] > $pun_user['last_visit'])
 87:         $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n"; 83:     {
  84:         $item_status = 'inew';
  85:         $icon_text = $lang_common['New icon'];
  86:         $icon_type = 'icon inew';
  87:     }
 88:  88: 
 89:     // Is this a redirect forum? 89:     // Is this a redirect forum?
 90:     if ($cur_forum['redirect_url'] != '') 90:     if ($cur_forum['redirect_url'] != '')
 91:     { 91:     {
 92:         $forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>'; 92:         $forum_field = '<h3><a href="'.pun_htmlspecialchars($cur_forum['redirect_url']).'" title="'.$lang_index['Link to'].' '.pun_htmlspecialchars($cur_forum['redirect_url']).'">'.pun_htmlspecialchars($cur_forum['forum_name']).'</a></h3>';
 93:         $num_topics = $num_posts = '&nbsp;'; 93:         $num_topics = $num_posts = '&nbsp;';
 94:         $icon = '<div class="iredirect"><div class="nosize">'.$lang_common['Redirect icon'].'</div></div>'."\n"; 94:         $item_status = 'iredirect';
  95:         $icon_text = $lang_common['Redirect icon'];
  96:         $icon_type = 'icon';
 95:     } 97:     }
 96:     else 98:     else
 97:     { 99:     {
101:     }103:     }
102: 104: 
103:     if ($cur_forum['forum_desc'] != '')105:     if ($cur_forum['forum_desc'] != '')
104:         $forum_field .= "\n\t\t\t\t\t\t\t".$cur_forum['forum_desc'];106:         $forum_field .= "\n\t\t\t\t\t\t\t\t".$cur_forum['forum_desc'];
105: 107: 
106: 108: 
107:     // If there is a last_post/last_poster.109:     // If there is a last_post/last_poster.
108:     if ($cur_forum['last_post'] != '')110:     if ($cur_forum['last_post'] != '')
109:         $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a><br />'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']);111:         $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
110:     else112:     else
111:         $last_post = '&nbsp;';113:         $last_post = '&nbsp;';
112: 114: 
118:         while (list($mod_username, $mod_id) = @each($mods_array))120:         while (list($mod_username, $mod_id) = @each($mods_array))
119:             $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';121:             $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';
120: 122: 
121:         $moderators = "\t\t\t\t\t\t\t".'<p><em>('.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";123:         $moderators = "\t\t\t\t\t\t\t\t".'<p><em>('.$lang_common['Moderated by'].'</em> '.implode(', ', $moderators).')</p>'."\n";
122:     }124:     }
123: 125: 
124: ?>126: ?>
125:                 <tr<?php if ($cur_forum['redirect_url'] != '') echo ' class="redirectrow"'; ?>>127:                  <tr<?php if ($item_status != '') echo ' class="'.$item_status.'"'; ?>>
126:                     <td class="tcl">128:                     <td class="tcl">
127:                         <div class="intd">129:                         <div class="intd">
128:                             <?php echo $icon ?>130:                             <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo $icon_text ?></div></div>
129:                             <div class="tclcon">131:                             <div class="tclcon">
130:                                 <?php echo $forum_field."\n".$moderators ?>132:                                 <?php echo $forum_field."\n".$moderators ?>
131:                             </div>133:                             </div>
189: 191: 
190:     $num_users = count($users);192:     $num_users = count($users);
191:     echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";193:     echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";
192:     echo "\t\t\t".'<div class="clearer"></div>'."\n"; 
193: 194: 
194: 195: 
195:     if ($num_users > 0)196:     if ($num_users > 0)
196:         echo "\t\t\t".'<dl id="onlinelist">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].':&nbsp;</strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";197:         echo "\t\t\t".'<dl id="onlinelist" class= "clearb">'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].':&nbsp;</strong></dt>'."\t\t\t\t".implode(',</dd> ', $users).'</dd>'."\n\t\t\t".'</dl>'."\n";
 198:     else
 199:         echo "\t\t\t".'<div class="clearer"></div>'."\n";
 200: 
197: }201: }
198: else202: else
199:     echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";203:     echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";


punbb-1.2/upload/install.php punbb-1.2.14/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'; 27: $punbb_version = '1.2.14';
 28:  28: 
 29:  29: 
 30: define('PUN_ROOT', './'); 30: define('PUN_ROOT', './');
 31: if (file_exists(PUN_ROOT.'config.php')) 31: if (file_exists(PUN_ROOT.'config.php'))
 32:     exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.'); 32:     exit('The file \'config.php\' already exists which would mean that PunBB is already installed. You should go <a href="index.php">here</a> instead.');
 33:  33: 
  34: 
 34: // Make sure we are running at least PHP 4.1.0 35: // Make sure we are running at least PHP 4.1.0
 35: if (intval(str_replace('.', '', phpversion())) < 410) 36: if (intval(str_replace('.', '', phpversion())) < 410)
 36:     exit('You are running PHP version '.phpversion().'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.'); 37:     exit('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.1.0 to run properly. You must upgrade your PHP installation before you can continue.');
 37:  38: 
 38: // Disable error reporting for uninitialized variables 39: // Disable error reporting for uninitialized variables
 39: error_reporting(E_ALL); 40: error_reporting(E_ALL);
164:                 <fieldset>165:                 <fieldset>
165:                     <legend>Enter then name of your database</legend>166:                     <legend>Enter then name of your database</legend>
166:                     <div class="infldset">167:                     <div class="infldset">
167:                         <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>
168:                         <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>
169:                     </div>170:                     </div>
170:                 </fieldset>171:                 </fieldset>
323:     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))
324:         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.');
325: 326: 
326:     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))
327:         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.');
328: 329: 
329: 330: 
345:         case 'sqlite':346:         case 'sqlite':
346:             require PUN_ROOT.'include/dblayer/sqlite.php';347:             require PUN_ROOT.'include/dblayer/sqlite.php';
347:             break;348:             break;
 349: 
 350:         default:
 351:             error('\''.$db_type.'\' is not a valid database type.');
348:     }352:     }
349: 353: 
350:     // Create the database object (and connect/select db)354:     // Create the database object (and connect/select db)
360: 364: 
361:         case 'pgsql':365:         case 'pgsql':
362:             // Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL)366:             // Make sure we are running at least PHP 4.3.0 (needed only for PostgreSQL)
363:             if (intval(str_replace('.', '', phpversion())) < 430)367:             if (version_compare(PHP_VERSION, '4.3.0', '<'))
364:                 error('You are running PHP version '.phpversion().'. PunBB requires at least PHP 4.3.0 to run properly when using PostgreSQL. You must upgrade your PHP installation or use a different database before you can continue.');368:                 error('You are running PHP version '.PHP_VERSION.'. PunBB requires at least PHP 4.3.0 to run properly when using PostgreSQL. You must upgrade your PHP installation or use a different database before you can continue.');
365:             break;369:             break;
366: 370: 
367:         case 'sqlite':371:         case 'sqlite':
524:             break;528:             break;
525:     }529:     }
526: 530: 
527:     $db->query($sql) or error('Unable to create table '.$db_prefix.'online. Please check your settings and try again.',  __FILE__, __LINE__, $db->error());531:     $db->query($sql) or error('Unable to create table '.$db_prefix.'config. Please check your settings and try again.',  __FILE__, __LINE__, $db->error());
528: 532: 
529: 533: 
530: 534: 
753:                     poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,757:                     poster_id INT(10) UNSIGNED NOT NULL DEFAULT 1,
754:                     poster_ip VARCHAR(15),758:                     poster_ip VARCHAR(15),
755:                     poster_email VARCHAR(50),759:                     poster_email VARCHAR(50),
756:                     message TEXT NOT NULL DEFAULT '',760:                     message TEXT,
757:                     hide_smilies TINYINT(1) NOT NULL DEFAULT 0,761:                     hide_smilies TINYINT(1) NOT NULL DEFAULT 0,
758:                     posted INT(10) UNSIGNED NOT NULL DEFAULT 0,762:                     posted INT(10) UNSIGNED NOT NULL DEFAULT 0,
759:                     edited INT(10) UNSIGNED,763:                     edited INT(10) UNSIGNED,
770:                     poster_id INT NOT NULL DEFAULT 1,774:                     poster_id INT NOT NULL DEFAULT 1,
771:                     poster_ip VARCHAR(15),775:                     poster_ip VARCHAR(15),
772:                     poster_email VARCHAR(50),776:                     poster_email VARCHAR(50),
773:                     message TEXT NOT NULL DEFAULT '',777:                     message TEXT,
774:                     hide_smilies SMALLINT NOT NULL DEFAULT 0,778:                     hide_smilies SMALLINT NOT NULL DEFAULT 0,
775:                     posted INT NOT NULL DEFAULT 0,779:                     posted INT NOT NULL DEFAULT 0,
776:                     edited INT,780:                     edited INT,
787:                     poster_id INTEGER NOT NULL DEFAULT 1,791:                     poster_id INTEGER NOT NULL DEFAULT 1,
788:                     poster_ip VARCHAR(15),792:                     poster_ip VARCHAR(15),
789:                     poster_email VARCHAR(50),793:                     poster_email VARCHAR(50),
790:                     message TEXT NOT NULL DEFAULT '',794:                     message TEXT,
791:                     hide_smilies INTEGER NOT NULL DEFAULT 0,795:                     hide_smilies INTEGER NOT NULL DEFAULT 0,
792:                     posted INTEGER NOT NULL DEFAULT 0,796:                     posted INTEGER NOT NULL DEFAULT 0,
793:                     edited INTEGER,797:                     edited INTEGER,
848:                     forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,852:                     forum_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
849:                     reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,853:                     reported_by INT(10) UNSIGNED NOT NULL DEFAULT 0,
850:                     created INT(10) UNSIGNED NOT NULL DEFAULT 0,854:                     created INT(10) UNSIGNED NOT NULL DEFAULT 0,
851:                     message TEXT NOT NULL DEFAULT '',855:                     message TEXT,
852:                     zapped INT(10) UNSIGNED,856:                     zapped INT(10) UNSIGNED,
853:                     zapped_by INT(10) UNSIGNED,857:                     zapped_by INT(10) UNSIGNED,
854:                     PRIMARY KEY (id)858:                     PRIMARY KEY (id)
863:                     forum_id INT NOT NULL DEFAULT 0,867:                     forum_id INT NOT NULL DEFAULT 0,
864:                     reported_by INT NOT NULL DEFAULT 0,868:                     reported_by INT NOT NULL DEFAULT 0,
865:                     created INT NOT NULL DEFAULT 0,869:                     created INT NOT NULL DEFAULT 0,
866:                     message TEXT NOT NULL DEFAULT '',870:                     message TEXT,
867:                     zapped INT,871:                     zapped INT,
868:                     zapped_by INT,872:                     zapped_by INT,
869:                     PRIMARY KEY (id)873:                     PRIMARY KEY (id)
878:                     forum_id INTEGER NOT NULL DEFAULT 0,882:                     forum_id INTEGER NOT NULL DEFAULT 0,
879:                     reported_by INTEGER NOT NULL DEFAULT 0,883:                     reported_by INTEGER NOT NULL DEFAULT 0,
880:                     created INTEGER NOT NULL DEFAULT 0,884:                     created INTEGER NOT NULL DEFAULT 0,
881:                     message TEXT NOT NULL DEFAULT '',885:                     message TEXT,
882:                     zapped INTEGER,886:                     zapped INTEGER,
883:                     zapped_by INTEGER,887:                     zapped_by INTEGER,
884:                     PRIMARY KEY (id)888:                     PRIMARY KEY (id)
897:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (901:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
898:                     id INT(10) UNSIGNED NOT NULL DEFAULT 0,902:                     id INT(10) UNSIGNED NOT NULL DEFAULT 0,
899:                     ident VARCHAR(200) NOT NULL DEFAULT '',903:                     ident VARCHAR(200) NOT NULL DEFAULT '',
900:                     search_data TEXT NOT NULL DEFAULT '',904:                     search_data TEXT,
901:                     PRIMARY KEY (id)905:                     PRIMARY KEY (id)
902:                     ) TYPE=MyISAM;";906:                     ) TYPE=MyISAM;";
903:             break;907:             break;
906:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (910:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
907:                     id INT NOT NULL DEFAULT 0,911:                     id INT NOT NULL DEFAULT 0,
908:                     ident VARCHAR(200) NOT NULL DEFAULT '',912:                     ident VARCHAR(200) NOT NULL DEFAULT '',
909:                     search_data TEXT NOT NULL DEFAULT '',913:                     search_data TEXT,
910:                     PRIMARY KEY (id)914:                     PRIMARY KEY (id)
911:                     )";915:                     )";
912:             break;916:             break;
915:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (919:             $sql = 'CREATE TABLE '.$db_prefix."search_cache (
916:                     id INTEGER NOT NULL DEFAULT 0,920:                     id INTEGER NOT NULL DEFAULT 0,
917:                     ident VARCHAR(200) NOT NULL DEFAULT '',921:                     ident VARCHAR(200) NOT NULL DEFAULT '',
918:                     search_data TEXT NOT NULL DEFAULT '',922:                     search_data TEXT,
919:                     PRIMARY KEY (id)923:                     PRIMARY KEY (id)
920:                     )";924:                     )";
921:             break;925:             break;
1094:         case 'mysqli':1098:         case 'mysqli':
1095:             $sql = 'CREATE TABLE '.$db_prefix."users (1099:             $sql = 'CREATE TABLE '.$db_prefix."users (
1096:                     id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,1100:                     id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
1097:                     group_id INT(10) NOT NULL DEFAULT 4,1101:                     group_id INT(10) UNSIGNED NOT NULL DEFAULT 4,
1098:                     username VARCHAR(200) NOT NULL DEFAULT '',1102:                     username VARCHAR(200) NOT NULL DEFAULT '',
1099:                     password VARCHAR(40) NOT NULL DEFAULT '',1103:                     password VARCHAR(40) NOT NULL DEFAULT '',
1100:                     email VARCHAR(50) NOT NULL DEFAULT '',1104:                     email VARCHAR(50) NOT NULL DEFAULT '',
1311:         'o_show_dot'                => "'0'",1315:         'o_show_dot'                => "'0'",
1312:         'o_quickjump'                => "'1'",1316:         'o_quickjump'                => "'1'",
1313:         'o_gzip'                    => "'0'",1317:         'o_gzip'                    => "'0'",
 1318:         'o_additional_navlinks'        => "''",
1314:         'o_report_method'            => "'0'",1319:         'o_report_method'            => "'0'",
1315:         'o_regs_report'                => "'0'",1320:         'o_regs_report'                => "'0'",
1316:         'o_mailing_list'            => "'$email'",1321:         'o_mailing_list'            => "'$email'",
1395: 1400: 
1396: 1401: 
1397:     /// Display config.php and give further instructions1402:     /// Display config.php and give further instructions
1398:     $config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);\n\n?>";1403:     $config = '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.$db_name."';\n".'$db_username = \''.$db_username."';\n".'$db_password = \''.$db_password."';\n".'$db_prefix = \''.$db_prefix."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'punbb_cookie';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.substr(md5(time()), -8)."';\n\ndefine('PUN', 1);";
1399: 1404: 
1400: 1405: 
1401: ?>1406: ?>
1418:         <div class="fakeform">1423:         <div class="fakeform">
1419:             <div class="inform">1424:             <div class="inform">
1420:                 <div class="forminfo">1425:                 <div class="forminfo">
1421:                     <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 &lt;?php and after ?&gt; 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 &lt;?php. You can later edit config.php if you reconfigure your setup (e.g. change the database password or ).</p>
1422: <?php if ($alerts != ''): ?>                    <?php echo $alerts."\n" ?>1427: <?php if ($alerts != ''): ?>                    <?php echo $alerts."\n" ?>
1423: <?php endif; ?>                </div>1428: <?php endif; ?>                </div>
1424:                 <fieldset>1429:                 <fieldset>


punbb-1.2/upload/lang/English/common.php punbb-1.2.14/upload/lang/English/common.php
146: 'Debug table'            =>    'Debug information',146: 'Debug table'            =>    'Debug information',
147: 147: 
148: // For extern.php RSS feed148: // For extern.php RSS feed
149: 'RSS Desc Active    '    =>    'The most recently active topics at',    // board_title will be appended to this string149: 'RSS Desc Active'        =>    'The most recently active topics at',    // board_title will be appended to this string
150: 'RSS Desc New'            =>    'The newest topics at',                    // board_title will be appended to this string150: 'RSS Desc New'            =>    'The newest topics at',                    // board_title will be appended to this string
151: 'Posted'                =>    'Posted'    // The date/time a topic was started151: 'Posted'                =>    'Posted'    // The date/time a topic was started
152: 152: 


punbb-1.2/upload/lang/English/misc.php punbb-1.2.14/upload/lang/English/misc.php
  9: 'Form e-mail disabled'        =>    'The user you are trying to send an e-mail to has disabled form e-mail.',  9: 'Form e-mail disabled'        =>    'The user you are trying to send an e-mail to has disabled form e-mail.',
 10: 'No e-mail subject'            =>    'You must enter a subject.', 10: 'No e-mail subject'            =>    'You must enter a subject.',
 11: 'No e-mail message'            =>    'You must enter a message.', 11: 'No e-mail message'            =>    'You must enter a message.',
 12: 'Too long e-mail message'    =>    'Messages cannot be longer that 65535 characters (64 Kb).', 12: 'Too long e-mail message'    =>    'Messages cannot be longer than 65535 characters (64 KB).',
 13: 'E-mail sent redirect'        =>    'E-mail sent. Redirecting &hellip;', 13: 'E-mail sent redirect'        =>    'E-mail sent. Redirecting &hellip;',
 14: 'Send e-mail to'            =>    'Send e-mail to', 14: 'Send e-mail to'            =>    'Send e-mail to',
 15: 'E-mail subject'            =>    'Subject', 15: 'E-mail subject'            =>    'Subject',


punbb-1.2/upload/lang/English/profile.php punbb-1.2.14/upload/lang/English/profile.php
 46: 'Avatars disabled'            =>    'The administrator has disabled avatar support.', 46: 'Avatars disabled'            =>    'The administrator has disabled avatar support.',
 47: 'Too large ini'                =>    'The selected file was too large to upload. The server didn\'t allow the upload.', 47: 'Too large ini'                =>    'The selected file was too large to upload. The server didn\'t allow the upload.',
 48: 'Partial upload'            =>    'The selected file was only partially uploaded. Please try again.', 48: 'Partial upload'            =>    'The selected file was only partially uploaded. Please try again.',
  49: 'No tmp directory'            =>    'PHP was unable to save the uploaded file to a temporary location.',
 49: 'No file'                    =>    'You did not select a file for upload.', 50: 'No file'                    =>    'You did not select a file for upload.',
 50: 'Bad type'                    =>    'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.', 51: 'Bad type'                    =>    'The file you tried to upload is not of an allowed type. Allowed types are gif, jpeg and png.',
 51: 'Too wide or high'            =>    'The file you tried to upload is wider and/or higher than the maximum allowed', 52: 'Too wide or high'            =>    'The file you tried to upload is wider and/or higher than the maximum allowed',


punbb-1.2/upload/login.php punbb-1.2.14/upload/login.php
 40:     $form_username = trim($_POST['req_username']); 40:     $form_username = trim($_POST['req_username']);
 41:     $form_password = trim($_POST['req_password']); 41:     $form_password = trim($_POST['req_password']);
 42:  42: 
 43:     $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE username=\''.$db->escape($form_username).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); 43:     $username_sql = ($db_type == 'mysql' || $db_type == 'mysqli') ? 'username=\''.$db->escape($form_username).'\'' : 'LOWER(username)=LOWER(\''.$db->escape($form_username).'\')';
  44: 
  45:     $result = $db->query('SELECT id, group_id, password, save_pass FROM '.$db->prefix.'users WHERE '.$username_sql) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
 44:     list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result); 46:     list($user_id, $group_id, $db_password_hash, $save_pass) = $db->fetch_row($result);
 45:  47: 
 46:     $authorized = false; 48:     $authorized = false;
 76:     $expire = ($save_pass == '1') ? time() + 31536000 : 0; 78:     $expire = ($save_pass == '1') ? time() + 31536000 : 0;
 77:     pun_setcookie($user_id, $form_password_hash, $expire); 79:     pun_setcookie($user_id, $form_password_hash, $expire);
 78:  80: 
 79:     redirect($_POST['redirect_url'], $lang_login['Login redirect']); 81:     redirect(htmlspecialchars($_POST['redirect_url']), $lang_login['Login redirect']);
 80: } 82: }
 81:  83: 
 82:  84: 
 91:     // Remove user from "users online" list. 93:     // Remove user from "users online" list.
 92:     $db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error()); 94:     $db->query('DELETE FROM '.$db->prefix.'online WHERE user_id='.$pun_user['id']) or error('Unable to delete from online list', __FILE__, __LINE__, $db->error());
 93:  95: 
  96:     // Update last_visit (make sure there's something to update it with)
  97:     if (isset($pun_user['logged']))
  98:         $db->query('UPDATE '.$db->prefix.'users SET last_visit='.$pun_user['logged'].' WHERE id='.$pun_user['id']) or error('Unable to update user visit data', __FILE__, __LINE__, $db->error());
  99: 
 94:     pun_setcookie(1, random_pass(8), time() + 31536000);100:     pun_setcookie(1, random_pass(8), time() + 31536000);
 95: 101: 
 96:     redirect('index.php', $lang_login['Logout redirect']);102:     redirect('index.php', $lang_login['Logout redirect']);
147:             message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');153:             message($lang_login['Forget mail'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
148:         }154:         }
149:         else155:         else
150:             message($lang_login['No e-mail match'].' '.$email.'.');156:             message($lang_login['No e-mail match'].' '.htmlspecialchars($email).'.');
151:     }157:     }
152: 158: 
153: 159: 
185:     header('Location: index.php');191:     header('Location: index.php');
186: 192: 
187: // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)193: // Try to determine if the data in HTTP_REFERER is valid (if not, we redirect to index.php after login)
188: $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'index.php';194: $redirect_url = (isset($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($pun_config['o_base_url']).'/(.*?)\.php#i', $_SERVER['HTTP_REFERER'])) ? htmlspecialchars($_SERVER['HTTP_REFERER']) : 'index.php';
189: 195: 
190: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];196: $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Login'];
191: $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);197: $required_fields = array('req_username' => $lang_common['Username'], 'req_password' => $lang_common['Password']);


punbb-1.2/upload/misc.php punbb-1.2.14/upload/misc.php
 76:         message($lang_common['No permission']); 76:         message($lang_common['No permission']);
 77:  77: 
 78:     $recipient_id = intval($_GET['email']); 78:     $recipient_id = intval($_GET['email']);
 79:     if ($recipient_id < 1) 79:     if ($recipient_id < 2)
 80:         message($lang_common['Bad request']); 80:         message($lang_common['Bad request']);
 81:  81: 
 82:     $result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error()); 82:     $result = $db->query('SELECT username, email, email_setting FROM '.$db->prefix.'users WHERE id='.$recipient_id) or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
118: 118: 
119:         require_once PUN_ROOT.'include/email.php';119:         require_once PUN_ROOT.'include/email.php';
120: 120: 
121:         pun_mail($recipient_email, $mail_subject, $mail_message, $pun_user['username'].' <'.$pun_user['email'].'>');121:         pun_mail($recipient_email, $mail_subject, $mail_message, '"'.str_replace('"', '', $pun_user['username']).'" <'.$pun_user['email'].'>');
122: 122: 
123:         redirect($_POST['redirect_url'], $lang_misc['E-mail sent redirect']);123:         redirect(htmlspecialchars($_POST['redirect_url']), $lang_misc['E-mail sent redirect']);
124:     }124:     }
125: 125: 
126: 126: 
245: 245: 
246: else if (isset($_GET['subscribe']))246: else if (isset($_GET['subscribe']))
247: {247: {
248:     if ($pun_user['is_guest'])248:     if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
249:         message($lang_common['No permission']);249:         message($lang_common['No permission']);
250: 250: 
251:     $topic_id = intval($_GET['subscribe']);251:     $topic_id = intval($_GET['subscribe']);
264: 264: 
265: else if (isset($_GET['unsubscribe']))265: else if (isset($_GET['unsubscribe']))
266: {266: {
267:     if ($pun_user['is_guest'])267:     if ($pun_user['is_guest'] || $pun_config['o_subscriptions'] != '1')
268:         message($lang_common['No permission']);268:         message($lang_common['No permission']);
269: 269: 
270:     $topic_id = intval($_GET['unsubscribe']);270:     $topic_id = intval($_GET['unsubscribe']);


punbb-1.2/upload/moderate.php punbb-1.2.14/upload/moderate.php
 50:         $ip = $db->result($result); 50:         $ip = $db->result($result);
 51:     } 51:     }
 52:  52: 
 53:     message('The IP address is: '.$ip.'<br />The host name is: '.gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>'); 53:     message('The IP address is: '.$ip.'<br />The host name is: '.@gethostbyaddr($ip).'<br /><br /><a href="admin_users.php?show_users='.$ip.'">Show more users for this IP</a>');
 54: } 54: }
 55:  55: 
 56:  56: 
 98:         { 98:         {
 99:             confirm_referrer('moderate.php'); 99:             confirm_referrer('moderate.php');
100: 100: 
 101:             if (preg_match('/[^0-9,]/', $posts))
 102:                 message($lang_common['Bad request']);
 103: 
101:             // Delete the posts104:             // Delete the posts
102:             $db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error());105:             $db->query('DELETE FROM '.$db->prefix.'posts WHERE id IN('.$posts.')') or error('Unable to delete posts', __FILE__, __LINE__, $db->error());
103: 106: 
278:     {281:     {
279:         confirm_referrer('moderate.php');282:         confirm_referrer('moderate.php');
280: 283: 
 284:         if (preg_match('/[^0-9,]/', $_POST['topics']))
 285:             message($lang_common['Bad request']);
 286: 
281:         $topics = explode(',', $_POST['topics']);287:         $topics = explode(',', $_POST['topics']);
282:         $move_to_forum = intval($_POST['move_to_forum']);288:         $move_to_forum = isset($_POST['move_to_forum']) ? intval($_POST['move_to_forum']) : 0;
283:         if (empty($topics) || $move_to_forum < 1)289:         if (empty($topics) || $move_to_forum < 1)
284:             message($lang_common['Bad request']);290:             message($lang_common['Bad request']);
285: 291: 
345:                         <br /><select name="move_to_forum">351:                         <br /><select name="move_to_forum">
346: <?php352: <?php
347: 353: 
348:     $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id WHERE f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position') or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());354:     $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name 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());
349: 355: 
350:     $cur_category = 0;356:     $cur_category = 0;
351:     while ($cur_forum = $db->fetch_assoc($result))357:     while ($cur_forum = $db->fetch_assoc($result))
394:     {400:     {
395:         confirm_referrer('moderate.php');401:         confirm_referrer('moderate.php');
396: 402: 
 403:         if (preg_match('/[^0-9,]/', $topics))
 404:             message($lang_common['Bad request']);
 405: 
397:         require PUN_ROOT.'include/search_idx.php';406:         require PUN_ROOT.'include/search_idx.php';
398: 407: 
399:         // Delete the topics and any redirect topics408:         // Delete the topics and any redirect topics
459:     {468:     {
460:         confirm_referrer('moderate.php');469:         confirm_referrer('moderate.php');
461: 470: 
462:         $topics = isset($_POST['topics']) ? $_POST['topics'] : array();471:         $topics = isset($_POST['topics']) ? @array_map('intval', @array_keys($_POST['topics'])) : array();
463:         if (empty($topics))472:         if (empty($topics))
464:             message($lang_misc['No topics selected']);473:             message($lang_misc['No topics selected']);
465: 474: 
466:         $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', array_keys($topics)).')') or error('Unable to close topics', __FILE__, __LINE__, $db->error());475:         $db->query('UPDATE '.$db->prefix.'topics SET closed='.$action.' WHERE id IN('.implode(',', $topics).')') or error('Unable to close topics', __FILE__, __LINE__, $db->error());
467: 476: 
468:         $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];477:         $redirect_msg = ($action) ? $lang_misc['Close topics redirect'] : $lang_misc['Open topics redirect'];
469:         redirect('moderate.php?fid='.$fid, $redirect_msg);478:         redirect('moderate.php?fid='.$fid, $redirect_msg);
560:             <table cellspacing="0">569:             <table cellspacing="0">
561:             <thead>570:             <thead>
562:                 <tr>571:                 <tr>
563:                     <th class="tc1" scope="col"><?php echo $lang_common['Topic'] ?></th>572:                     <th class="tcl" scope="col"><?php echo $lang_common['Topic'] ?></th>
564:                     <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>573:                     <th class="tc2" scope="col"><?php echo $lang_common['Replies'] ?></th>
565:                     <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>574:                     <th class="tc3" scope="col"><?php echo $lang_forum['Views'] ?></th>
566:                     <th class="tcr"><?php echo $lang_common['Last post'] ?></th>575:                     <th class="tcr"><?php echo $lang_common['Last post'] ?></th>
580: 589: 
581:     while ($cur_topic = $db->fetch_assoc($result))590:     while ($cur_topic = $db->fetch_assoc($result))
582:     {591:     {
583:         $icon = '<div class="inormal"><div class="nosize">'.$lang_common['Normal icon'].'</div></div>'."\n";592: 
 593:         $icon_text = $lang_common['Normal icon'];
 594:         $item_status = '';
 595:         $icon_type = 'icon';
 596: 
584:         if ($cur_topic['moved_to'] == null)597:         if ($cur_topic['moved_to'] == null)
585:         {598:         {
586:             $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']);599:             $last_post = '<a href="viewtopic.php?pid='.$cur_topic['last_post_id'].'#p'.$cur_topic['last_post_id'].'">'.format_time($cur_topic['last_post']).'</a> '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']);
601:             $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';614:             $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span>'.$lang_common['by'].'&nbsp;'.pun_htmlspecialchars($cur_topic['poster']).'</span>';
602:         else615:         else
603:         {616:         {
604:             $subject = '<a class="showclosed" href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';617:             $subject = '<a href="viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).'</span>';
605:             $icon = '<div class="iclosed"><div class="nosize">'.$lang_common['Closed icon'].'</div></div>'."\n";618:             $icon_text = $lang_common['Closed icon'];
 619:             $item_status = 'iclosed';
606:         }620:         }
607: 621: 
608:         if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic)622:         if ($cur_topic['last_post'] > $pun_user['last_visit'] && !$ghost_topic)
609:         {623:         {
610:             $icon = '<div class="inew"><div class="nosize">'.$lang_common['New icon'].'</div></div>'."\n";624:             $icon_text .= ' '.$lang_common['New icon'];
611: 625:             $item_status .= ' inew';
 626:             $icon_type = 'icon inew';
612:             $subject = '<strong>'.$subject.'</strong>';627:             $subject = '<strong>'.$subject.'</strong>';
613:             $subject_new_posts = '[&nbsp;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&nbsp;]';628:             $subject_new_posts = '<span class="newtext">[&nbsp;<a href="viewtopic.php?id='.$cur_topic['id'].'&amp;action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a>&nbsp;]</span>';
614:         }629:         }
615:         else630:         else
616:             $subject_new_posts = null;631:             $subject_new_posts = null;
620:             $subject = '&nbsp;&nbsp;'.$subject;635:             $subject = '&nbsp;&nbsp;'.$subject;
621: 636: 
622:         if ($cur_topic['sticky'] == '1')637:         if ($cur_topic['sticky'] == '1')
623:             $subject = $lang_forum['Sticky'].': '.$subject;638:         {
624: 639:             $subject = '<span class="stickytext">'.$lang_forum['Sticky'].': </span>'.$subject;
 640:             $item_status .= ' isticky';
 641:             $icon_text .= ' '.$lang_forum['Sticky'];
 642:         }
625: 643: 
626:         $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);644:         $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']);
627: 645: 
638:         }656:         }
639: 657: 
640: ?>658: ?>
641:                 <tr>659:                 <tr<?php if ($item_status != '') echo ' class="'.trim($item_status).'"'; ?>>
642:                     <td class="tcl">660:                     <td class="tcl">
643:                         <?php echo $icon ?>661:                         <div class="<?php echo $icon_type ?>"><div class="nosize"><?php echo trim($icon_text) ?></div></div>
644:                         <div class="tclcon">662:                         <div class="tclcon">
645:                             <?php echo $subject."\n" ?>663:                             <?php echo $subject."\n" ?>
646:                         </div>664:                         </div>


punbb-1.2/upload/plugins/AMP_Example.php punbb-1.2.14/upload/plugins/AMP_Example.php
  1: <?php  1: <?php
   2: /***********************************************************************
   3: 
   4:   Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)
   5: 
   6:   This file is part of PunBB.
   7: 
   8:   PunBB is free software; you can redistribute it and/or modify it
   9:   under the terms of the GNU General Public License as published
  10:   by the Free Software Foundation; either version 2 of the License,
  11:   or (at your option) any later version.
  12: 
  13:   PunBB is distributed in the hope that it will be useful, but
  14:   WITHOUT ANY WARRANTY; without even the implied warranty of
  15:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16:   GNU General Public License for more details.
  17: 
  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
  20:   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21:   MA  02111-1307  USA
  22: 
  23: ************************************************************************/
  24: 
  2: ## 25: ##
  3: ## 26: ##
  4: ##  A few notes of interest for aspiring plugin authors: 27: ##  A few notes of interest for aspiring plugin authors:
 36: ##     plugins. If you create your own styles they need to be added to 59: ##     plugins. If you create your own styles they need to be added to
 37: ##     the "base_admin" style sheet. 60: ##     the "base_admin" style sheet.
 38: ## 61: ##
 39: ##  8. Consider releasing your plugins under the GNU General Public 62: ##  8. Plugins must be released under the GNU General Public License or
 40: ##     License (or equivalent). 63: ##     a GPL compatible license. Copy the GPL preamble at the top of
  64: ##     this file into your plugin script and alter the copyright notice
  65: ##     to refrect the author of the plugin (i.e. you).
 41: ## 66: ##
 42: ## 67: ##
 43:  68: 
  69: 
  70: // Make sure no one attempts to run this script "directly"
  71: if (!defined('PUN'))
  72:     exit;
 44:  73: 
 45: // Tell admin_loader.php that this is indeed a plugin and that it is loaded 74: // Tell admin_loader.php that this is indeed a plugin and that it is loaded
 46: define('PUN_PLUGIN_LOADED', 1); 75: define('PUN_PLUGIN_LOADED', 1);


punbb-1.2/upload/post.php punbb-1.2.14/upload/post.php
 33:  33: 
 34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0; 34: $tid = isset($_GET['tid']) ? intval($_GET['tid']) : 0;
 35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0; 35: $fid = isset($_GET['fid']) ? intval($_GET['fid']) : 0;
 36: if ($tid < 1 && $fid < 1) 36: if ($tid < 1 && $fid < 1 || $tid > 0 && $fid > 0)
 37:     message($lang_common['Bad request']); 37:     message($lang_common['Bad request']);
 38:  38: 
 39: // Fetch some info about the topic and/or the forum 39: // Fetch some info about the topic and/or the forum
207: 207: 
208:             update_forum($cur_posting['id']);208:             update_forum($cur_posting['id']);
209: 209: 
210: 210:             // Should we send out notifications?
211:             // Get the post time for the previous post in this topic211:             if ($pun_config['o_subscriptions'] == '1')
212:             $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error()); 
213:             $previous_post_time = $db->result($result); 
214:  
215:             // Get any subscribed users that should be notified (banned users are excluded) 
216:             $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error()); 
217:             if ($db->num_rows($result)) 
218:             {212:             {
219:                 require_once PUN_ROOT.'include/email.php';213:                 // Get the post time for the previous post in this topic
 214:                 $result = $db->query('SELECT posted FROM '.$db->prefix.'posts WHERE topic_id='.$tid.' ORDER BY id DESC LIMIT 1, 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
 215:                 $previous_post_time = $db->result($result);
 216: 
 217:                 // Get any subscribed users that should be notified (banned users are excluded)
 218:                 $result = $db->query('SELECT u.id, u.email, u.notify_with_post, u.language FROM '.$db->prefix.'users AS u INNER JOIN '.$db->prefix.'subscriptions AS s ON u.id=s.user_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id='.$cur_posting['id'].' AND fp.group_id=u.group_id) LEFT JOIN '.$db->prefix.'online AS o ON u.id=o.user_id LEFT JOIN '.$db->prefix.'bans AS b ON u.username=b.username WHERE b.username IS NULL AND COALESCE(o.logged, u.last_visit)>'.$previous_post_time.' AND (fp.read_forum IS NULL OR fp.read_forum=1) AND s.topic_id='.$tid.' AND u.id!='.intval($pun_user['id'])) or error('Unable to fetch subscription info', __FILE__, __LINE__, $db->error());
 219:                 if ($db->num_rows($result))
 220:                 {
 221:                     require_once PUN_ROOT.'include/email.php';
220: 222: 
221:                 $notification_emails = array();223:                     $notification_emails = array();
222: 224: 
223:                 // Loop through subscribed users and send e-mails225:                     // Loop through subscribed users and send e-mails
224:                 while ($cur_subscriber = $db->fetch_assoc($result))226:                     while ($cur_subscriber = $db->fetch_assoc($result))
225:                 { 
226:                     // Is the subscription e-mail for $cur_subscriber['language'] cached or not? 
227:                     if (!isset($notification_emails[$cur_subscriber['language']])) 
228:                     {227:                     {
229:                         if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'))228:                         // Is the subscription e-mail for $cur_subscriber['language'] cached or not?
 229:                         if (!isset($notification_emails[$cur_subscriber['language']]))
230:                         {230:                         {
231:                             // Load the "new reply" template231:                             if (file_exists(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'))
232:                             $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'));232:                             {
233: 233:                                 // Load the "new reply" template
234:                             // Load the "new reply full" template (with post included)234:                                 $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply.tpl'));
235:                             $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl'));235: 
236: 236:                                 // Load the "new reply full" template (with post included)
237:                             // The first row contains the subject (it also starts with "Subject:")237:                                 $mail_tpl_full = trim(file_get_contents(PUN_ROOT.'lang/'.$cur_subscriber['language'].'/mail_templates/new_reply_full.tpl'));
238:                             $first_crlf = strpos($mail_tpl, "\n");238: 
239:                             $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));239:                                 // The first row contains the subject (it also starts with "Subject:")
240:                             $mail_message = trim(substr($mail_tpl, $first_crlf));240:                                 $first_crlf = strpos($mail_tpl, "\n");
241: 241:                                 $mail_subject = trim(substr($mail_tpl, 8, $first_crlf-8));
242:                             $first_crlf = strpos($mail_tpl_full, "\n");242:                                 $mail_message = trim(substr($mail_tpl, $first_crlf));
243:                             $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));243: 
244:                             $mail_message_full = trim(substr($mail_tpl_full, $first_crlf));244:                                 $first_crlf = strpos($mail_tpl_full, "\n");
245: 245:                                 $mail_subject_full = trim(substr($mail_tpl_full, 8, $first_crlf-8));
246:                             $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);246:                                 $mail_message_full = trim(substr($mail_tpl_full, $first_crlf));
247:                             $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);247: 
248:                             $mail_message = str_replace('<replier>', $username, $mail_message);248:                                 $mail_subject = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject);
249:                             $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);249:                                 $mail_message = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message);
250:                             $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message);250:                                 $mail_message = str_replace('<replier>', $username, $mail_message);
251:                             $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);251:                                 $mail_message = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message);
252: 252:                                 $mail_message = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message);
253:                             $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);253:                                 $mail_message = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message);
254:                             $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);254: 
255:                             $mail_message_full = str_replace('<replier>', $username, $mail_message_full);255:                                 $mail_subject_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_subject_full);
256:                             $mail_message_full = str_replace('<message>', $message, $mail_message_full);256:                                 $mail_message_full = str_replace('<topic_subject>', '\''.$cur_posting['subject'].'\'', $mail_message_full);
257:                             $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);257:                                 $mail_message_full = str_replace('<replier>', $username, $mail_message_full);
258:                             $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full);258:                                 $mail_message_full = str_replace('<message>', $message, $mail_message_full);
259:                             $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);259:                                 $mail_message_full = str_replace('<post_url>', $pun_config['o_base_url'].'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full);
260: 260:                                 $mail_message_full = str_replace('<unsubscribe_url>', $pun_config['o_base_url'].'/misc.php?unsubscribe='.$tid, $mail_message_full);
261:                             $notification_emails[$cur_subscriber['language']][0] = $mail_subject;261:                                 $mail_message_full = str_replace('<board_mailer>', $pun_config['o_board_title'].' '.$lang_common['Mailer'], $mail_message_full);
262:                             $notification_emails[$cur_subscriber['language']][1] = $mail_message;262: 
263:                             $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full;263:                                 $notification_emails[$cur_subscriber['language']][0] = $mail_subject;
264:                             $notification_emails[$cur_subscriber['language']][3] = $mail_message_full;264:                                 $notification_emails[$cur_subscriber['language']][1] = $mail_message;
 265:                                 $notification_emails[$cur_subscriber['language']][2] = $mail_subject_full;
 266:                                 $notification_emails[$cur_subscriber['language']][3] = $mail_message_full;
265: 267: 
266:                             $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null;268:                                 $mail_subject = $mail_message = $mail_subject_full = $mail_message_full = null;
 269:                             }
267:                         }270:                         }
268:                     } 
269: 271: 
270:                     // We have to double check here because the templates could be missing272:                         // We have to double check here because the templates could be missing
271:                     if (isset($notification_emails[$cur_subscriber['language']]))273:                         if (isset($notification_emails[$cur_subscriber['language']]))
272:                     {274:                         {
273:                         if ($cur_subscriber['notify_with_post'] == '0')275:                             if ($cur_subscriber['notify_with_post'] == '0')
274:                             pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);276:                                 pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][0], $notification_emails[$cur_subscriber['language']][1]);
275:                         else277:                             else
276:                             pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);278:                                 pun_mail($cur_subscriber['email'], $notification_emails[$cur_subscriber['language']][2], $notification_emails[$cur_subscriber['language']][3]);
 279:                         }
277:                     }280:                     }
278:                 }281:                 }
279:             }282:             }
335:         if ($qid < 1)338:         if ($qid < 1)
336:             message($lang_common['Bad request']);339:             message($lang_common['Bad request']);
337: 340: 
338:         $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());341:         $result = $db->query('SELECT poster, message FROM '.$db->prefix.'posts WHERE id='.$qid.' AND topic_id='.$tid) or error('Unable to fetch quote info', __FILE__, __LINE__, $db->error());
339:         if (!$db->num_rows($result))342:         if (!$db->num_rows($result))
340:             message($lang_common['Bad request']);343:             message($lang_common['Bad request']);
341: 344: 
437: else if (isset($_POST['preview']))440: else if (isset($_POST['preview']))
438: {441: {
439:     require_once PUN_ROOT.'include/parser.php';442:     require_once PUN_ROOT.'include/parser.php';
440:     $message = parse_message(trim($_POST['req_message']), $hide_smilies);443:     $preview_message = parse_message($message, $hide_smilies);
441: 444: 
442: ?>445: ?>
443: <div id="postpreview" class="blockpost">446: <div id="postpreview" class="blockpost">
446:         <div class="inbox">449:         <div class="inbox">
447:             <div class="postright">450:             <div class="postright">
448:                 <div class="postmsg">451:                 <div class="postmsg">
449:                     <?php echo $message."\n" ?>452:                     <?php echo $preview_message."\n" ?>
450:                 </div>453:                 </div>
451:             </div>454:             </div>
452:         </div>455:         </div>
488: if ($fid): ?>491: if ($fid): ?>
489:                         <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label>492:                         <label><strong><?php echo $lang_common['Subject'] ?></strong><br /><input class="longinput" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo pun_htmlspecialchars($subject); ?>" size="80" maxlength="70" tabindex="<?php echo $cur_index++ ?>" /><br /></label>
490: <?php endif; ?>                        <label><strong><?php echo $lang_common['Message'] ?></strong><br />493: <?php endif; ?>                        <label><strong><?php echo $lang_common['Message'] ?></strong><br />
491:                         <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars(trim($_POST['req_message'])) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>494:                         <textarea name="req_message" rows="20" cols="95" tabindex="<?php echo $cur_index++ ?>"><?php echo isset($_POST['req_message']) ? pun_htmlspecialchars($message) : (isset($quote) ? $quote : ''); ?></textarea><br /></label>
492:                         <ul class="bblinks">495:                         <ul class="bblinks">
493:                             <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>496:                             <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>
494:                             <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>497:                             <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/upload/profile.php punbb-1.2.14/upload/profile.php
 27: require PUN_ROOT.'include/common.php'; 27: require PUN_ROOT.'include/common.php';
 28:  28: 
 29:  29: 
 30: if ($pun_user['g_read_board'] == '0' && !isset($_GET['key'])) 
 31:     message($lang_common['No view']); 
 32:  
 33:  
 34: $action = isset($_GET['action']) ? $_GET['action'] : null; 30: $action = isset($_GET['action']) ? $_GET['action'] : null;
 35: $section = isset($_GET['section']) ? $_GET['section'] : null; 31: $section = isset($_GET['section']) ? $_GET['section'] : null;
 36: $id = isset($_GET['id']) ? intval($_GET['id']) : 0; 32: $id = isset($_GET['id']) ? intval($_GET['id']) : 0;
 37: if ($id < 2) 33: if ($id < 2)
 38:     message($lang_common['Bad request']); 34:     message($lang_common['Bad request']);
 39:  35: 
  36: if ($pun_user['g_read_board'] == '0' && ($action != 'change_pass' || !isset($_GET['key'])))
  37:     message($lang_common['No view']);
  38: 
 40: // Load the profile.php/register.php language file 39: // Load the profile.php/register.php language file
 41: require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php'; 40: require PUN_ROOT.'lang/'.$pun_user['language'].'/prof_reg.php';
 42:  41: 
 60:         $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error()); 59:         $result = $db->query('SELECT activate_string, activate_key FROM '.$db->prefix.'users WHERE id='.$id) or error('Unable to fetch new password', __FILE__, __LINE__, $db->error());
 61:         list($new_password_hash, $new_password_key) = $db->fetch_row($result); 60:         list($new_password_hash, $new_password_key) = $db->fetch_row($result);
 62:  61: 
 63:         if ($key != $new_password_key) 62:         if ($key == '' || $key != $new_password_key)
 64:             message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.'); 63:             message($lang_profile['Pass key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
 65:         else 64:         else
 66:         { 65:         {
195:             message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');194:             message($lang_profile['E-mail key bad'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
196:         else195:         else
197:         {196:         {
198:             $db->query('UPDATE '.$db->prefix.'users SET email=\''.$new_email.'\', activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());197:             $db->query('UPDATE '.$db->prefix.'users SET email=activate_string, activate_string=NULL, activate_key=NULL WHERE id='.$id) or error('Unable to update e-mail address', __FILE__, __LINE__, $db->error());
199: 198: 
200:             message($lang_profile['E-mail updated'], true);199:             message($lang_profile['E-mail updated'], true);
201:         }200:         }
202:     }201:     }
203:     else if (isset($_POST['form_sent']))202:     else if (isset($_POST['form_sent']))
204:     {203:     {
 204:         if (pun_hash($_POST['req_password']) !== $pun_user['password'])
 205:             message($lang_profile['Wrong pass']);
 206: 
205:         require PUN_ROOT.'include/email.php';207:         require PUN_ROOT.'include/email.php';
206: 208: 
207:         // Validate the email-address209:         // Validate the email-address
224:         }226:         }
225: 227: 
226:         // Check if someone else already has registered with that e-mail address228:         // Check if someone else already has registered with that e-mail address
227:         $result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$new_email.'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());229:         $result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE email=\''.$db->escape($new_email).'\'') or error('Unable to fetch user info', __FILE__, __LINE__, $db->error());
228:         if ($db->num_rows($result))230:         if ($db->num_rows($result))
229:         {231:         {
230:             if ($pun_config['p_allow_dupe_email'] == '0')232:             if ($pun_config['p_allow_dupe_email'] == '0')
244: 246: 
245:         $new_email_key = random_pass(8);247:         $new_email_key = random_pass(8);
246: 248: 
247:         $db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$new_email.'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());249:         $db->query('UPDATE '.$db->prefix.'users SET activate_string=\''.$db->escape($new_email).'\', activate_key=\''.$new_email_key.'\' WHERE id='.$id) or error('Unable to update activation data', __FILE__, __LINE__, $db->error());
248: 250: 
249:         // Load the "activate e-mail" template251:         // Load the "activate e-mail" template
250:         $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));252:         $mail_tpl = trim(file_get_contents(PUN_ROOT.'lang/'.$pun_user['language'].'/mail_templates/activate_email.tpl'));
265:     }267:     }
266: 268: 
267:     $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];269:     $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Profile'];
268:     $required_fields = array('req_new_email' => $lang_profile['New e-mail']);270:     $required_fields = array('req_new_email' => $lang_profile['New e-mail'], 'req_password' => $lang_common['Password']);
269:     $focus_element = array('change_email', 'req_new_email');271:     $focus_element = array('change_email', 'req_new_email');
270:     require PUN_ROOT.'header.php';272:     require PUN_ROOT.'header.php';
271: 273: 
280:                     <div class="infldset">282:                     <div class="infldset">
281:                         <input type="hidden" name="form_sent" value="1" />283:                         <input type="hidden" name="form_sent" value="1" />
282:                         <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>284:                         <label><strong><?php echo $lang_profile['New e-mail'] ?></strong><br /><input type="text" name="req_new_email" size="50" maxlength="50" /><br /></label>
 285:                         <label><strong><?php echo $lang_common['Password'] ?></strong><br /><input type="password" name="req_password" size="16" maxlength="16" /><br /></label>
283:                         <p><?php echo $lang_profile['E-mail instructions'] ?></p>286:                         <p><?php echo $lang_profile['E-mail instructions'] ?></p>
284:                     </div>287:                     </div>
285:                 </fieldset>288:                 </fieldset>
304: 307: 
305:     if (isset($_POST['form_sent']))308:     if (isset($_POST['form_sent']))
306:     {309:     {
 310:         if (!isset($_FILES['req_file']))
 311:             message($lang_profile['No file']);
 312:             
307:         $uploaded_file = $_FILES['req_file'];313:         $uploaded_file = $_FILES['req_file'];
308: 314: 
309:         // Make sure the upload went smooth315:         // Make sure the upload went smooth
324:                     message($lang_profile['No file']);330:                     message($lang_profile['No file']);
325:                     break;331:                     break;
326: 332: 
 333:                 case 6:    // UPLOAD_ERR_NO_TMP_DIR
 334:                     message($lang_profile['No tmp directory']);
 335:                     break;
 336: 
327:                 default:337:                 default:
328:                     // No error occured, but was something actually uploaded?338:                     // No error occured, but was something actually uploaded?
329:                     if ($uploaded_file['size'] == 0)339:                     if ($uploaded_file['size'] == 0)
356:                 message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');366:                 message($lang_profile['Move failed'].' <a href="mailto:'.$pun_config['o_admin_email'].'">'.$pun_config['o_admin_email'].'</a>.');
357: 367: 
358:             // Now check the width/height368:             // Now check the width/height
359:             list($width, $height, ,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');369:             list($width, $height, $type,) = getimagesize($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
360:             if ($width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])370:             if (empty($width) || empty($height) || $width > $pun_config['o_avatars_width'] || $height > $pun_config['o_avatars_height'])
361:             {371:             {
362:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');372:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
363:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');373:                 message($lang_profile['Too wide or high'].' '.$pun_config['o_avatars_width'].'x'.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].'.');
364:             }374:             }
 375:             else if ($type == 1 && $uploaded_file['type'] != 'image/gif')    // Prevent dodgy uploads
 376:             {
 377:                 @unlink($pun_config['o_avatars_dir'].'/'.$id.'.tmp');
 378:                 message($lang_profile['Bad type']);
 379:             }            
365: 380: 
366:             // Delete any old avatars and put the new one in place381:             // Delete any old avatars and put the new one in place
367:             @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);382:             @unlink($pun_config['o_avatars_dir'].'/'.$id.$extensions[0]);
395:                     <div class="infldset">410:                     <div class="infldset">
396:                         <input type="hidden" name="form_sent" value="1" />411:                         <input type="hidden" name="form_sent" value="1" />
397:                         <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" />412:                         <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $pun_config['o_avatars_size'] ?>" />
398:                         <p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p> 
399:                         <label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label>413:                         <label><strong><?php echo $lang_profile['File'] ?></strong><br /><input name="req_file" type="file" size="40" /><br /></label>
 414:                         <p><?php echo $lang_profile['Avatar desc'].' '.$pun_config['o_avatars_width'].' x '.$pun_config['o_avatars_height'].' '.$lang_profile['pixels'].' '.$lang_common['and'].' '.$pun_config['o_avatars_size'].' '.$lang_profile['bytes'].' ('.ceil($pun_config['o_avatars_size'] / 1024) ?> KB).</p>
400:                     </div>415:                     </div>
401:                 </fieldset>416:                 </fieldset>
402:             </div>417:             </div>
524:     $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());539:     $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());
525:     list($group_id, $username) = $db->fetch_row($result);540:     list($group_id, $username) = $db->fetch_row($result);
526: 541: 
 542:     if ($group_id == PUN_ADMIN)
 543:         message('Administrators cannot be deleted. In order to delete this user, you must first move him/her to a different user group.');
 544: 
527:     if (isset($_POST['delete_user_comply']))545:     if (isset($_POST['delete_user_comply']))
528:     {546:     {
529:         // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well547:         // If the user is a moderator or an administrator, we remove him/her from the moderator list in all forums as well
601:                         <div class="rbox">619:                         <div class="rbox">
602:                             <label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label>620:                             <label><input type="checkbox" name="delete_posts" value="1" checked="checked" /><?php echo $lang_profile['Delete posts'] ?><br /></label>
603:                         </div>621:                         </div>
604:                         <p><strong class="showhot"><?php echo $lang_profile['Delete warning'] ?></strong></p>622:                         <p class="warntext"><strong><?php echo $lang_profile['Delete warning'] ?></strong></p>
605:                     </div>623:                     </div>
606:                 </fieldset>624:                 </fieldset>
607:             </div>625:             </div>
654:     {672:     {
655:         case 'essentials':673:         case 'essentials':
656:         {674:         {
657:             $form = extract_elements(array('timezone', 'language', 'style'));675:             $form = extract_elements(array('timezone', 'language'));
658: 676: 
659:             if ($pun_user['g_id'] < PUN_GUEST)677:             if ($pun_user['g_id'] < PUN_GUEST)
660:             {678:             {
701:                     message($lang_common['Invalid e-mail']);719:                     message($lang_common['Invalid e-mail']);
702:             }720:             }
703: 721: 
 722:             // Make sure we got a valid language string
 723:             if (isset($form['language']))
 724:             {
 725:                 $form['language'] = preg_replace('#[\.\\\/]#', '', $form['language']);
 726:                 if (!file_exists(PUN_ROOT.'lang/'.$form['language'].'/common.php'))
 727:                         message($lang_common['Bad request']);
 728:             }
 729: 
704:             break;730:             break;
705:         }731:         }
706: 732: 
708:         {734:         {
709:             $form = extract_elements(array('realname', 'url', 'location'));735:             $form = extract_elements(array('realname', 'url', 'location'));
710: 736: 
711:             if ($pun_user['g_id'] < PUN_GUEST)737:             if ($pun_user['g_id'] == PUN_ADMIN)
712:                 $form['title'] = trim($_POST['title']);738:                 $form['title'] = trim($_POST['title']);
713:             else if ($pun_user['g_set_title'] == '1')739:             else if ($pun_user['g_set_title'] == '1')
714:             {740:             {
792:         {818:         {
793:             $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));819:             $form = extract_elements(array('email_setting', 'save_pass', 'notify_with_post'));
794: 820: 
795:             $form['email_setting'] == intval($form['email_setting']);821:             $form['email_setting'] = intval($form['email_setting']);
796:             if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;822:             if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1;
797: 823: 
798:             if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';824:             if (!isset($form['save_pass']) || $form['save_pass'] != '1') $form['save_pass'] = '0';
814: 840: 
815: 841: 
816:     // Singlequotes around non-empty values and NULL for empty values842:     // Singlequotes around non-empty values and NULL for empty values
 843:     $temp = array();
817:     while (list($key, $input) = @each($form))844:     while (list($key, $input) = @each($form))
818:     {845:     {
819:         $value = ($input != '') ? '\''.$db->escape($input).'\'' : 'NULL';846:         $value = ($input !== '') ? '\''.$db->escape($input).'\'' : 'NULL';
820: 847: 
821:         $temp[] = $key.'='.$value;848:         $temp[] = $key.'='.$value;
822:     }849:     }
823: 850: 
 851:     if (empty($temp))
 852:         message($lang_common['Bad request']);
 853: 
824: 854: 
825:     $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());855:     $db->query('UPDATE '.$db->prefix.'users SET '.implode(',', $temp).' WHERE id='.$id) or error('Unable to update profile', __FILE__, __LINE__, $db->error());
826: 856: 
861: }891: }
862: 892: 
863: 893: 
864: $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());894: $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());
865: if (!$db->num_rows($result))895: if (!$db->num_rows($result))
866:     message($lang_common['Bad request']);896:     message($lang_common['Bad request']);
867: 897: 
963:                     <div class="infldset">993:                     <div class="infldset">
964:                         <dl>994:                         <dl>
965:                             <dt><?php echo $lang_profile['Jabber'] ?>: </dt>995:                             <dt><?php echo $lang_profile['Jabber'] ?>: </dt>
966:                             <dd><?php echo ($user['jabber'] !='') ? $user['jabber'] : $lang_profile['Unknown']; ?></dd>996:                             <dd><?php echo ($user['jabber'] !='') ? pun_htmlspecialchars($user['jabber']) : $lang_profile['Unknown']; ?></dd>
967:                             <dt><?php echo $lang_profile['ICQ'] ?>: </dt>997:                             <dt><?php echo $lang_profile['ICQ'] ?>: </dt>
968:                             <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>998:                             <dd><?php echo ($user['icq'] !='') ? $user['icq'] : $lang_profile['Unknown']; ?></dd>
969:                             <dt><?php echo $lang_profile['MSN'] ?>: </dt>999:                             <dt><?php echo $lang_profile['MSN'] ?>: </dt>
1125:         $d = dir(PUN_ROOT.'lang');1155:         $d = dir(PUN_ROOT.'lang');
1126:         while (($entry = $d->read()) !== false)1156:         while (($entry = $d->read()) !== false)
1127:         {1157:         {
1128:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry))1158:             if ($entry != '.' && $entry != '..' && is_dir(PUN_ROOT.'lang/'.$entry) && file_exists(PUN_ROOT.'lang/'.$entry.'/common.php'))
1129:                 $languages[] = $entry;1159:                 $languages[] = $entry;
1130:         }1160:         }
1131:         $d->close();1161:         $d->close();
1133:         // Only display the language selection box if there's more than one language available1163:         // Only display the language selection box if there's more than one language available
1134:         if (count($languages) > 1)1164:         if (count($languages) > 1)
1135:         {1165:         {
 1166:             natsort($languages);
1136: 1167: 
1137: ?>1168: ?>
1138:                             <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>1169:                             <label><?php echo $lang_prof_reg['Language'] ?>: <?php echo $lang_prof_reg['Language info'] ?>
1141: 1172: 
1142:             while (list(, $temp) = @each($languages))1173:             while (list(, $temp) = @each($languages))
1143:             {1174:             {
1144:                 if ($pun_user['language'] == $temp)1175:                 if ($user['language'] == $temp)
1145:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";1176:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
1146:                 else1177:                 else
1147:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";1178:                     echo "\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
1179:     }1210:     }
1180:     else if ($section == 'personal')1211:     else if ($section == 'personal')
1181:     {1212:     {
1182:         if ($pun_user['g_set_title'] == '1' || $pun_user['g_id'] < PUN_GUEST)1213:     &n