Thread: [phpbbreloaded-checkins] SF.net SVN: phpbbreloaded: [232] phpBB Reloaded 2
Status: Planning
Brought to you by:
tehphpmaster
From: <mar...@us...> - 2006-06-20 21:42:16
|
Revision: 232 Author: markthedaemon Date: 2006-06-20 14:42:08 -0700 (Tue, 20 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpbbreloaded/?rev=232&view=rev Log Message: ----------- seeing the new installer thats currently in development won't be around for quite a while i've decided to improve the current one :D Modified Paths: -------------- phpBB Reloaded 2/install/cookie.php phpBB Reloaded 2/install/install.php Removed Paths: ------------- phpBB Reloaded 2/install/upgrade.php phpBB Reloaded 2/toolkit.php Modified: phpBB Reloaded 2/install/cookie.php =================================================================== --- phpBB Reloaded 2/install/cookie.php 2006-06-20 16:31:38 UTC (rev 231) +++ phpBB Reloaded 2/install/cookie.php 2006-06-20 21:42:08 UTC (rev 232) @@ -362,12 +362,12 @@ <tr><td colspan=2> <table width="99%" cellpadding="4" cellspacing="1" border="0" align="center" class="forumline"> <tr> - <th class="thHead">Step 2 Complete</th> + <th class="thHead">Installation Complete!</th> </tr> <tr> <td class="row1"> <span class="gen"></span><br /> - <span class="gen"><strong><font color="red"><a href="./../toolkit.php">Proceed to next (and final) part of installation!</a></font></strong></span><br /> + <span class="gen"><strong><font color="red"><a href="./../login.php">Delete the whole /install directory. When you have done this login!</a></font></strong></span><br /> </td> </tr> </td></tr> Modified: phpBB Reloaded 2/install/install.php =================================================================== --- phpBB Reloaded 2/install/install.php 2006-06-20 16:31:38 UTC (rev 231) +++ phpBB Reloaded 2/install/install.php 2006-06-20 21:42:08 UTC (rev 232) @@ -40,16 +40,16 @@ <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>"> <meta http-equiv="Content-Style-Type" content="text/css"> <title><?php echo $lang['Welcome_install'];?></title> -<link rel="stylesheet" href="../templates/subSilver/subSilver.css" type="text/css"> +<link rel="stylesheet" href="../templates/subC1/subC1.css" type="text/css"> <style type="text/css"> <!-- -th { background-image: url('../templates/subSilver/images/cellpic3.gif') } -td.cat { background-image: url('../templates/subSilver/images/cellpic1.gif') } -td.rowpic { background-image: url('../templates/subSilver/images/cellpic2.jpg'); background-repeat: repeat-y } -td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom { background-image: url('../templates/subSilver/images/cellpic1.gif') } +th { background-image: url('../templates/subC1/images/cellpic3.gif') } +td.cat { background-image: url('../templates/subC1/images/cellpic1.gif') } +td.rowpic { background-image: url('../templates/subC1/images/cellpic2.jpg'); background-repeat: repeat-y } +td.catHead,td.catSides,td.catLeft,td.catRight,td.catBottom { background-image: url('../templates/subC1/images/cellpic1.gif') } /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ -@import url("../templates/subSilver/formIE.css"); +@import url("../templates/subC1/formIE.css"); //--> </style> </head> @@ -61,8 +61,7 @@ <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> - <td><img src="../templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td> - <td align="center" width="100%" valign="middle"><span class="maintitle"><?php echo $lang['Welcome_install'];?></span></td> + <td align="center"><img src="../templates/subC1/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td> </tr> </table></td> </tr> Deleted: phpBB Reloaded 2/install/upgrade.php =================================================================== --- phpBB Reloaded 2/install/upgrade.php 2006-06-20 16:31:38 UTC (rev 231) +++ phpBB Reloaded 2/install/upgrade.php 2006-06-20 21:42:08 UTC (rev 232) @@ -1,281 +0,0 @@ -CREATE TABLE phpbb_attach_quota ( - user_id mediumint(8) unsigned NOT NULL default '0', - group_id mediumint(8) unsigned NOT NULL default '0', - quota_type smallint(2) NOT NULL default '0', - quota_limit_id mediumint(8) unsigned NOT NULL default '0', - KEY quota_type (quota_type) -) TYPE=MyISAM - -CREATE TABLE phpbb_attachments ( - attach_id mediumint(8) unsigned NOT NULL default '0', - post_id mediumint(8) unsigned NOT NULL default '0', - privmsgs_id mediumint(8) unsigned NOT NULL default '0', - user_id_1 mediumint(8) NOT NULL default '0', - user_id_2 mediumint(8) NOT NULL default '0', - KEY attach_id_post_id (attach_id,post_id), - KEY attach_id_privmsgs_id (attach_id,privmsgs_id), - KEY post_id (post_id), - KEY privmsgs_id (privmsgs_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_attachments_config ( - config_name varchar(255) NOT NULL default '', - config_value varchar(255) NOT NULL default '', - PRIMARY KEY (config_name) -) TYPE=MyISAM - -CREATE TABLE phpbb_attachments_desc ( - attach_id mediumint(8) unsigned NOT NULL auto_increment, - physical_filename varchar(255) NOT NULL default '', - real_filename varchar(255) NOT NULL default '', - download_count mediumint(8) unsigned NOT NULL default '0', - comment varchar(255) default NULL, - extension varchar(100) default NULL, - mimetype varchar(100) default NULL, - filesize int(20) NOT NULL default '0', - filetime int(11) NOT NULL default '0', - thumbnail tinyint(1) NOT NULL default '0', - PRIMARY KEY (attach_id), - KEY filetime (filetime), - KEY physical_filename (physical_filename(10)), - KEY filesize (filesize) -) TYPE=MyISAM -CREATE TABLE phpbb_auths_def ( - auth_id smallint(5) unsigned NOT NULL auto_increment, - auth_type char(1) binary NOT NULL default '', - auth_name varchar(50) NOT NULL default '', - auth_desc varchar(255) NOT NULL default '', - auth_title tinyint(1) NOT NULL default '0', - auth_order mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (auth_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_banlist ( - ban_id mediumint(8) UNSIGNED NOT NULL auto_increment, - ban_userid mediumint(8) NOT NULL, - ban_ip char(8) NOT NULL, - ban_email varchar(255), - PRIMARY KEY (ban_id), - KEY ban_ip_user_id (ban_ip, ban_userid) -) - -CREATE TABLE phpbb_cp_fields ( - field_id mediumint(8) unsigned NOT NULL auto_increment, - field_name varchar(50) NOT NULL default '', - panel_id mediumint(8) unsigned NOT NULL default '0', - field_order mediumint(8) unsigned NOT NULL default '0', - field_attr text NOT NULL, - PRIMARY KEY (field_id), - KEY panel_id (panel_id,field_name) -) TYPE=MyISAM - -CREATE TABLE phpbb_cp_patches ( - patch_id mediumint(8) unsigned NOT NULL auto_increment, - patch_file varchar(255) NOT NULL default '', - patch_time int(11) NOT NULL default '0', - patch_version varchar(25) NOT NULL default '', - patch_date varchar(8) NOT NULL default '', - patch_ref varchar(255) NOT NULL default '', - patch_author varchar(255) NOT NULL default '', - PRIMARY KEY (patch_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_draft_prune ( - prune_id tinyint(1) unsigned NOT NULL default '1', - prune_days smallint(5) unsigned NOT NULL default '0', - prune_freq smallint(5) unsigned NOT NULL default '0', - prune_next int(11) unsigned NOT NULL default '0', - prune_enable tinyint(1) unsigned NOT NULL default '0' -) TYPE=MyISAM - -CREATE TABLE phpbb_extension_groups ( - group_id mediumint(8) NOT NULL auto_increment, - group_name varchar(20) NOT NULL default '', - cat_id tinyint(2) NOT NULL default '0', - allow_group tinyint(1) NOT NULL default '0', - download_mode tinyint(1) unsigned NOT NULL default '1', - upload_icon varchar(100) default '', - max_filesize int(20) NOT NULL default '0', - forum_permissions varchar(255) NOT NULL default '', - PRIMARY KEY (group_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_extensions ( - ext_id mediumint(8) unsigned NOT NULL auto_increment, - group_id mediumint(8) unsigned NOT NULL default '0', - extension varchar(100) NOT NULL default '', - comment varchar(100) default NULL, - PRIMARY KEY (ext_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_forbidden_extensions ( - ext_id mediumint(8) unsigned NOT NULL auto_increment, - extension varchar(100) NOT NULL default '', - PRIMARY KEY (ext_id) -) TYPE=MyISAM - -ALTER TABLE phpbb_forums ADD( -auth_global_announce tinyint(2) NOT NULL default '0', - forum_last_title varchar(255) default NULL, - forum_last_poster mediumint(8) NOT NULL default '0', - forum_last_username varchar(25) default NULL, - forum_last_time int(11) NOT NULL default '0', - forum_link varchar(255) default NULL, - forum_link_hit_count tinyint(1) NOT NULL default '0', - forum_link_hit bigint(20) unsigned NOT NULL default '0', - forum_link_start int(11) NOT NULL default '0', - forum_style tinyint(4) NOT NULL default '0', - forum_nav_icon varchar(255) default NULL, - forum_icon varchar(255) default NULL, - forum_topics_ppage tinyint(2) NOT NULL default '0', - forum_topics_sort varchar(25) default NULL, - forum_topics_order varchar(4) default NULL, - forum_index_pack tinyint(1) NOT NULL default '0', - forum_index_split tinyint(1) NOT NULL default '0', - forum_board_box tinyint(1) NOT NULL default '0', - forum_subs_hidden tinyint(1) NOT NULL default '0', - auth_download tinyint(2) NOT NULL default '0', - forum_qpes tinyint(1) NOT NULL default '1', -) - -CREATE TABLE phpbb_groups ( - group_id mediumint(8) NOT NULL auto_increment, - group_type tinyint(4) NOT NULL default '1', - group_name varchar(40) NOT NULL default '', - group_description varchar(255) NOT NULL default '', - group_moderator mediumint(8) NOT NULL default '0', - group_single_user tinyint(1) NOT NULL default '1', - group_status tinyint(2) NOT NULL default '0', - group_user_id mediumint(8) NOT NULL default '0', - group_user_list text NOT NULL, - group_weight mediumint(3) NOT NULL default '0', - group_legend smallint(1) NOT NULL default '0', - group_color smallint(1) NOT NULL default '0', - group_dl_auto_traffic bigint(20) NOT NULL default '0', - PRIMARY KEY (group_id), - KEY group_single_user (group_single_user), - KEY group_user_id (group_user_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_icons ( - icon_id mediumint(3) NOT NULL auto_increment, - icon_name varchar(50) NOT NULL default '', - icon_url varchar(255) NOT NULL default '', - icon_auth varchar(50) NOT NULL default '', - icon_types varchar(255) default NULL, - icon_order mediumint(8) unsigned NOT NULL default '0', - PRIMARY KEY (icon_id) -) TYPE=MyISAM - - -ALTER TABLE phpbb_posts ADD( - post_icon smallint(3) unsigned NOT NULL default '0', - post_attachment tinyint(1) NOT NULL default '0', - post_draft smallint(1) unsigned NOT NULL default '0', - KEY post_icon (post_icon) -) - -ALTER TABLE phpbb_posts_text ADD( - post_sub_title varchar(255) default NULL, -) - -CREATE TABLE phpbb_presets ( - preset_id mediumint(5) unsigned NOT NULL auto_increment, - preset_type varchar(5) NOT NULL default '', - preset_name varchar(50) NOT NULL default '', - PRIMARY KEY (preset_id) -) TYPE=MyISAM - -CREATE TABLE phpbb_presets_data ( - preset_id mediumint(5) unsigned NOT NULL default '0', - preset_auth varchar(50) NOT NULL default '', - preset_value tinyint(1) default NULL, - PRIMARY KEY (preset_id,preset_auth) -) TYPE=MyISAM - - -ALTER TABLE phpbb_privmsgs ADD( - privmsgs_attachment tinyint(1) NOT NULL default '0', -) - -CREATE TABLE phpbb_quota_limits ( - quota_limit_id mediumint(8) unsigned NOT NULL auto_increment, - quota_desc varchar(20) NOT NULL default '', - quota_limit bigint(20) unsigned NOT NULL default '0', - PRIMARY KEY (quota_limit_id) -) TYPE=MyISAM - -ALTER TABLE phpbb_themes ADD( - session_time varchar(6) NOT NULL default '', - g0 varchar(6) NOT NULL default '', - g3 varchar(6) NOT NULL default '', - g4 varchar(6) NOT NULL default '', - g5 varchar(6) NOT NULL default '', - g7 varchar(6) NOT NULL default '', - g8 varchar(6) NOT NULL default '', -) - -ALTER TABLE phpbb_topics ADD( - topic_sub_type mediumint(5) NOT NULL default '0', - topic_sub_title varchar(255) default NULL, - topic_first_username varchar(25) default NULL, - topic_last_poster mediumint(8) NOT NULL default '0', - topic_last_username varchar(25) default NULL, - topic_last_time int(11) NOT NULL default '0', - topic_icon smallint(3) unsigned NOT NULL default '0', - topic_duration int(11) NOT NULL default '0', - topic_calendar_time int(11) default NULL, - topic_calendar_duration int(11) default NULL, - topic_attachment tinyint(1) NOT NULL default '0', - KEY topic_last_time (topic_last_time), - KEY topic_calendar_time (topic_calendar_time) -) - -CREATE TABLE phpbb_topics_attr ( - attr_id mediumint(5) unsigned NOT NULL auto_increment, - attr_name varchar(50) NOT NULL default '', - attr_fname varchar(50) default NULL, - attr_fimg varchar(50) default NULL, - attr_tname varchar(50) default NULL, - attr_timg varchar(50) default NULL, - attr_order mediumint(8) NOT NULL default '0', - attr_field varchar(50) default NULL, - attr_cond char(2) default NULL, - attr_value smallint(3) NOT NULL default '0', - attr_auth varchar(50) default NULL, - PRIMARY KEY (attr_id) -) - - -CREATE TABLE phpbb_users ( - user_unread_date int(11) NOT NULL default '0', - user_unread_topics text, - user_keep_unreads tinyint(1) NOT NULL default '0', - user_topics_sort varchar(25) NOT NULL default '', - user_topics_order varchar(4) NOT NULL default '', - user_smart_date tinyint(1) NOT NULL default '0', - user_dst tinyint(1) NOT NULL default '0', - user_board_box tinyint(1) NOT NULL default '0', - user_index_pack tinyint(1) NOT NULL default '0', - user_index_split tinyint(1) NOT NULL default '0', - user_session_logged tinyint(1) NOT NULL default '0', - user_group_id mediumint(8) NOT NULL default '5', - user_qp_settings varchar(25) NOT NULL default '0', -) - - -CREATE TABLE phpbb_users_cache ( - user_id mediumint(8) NOT NULL default '0', - cache_id varchar(5) NOT NULL default '', - cache_data longtext, - cache_time int(11) default '0', - PRIMARY KEY (user_id,cache_id) -) TYPE=MyISAM - -ALTER TABLE phpbb_vote_desc ADD( - vote_option_id tinyint(4) unsigned NOT NULL default '0', - vote_option_text varchar(255) NOT NULL default '', - vote_result int(11) NOT NULL default '0', - KEY vote_option_id (vote_option_id), - KEY vote_id (vote_id) -) \ No newline at end of file Deleted: phpBB Reloaded 2/toolkit.php =================================================================== --- phpBB Reloaded 2/toolkit.php 2006-06-20 16:31:38 UTC (rev 231) +++ phpBB Reloaded 2/toolkit.php 2006-06-20 21:42:08 UTC (rev 232) @@ -1,9413 +0,0 @@ -<?php - -// PHPBB Admin ToolKit, v2.1 - Starfoxtj (sta...@ya...) -// Copyright 2005 - Starfoxtj -// This script is NOT released under the GPL: - - - -/***************************************************************************************************** - - -By using this script you agree to the following: - - -1. You may modify any portion of this script for personal/business use. This includes changing the - look, style, messages, functions, behavior etc. Note that any modifications outside of the standard - configuration options may negatively affect the security of this script if the modification is not - written properly and securely. - Note: If the script has been modified, I ask that you at least retain the toolkit name, and - my name (Starfoxtj), as a link to: http://starfoxtj.no-ip.com/phpbb/uploadtoolkit on the header - or footer of every page. You are not required to list this information, but by removing it you may - be forfeiting your support for this product. (Similar to the phpbb copyright agreement) -2. Ownership of this script remains with Starfoxtj regardless of how this script was acquired. -3. You may NOT sell any portion of this script, even if it is contained within another package - without prior consent from Starfoxtj. -4. You may NOT hold Starfoxtj liable for any direct or indirect consequences of using this script. - Many hours have been spent ensuring that this script is as secure as possible. However nothing - can be 100% guaranteed. - If a security hole has been found, please contact me immediately at: sta...@ya... - - -5. You MAY distribute this script stand alone, or with another package without any prior permission - at no charge. You may NOT however, distribute this script if any modifications have been made - without the consent of Starfoxtj. Meaning, only the unmodified original may be freely distributed - (at no charge). - - I personally recommended you only download this script from: - http://starfoxtj.no-ip.com/phpbb/toolkit - - If the script was downloaded form another location, it IS possible that it may have been altered. - - -******************************************************************************************************/ - - -// You may set a password here if you would rather not use the toolkit_config.php - -$use_toolkit_config_file = 'yes'; // Change this to 'No' to set the password in the toolkit.php itself like in previous releases -$use_hashed_in_file_passwords = 'no'; // Change this if you want to use hashed admin/mod passwords specified in the toolkit (the toolkit_config.php file will use hashed passwords regardless) -$adminpassword = 'ENTER_ADMIN_PASSWORD_HERE'; // Note: I HIGHLY recommend using a password at least 16 characters long! -$modpassword = 'ENTER_MOD_PASSWORD_HERE'; // Leave blank to disable mod login - - -// Option 1: Allow Mods to Ban/UnBan Users? -$modban = 'yes'; // 'yes' : 'no' - - -// Option 2: Allow Mods to Change User Post Count? -$modpost = 'no'; // 'yes' : 'no' - - -// Option 3: Allow Mods to Change User Ranks? -$modrank = 'yes'; // 'yes' : 'no' - - -// Option 4: Allow Mods to Delete Users? -$moddelete = 'no'; // 'yes' : 'no' - - -// Option 5: Update check URLs -// Note: To disable checking for updates for phpbb, set the phpbb URL to 'none' -// Note: To disable checking for updates for this toolkit, set the toolkit URL to 'none' -// The default phpbb url is: http://www.phpbb.com/updatecheck/20x.txt -// The default toolkit url is: http://starfoxtj.no-ip.com/phpBB/toolkit/updatecheck/2.x.txt -$update_url['phpbb'] = 'http://www.phpbbreloaded.com/versionchecker/20x.txt'; -$update_url['toolkit'] = 'http://starfoxtj.no-ip.com/phpBB/toolkit/updatecheck/2.x.txt'; - - - - - -// Lets begin the coding! -// -// (CHANGE INFORMATION AFTER THIS LINE WITH CAUTION!) -// -// -// - - - - -session_start(); - -$_SESSION['toolkitversion'] = '2.1'; -$_SESSION['toolkit_title'] = '<b><a href="index.php"><font size="5" color="#000000">PHPBB Admin ToolKit '.$_SESSION['toolkitversion'].'</b></font></a><font size="5"> - <a href="http://starfoxtj.no-ip.com/phpbb/toolkit" target="_blank">Starfoxtj</a></font>'; -$_SESSION['toolkit_title_nversion'] = '<b><a href="index.php"><font size="5" color="#000000">PHPBB Admin ToolKit</b></font></a><font size="5"> - <a href="http://starfoxtj.no-ip.com/phpbb/toolkit" target="_blank">Starfoxtj</a></font>'; -$_SESSION['copyrightfooter'] = '<br /><center><hr width="90%"><font size="2">PHPBB Admin ToolKit '.$_SESSION['toolkitversion'].' \xA9 2006 - <a href="mailto:sta...@ya...">Starfoxtj</a></font></center>'; - - - -// Set global information and start db access - -if( file_exists( 'config.php' ) ) - - { - - include( 'config.php' ); - - if( $dbms == 'mysql' || $dbms == 'mysql4' ) - - { - - $db = @mysql_connect("$dbhost", "$dbuser", "$dbpasswd") - or die( 'Could not connect to database: '.mysql_error() ); - - @mysql_select_db($dbname) - or die( 'Could not select database: '.mysql_error() ); - - } - - else - - { - - die( 'This toolkit is only compatible with MySQL databases.' ); - - } - } - - -// Define Some Variables - -$index = $_SERVER['PHP_SELF']; -$domain = $_SERVER['SERVER_NAME']; -$full_domain = 'http://'.$domain; - -if( file_exists( 'config.php' ) ) - - { - - $phpbb_auth_access = $table_prefix."auth_access"; - $phpbb_config = $table_prefix."config"; - $phpbb_banlist = $table_prefix."banlist"; - $phpbb_users = $table_prefix."users"; - $phpbb_ranks = $table_prefix."ranks"; - $phpbb_vote_voters = $table_prefix."vote_voters"; - $phpbb_user_group = $table_prefix."user_group"; - $phpbb_groups = $table_prefix."groups"; - $phpbb_posts = $table_prefix."posts"; - $phpbb_posts_text = $table_prefix."posts_text"; - $phpbb_topics = $table_prefix."topics"; - $phpbb_forums = $table_prefix."forums"; - $phpbb_themes = $table_prefix."themes"; - $phpbb_themes_name = $table_prefix."themes_name"; - $phpbb_sessions = $table_prefix."sessions"; - $phpbb_sessions_keys = $table_prefix."sessions_keys"; - $phpbb_topics_watch = $table_prefix."topics_watch"; - $phpbb_privmsgs = $table_prefix."privmsgs"; - $phpbb_privmsgs_text = $table_prefix."privmsgs_text"; - - $phpbb_version_result = mysql_query("SELECT * FROM $phpbb_config WHERE config_name='version'") - or die( 'MySQL Error: '.mysql_error() ); - $myrow_phpbb_version = mysql_fetch_array($phpbb_version_result); - $phpbb_version = $myrow_phpbb_version['config_value']; - - } - -$script_folder = substr( $index, 1, -(strlen( end( explode( '/', $index ) ) ) + 1 ) ); - - -// Set the errors to only display one of each error - -if( isset( $_SESSION['errors']['index'] ) ) - - { - - $_SESSION['errors']['index'] = array_unique( $_SESSION['errors']['index'] ); - - } - -if( isset( $_SESSION['errors']['edituser'] ) ) - - { - - $_SESSION['errors']['edituser'] = array_unique( $_SESSION['errors']['edituser'] ); - - } - -if( isset( $_SESSION['errors']['config'] ) ) - - { - - $_SESSION['errors']['config'] = array_unique( $_SESSION['errors']['config'] ); - - } - - - -///////////////////////////////////////// -// -// Check and Create config.php -// - -if( !file_exists( 'config.php' ) ) - - { //-.2-a - - - if( isset( $_POST['configphp_setup'] ) ) - - { //-.1-a.1 - - - if( $_POST['dbhost'] == '' || - $_POST['dbuser'] == '' || - $_POST['dbpasswd'] == '' || - $_POST['dbname'] == '' ) - - { - - $_SESSION['configphp_error'] = '<b>Error:</b> All fields must be filled in.'; - header( "Location: $index" ); - die(); - - } - - @chmod( "../$script_folder", 0777 ) - or die( "Could not CHMOD $script_folder folder to create config.php!<br /> - You can either change the CHMOD settings manually to 777, or create the config.php file by copying the following information - into notepad and specifying the database settings. Then save it as \"config.php\" and upload it to your $script_folder folder.<br /><br /> - Note: This assumes you are using MySQL4, if you are using MySQL3, replace \"mysql4\" with \"mysql\".<br /><br /> - - <table border=\"0\" width=\"400\" cellpadding=\"5\"; style=\"border-top: black 1px solid; border-right: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid\" bgcolor=\"#f5f5f5\"> - <tr> - - <td> - <b><?php<br /><br /> - - // phpBB 2.x auto-generated config file<br /> - // Do not change anything in this file!<br /><br /> - - \$dbms = 'mysql4';<br /><br /> - - \$dbhost = '<font color=\"#ff0000\">Your Host</font>';<br /> - \$dbname = '<font color=\"#ff0000\">Your Database Name</font>';<br /> - \$dbuser = '<font color=\"#ff0000\">Your Username</font>';<br /> - \$dbpasswd = '<font color=\"#ff0000\">Your Password</font>';<br /><br /> - - \$table_prefix = 'phpbb_';<br /><br /> - - define('PHPBB_INSTALLED', true);<br /><br /> - - ?></b> - - </td> - - </tr> - </table>" ); - - - @touch( 'config.php' ) - or die( "Could not create config.php!<br /> - You can either change the CHMOD settings manually to 777, or create the config.php file by copying the following information - into notepad and specifying the database settings. Then save it as \"config.php\" and upload it to your $script_folder folder.<br /><br /> - Note: This assumes you are using MySQL4, if you are using MySQL3, replace \"mysql4\" with \"mysql\".<br /><br /> - - <table border=\"0\" width=\"400\" cellpadding=\"5\"; style=\"border-top: black 1px solid; border-right: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid\" bgcolor=\"#f5f5f5\"> - <tr> - - <td> - <b><?php<br /><br /> - - // phpBB 2.x auto-generated config file<br /> - // Do not change anything in this file!<br /><br /> - - \$dbms = 'mysql4';<br /><br /> - - \$dbhost = '<font color=\"#ff0000\">Your Host</font>';<br /> - \$dbname = '<font color=\"#ff0000\">Your Database Name</font>';<br /> - \$dbuser = '<font color=\"#ff0000\">Your Username</font>';<br /> - \$dbpasswd = '<font color=\"#ff0000\">Your Password</font>';<br /><br /> - - \$table_prefix = 'phpbb_';<br /><br /> - - define('PHPBB_INSTALLED', true);<br /><br /> - - ?></b> - - </td> - - </tr> - </table>" ); - - - - - - $fp = fopen( 'config.php', "w" ) - or die ("The file config.php exists but could not be opened. Check the file permissions." ); - - $dbms = $_POST['dbms']; - $dbhost = $_POST['dbhost']; - $dbuser = $_POST['dbuser']; - $dbpasswd = $_POST['dbpasswd']; - $dbname = $_POST['dbname']; - $table_prefix = $_POST['table_prefix']; - - fwrite( $fp, "<?php - - -// phpBB 2.x auto-generated config file -// Do not change anything in this file! - -\$dbms = '$dbms'; - -\$dbhost = '$dbhost'; -\$dbname = '$dbname'; -\$dbuser = '$dbuser'; -\$dbpasswd = '$dbpasswd'; - -\$table_prefix = '$table_prefix'; - -define('PHPBB_INSTALLED', true); - -?>" ); - - fclose( $fp ); - - chmod( "../$script_folder", 0755 ); - - header( "Location: $index" ); - die(); - - - - } //-.1-a.1 - - else - - { //-.1-a.2 - - - session_destroy(); - - ?> - - <html> - <head> - <title>PHPBB Admin ToolKit v<?php echo $_SESSION['toolkitversion']; ?></title> - - <SCRIPT LANGUAGE="JavaScript"> - function placeFocus() { - if (document.forms.length > 0) { - var field = document.forms[0]; - for (i = 1; i < field.length; i++) { - if ((field.elements[i].name == "dbhost") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) { - document.forms[0].elements[i].focus(); - break; - } - } - } - } - </script> - - </head> - - <body link="#0000ff" vlink="#0000ff" alink="#0000ff" OnLoad="placeFocus()"> - - <center> - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr><td><div align="center"><?php echo $_SESSION['toolkit_title']; ?></div></td></tr> - </table><br /> - </center> - - <center> - - <font size="4">PHPBB Admin ToolKit: Create Config.php file</font> - <br /><br /> - - Config.php file not found! You may create a new one by entering in the information below:<br /><br /> - - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr> - - <td> - - <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> - - <table border="0" cellpadding="5" cellspacing="0"> - - <tr> - - <td> - - Database Type: - - </td> - - <td> - - <select name="dbms"> - <option value="mysql">MySQL 3.x</option> - <option value="mysql4" selected>MySQL 4.x</option> - <option value="postgres">PostgreSQL 7.x</option> - <option value="mssql">MS SQL Server 7/2000</option> - <option value="msaccess">MS Access [ ODBC ]</option> - <option value="mssql-odbc">MS SQL Server [ ODBC ]</option></select> - </td> - - </tr> - - <tr> - - <td> - - Host: - - </td> - - <td> - - <input type="text" name="dbhost" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - Username: - - </td> - - <td> - - <input type="text" name="dbuser" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - Password: - - </td> - - <td> - - <input type="password" name="dbpasswd" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - Database: - - </td> - - <td> - - <input type="text" name="dbname" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - Table Prefix: - - </td> - - <td> - - <input type="text" name="table_prefix" value="phpbb_" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td colspan="2" align="center"> - - <input type="hidden" name="configphp_setup" value="1" /> - - <br /><input TYPE="submit" VALUE="Create Config.php"> - - </td> - - </tr> - - </table> - - </form> - - </td> - - </tr> - </table> - </center> - - - <?php - - if( isset( $_SESSION['configphp_error'] ) ) - - { - - ?> - - <center> - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr> - - <td> - - <br /><br /><?php echo $_SESSION['configphp_error']; ?> - - </td> - - </tr> - - </table> - - - <?php - - } - - ?> - - </body> - </html> - - - - <?php - - - } //-.1-a.2 - - die(); - - - } //-.2-a - - - -///////////////////////////////////////// -// -// Check and set fist time password -// - -if( !file_exists( 'toolkit_config.php' ) && $use_toolkit_config_file == 'yes' ) - - { //-.1-a - - - if( isset( $_POST['toolkitconfig_setup'] ) ) - - { //-.1-a.1 - - - if( !isset( $_POST['admin_password'] ) || !isset( $_POST['admin_password_confirm'] ) ) - - { - - $_SESSION['toolkitconfig_error'] = '<b>Error:</b> Either the admin password was not specified, or the passwords did not match.'; - header( "Location: $index" ); - die(); - - } - - elseif( $_POST['admin_password'] == '' || $_POST['admin_password_confirm'] == '' ) - - { - - $_SESSION['toolkitconfig_error'] = '<b>Error:</b> Either the admin password was not specified, or the passwords did not match.'; - header( "Location: $index" ); - die(); - - } - - elseif( $_POST['admin_password'] != $_POST['admin_password_confirm'] ) - - { - - $_SESSION['toolkitconfig_error'] = '<b>Error:</b> The admin passwords do not match.'; - header( "Location: $index" ); - die(); - - } - - - if( $_POST['mod_password'] != $_POST['mod_password_confirm'] ) - - { - - $_SESSION['toolkitconfig_error'] = '<b>Error:</b> The mod passwords do not match.'; - header( "Location: $index" ); - die(); - - } - - @chmod( "../$script_folder", 0777 ) - or die( "Could not CHMOD $script_folder to 777 to create toolkit_config.php!<br /> - 1: Extract the toolkit.php file and open it with notepad.<br /> - 2: Find \"\$use_toolkit_config_file\" on line 40.<br /> - 3: Change the 'yes' to 'no'.<br /> - 4: Replace both the admin and mod passwords on lines 41 and 42<br /> - 5: Upload toolkit.php to your $script_folder folder." ); - - - @touch( 'toolkit_config.php' ) - or die( "Could not create toolkit_config.php, access denied!<br /> - Please install this script using method 2:<br /><br /> - 1: Extract the toolkit.php file and open it with notepad.<br /> - 2: Find \"\$use_toolkit_config_file\" on line 40.<br /> - 3: Change the 'yes' to 'no'.<br /> - 4: Replace both the admin and mod passwords on lines 41 and 42<br /> - 5: Upload toolkit.php to your $script_folder folder." ); - - - - - $fp = fopen( 'toolkit_config.php', "w" ) - or die ("The file toolkit_config.php exists but could not be opened. Check the file permissions." ); - - $version = $_SESSION['toolkitversion']; - $adminpassword = md5( md5( $_POST['admin_password'] ) ); - $modpassword = md5( md5( $_POST['mod_password'] ) ); - - fwrite( $fp, "<?php - -//////////////////////////////////////////////////////////// -// -// PHPBB Admin ToolKit v$version auto-generated config file. -// -// You may change the passwords in this file. - -// Note: The passwords in this file are hashed for security. -// If you need to change your passwords, you can either use the MD5 Generator included -// near the bottom of the toolkit index. -// Or you can simply delete this toolkit_config.php file and run toolkit.php -// to recreate this file with the new passwords. -// -// NOTE: For security, the passwords for this toolkit have been DOUBLE hashed! -// Meaning, the password was hashed once using the md5() function, then the hash -// was hashed again using the md5() function. The code equivalent is: \$pass = md5( md5( 'password' ) ); -// Because the password is double hashed, it should be almost completely uncrackable as -// a brute force/dictionary attack would have to first crack a 32 character password, THEN -// crack the result yielding the original password. -// This way, even if someone got your toolkit.config.php file it would in theory -// take the most powerful home computer over 10 years to break. -// - - - -\$adminpassword = '$adminpassword'; -\$modpassword = '$modpassword'; - -?>" ); - - fclose( $fp ); - - chmod( "../$script_folder", 0755 ); - - header( "Location: $index" ); - die(); - - - - } //-.1-a.1 - - else - - { //-.1-a.2 - - - session_destroy(); - - ?> - - <html> - <head> - <title>PHPBB Admin ToolKit v<?php echo $_SESSION['toolkitversion']; ?></title> - - <SCRIPT LANGUAGE="JavaScript"> - function placeFocus() { - if (document.forms.length > 0) { - var field = document.forms[0]; - for (i = 0; i < field.length; i++) { - if ((field.elements[i].name == "admin_password") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) { - document.forms[0].elements[i].focus(); - break; - } - } - } - } - </script> - - </head> - - <body link="#0000ff" vlink="#0000ff" alink="#0000ff" OnLoad="placeFocus()"> - - <center> - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr><td><div align="center"><?php echo $_SESSION['toolkit_title']; ?></div></td></tr> - </table><br /> - </center> - - <center> - - <font size="4">PHPBB Admin ToolKit: First Time Setup</font><br /> - - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr> - - <td> - - <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> - - <table border="0" cellpadding="5" cellspacing="0"> - - <tr> - - <td> - - Specify Admin Password: - - </td> - - <td> - - <input type="password" name="admin_password" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - Confirm Admin Password: - - </td> - - <td> - - <input type="password" name="admin_password_confirm" lengh="20" size="20" maxlengh="255"> - - </td> - - </tr> - - <tr> - - <td> - - <br />Specify ModPassword: - - </td> - - <td> - - <br /><input type="password" name="mod_password" lengh="20" size="20" maxlengh="255"> (Optional) - - </td> - - </tr> - - <tr> - - <td> - - Confirm Mod Password: - - </td> - - <td> - - <input type="password" name="mod_password_confirm" lengh="20" size="20" maxlengh="255"> (Optional) - - </td> - - </tr> - - <tr> - - <td colspan="2" align="center"> - - <input type="hidden" name="toolkitconfig_setup" value=1 /> - - <br /><input TYPE="submit" VALUE=" Enter "> - - </td> - - </tr> - - </table> - - </form> - - </td> - - </tr> - </table> - </center> - - - <?php - - if( isset( $_SESSION['toolkitconfig_error'] ) ) - - { - - ?> - - <center> - <table border="0" bgcolor="#ffffff" cellspacing="1" cellpadding="3"> - <tr> - - <td> - - <br /><br /><?php echo $_SESSION['toolkitconfig_error']; ?> - - </td> - - </tr> - - </table> - - - <?php - - } - - ?> - - </body> - </html> - - - - <?php - - - } //-.1-a.2 - - die(); - - - } //-.1-a - -elseif( file_exists( 'toolkit_config.php' ) && $use_toolkit_config_file == 'yes' ) - - { - - include( 'toolkit_config.php' ); - - - } - - - -if( !isset( $_SESSION['user_level'] ) ) - - { //-.1 - - $_SESSION['user_level'] = "null"; - - } //-.1 - - -if( !isset( $_SESSION['AUTH'] ) ) - - { - - $_SESSION['AUTH'] = array(); - - } - - -// Safe SQL data function - -function safe_sql( $data ) - - { - - if ( get_magic_quotes_gpc() ) - - { - - $data = stripslashes( $data ); - - } - - - if( phpversion() >= 4.3 ) - - { - - $data = mysql_real_escape_string( $data ); - - } - - else - - { - - $data = mysql_escape_string( $data ); - - } - - - $data = str_replace( '&', '&', $data ); - $data = str_replace( '<', '<', $data ); - $data = str_replace( '>', '>', $data ); - - return $data; - - } - -function safe_html( $data ) - - { - - $data = trim( $data ); - - $data = str_replace( '&', '&', $data ); - $data = str_replace( '<', '<', $data ); - $data = str_replace( '>', '>', $data ); - - return $data; - - } - -// Safe descriptions data function - -function safe_desc( $data ) - - { - - $data = str_replace( '&', '&', $data ); - $data = str_replace( '<', '<', $data ); - $data = str_replace( '>', '>', $data ); - - return $data; - - } - -// make_time function - -function make_time( $time ) - - { - - // Set error value to false as no errors are generated yet - - $error = false; - - // Set vals to proper "type" (int) - - $mm = intval( $time['mm'] ); - $dd = intval( $time['dd'] ); - $yy = intval( $time['yy'] ); - - $time_hh = intval( $time['time_hh'] ); - $time_mm = intval( $time['time_mm'] ); - $time_ss = intval( $time['time_ss'] ); - - - // Pad vals with leading zeros if single digets - - $mm = sprintf( "%02d", $mm ); - $dd = sprintf( "%02d", $dd ); - $yy = sprintf( "%02d", $yy ); - - $time_hh = sprintf( "%02d", $time_hh ); - $time_mm = sprintf( "%02d", $time_mm ); - $time_ss = sprintf( "%02d", $time_ss ); - - $time_ap = $time['time_ap']; - - - - // First check if specified date is a correct one - - if( !checkdate( $mm, $dd, $yy ) ) - - { - - $_SESSION['errors']['make_time'][] = 'You have entered an invalid date combination.'; - $error = true; - return false; - - } - - - - // Check if year is after 1970 (because thats when the timestamp starts) - - if( $yy < 1970 ) - - { - - $_SESSION['errors']['make_time'][] = 'Due to the Unix timestamp restriction, the year must not be before 1970.'; - $error = true; - return false; - - } - - - - // Now perform various checks on the time info - - if( - - ( - $time_hh > 12 || - $time_hh < 1 || - $time_mm > 60 || - $time_ss < 0 || - $time_ss > 60 || - $time_mm < 0 - ) - - || - - ( - - $time_ap != 'pm' && - $time_ap != 'am' - - ) ) - - { - - $_SESSION['errors']['make_time'][] = 'You have entered an invalid time.'; - $error = true; - return false; - - } - - - // Generate timestamp - - if( $time_ap == 'pm' ) - - { - - $time_hh += 12; - - } - - if( $error == false ) - - { - $time = mktime( $time_hh, $time_mm, $time_ss, $mm, $dd, $yy ); - return $time; - - } - -} - - -// Delete user core function -// Only the actual sql queries are here, the checks and options are in the delete_user() function - -function delete_user_core( $user_id, $clear_posts = false, $retain_pms = false ) - - { - - // Set global variables - - global $index; - global $phpbb_version; - - global $phpbb_banlist; - global $phpbb_user_group; - global $phpbb_users; - global $phpbb_groups; - global $phpbb_posts; - global $phpbb_posts_text; - global $phpbb_topics; - global $phpbb_vote_voters; - global $phpbb_auth_access; - global $phpbb_sessions; - global $phpbb_sessions_keys; - global $phpbb_privmsgs; - global $phpbb_privmsgs_text; - global $phpbb_topics_watch; - - - - // First things first, sanitize the $user_id - - $user_id = safe_sql( $user_id); - - - // - // Obtain username and level based on user_id - // - - $sql = "SELECT * FROM $phpbb_users WHERE user_id=$user_id LIMIT 1"; - - $result = mysql_query($sql); - $myrow = mysql_fetch_array($result); - - $username = safe_sql( $myrow['username'] ); - $user_level = safe_sql( $myrow['user_level'] ); - - - // Obtain first admin account to set as group mod if deleted user is a group mod (step 5) - - $sql = "SELECT * FROM $phpbb_users WHERE user_level=1 ORDER BY user_id ASC LIMIT 1"; - - $result = mysql_query($sql); - $myrow = mysql_fetch_array($result); - - $admin_id= safe_sql( $myrow['user_id'] ); - - // Debug info: - // echo '<pre>'; - // echo gettype( $myrow ); - // die( $admin_id ); - - - - // This actually starts the delete process - - // ************************************************************** - // - // First sql query is to collect group information about the user - // - // ************************************************************** - - $sql = "SELECT g.group_id FROM $phpbb_user_group ug, $phpbb_groups g WHERE ug.user_id = $user_id AND g.group_id = ug.group_id AND g.group_single_user = 1"; - - $result = mysql_query($sql); - $row = mysql_fetch_array($result); - unset( $row[0] ); // Read note directly below about this line: - - - // PHPBB's $row = $db->sql_fetchrow($result); line returns an array containg the user id: - // Array - // ( - // [group_id] => 123 - // ) - - // The mqsql fetch array used in this scrip: $myrow = mysql_fetch_array($result); - // Returns the following: - // Array - // ( - // [0] => 123 - // [group_id] => 123 - // ) - - // Therefore I unset the $row[0] element - - - // Debugging info: - // echo '<pre>'; - // print_r( $row ); - // echo"\n\n$username"; - // die(); - - - // *************************************************************************** - // - // Second sql query sets the poster id to the anonymous account for all posts - // First query in this section is for the $clear_posts variable - // - // *************************************************************************** - - - // If clear posts is set to true, replace all posts made by user to "DELETED" - - if( $clear_posts == true ) - - { - - $sql = "SELECT `post_id` FROM `$phpbb_posts` WHERE `poster_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error selecting selecting posts to clear:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // Assings the results of the above query into an array - - while($myrow = mysql_fetch_array($result)) - - { - - $marked_posts[] = $myrow['post_id']; - - } - - - // Makes mark an empty array if the user has no PMs - - if( !isset( $marked_posts ) ) - - { - - $marked_posts = array(); - - } - - - // First check to see if user has any posts, if not skip replacing the posts - - if( isset( $marked_posts ) && count( $marked_posts ) ) - - { - - $marked_posts = implode( ',', $marked_posts ); - - $sql = "UPDATE `$phpbb_posts_text` SET `post_text`='DELETED' WHERE `post_id` IN ( $marked_posts )"; - - // echo '<pre>'; - // echo $sql; - // echo '<br />'; - // print_r( $marked_posts ); - // die(); - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting posts to DELETED:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - - - // Sets the poster id to the anonymous account for all posts and replaces the username with DELETED - - $sql = "UPDATE `$phpbb_posts` SET `poster_id`=-1, `post_username`='DELETED' WHERE `poster_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting poster id to anonymous for deleted user:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - } - - else - - { - - - // Sets the poster id to the anonymous account for all posts, but retains the original username - - $sql = "UPDATE `$phpbb_posts` SET `poster_id`=-1, `post_username`='".str_replace( "\\'", "''", addslashes( $username ) )."' WHERE `poster_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting poster id to anonymous for deleted user:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - - // *************************************************************************** - // - // Third sql query sets the topic id to the anonymous account for all topics - // - // *************************************************************************** - - // If clear posts is set to true, replace all topics made by user to "DELETED" - - if( $clear_posts == true ) - - { - - $sql = "UPDATE `$phpbb_topics` SET `topic_title`='DELETED' WHERE `topic_poster`=$user_id"; - - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting topics to DELETED:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // Sets the topic id to the anonymous account for all topics and replaces the username with DELETED - - $sql = "UPDATE `$phpbb_topics` SET `topic_poster`=-1 WHERE `topic_poster`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting topic id poster to anonymous for deleted user:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - } - - else - - { - - - // Sets the poster id to the anonymous account for all posts, but retains the original username - - $sql = "UPDATE `$phpbb_topics` SET `topic_poster`=-1 WHERE `topic_poster`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting topic id poster to anonymous for deleted user:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - - // *************************************************************************** - // - // Fourth sql query sets the voter id to anonymous - // - // *************************************************************************** - - $sql = "UPDATE `$phpbb_vote_voters` SET `vote_user_id`=-1 WHERE `vote_user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting voter ID to anonymous:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Fifth sql query collects the phpbb_groups info and assigns it to the - // $group_mods array where the user is a moderator - // - // *************************************************************************** - - $sql = "SELECT `group_id` FROM `$phpbb_groups` WHERE `group_moderator`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error selecting groups where user is a moderator:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // Assings the results of the above query into an array - - while($myrow = mysql_fetch_array($result)) - - { - - $group_mod[] = $myrow['group_id']; - - } - - // Debugging info: - // echo '<pre>'; - // print_r( $group_mod ); - // die(); - - - // If the user is a moderator for any groups, this query assigns the - // new mod status to the oldest admin account - - if( isset( $group_mod ) && count( $group_mod ) ) - - { - - // - // Make SURE to insert a query here to check for the first admin account to associate as the new group moderator - // after the deleted user is deleted! - // Done - - // $admin_id = 3; //This is a temp static admin id that will be dymamic in the final release - - $update_mod_id = implode( ',', $group_mod ); - $sql = "UPDATE `$phpbb_groups` SET `group_moderator`=$admin_id WHERE `group_moderator` IN ( $update_mod_id )"; - - // Debugging info: - // echo '<pre>'; - // echo $sql; - // die(); - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting new group moderator to oldest admin:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - - // *************************************************************************** - // - // Sixth sql query deletes the user from the phpbb_users table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_users` WHERE `user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from users table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Seventh sql query deletes the user from the phpbb_user_group table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_user_group` WHERE `user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from user_group table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Eighth sql query deletes the user from the phpbb_groups table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_groups` WHERE `group_id`=".$row['group_id']; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user\'s group from groups table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Ninth sql query deletes the user from the phpbb_auth_access table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_auth_access` WHERE `group_id`=".$row['group_id']; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from auth_access table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Tenth sql query deletes the user from the phpbb topics watch table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_topics_watch` WHERE `user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from topics_watch table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Eleventh sql query deletes the user from the banlist table - // - // *************************************************************************** - - $sql = "DELETE FROM `$phpbb_banlist` WHERE `ban_userid`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from the banlist table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // *************************************************************************** - // - // Twelfth sql query deletes the user from the sessions table - // - // *************************************************************************** - - // This delete section was added in .19, so a check is done before using it incase - // the admin is running an older version of phpbb - - if( $phpbb_version >= 0.19 ) - - { - - $sql = "DELETE FROM `$phpbb_sessions` WHERE `session_user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from the sessions table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - - // *************************************************************************** - // - // Twelfth sql query deletes the user from the sessions_keys table - // - // *************************************************************************** - - // This delete section was added in .19, so a check is done before using it incase - // the admin is running an older version of phpbb - - if( $phpbb_version >= '.0.19' ) - - { - - // First check if the sesssions keys table exists - // (Since alot of .19 boards dont have it due to incomplete updates - - $sql_key_check ="SHOW TABLES LIKE '$phpbb_sessions_keys'"; - - if( !$result_key_check = mysql_query( $sql_key_check ) ) - - { - - die( '<font size="4"><b>Error selecting session keys table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // This section actually checks if the table exists, if not it skips - // deleting the user from this table - - if( mysql_fetch_array($result_key_check) ) - - { - - - $sql = "DELETE FROM `$phpbb_sessions_keys` WHERE `user_id`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error deleting user from the sessions_keys table:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - } - - - // *************************************************************************** - // - // The final sql query collets the to/from PMs with the user's id & deletes them - // - // *************************************************************************** - - // If retain_pms is set to true, change PM author to anonymous instead of deleting them - - if( $retain_pms == true ) - - { - - // This query sets the from_user_id to the anonymous account so the PMs dont have to be deleted - - $sql = "UPDATE `$phpbb_privmsgs` SET `privmsgs_from_userid`=-1 WHERE `privmsgs_from_userid`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting from PM from_user_id to anonymous:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // This query sets the to_user_id to the anonymous account so the PMs dont have to be deleted - - $sql = "UPDATE `$phpbb_privmsgs` SET `privmsgs_to_userid`=-1 WHERE `privmsgs_to_userid`=$user_id"; - - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error setting from PM to_user_id to anonymous:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - } - - else - - { - - $sql = "SELECT `privmsgs_id` FROM `$phpbb_privmsgs` WHERE `privmsgs_from_userid`=$user_id OR `privmsgs_to_userid`=$user_id"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( '<font size="4"><b>Error selecting PMs for the user:</b></font><br /><b>Line:</b> '.__LINE__.'<br /><b>File:</b> '.$_SERVER['PHP_SELF']."<br /><b>Query:</b> $sql<br /><b>MySQL Error:</b> ".mysql_error() ); - - } - - - // Debugging info: - // echo "<br />$sql<br />"; - - - // This section marks and assigns the resulting PMs into the $marked array - - while($myrow = mysql_fetch_array($result)) - - { - - $marked[] = $myrow['privmsgs_id']; - - } - - - // Makes mark an empty array if the user has no PMs - - if( !isset( $marked ) ) - - { - - $marked = array(); - - } - - // This section actually goes through the list and deletes the PMs - - - // Debugging info: - // echo '<pre>'; - // print_r( $marked ); - - if( count( $marked ) ) - - { - - $delete_id = implode( ',', $marked ); - - // Debugging info: - // echo "<br />$delete_id"; - - $sql = "DELETE FROM `$phpbb_privmsgs_text` WHERE `privmsgs_text_id` IN ( $delete_id )"; - - // Debugging info: - // echo "<br />$sql"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( 'Error deleting user PMs:<br />Line: '.__LINE__.'<br />File: '.$_SERVER['PHP_SELF']."<br />Query: $sql<br />MySQL Error: ".msql_error() ); - - } - - - $sql = "DELETE FROM `$phpbb_privmsgs` WHERE `privmsgs_id` IN ( $delete_id )"; - - // Debugging info: - // echo "<br />$sql"; - - if( !$result = mysql_query( $sql ) ) - - { - - die( 'Error deleting user Pms:<br />Line: '.__LINE__.'<br />File: '.$_SERVER['PHP_SELF']."<br />Query: $sql" ); - - } - - } - - } - - // And thats it! The user should now be fully and properly deleted! - - } - - -// Delete User function - -function delete_user( $user_id, $clear_posts = false, $retain_pms = false, $from = 'index' ) - - { - - // Debugging info: - // var_dump( $user_id ); - // var_dump( $clear_posts ); - // var_dump( $retain_pms ); - // var_dump( $from ); - - - // Set global variables - - global $index; - global $phpbb_version; - - global $phpbb_banlist; - global $phpbb_user_group; - global $phpbb_users; - global $phpbb_groups; - global $phpbb_posts; - global $phpbb_posts_text; - global $phpbb_topics; - global $phpbb_vote_voters; - global $phpbb_auth_access; - global $phpbb_sessions; - global $phpbb_sessions_keys; - global $phpbb_privmsgs; - global $phpbb_privmsgs_text; - global $phpbb_topics_watch; - - - // Set redirect URL - - if( $from == 'edit' ) - - { - - $from ="$index?user_id=$user_id"; - - } - - else - - { - - $from = $index; - - } - - - // First, check if we are dealing with a single user, or an array of users - - if( is_array( $user_id ) ) - - { - - // Create user counter variable - - $user_counter = 0; - - - // Loop through the array and perform security checks - // on each element before actually deleting anything - - foreach( $user_id as $id ) - - { //user_id foreach - - // First things first, sanitize the $user_id - - $user_id = safe_sql( $id ); - - - // - // Obtain username and level based on user_id - // - - $sql = "SELECT * FROM $phpbb_users WHERE user_id=$id LIMIT 1"; - - $result = mysql_query($sql); - $myrow = mysql_fetch_array($result); - - $username = safe_sql( $myrow['username'] ); - $user_level = safe_sql( $myrow['user_level'] ); - - - // Obtain first admin account to set as group mod if deleted user is a group mod (step 5) - - $sql = "SELECT * FROM $phpbb_users WHERE user_level=1 ORDER BY user_id ASC LIMIT 1"; - - $result = mysql_query($sql); - $myrow = mysql_fetch_array($result); - - $admin_id= safe_sql( $myrow['user_id'] ); - - // Debug info: - // echo '<pre>'; - // echo gettype( $myrow ); - // die( $admin_id ); - - - // Check if admin account exists before deleting, if not return with error - - if( !is_array( $myrow ) ) - - { - - $_SESSION['errors']['edituser'][] = 'Due to the phpbb table requirements, at least one admin must exist in the database before a user can be deleted.<br />Either promote a current user to an admin, or register a new one g... [truncated message content] |
From: <mar...@us...> - 2006-06-20 22:09:33
|
Revision: 237 Author: markthedaemon Date: 2006-06-20 15:09:27 -0700 (Tue, 20 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpbbreloaded/?rev=237&view=rev Log Message: ----------- Modified Paths: -------------- phpBB Reloaded 2/config.php phpBB Reloaded 2/includes/page_header.php Modified: phpBB Reloaded 2/config.php =================================================================== --- phpBB Reloaded 2/config.php 2006-06-20 22:07:00 UTC (rev 236) +++ phpBB Reloaded 2/config.php 2006-06-20 22:09:27 UTC (rev 237) @@ -0,0 +1,18 @@ +<?php + + +// phpBB 2.x auto-generated config file +// Do not change anything in this file! + +$dbms = 'mysql'; + +$dbhost = 'localhost'; +$dbname = 'phpbbreloaded'; +$dbuser = 'root'; +$dbpasswd = ''; + +$table_prefix = 'reloaded_'; + +define('PHPBB_INSTALLED', true); + +?> \ No newline at end of file Modified: phpBB Reloaded 2/includes/page_header.php =================================================================== --- phpBB Reloaded 2/includes/page_header.php 2006-06-20 22:07:00 UTC (rev 236) +++ phpBB Reloaded 2/includes/page_header.php 2006-06-20 22:09:27 UTC (rev 237) @@ -639,7 +639,7 @@ { $template->assign_vars(array( 'I_RANKS' => '<img src="' . $images['Ranks'] . '" width="12" height="13" border="0" alt="' . $lang['Ranks'] . '" hspace="3" />', - 'U_RANKS' => append_sid("ranks.$phpEx"), + 'U_RANKS' => append_sid('ranks.'.$phpEx), 'L_RANKS' => $lang['Ranks'], ) ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2006-06-20 22:20:37
|
Revision: 242 Author: markthedaemon Date: 2006-06-20 15:20:27 -0700 (Tue, 20 Jun 2006) ViewCVS: http://svn.sourceforge.net/phpbbreloaded/?rev=242&view=rev Log Message: ----------- massive cleanup/changing/making things work Modified Paths: -------------- phpBB Reloaded 2/templates/subC1/overall_header.tpl Removed Paths: ------------- phpBB Reloaded 2/includes/class_install.php phpBB Reloaded 2/usercp.php Deleted: phpBB Reloaded 2/includes/class_install.php =================================================================== --- phpBB Reloaded 2/includes/class_install.php 2006-06-20 22:15:10 UTC (rev 241) +++ phpBB Reloaded 2/includes/class_install.php 2006-06-20 22:20:27 UTC (rev 242) @@ -1,882 +0,0 @@ -<?php -/*************************************************************************** - * class_install.php - * ----------------- - * begin : 06/08/2005 - * copyright : Ptirhiik - * email : pti...@cl... - * - * Version : 0.0.2 - 31/10/2005 - * - ***************************************************************************/ - -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ - -// lang keys used in this class -$sys_lang = array( - 'SQL_error' => '<b><u>SQL request not achieved:</u></b><ul><li><b>reason:</b> %s<li><b>file:</b> %s, <b>line:</b> %s<li><b>request:</b><hr /> %s<hr /></ul>', - 'Login_required' => 'You must log in', - 'Login_title' => 'Login', - 'Login_failed' => 'Login failed. Check the username and the password you\'ve typed in, then retry.', - 'Login_username' => 'Username', - 'Login_password' => 'Password', - 'Login_submit' => 'Log me in', - 'Login_admin' => 'You must be an administrator to go further.', - 'Login_mod' => 'You must be an administrator or a moderator to go further.', - 'Error_resume_explain' => 'These are warnings only : press "Resume" to continue :', - 'Error_resume' => 'Resume', -); - -// install the new db class -$original_db = $db; -$db = new light_db(); - -// page management -class page -{ - var $requester; - var $parms; - var $messages; - var $error_msg; - var $title; - var $sub_title; - - var $root; - var $ext; - var $header_sent; - - function page($requester, $title='', $lang_file='') - { - global $phpbb_root_path, $phpEx; - - $this->requester = $requester; - $this->parms = array(); - $this->root = $phpbb_root_path; - $this->ext = $phpEx; - $this->messages = array(); - $this->error_msg = array(); - $this->header_sent = false; - $this->guess_lang($lang_file); - $this->title = empty($title) ? 'Script_title' : $title; - $this->sub_title = ''; - } - - function set_parms($parms) - { - $this->parms = empty($this->parms) ? $parms : array_merge($this->parms, $parms); - } - - function unset_parms($parms) - { - if ( empty($parms) ) - { - return; - } - if ( !is_array($parms) ) - { - $parms = array($parms); - } - if ( empty($this->parms) ) - { - return; - } - $count_parms = count($parms); - for ( $i = 0; $i < $count_parms; $i++ ) - { - if ( isset($this->parms[ $parms[$i] ]) ) - { - unset($this->parms[ $parms[$i] ]); - } - } - } - - // this one comes from phpBB install.php - function guess_lang($lang_file) - { - global $HTTP_SERVER_VARS, $lang; - - // The order here _is_ important, at least for major_minor - // matches. Don't go moving these around without checking with - // me first - psoTFX - $match_lang = array( - 'arabic' => 'ar([_-][a-z]+)?', - 'bulgarian' => 'bg', - 'catalan' => 'ca', - 'czech' => 'cs', - 'danish' => 'da', - 'german' => 'de([_-][a-z]+)?', - 'english' => 'en([_-][a-z]+)?', - 'estonian' => 'et', - 'finnish' => 'fi', - 'french' => 'fr([_-][a-z]+)?', - 'greek' => 'el', - 'spanish_argentina' => 'es[_-]ar', - 'spanish' => 'es([_-][a-z]+)?', - 'gaelic' => 'gd', - 'galego' => 'gl', - 'gujarati' => 'gu', - 'hebrew' => 'he', - 'hindi' => 'hi', - 'croatian' => 'hr', - 'hungarian' => 'hu', - 'icelandic' => 'is', - 'indonesian' => 'id([_-][a-z]+)?', - 'italian' => 'it([_-][a-z]+)?', - 'japanese' => 'ja([_-][a-z]+)?', - 'korean' => 'ko([_-][a-z]+)?', - 'latvian' => 'lv', - 'lithuanian' => 'lt', - 'macedonian' => 'mk', - 'dutch' => 'nl([_-][a-z]+)?', - 'norwegian' => 'no', - 'punjabi' => 'pa', - 'polish' => 'pl', - 'portuguese_brazil' => 'pt[_-]br', - 'portuguese' => 'pt([_-][a-z]+)?', - 'romanian' => 'ro([_-][a-z]+)?', - 'russian' => 'ru([_-][a-z]+)?', - 'slovenian' => 'sl([_-][a-z]+)?', - 'albanian' => 'sq', - 'serbian' => 'sr([_-][a-z]+)?', - 'slovak' => 'sv([_-][a-z]+)?', - 'swedish' => 'sv([_-][a-z]+)?', - 'thai' => 'th([_-][a-z]+)?', - 'turkish' => 'tr([_-][a-z]+)?', - 'ukranian' => 'uk([_-][a-z]+)?', - 'urdu' => 'ur', - 'viatnamese' => 'vi', - 'chinese_traditional_taiwan'=> 'zh[_-]tw', - 'chinese_simplified' => 'zh', - ); - if ( empty($lang_file) ) - { - $lang_file = 'lang_CH_install'; - } - $lang_file = $this->root . 'language/lang_%s/' . $lang_file . '.' . $this->ext; - - @include(sprintf($lang_file, 'english')); - if ( isset($HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']) ) - { - $accepted_langs = explode(',', $HTTP_SERVER_VARS['HTTP_ACCEPT_LANGUAGE']); - $count_accepted_langs = count($accepted_langs); - for ( $i = 0; $i < $count_accepted_langs; $i++ ) - { - foreach ( $match_lang as $lang_available => $match ) - { - if ( ($lang_available != 'english') && preg_match('#' . $match . '#i', trim($accepted_langs[$i])) ) - { - $file = sprintf($lang_file, trim($lang_available)); - if ( @file_exists($file) ) - { - @include($file); - return; - } - } - } - } - } - - return; - } - - function lang($key) - { - global $lang, $sys_lang; - return empty($key) ? '' : (isset($lang[$key]) ? $lang[$key] : (isset($sys_lang[$key]) ? $sys_lang[$key] : $key)); - } - - function url($parms='', $script='') - { - if ( empty($script) ) - { - $script = $this->requester; - } - $url_parms = ''; - if ( !empty($parms) ) - { - foreach ( $parms as $parm => $value ) - { - if ( !empty($value) ) - { - $url_parms .= (empty($url_parms) ? '?' : '&') . $parm . '=' . $value; - } - } - } - return $this->root . $script . '.' . $this->ext . $url_parms; - } - - function error($msg='') - { - if ( empty($msg) ) - { - return !empty($this->error_msg); - } - $this->error_msg[] = $this->lang($msg); - return true; - } - - function critical_error($msg='') - { - $this->error_msg[] = $this->lang($msg); - $this->header(); - $this->footer(); - } - - function output($msg='') - { - if ( empty($msg) ) - { - return !empty($this->messages); - } - $this->messages[] = $this->lang($msg); - return true; - } - - function header($meta='') - { - if ( $this->header_sent ) - { - return; - } - $this->header_sent = true; -?> -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -<meta http-equiv="Content-Style-Type" content="text/css"><?php echo $meta; ?> -<title><?php echo $this->lang($this->title); ?></title> -<style type="text/css"> -<!-- -font,th,td,p {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;} -th {font-size: 11px; font-weight : bold; color: #FFA34F; background-color: #0000A0;} -hr {height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;} -.gen {font-size: 12px} -.gensmall {font-size: 11px} -.background {background-color: #FFFFFF; border: 1px #98AAB1 solid;} -.row1 {background-color: #F0F0FE;} -.row2 {background-color: #E0E0F0;} -//--> -</style> -</head> -<body bgcolor="#E5E5E5" text="#000000" link="#006699" vlink="#5584AA"> -<table cellpadding="10" cellspacing="1" border="0" class="background" width="100%" style="height: 100%"><tr><td valign="top"> -<div align="center" class="background"><br /><br /><h1><u><b><?php echo $this->lang($this->title); ?></b></u></h1><?php if ( !empty($this->sub_title) ) {echo $this->lang($this->sub_title);} ?><br /><br /></div> -<div align="justify" class="gen"><br /><br /> -<?php - } - - function send_messages() - { - // send error messages if any - if ( $count_error_msg = count($this->error_msg) ) - { -?><div class="background" style="width: 100%;"><div class="row1" align="center"><br /><br /> -<?php - for ( $i = 0; $i < $count_error_msg; $i++ ) - { - echo $this->error_msg[$i] . '<br />'; - } -?><br /><br /></div></div><br /><br /> -<?php - $this->error_msg = array(); - } - - // send other messages if any - if ( $count_messages = count($this->messages) ) - { -?><div class="background" style="width: 100%;"><br /><?php - for ( $i = 0; $i < $count_messages; $i++ ) - { - echo $this->messages[$i] . '<br />'; - } -?><br /></div><?php - $this->messages = array(); - } - } - - function hide() - { - if ( !empty($this->parms) ) - { - foreach ( $this->parms as $parm => $value ) - { - if ( !empty($value) ) - { -?><input type="hidden" name="<?php echo $parm; ?>" value="<?php echo str_replace('"', '"', $value); ?>" /><?php - } - } - } - } - - function footer() - { - // send header if not done - if ( !$this->header_sent ) - { - $this->header(); - } - - // send messages if any - $this->send_messages(); - - // close db - if ( !empty($db) && is_object($db) ) - { - $db->sql_close(); - } - - // send footer -?> -</div><br /><hr /> -<div align="center" class="gensmall"><a href="http://www.phpbb.com/" target="phpbb" class="gensmall">phpBB</a> © 2001,2002 phpBB Group</div> -</td></tr></table> -</body> -</html> -<?php - // stop - exit; - } - - function loop($parms='', $no_wait=true) - { - $parms = empty($parms) ? $this->parms : array_merge($this->parms, $parms); - if ( $this->error() ) - { - $this->set_parms($parms); - $this->resume_form(); - } - $meta = '<meta http-equiv="refresh" content="' . ($no_wait ? 0 : 3) . ';url=' . $this->url($parms) . '">'; - $this->header($meta); - $this->footer(); - } - - function _button($var) - { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - return (isset($HTTP_POST_VARS[$var]) && !empty($HTTP_POST_VARS[$var])) || (isset($HTTP_GETT_VARS[$var]) && intval($HTTP_GET_VARS[$var])); - } - - function resume_form() - { - if ( ($count_error_msg = count($this->error_msg)) && !$this->_button('resume') ) - { - $this->header(); -?><form name="post" method="post" action="<?php echo $this->url(); ?>"><div class="background" style="width: 100%;"><div class="row1" align="center"><br /><br /> -<?php - for ( $i = 0; $i < $count_error_msg; $i++ ) - { - echo $this->error_msg[$i] . '<br />'; - } -?><br /><hr /><?php echo $this->lang('Error_resume_explain') ?> <input type="submit" name="resume" value="<?php echo $this->lang('Error_resume') ?>" /><?php $this->hide() ?><br /><br /></div></div><br /><br /></form> -<?php - $this->error_msg = array(); - - // other mesages - $this->send_messages(); - $this->footer(); - } - } -} - -// sample from class_db -class light_db -{ - var $sql_fields; - var $sql_values; - var $sql_update; - var $sql_stack_fields; - var $sql_stack_values; - - function sql_close() - { - global $original_db; - return $original_db->sql_close($id); - } - function sql_query($query='', $transaction=false, $line='', $file='', $break_on_error=true) - { - global $original_db; - - $query_res = $original_db->sql_query($query, $transaction); - if ( !$query_res && $break_on_error ) - { - if ( empty($file) && function_exists('debug_backtrace') ) - { - $dbg = debug_backtrace(); - $file = $dbg[0]['file']; - $line = $dbg[0]['line']; - unset($dbg); - } - else - { - $file = basename(__FILE__); - } - $this->error($line, $file, $query); - } - return $query_res; - } - function sql_numrows($id=0) - { - global $original_db; - return $original_db->sql_numrows($id); - } - function sql_affectedrows() - { - global $original_db; - return $original_db->sql_affectedrows(); - } - function sql_numfields($id=0) - { - global $original_db; - return $original_db->sql_numfields($id); - } - function sql_fieldname($offset, $id=0) - { - global $original_db; - return $original_db->sql_fieldname($offset, $id); - } - function sql_fieldtype($offset, $id=0) - { - global $original_db; - return $original_db->sql_fieldtype($offset, $id); - } - function sql_fetchrow($id=0) - { - global $original_db; - return $original_db->sql_fetchrow($id); - } - function sql_fetchrowset($id=0) - { - global $original_db; - return $original_db->sql_fetchrowset($id); - } - function sql_fetchfield($field, $rownum=-1, $id=0) - { - global $original_db; - return $original_db->sql_fetchfield($field, $rownum, $id); - } - function sql_rowseek($rownum, $id=0) - { - global $original_db; - return $original_db->sql_rowseek($rownum, $id); - } - function sql_nextid() - { - global $original_db; - return $original_db->sql_nextid(); - } - function sql_freeresult($id=0) - { - global $original_db; - return $original_db->sql_freeresult($id); - } - function sql_error($id=0) - { - global $original_db; - return $original_db->sql_error($id); - } - - // additional - function error($line, $file, $query) - { - global $page, $lang; - - $sql_error = $this->sql_error(); - $page->critical_error(sprintf($lang['SQL_error'], empty($sql_error['message']) ? '' : $sql_error['code'] . ' - ' . $sql_error['message'], $file, $line, htmlspecialchars(preg_replace('/[\n\r\s\t]+/', ' ', $query)))); - } - - function sql_escape_string($str) - { - return str_replace('\\\'', '\'\'', addslashes(preg_replace('/[\n\r]+/', '<br />', $str))); - } - - function sql_type_cast(&$value) - { - if ( is_float($value) ) - { - return doubleval($value); - } - if ( is_integer($value) || is_bool($value) ) - { - return intval($value); - } - if ( is_string($value) || empty($value) ) - { - return '\'' . $this->sql_escape_string($value) . '\''; - } - // uncastable var : let's do a basic protection on it to prevent sql injection attempt - return '\'' . $this->sql_escape_string(htmlspecialchars($value)) . '\''; - } - - function sql_statement(&$fields) - { - global $original_db; - - // init result - $this->sql_fields = $this->sql_values = $this->sql_update = ''; - if ( empty($fields) ) - { - return; - } - - // process - $first = true; - foreach ( $fields as $field => $value ) - { - // field must contain a field name - if ( !empty($field) && is_string($field) ) - { - $value = $this->sql_type_cast($value); - $this->sql_fields .= ( $first ? '' : ', ' ) . $field; - $this->sql_values .= ( $first ? '' : ', ' ) . $value; - $this->sql_update .= ( $first ? '' : ', ' ) . $field . ' = ' . $value; - $first = false; - } - } - } - - function sql_stack_reset($id='') - { - if ( empty($id) ) - { - $this->sql_stack_fields = array(); - $this->sql_stack_values = array(); - } - else - { - $this->sql_stack_fields[$id] = array(); - $this->sql_stack_values[$id] = array(); - } - } - - function sql_stack_statement(&$fields, $id='') - { - $this->sql_statement($fields); - if ( empty($id) ) - { - $this->sql_stack_fields = $this->sql_fields; - $this->sql_stack_values[] = '(' . $this->sql_values . ')'; - } - else - { - $this->sql_stack_fields[$id] = $this->sql_fields; - $this->sql_stack_values[$id][] = '(' . $this->sql_values . ')'; - } - } - - function sql_stack_insert($table, $transaction=false, $line='', $file='', $break_on_error=true, $id='') - { - if ( (empty($id) && empty($this->sql_stack_values)) || (!empty($id) && empty($this->sql_stack_values[$id])) ) - { - return false; - } - switch( SQL_LAYER ) - { - case 'mysql': - case 'mysql4': - if ( empty($id) ) - { - $sql = 'INSERT INTO ' . $table . ' - (' . $this->sql_stack_fields . ') VALUES ' . implode(",\n", $this->sql_stack_values); - } - else - { - $sql = 'INSERT INTO ' . $table . ' - (' . $this->sql_stack_fields[$id] . ') VALUES ' . implode(",\n", $this->sql_stack_values[$id]); - } - $this->sql_stack_reset($id); - return $this->sql_query($sql, $transaction, $line, $file, $break_on_error); - break; - default: - $count_sql_stack_values = empty($id) ? count($this->sql_stack_values) : count($this->sql_stack_values[$id]); - $result = !empty($count_sql_stack_values); - for ( $i = 0; $i < $count_sql_stack_values; $i++ ) - { - if ( empty($id) ) - { - $sql = 'INSERT INTO ' . $table . ' - (' . $this->sql_stack_fields . ') VALUES ' . $this->sql_stack_values[$i]; - } - else - { - $sql = 'INSERT INTO ' . $table . ' - (' . $this->sql_stack_fields[$id] . ') VALUES ' . $this->sql_stack_values[$id][$i]; - } - $result &= $this->sql_query($sql, $transaction, $line, $file, $break_on_error); - } - $this->sql_stack_reset($id); - return $result; - break; - } - } - - function get_layer() - { - // Define schemes info - $available_dbms = array( - 'mysql'=> array( - 'LABEL' => 'MySQL 3.x', - 'SCHEMA' => 'mysql', - 'DELIM' => ';', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_remarks' - ), - 'mysql4' => array( - 'LABEL' => 'MySQL 4.x', - 'SCHEMA' => 'mysql', - 'DELIM' => ';', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_remarks' - ), - 'postgres' => array( - 'LABEL' => 'PostgreSQL 7.x', - 'SCHEMA' => 'postgres', - 'DELIM' => ';', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_comments' - ), - 'mssql' => array( - 'LABEL' => 'MS SQL Server 7/2000', - 'SCHEMA' => 'mssql', - 'DELIM' => 'GO', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_comments' - ), - 'mssql-odbc' => array( - 'LABEL' => 'MS SQL Server [ ODBC ]', - 'SCHEMA' => 'mssql', - 'DELIM' => 'GO', - 'DELIM_BASIC' => ';', - 'COMMENTS' => 'remove_comments' - ), - ); - return isset($available_dbms[SQL_LAYER]) ? $available_dbms[SQL_LAYER] : false; - } -} - -class light_session -{ - var $session_max_length; - var $session_id; - var $session_ip; - var $session_logged_in; - var $user_id; - var $user_level; - - function light_session() - { - $this->session_id = $this->get_id(); - $this->session_ip = $this->get_ip(); - $this->session_logged_in = false; - $this->user_id = ANONYMOUS; - $this->user_level = USER; - } - - function get_id() - { - global $HTTP_POST_VARS, $HTTP_GET_VARS; - - $session_id = ''; - if ( isset($HTTP_POST_VARS['sid']) || isset($HTTP_GET_VARS['sid']) ) - { - $session_id = htmlspecialchars(trim(isset($HTTP_POST_VARS['sid']) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'])); - } - if ( empty($session_id) || !preg_match('/^[A-Za-z0-9]*$/', $session_id) ) - { - list($sec, $usec) = explode(' ', microtime()); - mt_srand((float) $sec + ((float) $usec * 100000)); - $session_id = md5(uniqid(mt_rand(), true)); - } - return $session_id; - } - - function get_ip() - { - global $HTTP_SERVER_VARS, $HTTP_ENV_VARS; - $ip = explode('.', !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR'))); - return sprintf('%02x%02x%02x%02x', intval($ip[0]), intval($ip[1]), intval($ip[2]), intval($ip[3])); - } - - function log_out() - { - global $page, $db; - if ( empty($this->session_id) ) - { - return; - } - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE session_id = \'' . $this->session_id . '\''; - $db->sql_query($sql, false, __LINE__, __FILE__); - $this->session_id = ''; - $this->session_logged_in = false; - $this->user_id = ANONYMOUS; - $this->user_level = USER; - $page->unset_parms('sid'); - } - - function log_in($level=USER) - { - $this->init(); - $this->check($level); - $this->validate(); - $this->display(); - } - - function init() - { - global $db, $page; - - $this->session_logged_in = false; - $session_max_length = 600; // 10 minutes - - // do not use a previous session while validating a login - if ( $page->_button('logme') ) - { - return $this->session_logged_in; - } - - // read session from table - $sql = 'SELECT s.session_id, s.session_ip, s.session_time, u.user_id, u.user_level - FROM ' . SESSIONS_TABLE . ' s - LEFT JOIN ' . USERS_TABLE . ' u - ON u.user_id = s.session_user_id - WHERE session_id = \'' . $this->session_id . '\''; - $result = $db->sql_query($sql, false, __LINE__, __FILE__); - if ( $row = $db->sql_fetchrow($result) ) - { - // check session ip with current ip - $ip_stored = substr($row['session_ip'], 0, 6); - $ip_current = substr($this->session_ip, 0, 6); - if ( $ip_stored == $ip_current ) - { - // the ips match : does the session lenght ok ? - if ( (time() - intval($row['session_time'])) < $session_max_length ) - { - // does the user exists - if ( !empty($row['user_id']) ) - { - $this->user_id = intval($row['user_id']); - $this->user_level = intval($row['user_level']); - - // this session is ok : update the session table - $fields = array( - 'session_ip' => $this->session_ip, - 'session_time' => time(), - ); - $db->sql_statement($fields); - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET ' . $db->sql_update . ' - WHERE session_id = \'' . $this->session_id . '\''; - $db->sql_query($sql, false, __LINE__, __FILE__); - $this->session_logged_in = true; - } - } - } - } - return $this->session_logged_in; - } - - function check($level=USER) - { - global $page, $db; - global $HTTP_POST_VARS; - - if ( $this->session_logged_in || !$page->_button('submit') ) - { - return; - } - $username = isset($HTTP_POST_VARS['username']) ? trim(stripslashes(phpbb_clean_username($HTTP_POST_VARS['username']))) : ''; - $password = isset($HTTP_POST_VARS['password']) ? md5($HTTP_POST_VARS['password']) : ''; - if ( empty($username) || empty($password) ) - { - $page->error('Login_required'); - } - else - { - // search the user - $sql = 'SELECT user_id, user_password, user_level, user_active - FROM ' . USERS_TABLE . ' - WHERE LOWER(username) = \'' . $db->sql_escape_string(strtolower($username)) . '\''; - $result = $db->sql_query($sql, false, __LINE__, __FILE__); - if ( (!$row = $db->sql_fetchrow($result)) || !$row['user_active'] || ($row['user_id'] == ANONYMOUS) || ($password != $row['user_password']) ) - { - $page->error('Login_failed'); - } - else if ( (($level == ADMIN) && (intval($row['user_level']) != ADMIN)) || (($level == MOD) && !in_array(intval($row['user_level']), array(MOD, ADMIN))) ) - { - $page->error($level == ADMIN ? 'Login_admin' : 'Login_mod'); - } - else - { - $this->user_id = intval($row['user_id']); - $this->user_level = intval($row['user_level']); - } - } - } - - function validate() - { - global $page, $db; - - if ( $this->session_logged_in ) - { - $page->set_parms(array('sid' => $this->session_id)); - return $this->session_logged_in; - } - else if ( !$page->_button('submit') || $page->error() ) - { - return $this->session_logged_in; - } - - // delete outdated session - $sql = 'DELETE FROM ' . SESSIONS_TABLE . ' - WHERE session_user_id = ' . $this->user_id; - $db->sql_query($sql, false, __LINE__, __FILE__); - - // create the session row - $fields = array( - 'session_id' => $this->session_id, - 'session_ip' => $this->session_ip, - 'session_user_id' => $this->user_id, - 'session_start' => time(), - 'session_time' => time(), - ); - $db->sql_statement($fields); - $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' - (' . $db->sql_fields . ') VALUES(' . $db->sql_values . ')'; - $db->sql_query($sql, false, __LINE__, __FILE__); - $this->session_logged_in = true; - $page->set_parms(array('sid' => $this->session_id)); - return $this->session_logged_in; - } - - function display() - { - global $page; - - if ( $this->session_logged_in ) - { - return; - } - - $page->header(); - $page->send_messages(); -?><form name="post" method="post" action="<?php echo str_replace('"', '"', $page->url($parms)); ?>"><div align="center"><div class="background" style="width: 50%;"><table cellpadding="4" cellspacing="1" border="0" width="100%"> -<tr><th colspan="2"><?php echo $page->lang('Login_title'); ?></th></tr> -<tr><td width="40%" class="row1"><b><?php echo $page->lang('Login_username'); ?>:</b></td><td class="row2"><input type="text" name="username" value="" size="25" /></td></tr> -<tr><td class="row1"><b><?php echo $page->lang('Login_password'); ?>:</b></td><td class="row2"><input type="password" name="password" value="" size="40" /></td></tr> -<tr><td class="row2" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo str_replace('"', '"', $page->lang('Login_submit')); ?>" /><input type="hidden" name="logme" value="1" /><?php $page->hide(); ?></td></tr> -</table></div></div></form> -<?php - $page->footer(); - } -} - -?> \ No newline at end of file Modified: phpBB Reloaded 2/templates/subC1/overall_header.tpl =================================================================== --- phpBB Reloaded 2/templates/subC1/overall_header.tpl 2006-06-20 22:15:10 UTC (rev 241) +++ phpBB Reloaded 2/templates/subC1/overall_header.tpl 2006-06-20 22:20:27 UTC (rev 242) @@ -89,7 +89,6 @@ <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a> <a href="{U_GROUP_CP}">{L_USERGROUPS}</a> <a href="{U_PROFILE}">{L_PROFILE}</a> -<a href="{U_PREFERENCES}">{L_PREFERENCES}</a> <a href="{U_RANKS}">{L_RANKS}</a> </div></td></tr> </table> Deleted: phpBB Reloaded 2/usercp.php =================================================================== --- phpBB Reloaded 2/usercp.php 2006-06-20 22:15:10 UTC (rev 241) +++ phpBB Reloaded 2/usercp.php 2006-06-20 22:20:27 UTC (rev 242) @@ -1,342 +0,0 @@ -<?php -/*************************************************************************** - * usercp.php - * ---------- - * begin : 26/08/2004 - * copyright : Ptirhiik - * email : pti...@cl... - * - * Version : 0.0.7 - 21/08/2005 - * - ***************************************************************************/ - -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ - -define('IN_PHPBB', 1); -$phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.'.$phpEx); - -// classes -include($config->url('includes/class_form')); -include($config->url('includes/class_cp')); - -// define the control panel -$cp_name = 'ucp'; - -// return messages & other urls settings -$cp_requester = 'usercp'; -$cp_parms = array(); - -// layout switches -$cp_no_navigation = false; -$cp_no_menus = false; - -// right side title -$cp_panel_name = ''; - -// -// Start session management -// -$userdata = session_pagestart($user_ip, empty($forum_id) ? PAGE_PROFILE : $forum_id); -init_userprefs($userdata); -// -// End session management -// - -// read panels and apply patches if available -$cp_panels = new cp_panels(); -$cp_panels->read(); -$cp_panels->patch(); - -// no panels : end there -if ( empty($cp_panels->keys) ) -{ - message_return('No_options'); -} - -// get viewed user -$view_user_id = _read(POST_USERS_URL, TYPE_INT, $user->data['user_id']); -if ( empty($view_user_id) || ($view_user_id == $user->data['user_id']) ) -{ - $view_user = &$user; -} -else -{ - $view_user = new user(); - $view_user->read($view_user_id); -} - -// retrieve auths -$user->get_cache(array(POST_GROUPS_URL, POST_PANELS_URL)); - -// prepare links -$cp_parms = ($view_user->data['user_id'] == $user->data['user_id']) ? array() : array(POST_USERS_URL => $view_user->data['user_id']); - -// search for the $cp_name panel_id -$cp_panel_id = $cp_panels->search(0, $cp_name); -if ( !$cp_panels->auth($cp_panel_id, $view_user) ) -{ - if ( !$user->data['session_logged_in'] ) - { - redirect($config->url('login', array('redirect' => $config->url($cp_requester, $cp_parms)), true)); - exit; - } - message_return('Not_Authorised'); -} - -// get the first level menus -$panels = $cp_panels->get_menu($cp_panel_id); -$menus = array(); -if ( !empty($panels) ) -{ - foreach ( $panels as $shortcut => $panel_id ) - { - if ( $cp_panels->auth($panel_id, $view_user) ) - { - $menus[$shortcut] = $panel_id; - } - } -} -if ( empty($menus) ) -{ - if ( !$user->data['session_logged_in'] ) - { - redirect($config->url('login', array('redirect' => $config->url($cp_requester, $cp_parms)), true)); - exit; - } - message_return('Not_Authorised'); -} - -// get the menus parm -$menu_id = _read('mode', TYPE_NO_HTML); -if ( empty($menu_id) || !isset($menus[$menu_id]) ) -{ - $found = false; - foreach ( $menus as $shortcut => $id ) - { - $found = !empty($menu_id) || !$cp_panels->data[$id]['panel_hidden']; - if ( $found ) - { - $menu_id = $shortcut; - break; - } - } - if ( !$found ) - { - $menu_id = ''; - } -} -if ( empty($menu_id) ) -{ - if ( !$user->data['session_logged_in'] ) - { - redirect($config->url('login', array('redirect' => $config->url($cp_requester, $cp_parms)), true)); - exit; - } - message_return('Not_Authorised'); -} - -// get the second level menus -$panels = $cp_panels->get_menu($menus[$menu_id]); -$sub_menus = array(); -if ( !empty($panels) ) -{ - foreach ( $panels as $shortcut => $panel_id ) - { - if ( $cp_panels->auth($panel_id, $view_user) ) - { - $sub_menus[$shortcut] = $panel_id; - } - } -} -$dft_sub = ''; -if ( empty($sub_menus) ) -{ - $sub_menus[$menu_id] = $menus[$menu_id]; - $dft_sub = $menu_id; -} - -// get sub-menu parm -$subm_id = _read('sub', TYPE_NO_HTML, $dft_sub); -if ( empty($subm_id) || !isset($sub_menus[$subm_id]) ) -{ - $found = false; - foreach ( $sub_menus as $shortcut => $id ) - { - $found = !empty($subm_id) || !$cp_panels->data[$id]['panel_hidden']; - if ( $found ) - { - $subm_id = $shortcut; - break; - } - } - if ( !$found ) - { - $subm_id = ''; - } -} -if ( empty($subm_id) ) -{ - if ( !$user->data['session_logged_in'] ) - { - redirect($config->url('login', array('redirect' => $config->url($cp_requester, $cp_parms)), true)); - exit; - } - message_return('Not_Authorised'); -} - -// prepare navigation -$navigation->add($view_user->data['username'], '', $cp_requester, $cp_parms); -$navigation->add( $cp_panels->data[ $menus[$menu_id] ]['panel_name'], '', $cp_requester, $cp_parms + array('mode' => $menu_id)); -if ( $menu_id != $subm_id ) -{ - $navigation->add( $cp_panels->data[ $sub_menus[$subm_id] ]['panel_name'], '', $cp_requester, $cp_parms + array('mode' => $menu_id, 'sub' => $subm_id)); -} - -// init fields -$fields = array(); - -// include the specified files -$file = $config->url((empty($cp_panels->data[ $sub_menus[$subm_id] ]['panel_file']) ? 'includes/' . $cp_name . '/' . $cp_name . '_generic' : $cp_panels->data[ $sub_menus[$subm_id] ]['panel_file'])); -if ( !file_exists($file) ) -{ - // send "no options" - $cp_panels->display_empty(); -} -else -{ - // get the fields - $sql = 'SELECT * - FROM ' . CP_FIELDS_TABLE . ' - WHERE panel_id = ' . intval($sub_menus[$subm_id]) . ' - ORDER BY field_order'; - $result = $db->sql_query($sql, false, __LINE__, __FILE__); - $fields = array(); - while ( $row = $db->sql_fetchrow($result) ) - { - // do some tweaking regarding dynamical data - if ( !empty($row['field_name']) ) - { - // unpack data - $field = unserialize(stripslashes($row['field_attr'])); - - // check auths - $authed = true; - if ( !empty($field['field_auth']) ) - { - $auth_type = POST_GROUPS_URL; - $auth_name = $field['field_auth']; - if ( $view_user->data['user_id'] == ANONYMOUS ) - { - $group_user_list = array(GROUP_ANONYMOUS); - } - else if ( $view_user->data['user_id'] == $user->data['user_id'] ) - { - $group_user_list = array(GROUP_OWN); - } - else - { - $group_user_list = $view_user->get_groups_list(); - } - $authed = $user->auth($auth_type, $auth_name, $group_user_list); - } - - if ( $authed) - { - $fields[ $row['field_name'] ] = $field; - if ( !empty($fields[ $row['field_name'] ]['class_file']) ) - { - @include_once($config->url($fields[ $row['field_name'] ]['class_file'])); - } - foreach ( $fields[ $row['field_name'] ] as $key => $val ) - { - if ( !empty($val) && is_string($val) && preg_match('/^\[/', $val) ) - { - $var_check = explode(', ', preg_replace('/^\[([^\]]*)\](.*)/i', '\1, \2', $val)); - if ( !empty($var_check[1]) && preg_match('/^\[/', $var_check[1]) ) - { - $file_check = explode(', ', preg_replace('/^\[([^\]]*)\](.*)/i', '\1, \2', $var_check[1])); - if ( !empty($file_check[1]) ) - { - $var_check[1] = $file_check[1]; - $var_check[2] = $file_check[0]; - } - } - if ( (count($var_check) > 1) && !empty($var_check[0]) && !empty($var_check[1]) ) - { - if ( !empty($var_check[2]) ) - { - @include_once($config->url($var_check[2])); - } - $entity_name = $var_check[1]; - switch ( $var_check[0] ) - { - case 'var': - $res = ''; - if ( isset($$entity_name) ) - { - $res = $$entity_name; - } - $fields[ $row['field_name'] ][$key] = $res; - break; - case 'func': - $res = ''; - if ( function_exists($entity_name) ) - { - $res = $entity_name(); - } - $fields[ $row['field_name'] ][$key] = $res; - break; - } - } - } - } - } - } - } - - // include the file - include($file); -} - -// display constants -$template->assign_vars(array( - 'L_MENU' => $user->lang('Profile'), - 'L_FORM' => empty($cp_panel_name) ? $user->lang($cp_panels->data[ $sub_menus[$subm_id] ]['panel_name']) : $user->lang($cp_panel_name), - 'S_ACTION' => $config->url($cp_requester, '', true), -)); - -// display nav -if ( !$cp_no_navigation ) -{ - $navigation->display('nav'); -} - -// display menu -if ( !$cp_no_menus ) -{ - $cp_panels->display_menus($menus, $sub_menus, $menu_id, $subm_id, $cp_requester, $cp_parms, 'CP_MENUS_BOX'); -} - -// hide some values on form -_hide($cp_parms + array('mode' => $menu_id)); -if ( $subm_id != $menu_id ) -{ - _hide('sub', $subm_id); -} -_hide_set(); - -// send all to browser -include($config->url('includes/page_header')); -$template->pparse('body'); -include($config->url('includes/page_tail')); - -?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kla...@us...> - 2006-08-12 15:11:00
|
Revision: 250 Author: klarinetking Date: 2006-08-12 08:10:37 -0700 (Sat, 12 Aug 2006) ViewCVS: http://svn.sourceforge.net/phpbbreloaded/?rev=250&view=rev Log Message: ----------- Big commit today! Mostly removing useless code, updating to internal (not yet published) coding standards. More files to come. Modified Paths: -------------- phpBB Reloaded 2/attach_rules.php phpBB Reloaded 2/calendar.php phpBB Reloaded 2/calendar_scheduler.php phpBB Reloaded 2/common.php phpBB Reloaded 2/download.php phpBB Reloaded 2/extension.inc phpBB Reloaded 2/faq.php phpBB Reloaded 2/groupcp.php phpBB Reloaded 2/index.php phpBB Reloaded 2/login.php phpBB Reloaded 2/memberlist.php phpBB Reloaded 2/modcp.php phpBB Reloaded 2/posting.php phpBB Reloaded 2/privmsg.php phpBB Reloaded 2/profile.php phpBB Reloaded 2/qpes.php phpBB Reloaded 2/ranks.php phpBB Reloaded 2/search.php phpBB Reloaded 2/shoutbox.php phpBB Reloaded 2/shoutbox_max.php phpBB Reloaded 2/shoutbox_view.php phpBB Reloaded 2/uacp.php phpBB Reloaded 2/viewonline.php phpBB Reloaded 2/viewtopic.php Modified: phpBB Reloaded 2/attach_rules.php =================================================================== --- phpBB Reloaded 2/attach_rules.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/attach_rules.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,16 +1,16 @@ <?php -/** -* -* @package attachment_mod -* @version $Id: attach_rules.php,v 1.1.1.1 2006/02/24 02:28:06 markthedaemon Exp $ -* @copyright (c) 2002 Meik Sievertsen -* @license http://opensource.org/licenses/gpl-license.php GNU Public License -* -*/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ /** -*/ -if (defined('IN_PHPBB')) + * phpBB originally created by phpBB http://www.phpbb.com + */ + +if ( defined('IN_PHPBB') ) { die('Hacking attempt'); exit; @@ -18,21 +18,23 @@ define('IN_PHPBB', TRUE); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.'.$phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.' . $phpEx); $forum_id = get_var('f', 0); $privmsg = (!$forum_id) ? true : false; // Start Session Management + $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // Display the allowed Extension Groups and Upload Size -if ($privmsg) + +if ( $privmsg ) { - $auth['auth_attachments'] = ($userdata['user_level'] != ADMIN) ? intval($attach_config['allow_pm_attach']) : true; - $auth['auth_view'] = true; + $auth['auth_attachments'] = ($userdata['user_level'] != ADMIN) ? intval($attach_config['allow_pm_attach']) : TRUE; + $auth['auth_view'] = TRUE; $_max_filesize = $attach_config['max_filesize_pm']; } else @@ -41,7 +43,7 @@ $_max_filesize = $attach_config['max_filesize']; } -if (!($auth['auth_attachments'] && $auth['auth_view'])) +if ( !($auth['auth_attachments'] && $auth['auth_view']) ) { message_die(GENERAL_ERROR, 'You are not allowed to call this file (ID:2)'); } @@ -52,10 +54,10 @@ $sql = 'SELECT group_id, group_name, max_filesize, forum_permissions FROM ' . EXTENSION_GROUPS_TABLE . ' - WHERE allow_group = 1 + WHERE allow_group = 1 ORDER BY group_name ASC'; -if (!($result = $db->sql_query($sql))) +if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query Extension Groups.', '', __LINE__, __FILE__, $sql); } @@ -66,16 +68,18 @@ $db->sql_freeresult($result); // Ok, only process those Groups allowed within this forum -$nothing = true; + +$nothing = TRUE; + for ($i = 0; $i < $num_rows; $i++) { $auth_cache = trim($rows[$i]['forum_permissions']); - $permit = ($privmsg) ? true : ((is_forum_authed($auth_cache, $forum_id)) || trim($rows[$i]['forum_permissions']) == ''); + $permit = ($privmsg) ? TRUE : ((is_forum_authed($auth_cache, $forum_id)) || trim($rows[$i]['forum_permissions']) == ''); - if ($permit) + if ( $permit ) { - $nothing = false; + $nothing = FALSE; $group_name = $rows[$i]['group_name']; $f_size = intval(trim($rows[$i]['max_filesize'])); $det_filesize = (!$f_size) ? $_max_filesize : $f_size; @@ -98,10 +102,10 @@ $sql = 'SELECT extension FROM ' . EXTENSIONS_TABLE . " - WHERE group_id = " . (int) $rows[$i]['group_id'] . " + WHERE group_id = " . (int) $rows[$i]['group_id'] . " ORDER BY extension ASC"; - if (!($result = $db->sql_query($sql))) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query Extensions.', '', __LINE__, __FILE__, $sql); } @@ -121,7 +125,7 @@ $gen_simple_header = TRUE; $page_title = $lang['Attach_rules_title']; -include($phpbb_root_path . 'includes/page_header.' . $phpEx); +include ($phpbb_root_path . 'includes/page_header.' . $phpEx); $template->assign_vars(array( 'L_RULES_TITLE' => $lang['Attach_rules_title'], @@ -129,7 +133,7 @@ 'L_EMPTY_GROUP_PERMS' => $lang['Note_user_empty_group_permissions']) ); -if ($nothing) +if ( $nothing ) { $template->assign_block_vars('switch_nothing', array()); } Modified: phpBB Reloaded 2/calendar.php =================================================================== --- phpBB Reloaded 2/calendar.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/calendar.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,46 +1,41 @@ <?php -/*************************************************************************** - * calendar.php - CH edition - * ------------ - * begin : 06/12/2004 - * copyright : Ptirhiik - * email : pti...@cl... - * - * Version : 0.0.2 - 15/05/2005 - * - ***************************************************************************/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ -define('IN_PHPBB', true); -define('IN_CALENDAR', true); +define('IN_PHPBB', TRUE); +define('IN_CALENDAR', TRUE); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.' . $phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.' . $phpEx); -include($config->url('includes/class_forums')); -include($config->url('includes/class_calendar')); +include ($config->url('includes/class_forums')); +include ($config->url('includes/class_calendar')); // date is in user format + $date = sprintf('%08d', _read('date', TYPE_INT)); $date = (intval($date) < 19700102) || (intval($date) >= 20700101) ? 0 : mktime( 0, 0, 0, intval(substr($date, 4, 2)), intval(substr($date, 6, 2)), intval(substr($date, 0, 4))); // from pull down lists + $month = _read('month', TYPE_INT); $year = _read('year', TYPE_INT); + if ( ($month > 0) && ($month <= 12) && ($year >= 1970) && ($year < 2070) ) { $date = mktime( 0, 0, 0, $month, 01, $year); } // next/previous from input buttons + if ( intval($date) ) { $aamm = date('Ym', $date); @@ -48,6 +43,7 @@ { $date = mktime( 0, 0, 0, date('m', $date) + 1, 01, $year); } + if ( _button('prev') && ($aamm > 197001) && ($aamm <= 206912) ) { $date = mktime( 0, 0, 0, date('m', $date), 00, $year); @@ -55,6 +51,7 @@ } // read forums + $forums = new forums(); $forums->read(); $forum_id = _read(POST_FORUM_URL, TYPE_INT); @@ -62,13 +59,16 @@ // // Start session management // + $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); + // // End session management // // check auths + $user->get_cache(POST_FORUM_URL); if ( !$user->auth(POST_FORUM_URL, 'auth_read', $forum_id) ) { @@ -76,27 +76,31 @@ } // navigation + $navigation = new navigation(); $navigation->add('Calendar', '', 'calendar', array(POST_FORUM_URL => $forum_id, 'date' => empty($date) ? 0 : date('Ymd', $date)), ''); $navigation->display(); // send the calendar box + $calendar = new calendar(); $calendar->display('CALENDAR_MONTH', $date, $forum_id, true); // send board header + $page_title = $user->lang('Calendar'); include($config->url('includes/page_header')); // system + $template->assign_vars(array( - 'S_ACTION' => $config->url('calendar', '', true), + 'S_ACTION' => $config->url('calendar', '', TRUE), )); _hide_set(); // send to browser + $template->set_filenames(array('body' => 'calendar_body.tpl')); $template->pparse('body'); -include($config->url('includes/page_tail')); - +include ($config->url('includes/page_tail')); ?> \ No newline at end of file Modified: phpBB Reloaded 2/calendar_scheduler.php =================================================================== --- phpBB Reloaded 2/calendar_scheduler.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/calendar_scheduler.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,41 +1,35 @@ <?php -/*************************************************************************** - * calendar_scheduler.php - CH edition - * ---------------------- - * begin : 06/12/2004 - * copyright : Ptirhiik - * email : pti...@cl... - * - * Version : 0.0.2 - 15/05/2005 - * - ***************************************************************************/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ -define('IN_PHPBB', true); -define('IN_CALENDAR', true); +define('IN_PHPBB', TRUE); +define('IN_CALENDAR', TRUE); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.' . $phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.' . $phpEx); -include($config->url('includes/class_forums')); -include($config->url('includes/class_calendar')); +include ($config->url('includes/class_forums')); +include ($config->url('includes/class_calendar')); // date is in user format + $date = sprintf('%08d', _read('date', TYPE_INT)); $date = (intval($date) < 19700102) || (intval($date) >= 20700101) ? 0 : mktime( 0, 0, 0, intval(substr($date, 4, 2)), intval(substr($date, 6, 2)), intval(substr($date, 0, 4))); // from pull down lists + $year = _read('year', TYPE_INT); $month = _read('month', TYPE_INT); $day = _read('day', TYPE_INT); + if ( ($month > 0) && ($month <= 12) && ($year >= 1970) && ($year < 2070) ) { $date = mktime( 0, 0, 0, $month, $day, $year); @@ -46,13 +40,16 @@ } // next/previous from input buttons + if ( intval($date) ) { $aamm = date('Ym', $date); + if ( _button('next') && ($aamm >= 197001) && ($aamm < 206912) ) { $date = mktime( 0, 0, 0, date('m', $date) + 1, 01, $year); } + if ( _button('prev') && ($aamm > 197001) && ($aamm <= 206912) ) { $date = mktime( 0, 0, 0, date('m', $date), 00, $year); @@ -60,6 +57,7 @@ } // hour + $hour = _read('hour', TYPE_INT); if ( ($hour < 0) || ($hour > 24) ) { @@ -67,6 +65,7 @@ } // read forums + $forums = new forums(); $forums->read(); $forum_id = _read(POST_FORUM_URL, TYPE_INT); @@ -74,43 +73,52 @@ // // Start session management // + $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); + // // End session management // // check auths + $user->get_cache(POST_FORUM_URL); + if ( !$user->auth(POST_FORUM_URL, 'auth_read', $forum_id) ) { $forum_id = 0; } // navigation + $navigation = new navigation(); $navigation->add('Calendar', '', 'calendar', array(POST_FORUM_URL => $forum_id, 'date' => empty($date) ? 0 : date('Ymd', $date)), ''); $navigation->add('Calendar_scheduler', '', 'calendar_scheduler', array(POST_FORUM_URL => $forum_id, 'date' => date('Ymd', $date), 'hour' => $hour), ''); $navigation->display(); // send the calendar box + $calendar_scheduler = new calendar_scheduler(); $calendar_scheduler->display($date, $hour, $forum_id); // send board header + $page_title = $user->lang('Calendar_scheduler'); -include($config->url('includes/page_header')); +include ($config->url('includes/page_header')); // system + $template->assign_vars(array( - 'S_ACTION' => $config->url('calendar_scheduler', '', true), -)); + 'S_ACTION' => $config->url('calendar_scheduler', '', true)) +); + _hide('date', $date); _hide_set(); // send to browser + $template->set_filenames(array('body' => 'calendar_scheduler_body.tpl')); $template->pparse('body'); -include($config->url('includes/page_tail')); - +include ($config->url('includes/page_tail')); ?> \ No newline at end of file Modified: phpBB Reloaded 2/common.php =================================================================== --- phpBB Reloaded 2/common.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/common.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,13 +1,15 @@ <?php /** -* -* @package: reloaded -* @version: $Id: common.php,v 1.1.1.1 2006/02/24 02:28:06 markthedaemon Exp $ -* @copyright: (c) 2005, 2006 phpBB Reloaded & 2002, 2006 phpBB Group -* @license: http://opensource.org/licenses/gpl-license.php GNU Public License -* -*/ + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ + if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); @@ -16,8 +18,6 @@ $starttime = microtime(); $trc_loc_start = $trc_loc_end = 0; - -// error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime @@ -25,6 +25,7 @@ // Thanks to Matt Kavanagh and Stefan Esser for providing feedback as well as patch files // PHP5 with register_long_arrays off? + if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) { $HTTP_POST_VARS = $_POST; @@ -35,55 +36,62 @@ $HTTP_POST_FILES = $_FILES; // _SESSION is the only superglobal which is conditionally set - if (isset($_SESSION)) + + if ( isset($_SESSION) ) { $HTTP_SESSION_VARS = $_SESSION; } } // Protect against GLOBALS tricks -if (isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS'])) + +if ( isset($HTTP_POST_VARS['GLOBALS']) || isset($HTTP_POST_FILES['GLOBALS']) || isset($HTTP_GET_VARS['GLOBALS']) || isset($HTTP_COOKIE_VARS['GLOBALS']) ) { die("Hacking attempt"); } // Protect against HTTP_SESSION_VARS tricks -if (isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS)) + +if ( isset($HTTP_SESSION_VARS) && !is_array($HTTP_SESSION_VARS) ) { die("Hacking attempt"); } -if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') +if ( @ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on' ) { // PHP4+ path + $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if // HTTP_SESSION_VARS has been initialised. - if (!isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS)) + + if ( !isset($HTTP_SESSION_VARS) || !is_array($HTTP_SESSION_VARS) ) { $HTTP_SESSION_VARS = array(); } // Merge all into one extremely huge array; unset // this later + $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES); - unset($input['input']); - unset($input['not_unset']); + unset ($input['input']); + unset ($input['not_unset']); - while (list($var,) = @each($input)) + while ( list($var,) = @each($input) ) { - if (in_array($var, $not_unset)) + if ( in_array($var, $not_unset) ) { die('Hacking attempt!'); } - unset($$var); + + unset ($$var); } - unset($input); + unset ($input); } // @@ -93,16 +101,17 @@ // if( !get_magic_quotes_gpc() ) { - if( is_array($HTTP_GET_VARS) ) + if ( is_array($HTTP_GET_VARS) ) { - while( list($k, $v) = each($HTTP_GET_VARS) ) + while ( list($k, $v) = each($HTTP_GET_VARS) ) { - if( is_array($HTTP_GET_VARS[$k]) ) + if ( is_array($HTTP_GET_VARS[$k]) ) { - while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) + while ( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) { $HTTP_GET_VARS[$k][$k2] = addslashes($v2); } + @reset($HTTP_GET_VARS[$k]); } else @@ -110,19 +119,21 @@ $HTTP_GET_VARS[$k] = addslashes($v); } } + @reset($HTTP_GET_VARS); } - if( is_array($HTTP_POST_VARS) ) + if ( is_array($HTTP_POST_VARS) ) { - while( list($k, $v) = each($HTTP_POST_VARS) ) + while ( list($k, $v) = each($HTTP_POST_VARS) ) { - if( is_array($HTTP_POST_VARS[$k]) ) + if ( is_array($HTTP_POST_VARS[$k]) ) { - while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) + while ( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } + @reset($HTTP_POST_VARS[$k]); } else @@ -130,19 +141,21 @@ $HTTP_POST_VARS[$k] = addslashes($v); } } + @reset($HTTP_POST_VARS); } - if( is_array($HTTP_COOKIE_VARS) ) + if ( is_array($HTTP_COOKIE_VARS) ) { - while( list($k, $v) = each($HTTP_COOKIE_VARS) ) + while ( list($k, $v) = each($HTTP_COOKIE_VARS) ) { - if( is_array($HTTP_COOKIE_VARS[$k]) ) + if ( is_array($HTTP_COOKIE_VARS[$k]) ) { - while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) + while ( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) { $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); } + @reset($HTTP_COOKIE_VARS[$k]); } else @@ -150,6 +163,7 @@ $HTTP_COOKIE_VARS[$k] = addslashes($v); } } + @reset($HTTP_COOKIE_VARS); } } @@ -159,6 +173,7 @@ // malicious rewriting of language and otherarray values via // URI params // + $board_config = array(); $userdata = array(); $theme = array(); @@ -168,31 +183,25 @@ $gen_simple_header = FALSE; $dss_seeded = false; -include($phpbb_root_path . 'config.'.$phpEx); +include ($phpbb_root_path . 'config.' . $phpEx); -if( !defined("PHPBB_INSTALLED") ) +if ( !defined("PHPBB_INSTALLED") ) { header('Location: ' . $phpbb_root_path . 'install/install.' . $phpEx); exit; } -include($phpbb_root_path . 'includes/constants.'.$phpEx); -//-- mod : categories hierarchy ------------------------------------------------ -//-- delete -/* -include($phpbb_root_path . 'includes/template.'.$phpEx); -*/ -//-- add -include($phpbb_root_path . 'includes/class_template.'.$phpEx); -//-- fin mod : categories hierarchy -------------------------------------------- -include($phpbb_root_path . 'includes/sessions.'.$phpEx); -include($phpbb_root_path . 'includes/auth.'.$phpEx); -include($phpbb_root_path . 'includes/functions.'.$phpEx); -include($phpbb_root_path . 'includes/db.'.$phpEx); +include ($phpbb_root_path . 'includes/constants.' . $phpEx); +include ($phpbb_root_path . 'includes/class_template.' . $phpEx); +include ($phpbb_root_path . 'includes/sessions.' . $phpEx); +include ($phpbb_root_path . 'includes/auth.' . $phpEx); +include ($phpbb_root_path . 'includes/functions.' . $phpEx); +include ($phpbb_root_path . 'includes/db.' . $phpEx); // We do not need this any longer, unset for safety purposes -unset($dbpasswd); +unset ($dbpasswd); + // // Obtain and encode users IP // @@ -201,6 +210,7 @@ // even bother complaining ... go scream and shout at the idiots out there who feel // "clever" is doing harm rather than good ... karma is a great thing ... :) // + $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); $user_ip = encode_ip($client_ip); @@ -209,40 +219,27 @@ // then we output a CRITICAL_ERROR since // basic forum information is not available // -//-- mod : categories hierarchy ------------------------------------------------ -//-- delete -/* -$sql = "SELECT * - FROM " . CONFIG_TABLE; -if( !($result = $db->sql_query($sql)) ) -{ - message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); -} -while ( $row = $db->sql_fetchrow($result) ) -{ - $board_config[$row['config_name']] = $row['config_value']; -} -*/ -//-- add // include basic classes def include($phpbb_root_path . 'includes/class_config.' . $phpEx); // get config + $config = new config_class(); + if ( !$config->read() ) { define('RUN_CH_INSTALL', true); } + $board_config = &$config->data; - - // user objects -include($config->url('includes/class_groups')); -include($config->url('includes/class_user')); -include($config->url('includes/class_auth')); +include ($config->url('includes/class_groups')); +include ($config->url('includes/class_user')); +include ($config->url('includes/class_auth')); + // instantiate some objects $user = new user(); $censored_words = new words(); @@ -253,34 +250,30 @@ $topics_attr = new topics_attr(); // People never read achievement messages after after having seen "Succesfull !", tss tss :) + if ( !defined('IN_LOGIN') && !defined('IN_INSTALL') && file_exists('install_cat') ) { message_die(GENERAL_MESSAGE, 'Please ensure the install_cat/ directory is deleted'); } // messages queue -@include($config->url('includes/class_message')); + +@include ($config->url('includes/class_message')); $message_queue = defined('CH_message_queue') ? new message_queue() : ''; -//-- mod : attachmod ----------------------------------------------------------- -//-- add -// attachmod -@include($config->url('attach_mod/attachment_mod')); -//-- fin mod : attachmod ------------------------------------------------------- -//-- fin mod : categories hierarchy ------------------------------------------- +@include ($config->url('attach_mod/attachment_mod')); -//-- mod : Advanced Group Color Management ------------------------------------- -//-- add define('IN_CH', TRUE); -include($config->url('includes/class_color')); +include ($config->url('includes/class_color')); // // prepare colors class -// +/ $colors = new colors(); // // People never read achievement messages after after having seen "Succesfull !", tss tss :) // + if ( !defined('IN_INSTALL') && file_exists('install_color') ) { message_die(GENERAL_MESSAGE, 'Please ensure the install_color/ directory is deleted'); @@ -290,32 +283,20 @@ // // read colors // + if ( !defined('IN_INSTALL') ) { $colors->read(); } -//-- fin mod : Advanced Group Color Management --------------------------------- -if (file_exists('install') || file_exists('contrib')) +if ( file_exists('install') || file_exists('contrib') ) { message_die(GENERAL_MESSAGE, 'Please_remove_install_contrib'); } -// -// Show 'Board is disabled' message if needed. -// -//-- mod : categories hierarchy ------------------------------------------------ -//-- delete -/* -if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") ) -*/ -//-- add -/* -if( $config->data['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') && !defined('IN_INSTALL') ) -//-- fin mod : categories hierarchy --------------------------------------------- + +if ( $config->data['board_disable'] && !defined('IN_ADMIN') && !defined('IN_LOGIN') && !defined('IN_INSTALL') ) { message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); } -*/ - ?> \ No newline at end of file Modified: phpBB Reloaded 2/download.php =================================================================== --- phpBB Reloaded 2/download.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/download.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,32 +1,25 @@ <?php -/** -* -* @package attachment_mod -* @version $Id: download.php,v 1.1.1.1 2006/02/24 02:28:09 markthedaemon Exp $ -* @copyright (c) 2002 Meik Sievertsen -* @license http://opensource.org/licenses/gpl-license.php GNU Public License -* -*/ -/*************************************************************************** - * - * This file has been modified by phpBB Reloaded - (C) 2006 phpBB Reloaded Group - * Support questions placed here: http://www.phpbbreloaded.com - * - * DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING - * - ***************************************************************************/ /** -*/ -if (defined('IN_PHPBB')) + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ + +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ + +if ( defined('IN_PHPBB')) { - die('Hacking attempt'); + die ('Hacking attempt'); exit; } -define('IN_PHPBB', true); +define ('IN_PHPBB', TRUE); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.' . $phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.' . $phpEx); // // Delete the / * to uncomment the block, and edit the values (read the comments) to @@ -101,6 +94,7 @@ $thumbnail = get_var('thumb', 0); // Send file to browser + function send_file_to_browser($attachment, $upload_dir) { global $_SERVER, $HTTP_USER_AGENT, $HTTP_SERVER_VARS, $lang, $db, $attach_config; @@ -109,9 +103,9 @@ $gotit = false; - if (!intval($attach_config['allow_ftp_upload'])) + if ( !intval($attach_config['allow_ftp_upload']) ) { - if (@!file_exists(@amod_realpath($filename))) + if ( @!file_exists(@amod_realpath($filename)) ) { message_die(GENERAL_ERROR, $lang['Error_no_attachment'] . "<br /><br /><b>404 File Not Found:</b> The File <i>" . $filename . "</i> does not exist."); } @@ -125,45 +119,46 @@ // Determine the Browser the User is using, because of some nasty incompatibilities. // Most of the methods used in this function are from phpMyAdmin. :) // - if (!empty($_SERVER['HTTP_USER_AGENT'])) + + if ( !empty($_SERVER['HTTP_USER_AGENT']) ) { $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; } - else if (!empty($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) + elseif ( !empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']) ) { $HTTP_USER_AGENT = $HTTP_SERVER_VARS['HTTP_USER_AGENT']; } - else if (!isset($HTTP_USER_AGENT)) + elseif ( !isset($HTTP_USER_AGENT) ) { $HTTP_USER_AGENT = ''; } - if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + if ( ereg('Opera(/| )([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[2]; $browser_agent = 'opera'; } - else if (ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + elseif ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[1]; $browser_agent = 'ie'; } - else if (ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + elseif ( ereg('OmniWeb/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[1]; $browser_agent = 'omniweb'; } - else if (ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version)) + elseif ( ereg('Netscape([0-9]{1})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[1]; $browser_agent = 'netscape'; } - else if (ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + elseif ( ereg('Mozilla/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[1]; $browser_agent = 'mozilla'; } - else if (ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version)) + elseif ( ereg('Konqueror/([0-9].[0-9]{1,2})', $HTTP_USER_AGENT, $log_version) ) { $browser_version = $log_version[1]; $browser_agent = 'konqueror'; @@ -176,38 +171,39 @@ // Correct the mime type - we force application/octetstream for all files, except images // Please do not change this, it is a security precaution + if (!strstr($attachment['mimetype'], 'image')) { $attachment['mimetype'] = ($browser_agent == 'ie' || $browser_agent == 'opera') ? 'application/octetstream' : 'application/octet-stream'; } - // Now the tricky part... let's dance -// @ob_end_clean(); -// @ini_set('zlib.output_compression', 'Off'); header('Pragma: public'); -// header('Content-Transfer-Encoding: none'); $real_filename = html_entity_decode(basename($attachment['real_filename'])); // Send out the Headers + header('Content-Type: ' . $attachment['mimetype'] . '; name="' . $real_filename . '"'); header('Content-Disposition: inline; filename="' . $real_filename . '"'); - unset($real_filename); + unset ($real_filename); // // Now send the File Contents to the Browser // - if ($gotit) + + if ( $gotit ) { $size = @filesize($filename); - if ($size) + + if ( $size ) { header("Content-length: $size"); } + readfile($filename); } - else if (!$gotit && intval($attach_config['allow_ftp_upload'])) + elseif ( !$gotit && intval($attach_config['allow_ftp_upload']) ) { $conn_id = attach_init_ftp(); @@ -219,6 +215,7 @@ @unlink($tmp_filename); $mode = FTP_BINARY; + if ( (preg_match("/text/i", $attachment['mimetype'])) || (preg_match("/html/i", $attachment['mimetype'])) ) { $mode = FTP_ASCII; @@ -226,7 +223,7 @@ $result = @ftp_get($conn_id, $tmp_filename, $filename, $mode); - if (!$result) + if ( !$result ) { message_die(GENERAL_ERROR, $lang['Error_no_attachment'] . "<br /><br /><b>404 File Not Found:</b> The File <i>" . $filename . "</i> does not exist."); } @@ -234,10 +231,12 @@ @ftp_quit($conn_id); $size = @filesize($tmp_filename); - if ($size) + + if ( $size ) { header("Content-length: $size"); } + readfile($tmp_filename); @unlink($tmp_filename); } @@ -258,26 +257,26 @@ $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); -if (!$download_id) +if ( !$download_id ) { message_die(GENERAL_ERROR, $lang['No_attachment_selected']); } -if ($attach_config['disable_mod'] && $userdata['user_level'] != ADMIN) +if ( $attach_config['disable_mod'] && $userdata['user_level'] != ADMIN ) { message_die(GENERAL_MESSAGE, $lang['Attachment_feature_disabled']); } $sql = 'SELECT * FROM ' . ATTACHMENTS_DESC_TABLE . ' - WHERE attach_id = ' . (int) $download_id; + WHERE attach_id = ' . (int) $download_id; -if (!($result = $db->sql_query($sql))) +if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql); } -if (!($attachment = $db->sql_fetchrow($result))) +if ( !($attachment = $db->sql_fetchrow($result)) ) { message_die(GENERAL_MESSAGE, $lang['Error_no_attachment']); } @@ -287,13 +286,14 @@ $db->sql_freeresult($result); // get forum_id for attachment authorization or private message authorization -$authorised = false; +$authorised = FALSE; + $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' - WHERE attach_id = ' . (int) $attachment['attach_id']; + WHERE attach_id = ' . (int) $attachment['attach_id']; -if (!($result = $db->sql_query($sql))) +if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query attachment informations', '', __LINE__, __FILE__, $sql); } @@ -301,11 +301,11 @@ $auth_pages = $db->sql_fetchrowset($result); $num_auth_pages = $db->sql_numrows($result); -for ($i = 0; $i < $num_auth_pages && $authorised == false; $i++) +for ( $i = 0; $i < $num_auth_pages && $authorised == FALSE; $i++ ) { $auth_pages[$i]['post_id'] = intval($auth_pages[$i]['post_id']); - if ($auth_pages[$i]['post_id'] != 0) + if ( $auth_pages[$i]['post_id'] != 0 ) { $sql = 'SELECT forum_id FROM ' . POSTS_TABLE . ' @@ -323,7 +323,7 @@ $is_auth = array(); $is_auth = auth(AUTH_ALL, $forum_id, $userdata); - if ($is_auth['auth_download']) + if ( $is_auth['auth_download'] ) { $authorised = TRUE; } @@ -338,7 +338,7 @@ } -if (!$authorised) +if ( !$authorised ) { message_die(GENERAL_MESSAGE, $lang['Sorry_auth_view_attach']); } @@ -346,9 +346,10 @@ // // Get Information on currently allowed Extensions // + $sql = "SELECT e.extension, g.download_mode FROM " . EXTENSION_GROUPS_TABLE . " g, " . EXTENSIONS_TABLE . " e - WHERE (g.allow_group = 1) AND (g.group_id = e.group_id)"; + WHERE (g.allow_group = 1) AND (g.group_id = e.group_id)"; if ( !($result = $db->sql_query($sql)) ) { @@ -358,7 +359,7 @@ $rows = $db->sql_fetchrowset($result); $num_rows = $db->sql_numrows($result); -for ($i = 0; $i < $num_rows; $i++) +for ( $i = 0; $i < $num_rows; $i++ ) { $extension = strtolower(trim($rows[$i]['extension'])); $allowed_extensions[] = $extension; @@ -366,47 +367,50 @@ } // disallowed ? -if (!in_array($attachment['extension'], $allowed_extensions) && $userdata['user_level'] != ADMIN) + +if ( !in_array($attachment['extension'], $allowed_extensions) && $userdata['user_level'] != ADMIN ) { message_die(GENERAL_MESSAGE, sprintf($lang['Extension_disabled_after_posting'], $attachment['extension'])); } $download_mode = intval($download_mode[$attachment['extension']]); -if ($thumbnail) +if ( $thumbnail ) { $attachment['physical_filename'] = THUMB_DIR . '/t_' . $attachment['physical_filename']; } // Update download count -if (!$thumbnail) + +if ( !$thumbnail ) { $sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' - SET download_count = download_count + 1 - WHERE attach_id = ' . (int) $attachment['attach_id']; + SET download_count = download_count + 1 + WHERE attach_id = ' . (int) $attachment['attach_id']; - if (!$db->sql_query($sql)) + if ( !$db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql); } } // Determine the 'presenting'-method -if ($download_mode == PHYSICAL_LINK) + +if ( $download_mode == PHYSICAL_LINK ) { $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; $server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['server_name'])); $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : ''; $script_name = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($board_config['script_path'])); - if ($script_name[strlen($script_name)] != '/') + if ( $script_name[strlen($script_name)] != '/' ) { $script_name .= '/'; } - if (intval($attach_config['allow_ftp_upload'])) + if ( intval($attach_config['allow_ftp_upload']) ) { - if (trim($attach_config['download_path']) == '') + if ( trim($attach_config['download_path']) == '' ) { message_die(GENERAL_ERROR, 'Physical Download not possible with the current Attachment Setting'); } @@ -422,22 +426,26 @@ } // Redirect via an HTML form for PITA webservers - if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE'))) + + if ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) { header('Refresh: 0; URL=' . $redirect_path); + echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . $redirect_path . '"><title>Redirect</title></head><body><div align="center">If your browser does not support meta redirection please click <a href="' . $redirect_path . '">HERE</a> to be redirected</div></body></html>'; exit; } // Behave as per HTTP/1.1 spec for others + header('Location: ' . $redirect_path); exit; } else { - if (intval($attach_config['allow_ftp_upload'])) + if ( intval($attach_config['allow_ftp_upload']) ) { // We do not need a download path, we are not downloading physically + send_file_to_browser($attachment, ''); exit; } Modified: phpBB Reloaded 2/extension.inc =================================================================== --- phpBB Reloaded 2/extension.inc 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/extension.inc 2006-08-12 15:10:37 UTC (rev 250) @@ -1,16 +1,15 @@ <?php -/*************************************************************************** - * extension.inc - * ------------------- - * begin : Saturday, Feb 13, 2001 - * copyright : (C) 2001 The phpBB Group - * email : su...@ph... - * - * $Id: extension.inc,v 1.1.1.1 2006/02/24 02:28:09 markthedaemon Exp $ - * - * - ***************************************************************************/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ + if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); Modified: phpBB Reloaded 2/faq.php =================================================================== --- phpBB Reloaded 2/faq.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/faq.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,43 +1,27 @@ <?php -/*************************************************************************** - * faq.php - * ------------------- - * begin : Sunday, Jul 8, 2001 - * copyright : (C) 2001 The phpBB Group - * email : su...@ph... - * - * $Id: faq.php,v 1.1.1.1 2006/02/24 02:28:09 markthedaemon Exp $ - * - * - ***************************************************************************/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ -/*************************************************************************** - * - * This file has been modified by phpBB Reloaded - (C) 2006 phpBB Reloaded Group - * Support questions placed here: http://www.phpbbreloaded.com - * - * DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING - * - ***************************************************************************/ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ define('IN_PHPBB', true); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.'.$phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.'.$phpEx); // // Start session management // + $userdata = session_pagestart($user_ip, PAGE_FAQ); init_userprefs($userdata); + // // End session management // @@ -46,22 +30,22 @@ $navigation->add('FAQ', '', 'faq', '', ''); $navigation->display(); - // Set vars to prevent naughtiness + $faq = array(); // // Load the appropriate faq file // -if( isset($HTTP_GET_VARS['mode']) ) +if ( isset($HTTP_GET_VARS['mode']) ) { - switch( $HTTP_GET_VARS['mode'] ) + switch ( $HTTP_GET_VARS['mode'] ) { - case 'bbcode': + case 'bbcode' : $lang_file = 'lang_bbcode'; $l_title = $lang['BBCode_guide']; break; - default: + default : $lang_file = 'lang_faq'; $l_title = $lang['FAQ']; break; @@ -72,27 +56,28 @@ $lang_file = 'lang_faq'; $l_title = $lang['FAQ']; } -include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); +include ($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); + //attachment stuff! if ( defined('CH_mod_attachmod') ) { attach_faq_include($lang_file); } - // // Pull the array data from the lang pack // + $j = 0; $counter = 0; $counter_2 = 0; $faq_block = array(); $faq_block_titles = array(); -for($i = 0; $i < count($faq); $i++) +for ( $i = 0; $i < count($faq); $i++ ) { - if( $faq[$i][0] != '--' ) + if ( $faq[$i][0] != '--' ) { $faq_block[$j][$counter]['id'] = $counter_2; $faq_block[$j][$counter]['question'] = $faq[$i][0]; @@ -114,12 +99,14 @@ // // Lets build a page ... // + $page_title = $l_title; -include($phpbb_root_path . 'includes/page_header.'.$phpEx); +include ($phpbb_root_path . 'includes/page_header.'.$phpEx ); $template->set_filenames(array( 'body' => 'faq_body.tpl') ); + make_jumpbox('viewforum.'.$phpEx); $template->assign_vars(array( @@ -127,18 +114,19 @@ 'L_BACK_TO_TOP' => $lang['Back_to_top']) ); -for($i = 0; $i < count($faq_block); $i++) +for ( $i = 0; $i < count($faq_block); $i++ ) { - if( count($faq_block[$i]) ) + if ( count($faq_block[$i]) ) { $template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); + $template->assign_block_vars('faq_block_link', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); - for($j = 0; $j < count($faq_block[$i]); $j++) + for ( $j = 0; $j < count($faq_block[$i]); $j++ ) { $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2']; @@ -163,13 +151,11 @@ )); $template->set_switch('faq_block.faq_row.light', !($j % 2)); $template->set_switch('faq_block_link.faq_row_link.light', !($j % 2)); -//-- fin mod : categories hierarchy -------------------------------------------- } } } $template->pparse('body'); -include($phpbb_root_path . 'includes/page_tail.'.$phpEx); - +include ($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> \ No newline at end of file Modified: phpBB Reloaded 2/groupcp.php =================================================================== --- phpBB Reloaded 2/groupcp.php 2006-06-20 23:05:11 UTC (rev 249) +++ phpBB Reloaded 2/groupcp.php 2006-08-12 15:10:37 UTC (rev 250) @@ -1,34 +1,21 @@ <?php -//-- mod : group moderatorZ ------------------------------------------------------------------------ -//-- mod : categories hierarchy ------------------------------------------------ -/*************************************************************************** - * groupcp.php - * ------------------- - * begin : Saturday, Feb 13, 2001 - * copyright : (C) 2001 The phpBB Group - * email : su...@ph... - * - * $Id: groupcp.php,v 1.2 2006/02/27 03:45:02 scioncrow Exp $ - * - * - ***************************************************************************/ +/** + * @package core + * @version $ID: Exp$ + * @copyright phpBB Reloaded 2006 + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ -/*************************************************************************** - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - ***************************************************************************/ +/** + * phpBB originally created by phpBB http://www.phpbb.com + */ -define('IN_PHPBB', true); +define('IN_PHPBB', TRUE); $phpbb_root_path = './'; -include($phpbb_root_path . 'extension.inc'); -include($phpbb_root_path . 'common.'.$phpEx); +include ($phpbb_root_path . 'extension.inc'); +include ($phpbb_root_path . 'common.'.$phpEx); -// ------------------------- -// + function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$joined, &$poster_avatar, &$profile_img, &$profile, &$search_img, &$search, &$pm_img, &$pm, &$email_img, &$email, &$www_img, &$www, &$icq_status_img, &$icq_img, &$icq, &$aim_img, &$aim, &$msn_img, &$msn, &$yim_img, &$yim) { global $lang, $images, $board_config, $phpEx; @@ -38,9 +25,10 @@ $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; $poster_avatar = ''; + if ( $row['user_avatar_type'] && $row['user_id'] != ANONYMOUS && $row['user_allowavatar'] ) { - switch( $row['user_avatar_type'] ) + switch ( $row['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : ''; @@ -107,55 +95,61 @@ return; } -// -// -------------------------- // // Start session management // + $userdata = session_pagestart($user_ip, PAGE_GROUPCP); init_userprefs($userdata); + // // End session management // -//-- mod : categories hierarchy ------------------------------------------------ -//-- add $navigation = new navigation(); $navigation->add('Usergroups', '', 'groupcp', '', ''); $navigation->display(); // read forums and auths for the jumpbox -include($config->url('includes/class_forums')); + +include ($config->url('includes/class_forums')); $forums = new forums(); $forums->read(); $user->get_cache(array(POST_GROUPS_URL, POST_FORUM_URL, POST_FORUM_URL . 'jbox')); $user_groups_list = $user->get_groups_list(); // auth -$auth_manage = false; -$auth_membership = false; +$auth_manage = FALSE; +$auth_membership = FALSE; + // level + $is_founder = $user->data['session_logged_in'] && in_array(GROUP_FOUNDER, $user_groups_list); $is_admin = $user->data['session_logged_in'] && in_array(GROUP_ADMIN, $user_groups_list); -$is_owner = false; +$is_owner = FALSE; // read group + $group_id = _read(POST_GROUPS_URL, TYPE_INT); + if ( $group_id == GROUP_REGISTERED ) { message_return('Not_Authorised'); } + $group_status = GROUP_STANDARD; $group_row = array(); + if ( !empty($group_id) ) { $sql = 'SELECT * FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . intval($group_id) . ' - AND group_single_user <> ' . true; + AND group_single_user <> ' . TRUE; $result = $db->sql_query($sql, false, __LINE__, __FILE__); + if ( $group_row = $db->sql_fetchrow($result) ) { $group_status = intval($group_row['group_status']); @@ -163,68 +157,40 @@ $group_row['group_description'] = ($group_status >= GROUP_SYSTEM) ? $user->lang($group_row['group_description']) : $group_row['group_description']; $is_owner = $user->data['session_logged_in'] && (intval($group_row['group_moderator']) == $user->data['user_id']); -//-- mod : group moderatorZ ------------------------------------------------------------------------ $sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE group_moderator = 1 AND group_id = $group_id"; - $result = $db->sql_query($sql, false, __LINE__, __FILE__); + $result = $db->sql_query($sql, FALSE, __LINE__, __FILE__); $modZ_row = array(); $is_modZ = FALSE; - while ( ( $modZ_row = $db->sql_fetchrow($result) ) AND ( $is_modZ == FALSE ) ) + + while ( ($modZ_row = $db->sql_fetchrow($result) ) && ($is_modZ == FALSE) ) { $is_modZ = $user->data['session_logged_in'] && (intval($modZ_row['user_id']) == $user->data['user_id']); } -//-- mod : group moderatorZ - dynamic adaptation --------------------------------------------------- + // check auths + $is_auth_owner = $user->auth(POST_GROUPS_URL, 'ucp_auth_owner', $group_id); $is_auth_mod = $user->auth(POST_GROUPS_URL, 'ucp_auth_mod', $group_id); -//-- fin mod : group moderatorZ - dynamic adaptation ----------------------------------------------- -//-- fin mod : group moderatorZ -------------------------------------------------------------------- } } + switch ( $group_id ) { -//-- mod : group moderatorZ ------------------------------------------------------------------------ -// here we added -// || $is_modZ 3 times. -// ( " || $is_auth_owner" and " || $is_auth_mod" for dynamic adaptation) -// -// *** Modding Help -// * Grouplevel -// GROUP_FOUNDER = This apply's to the usergroup that acts as founder -// GROUP_ADMIN = This apply's to the usergroup that acts as admin -// default = This is any outher group. -// * Authority -// $auth_manage = who an act as owner in groups (he has to be in $auth_mebership as well) -// $auth_membership = who can act as moderator in groups -// * Userlevel -// $is_owner = user that is owner oft that group -// $is_founder = user that has founder status -// $is_admin = user that has admin status -// $is_modZ = user that is appointed moderator of that particular group -// $is_auth_owner = user that is given owner acces in the ACP -// $is_auth_mod = user that is given moderator acces in the ACP -// *** End Help -// -// ***Advice: Remove " || $is_admin" from the default if you want that admins can not manage all default groups -// and only can manage those groups set by the founder in the ACP -// -//--modify - case GROUP_FOUNDER: + case GROUP_FOUNDER : $auth_manage = $is_owner; $auth_membership = $is_owner || $is_modZ; break; - case GROUP_ADMIN: + case GROUP_ADMIN : $auth_manage = $is_founder; $auth_membership = $is_owner || $is_founder || $is_modZ; break; - default: + default : $auth_manage = $is_owner || $is_founder || $is_admin; $auth_membership = $is_owner || $is_founder || $is_admin || $is_modZ; break; -//-- fin mod : group moderatorZ -------------------------------------------------------------------- } -//-- fin mod : categories hierarchy -------------------------------------------- $script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path'])); $script_name = ( $script_name != '' ) ? $script_name . '/groupcp.'.$phpEx : 'groupcp.'.$phpEx; @@ -261,63 +227,43 @@ // // Default var values // + $is_moderator = FALSE; -//-- mod : Advanced Group Color Management ------------------------------------- -//-- add $colors->read_group_users($group_id); -//-- fin mod : Advanced Group Color Management --------------------------------- - if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id ) { if ( !$userdata['session_logged_in'] ) { - redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", TRUE)); } -//-- mod : categories hierarchy ------------------------------------------------ -//-- delete -/* - $sql = "SELECT group_moderator - FROM " . GROUPS_TABLE . " - WHERE group_id = $group_id"; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); - } - - $row = $db->sql_fetchrow($result); -*/ -//-- add // get the group + $row = $group_row; $group_type = _read('group_type', TYPE_INT); + if ( !$auth_membership ) { _error('Not_group_moderator'); } - else if ( ($group_status >= GROUP_SYSTEM) && ($group_type < GROUP_CLOSED) ) + elseif ( ($group_status >= GROUP_SYSTEM) && ($group_type < GROUP_CLOSED) ) { _error('Change_sysgroup_type_denied'); } - else if ( ($group_type != $row['group_type']) && !$auth_manage ) + elseif ( ($group_type != $row['group_type']) && !$auth_manage ) { _error('Manage_group_denied'); } + if ( $error ) { $l_link = 'Click_return_group'; - $u_link = $config->url('groupcp', array(POST_GROUPS_URL => intval($group_id)), true); + $u_link = $config->url('groupcp', array(POST_GROUPS_URL => intval($group_id)), TRUE); message_return($error_msg, $l_link, $u_link); } -//-- fin mod : categories hierarchy -------------------------------------------- -//-- mod : group moderatorZ ------------------------------------------------------------------------ -//-- delete -// if ( $row['group_moderator'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN ) -//-- add - if ( !$auth_manage ) -//-- fin mod : group moderatorZ -------------------------------------------------------------------- + if ( !$auth_manage ) { $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">') @@ -331,6 +277,7 @@ $sql = "UPDATE " . GROUPS_TABLE . " SET group_type = " . intval($HTTP_POST_VARS['group_type']) . " WHERE group_id = $group_id"; + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); @@ -345,12 +292,13 @@ message_die(GENERAL_MESSAGE, $message); } -else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id ) +elseif ( isset($HTTP_POST_VARS['joingroup']) && $group_id ) { // // First, joining a group // If the user isn't logged in redirect them to login // + if ( !$userdata['session_logged_in'] ) { redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); @@ -358,15 +306,16 @@ $sql = "SELECT ug.user_id, g.group_type FROM " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g - WHERE g.group_id = $group_id - AND g.group_type <> " . GROUP_HIDDEN . " - AND ug.group_id = g.group_id"; + WHERE g.group_id = $group_id + AND g.group_type <> " . GROUP_HIDDEN . " + AND ug.group_id = g.group_id"; + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain user and group information', '', __LINE__, __FILE__, $sql); } - if ( $row = $db->sql_fetchrow($result) ) + if ( $row = $db->sql_fetchrow($result) ) { if ( $row['group_type'] == GROUP_OPEN ) { @@ -382,7 +331,8 @@ message_die(GENERAL_MESSAGE, $message); } - } while ( $row = $db->sql_fetchrow($result) ); + } + while ( $row = $db->sql_fetchrow($result) ); } else { @@ -402,64 +352,45 @@ $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending) VALUES ($group_id, " . $userdata['user_id'] . ", 1)"; + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql); } -//-- mod : group moderatorZ ------------------------------------------------------------------------ -// here we added -// include($phpbb_root_path . 'includes/emailer.'.$phpEx); -// and -// , " . USER_GROUP_TABLE . " ug -// and -// , ( [../..] OR ug.group_moderator = 1 ) -// and -// AND u.user_id = ug.user_id AND ug.group_id = g.group_id -//-- modify - include($phpbb_root_path . 'includes/emailer.'.$phpEx); + include ($phpbb_root_path . 'includes/emailer.'.$phpEx); + $sql = "SELECT u.user_email, u.username, u.user_lang, g.group_name FROM ".USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g WHERE ( u.user_id = g.group_moderator OR ug.group_moderator = 1 ) AND g.group_id = $group_id AND u.user_id = ug.user_id AND ug.group_id = g.group_id"; -//-- fin mod : group moderatorZ -------------------------------------------------------------------- + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Error getting group moderator data", "", __LINE__, __FILE__, $sql); } -//-- mod : group moderatorZ ------------------------------------------------------------------------ -//-- delete -// $moderator = $db->sql_fetchrow($result); -// -// include($phpbb_root_path . 'includes/emailer.'.$phpEx); -//-- add - while ($moderator = $db->sql_fetchrow($result)) + while ( $moderator = $db->sql_fetchrow($result) ) { -//-- fin mod : group moderatorZ -------------------------------------------------------------------- - $emailer = new emailer($board_config['smtp_delivery']); + $emailer = new emailer($board_config['smtp_delivery']); - $emailer->from($board_config['board_email']); - $emailer->replyto($board_config['board_email']); + $emailer->from($board_config['board_email']); + $emailer->replyto($board_config['board_email']); - $emailer->use_template('group_request', $moderator['user_lang']); - $emailer->email_address($moderator['user_email']); - $emailer->set_subject($lang['Group_request']); + $emailer->use_template('group_request', $moderator['user_lang']); + $emailer->email_address($moderator['user_email']); + $emailer->set_subject($lang['Group_request']); - $emailer->assign_vars(array( - 'SITENAME' => $board_config['sitename'], - 'GROUP_MODERATOR' => $moderator['username'], - 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', + $emailer->assign_vars(array( + 'SITENAME' => $board_config['sitename'], + 'GROUP_MODERATOR' => $moderator['username'], + 'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', - 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true") - ); - $emailer->send(); - $emailer->reset(); - -//-- mod : group moderatorZ ------------------------------------------------------------------------ -//-- add + 'U_GROUPCP' => $server_url . '?' . POST_GROUPS_URL . "=$group_id&validate=true") + ); + $emailer->send(); + $emailer->reset(); } -//-- fin mod : group moderatorZ -------------------------------------------------------------------- $template->assign_vars(array( 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">') @@ -469,19 +400,20 @@ message_die(GENERAL_MESSAGE, $message); } -else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending']) && $group_id ) +elseif ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending']) && $group_id ) { // // Second, unsubscribing from a group // Check for confirmation of unsub. // + if ( $cancel ) { - redirect(append_sid("groupcp.$phpEx", true)); + redirect(append_sid("groupcp.$phpEx", TRUE)); } elseif ( !$userdata['session_logged_in'] ) { - redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", TRUE)); } if ( $confirm ) @@ -494,63 +426,27 @@ message_die(GENERAL_ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql); } -//-- mod : categories hierarchy ------------------------------------------------ -//-- delete -/* - if ( $userdata['user_level'] != ADMIN && $userdata['user_level'] == MOD ) - { - $sql = "SELECT COUNT(auth_mod) AS is_auth_mod - FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug - WHERE ug.user_id = " . $userdata['user_id'] . " - AND aa.group_id = ug.group_id - AND aa.auth_mod = 1"; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain moderator status', '', __LINE__, __FILE__, $sql); - } - - ... [truncated message content] |
From: <teh...@us...> - 2006-10-23 04:34:06
|
Revision: 260 http://svn.sourceforge.net/phpbbreloaded/?rev=260&view=rev Author: tehphpmaster Date: 2006-10-22 21:33:53 -0700 (Sun, 22 Oct 2006) Log Message: ----------- Fixed a language error and also a parse error in search.php Modified Paths: -------------- phpBB Reloaded 2/language/lang_english/lang_main.php phpBB Reloaded 2/search.php Modified: phpBB Reloaded 2/language/lang_english/lang_main.php =================================================================== --- phpBB Reloaded 2/language/lang_english/lang_main.php 2006-10-23 04:11:33 UTC (rev 259) +++ phpBB Reloaded 2/language/lang_english/lang_main.php 2006-10-23 04:33:53 UTC (rev 260) @@ -1041,7 +1041,7 @@ $lang['Admin_reauthenticate'] = 'To administer the board you must re-authenticate yourself.'; $lang['Login_attempts_exceeded'] = 'The maximum number of %s login attempts has been exceeded. You are not allowed to login for the next %s minutes.'; -$lang['Please_remove_install_contrib'] = 'Please ensure both the install/ and contrib/ directories are deleted'; +$lang['Please_remove_install_contrib'] = 'Please ensure that the /install directory has been removed'; //+MOD: Select Expand BBcodes MOD $lang['Select'] = "Select"; Modified: phpBB Reloaded 2/search.php =================================================================== --- phpBB Reloaded 2/search.php 2006-10-23 04:11:33 UTC (rev 259) +++ phpBB Reloaded 2/search.php 2006-10-23 04:33:53 UTC (rev 260) @@ -1,29 +1,38 @@ <?php -/** - * @package core - * @version $ID: Exp$ - * @copyright phpBB Reloaded 2006 - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - */ +//-- mod : categories hierarchy ------------------------------------------------ +/*************************************************************************** + * search.php + * ------------------- + * begin : Saturday, Feb 13, 2001 + * copyright : (C) 2001 The phpBB Group + * email : su...@ph... + * + * $Id: search.php,v 1.72.2.19 2006/02/05 15:59:48 grahamje Exp $ + * + * + ***************************************************************************/ -/** - * phpBB originally created by phpBB http://www.phpbb.com - */ +/*************************************************************************** + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + ***************************************************************************/ -define ('IN_PHPBB', TRUE); +define('IN_PHPBB', true); $phpbb_root_path = './'; -include ($phpbb_root_path . 'extension.inc'); -include ($phpbb_root_path . 'common.' . $phpEx); -include ($phpbb_root_path . 'includes/bbcode.' . $phpEx); -include ($phpbb_root_path . 'includes/functions_search.' . $phpEx); +include($phpbb_root_path . 'extension.inc'); +include($phpbb_root_path . 'common.'.$phpEx); +include($phpbb_root_path . 'includes/bbcode.'.$phpEx); +include($phpbb_root_path . 'includes/functions_search.'.$phpEx); // read forums if not a searchuser - $searchuser = (_read('mode', TYPE_NO_HTML) == 'searchuser'); - if ( !$searchuser ) { - include ($config->url('includes/class_forums')); + include($config->url('includes/class_forums')); $forums = new forums(); $forums->read(); } @@ -31,14 +40,13 @@ // // Start session management // - $userdata = session_pagestart($user_ip, PAGE_SEARCH); init_userprefs($userdata); - // // End session management // + if ( !$searchuser ) { $user->get_cache(POST_FORUM_URL); @@ -48,9 +56,7 @@ } // topics class - -include ($config->url('includes/class_topics')); - +include($config->url('includes/class_topics')); class topics_search extends topics { function topics_search($parms='', $extra_parms='') @@ -69,33 +75,28 @@ $ppage = $this->parms['ppage']; // read topics - $sql = 'SELECT * - FROM ' . TOPICS_TABLE . ' - WHERE topic_id IN(' . $search_results . ') - AND topic_last_post_id > 0 - ORDER BY topic_last_time DESC + FROM ' . TOPICS_TABLE . ' + WHERE topic_id IN(' . $search_results . ') + AND topic_last_post_id > 0 + ORDER BY topic_last_time DESC LIMIT ' . $start . ', ' . $ppage; // read results - - $result = $db->sql_query($sql, FALSE, __LINE__, __FILE__); + $result = $db->sql_query($sql, false, __LINE__, __FILE__); $this->pre_process(); - while ( $row = $db->sql_fetchrow($result) ) { $this->row_process($row); $this->data_ext[ $row['topic_id'] ] = $row; } - $db->sql_freeresult($result); // get complementary data - $this->post_process(); } - function bottom_line($empty = FALSE) + function bottom_line($empty=false) { global $template, $user; @@ -110,7 +111,6 @@ // // Define initial vars // - if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; @@ -144,14 +144,13 @@ $show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'posts'; $show_results = ($show_results == 'topics') ? 'topics' : 'posts'; -// start mod save posts as drafts ... if user clicked to see his drafts and posts or topics, set search_id to egosearch and set show_results correctly - -if ( $search_id == 'egosearch_by_topic' || $search_id == 'egosearch_by_post' ) +if( $search_id == 'egosearch_by_topic' || $search_id == 'egosearch_by_post' ) { $show_results = ( $search_id == 'egosearch_by_topic' ) ? 'topics' : 'posts'; $search_id = 'egosearch'; } + if ( isset($HTTP_POST_VARS['search_terms']) ) { $search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0; @@ -204,29 +203,27 @@ // // encoding match for workaround // - $multibyte_charset = 'utf-8, big5, shift_jis, euc-kr, gb2312'; // // Begin core code // -if ( $mode == 'searchcolor' ) +if ($mode == 'searchcolor') { // // This handles the simple windowed user color // - color_search(); exit; } -elseif ($mode == 'searchuser') +else if ($mode == 'searchuser') + { // // This handles the simple windowed user search functions called from various other scripts // - if ( isset($HTTP_POST_VARS['search_username']) ) { username_search($HTTP_POST_VARS['search_username']); @@ -238,44 +235,36 @@ exit; } -elseif ( $search_keywords != '' || $search_author != '' || $search_id ) +else if ( $search_keywords != '' || $search_author != '' || $search_id ) { +// start mod save posts as drafts (and end mod too)...added the draft_on variable in the next line so that if the user clicks to after page 1 of list and then goes back to page 1 the draft lists will appear $store_vars = array('search_results', 'total_match_count', 'split_search', 'sort_by', 'sort_dir', 'show_results', 'return_chars', 'draft_on'); $search_results = ''; - // - // note : auth_sql will never be empty, so the forums table will always be joigned to the research - // - $auth_sql = ''; $store_vars[] = 'no_subs'; - // read params - + // read parms $search_forum = _read('search_forum', TYPE_INT); $no_subs = _button('no_subs'); // check forum id - - if ( !isset($forums->data[$search_forum]) || !$user->auth(POST_FORUM_URL, 'auth_read', $search_forum) ) + if (!isset($forums->data[$search_forum]) || !$user->auth(POST_FORUM_URL, 'auth_read', $search_forum) ) { message_die(GENERAL_MESSAGE, $user->lang('No_such_forum')); } // get min and max forum ids for the branch asked - $min_id = intval($search_forum); $max_id = $no_subs ? $search_forum : $forums->data[$search_forum]['last_child_id']; // get excluded forums - $tkeys = array_flip($forums->keys); $min_idx = $tkeys[$min_id]; $max_idx = $tkeys[$max_id]; - unset ($tkeys); + unset($tkeys); $exclude_forums = array(); - $something = FALSE; - + $something = false; for ( $i = $min_idx; $i <= $max_idx; $i++ ) { if ( !$user->auth(POST_FORUM_URL, 'auth_read', $forums->keys[$i]) ) @@ -284,73 +273,64 @@ } else { - $something = TRUE; + $something = true; } } // halt on no forum authed - if ( !$something ) { message_die(GENERAL_MESSAGE, $lang['No_searchable_forums']); } // set branch range - $auth_sql = $no_subs ? 'f.forum_id = ' . $min_id : '(f.forum_order BETWEEN ' . intval($forums->data[$min_id]['forum_order']) . ' AND ' . intval($forums->data[$max_id]['forum_order']) . ')'; // exclude unreadable forums - if ( !empty($exclude_forums) ) { $auth_sql .= count($exclude_forums) > 1 ? ' AND f.forum_id NOT IN(' . implode(', ', $exclude_forums) . ')' : ' AND f.forum_id <> ' . $exclude_forums[0]; - unset ($exclude_forums); + unset($exclude_forums); } // // Search ID Limiter, decrease this value if you experience further timeout problems with searching forums - $limiter = 5000; $current_time = time(); // // Cycle through options ... // - if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' ) { // // Flood control // - $where_sql = ($userdata['user_id'] == ANONYMOUS) ? "se.session_ip = '$user_ip'" : 'se.session_user_id = ' . $userdata['user_id']; $sql = 'SELECT MAX(sr.search_time) AS last_search_time FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se WHERE sr.session_id = se.session_id AND $where_sql"; - - if ( $result = $db->sql_query($sql) ) + if ($result = $db->sql_query($sql)) { - if ( $row = $db->sql_fetchrow($result) ) + if ($row = $db->sql_fetchrow($result)) { - if ( intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) < intval($board_config['search_flood_interval']) ) + if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) < intval($board_config['search_flood_interval'])) { message_die(GENERAL_MESSAGE, $lang['Search_Flood_Error']); } } } - if ( $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' ) ) { if ( $search_id == 'newposts' ) { + $user->read_cookies(); - if ( empty($user->cookies['unreads']) ) { message_return('No_search_match'); } - asort($user->cookies['unreads']); $floor = intval($user->cookies['unreads'][ _first_key($user->cookies['unreads']) ]); $sql = 'SELECT post_id, topic_id, post_time @@ -359,10 +339,8 @@ AND post_time > ' . $floor . ' AND post_draft = 0'; // start mod save posts as drafts (and end mod too)...added constraint in the preceding line that post_draft be 0 so that draftws wouldn't get included - - $result = $db->sql_query($sql, FALSE, __LINE__, __FILE__); + $result = $db->sql_query($sql, false, __LINE__, __FILE__); $search_ids = array(); - while ( $row = $db->sql_fetchrow($result) ) { if ( $row['post_time'] >= $user->cookies['unreads'][ $row['topic_id'] ] ) @@ -375,23 +353,25 @@ $sort_by = 0; $sort_dir = 'DESC'; } - elseif ( $search_id == 'egosearch' ) + else if ( $search_id == 'egosearch' ) { - $draft_on = TRUE; + $draft_on = true; - if ( $userdata['session_logged_in'] ) + if ( $userdata['session_logged_in'] ) { $sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE poster_id = " . $userdata['user_id'] . " AND post_draft = 0"; + } else { - redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=egosearch", TRUE)); + redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=egosearch", true)); } + $sort_by = 0; $sort_dir = 'DESC'; } @@ -399,7 +379,7 @@ { $search_author = str_replace('*', '%', trim($search_author)); - if ( ( strpos($search_author, '%') !== FALSE ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) ) + if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) ) { $search_author = ''; } @@ -407,21 +387,19 @@ $sql = "SELECT user_id FROM " . USERS_TABLE . " WHERE username LIKE '" . str_replace("\'", "''", $search_author) . "'"; - if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Couldn't obtain list of matching users (searching for: $search_author)", "", __LINE__, __FILE__, $sql); } $matching_userids = ''; - if ( $row = $db->sql_fetchrow($result) ) { do { $matching_userids .= ( ( $matching_userids != '' ) ? ', ' : '' ) . $row['user_id']; } - while ( $row = $db->sql_fetchrow($result) ); + while( $row = $db->sql_fetchrow($result) ); } else { @@ -432,33 +410,35 @@ FROM " . POSTS_TABLE . " WHERE poster_id IN ($matching_userids)"; - if ( $search_time ) + if ($search_time) { $sql .= " AND post_time >= " . $search_time; } } + if ( $search_id != 'newposts' ) { - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql); - } - $search_ids = array(); - - while ( $row = $db->sql_fetchrow($result) ) - { - $search_ids[] = $row['post_id']; - } - - $db->sql_freeresult($result); + if ( !($result = $db->sql_query($sql)) ) + { + message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql); } + $search_ids = array(); + while( $row = $db->sql_fetchrow($result) ) + { + $search_ids[] = $row['post_id']; + } + $db->sql_freeresult($result); + + } + + $total_match_count = count($search_ids); } - elseif ( $search_keywords != '' ) + else if ( $search_keywords != '' ) { $stopword_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_stopwords.txt'); $synonym_array = @file($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/search_synonyms.txt'); @@ -466,7 +446,7 @@ $split_search = array(); $stripped_keywords = stripslashes($search_keywords); $split_search = ( !strstr($multibyte_charset, $lang['ENCODING']) ) ? split_words(clean_words('search', $stripped_keywords, $stopword_array, $synonym_array), 'search') : split(' ', $search_keywords); - unset ($stripped_keywords); + unset($stripped_keywords); $search_msg_only = ( !$search_fields ) ? "AND m.title_match = 0" : ( ( strstr($multibyte_charset, $lang['ENCODING']) ) ? '' : '' ); @@ -476,7 +456,7 @@ $word_match = array(); $result_list = array(); - for ( $i = 0; $i < count($split_search); $i++ ) + for($i = 0; $i < count($split_search); $i++) { if ( strlen(str_replace(array('*', '%'), '', trim($split_search[$i]))) < $board_config['search_min_chars'] ) { @@ -523,15 +503,13 @@ WHERE post_text LIKE '$match_word' $search_msg_only"; } - if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql); } $row = array(); - - while ( $temp_row = $db->sql_fetchrow($result) ) + while( $temp_row = $db->sql_fetchrow($result) ) { $row[$temp_row['post_id']] = 1; @@ -539,11 +517,11 @@ { $result_list[$temp_row['post_id']] = 1; } - elseif ( $current_match_type == 'or' ) + else if ( $current_match_type == 'or' ) { $result_list[$temp_row['post_id']] = 1; } - elseif ( $current_match_type == 'not' ) + else if ( $current_match_type == 'not' ) { $result_list[$temp_row['post_id']] = 0; } @@ -552,7 +530,7 @@ if ( $current_match_type == 'and' && $word_count ) { @reset($result_list); - while list($post_id, $match_count) = @each($result_list) ) + while( list($post_id, $match_count) = @each($result_list) ) { if ( !$row[$post_id] ) { @@ -570,8 +548,7 @@ @reset($result_list); $search_ids = array(); - - while ( list($post_id, $matches) = each($result_list) ) + while( list($post_id, $matches) = each($result_list) ) { if ( $matches ) { @@ -579,7 +556,7 @@ } } - unset ($result_list); + unset($result_list); $total_match_count = count($search_ids); } @@ -590,15 +567,15 @@ // If not logged in we explicitly prevent searching of private forums // + // // Author name search // - if ( $search_author != '' ) { $search_author = str_replace('*', '%', trim($search_author)); - if ( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) ) + if( ( strpos($search_author, '%') !== false ) && ( strlen(str_replace('%', '', $search_author)) < $board_config['search_min_chars'] ) ) { $search_author = ''; } @@ -611,16 +588,15 @@ // // This one is a beast, try to seperate it a bit (workaround for connection timeouts) // - $search_id_chunks = array(); $count = 0; $chunk = 0; - if ( count($search_ids) > $limiter ) + if (count($search_ids) > $limiter) { - for ( $i = 0; $i < count($search_ids); $i++ ) + for ($i = 0; $i < count($search_ids); $i++) { - if ( $count == $limiter ) + if ($count == $limiter) { $chunk++; $count = 0; @@ -637,7 +613,7 @@ $search_ids = array(); - for ( $i = 0; $i < count($search_id_chunks); $i++ ) + for ($i = 0; $i < count($search_id_chunks); $i++) { $where_sql = ''; @@ -661,8 +637,8 @@ if ( $search_author != '' ) { $from_sql .= ", " . USERS_TABLE . " u"; - - $where_sql .= " AND u.user_id = p.poster_id AND u.username LIKE '$search_author' AND p.post_draft = 0"; + + $where_sql .= " AND u.user_id = p.poster_id AND u.username LIKE '$search_author' AND p.post_draft = 0"; } if ( $auth_sql != '' ) @@ -683,28 +659,27 @@ message_die(GENERAL_ERROR, 'Could not obtain topic ids', '', __LINE__, __FILE__, $sql); } - while ( $row = $db->sql_fetchrow($result) ) + while ($row = $db->sql_fetchrow($result)) { $search_ids[] = $row['topic_id']; } - $db->sql_freeresult($result); } $total_match_count = sizeof($search_ids); } - elseif ( $search_author != '' || $search_time || $auth_sql != '' ) + else if ( $search_author != '' || $search_time || $auth_sql != '' ) { $search_id_chunks = array(); $count = 0; $chunk = 0; - if ( count($search_ids) > $limiter ) + if (count($search_ids) > $limiter) { - for ( $i = 0; $i < count($search_ids); $i++ ) + for ($i = 0; $i < count($search_ids); $i++) { - if ( $count == $limiter ) + if ($count == $limiter) { $chunk++; $count = 0; @@ -721,7 +696,7 @@ $search_ids = array(); - for ( $i = 0; $i < count($search_id_chunks); $i++ ) + for ($i = 0; $i < count($search_id_chunks); $i++) { $where_sql = ( $search_author == '' && $auth_sql == '' ) ? 'post_id IN (' . implode(', ', $search_id_chunks[$i]) . ')' : 'p.post_id IN (' . implode(', ', $search_id_chunks[$i]) . ')'; $select_sql = ( $search_author == '' && $auth_sql == '' ) ? 'post_id' : 'p.post_id'; @@ -748,24 +723,22 @@ $sql = "SELECT " . $select_sql . " FROM $from_sql WHERE $where_sql"; - if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain post ids', '', __LINE__, __FILE__, $sql); } - while ( $row = $db->sql_fetchrow($result) ) + while( $row = $db->sql_fetchrow($result) ) { $search_ids[] = $row['post_id']; } - $db->sql_freeresult($result); } $total_match_count = count($search_ids); } } - elseif ( $search_id == 'unanswered' ) + else if ( $search_id == 'unanswered' ) { if ( $auth_sql != '' ) { @@ -790,12 +763,10 @@ } $search_ids = array(); - - while ( $row = $db->sql_fetchrow($result) ) + while( $row = $db->sql_fetchrow($result) ) { $search_ids[] = $row['topic_id']; } - $db->sql_freeresult($result); $total_match_count = count($search_ids); @@ -803,16 +774,14 @@ // // Basic requirements // - $show_results = 'topics'; $sort_by = 0; $sort_dir = 'DESC'; } else { - // start mod save posts as drafts (and end mod too)...added the check that skips the no match message if there are drafts to be shown - if ( !$draft_on ) + if(!$draft_on) { message_die(GENERAL_MESSAGE, $lang['No_search_match']); } @@ -821,10 +790,8 @@ // // Delete old data from the search result table // - $sql = 'DELETE FROM ' . SEARCH_TABLE . ' WHERE search_time < ' . ($current_time - (int) $board_config['session_length']); - if ( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, 'Could not delete old search id sessions', '', __LINE__, __FILE__, $sql); @@ -833,7 +800,6 @@ // // Store new result data // - $search_results = implode(', ', $search_ids); $per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page']; @@ -841,20 +807,29 @@ // Combine both results and search data (apart from original query) // so we can serialize it and place it in the DB // - $store_search_data = array(); // // Limit the character length (and with this the results displayed at all following pages) to prevent // truncated result arrays. Normally, search results above 12000 are affected. + // - to include or not to include + /* + $max_result_length = 60000; + if (strlen($search_results) > $max_result_length) + { + $search_results = substr($search_results, 0, $max_result_length); + $search_results = substr($search_results, 0, strrpos($search_results, ',')); + $total_match_count = count(explode(', ', $search_results)); + } + */ - for ( $i = 0; $i < count($store_vars); $i++ ) + for($i = 0; $i < count($store_vars); $i++) { $store_search_data[$store_vars[$i]] = $$store_vars[$i]; } $result_array = serialize($store_search_data); - unset ($store_search_data); + unset($store_search_data); mt_srand ((double) microtime() * 1000000); $search_id = mt_rand(); @@ -862,12 +837,10 @@ $sql = "UPDATE " . SEARCH_TABLE . " SET search_id = $search_id, search_time = $current_time, search_array = '" . str_replace("\'", "''", $result_array) . "' WHERE session_id = '" . $userdata['session_id'] . "'"; - if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() ) { $sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_time, search_array) VALUES($search_id, '" . $userdata['session_id'] . "', $current_time, '" . str_replace("\'", "''", $result_array) . "')"; - if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not insert search results', '', __LINE__, __FILE__, $sql); @@ -877,14 +850,12 @@ else { $search_id = intval($search_id); - if ( $search_id ) { $sql = "SELECT search_array FROM " . SEARCH_TABLE . " WHERE search_id = $search_id AND session_id = '". $userdata['session_id'] . "'"; - if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql); @@ -893,8 +864,7 @@ if ( $row = $db->sql_fetchrow($result) ) { $search_data = unserialize($row['search_array']); - - for ( $i = 0; $i < count($store_vars); $i++ ) + for($i = 0; $i < count($store_vars); $i++) { $$store_vars[$i] = $search_data[$store_vars[$i]]; } @@ -912,18 +882,15 @@ } // get cookies for unreaded topics - $user->read_cookies(); // display results as topics - if ( $show_results == 'topics' ) { // get highlight parm $highlight_active = ''; $highlight_match = array(); - - for ( $j = 0; $j < count($split_search); $j++ ) + for($j = 0; $j < count($split_search); $j++ ) { $split_word = $split_search[$j]; @@ -944,11 +911,9 @@ } } } - $extra_parms = empty($highlight_active) ? '' : array('highlight' => urlencode(trim($highlight_active))); // filter page and order - $start = max(0, _read('start', TYPE_INT)); $ppage = _read('ppage', TYPE_INT); $ppage = ($ppage > 0) ? $ppage : (intval($user->data['user_topics_ppage']) ? intval($user->data['user_topics_ppage']) : (intval($config->data['topics_per_page']) ? intval($config->data['topics_per_page']) : 50)); @@ -962,26 +927,18 @@ ); $topics = new topics_search($parms, $extra_parms); - - if ( !empty($search_results) ) - { - $topics->read($search_results, $total_match_count); - } + if( !empty($search_results) ) $topics->read($search_results, $total_match_count); // start the page - $page_title = $user->lang('Search'); - include ($config->url('includes/page_header') ); + include($config->url('includes/page_header')); // jumpbox - make_jumpbox('index'); // upper box (so with forum nav sentence for each topic), force display empty, force the title - - $topics->display(TRUE, TRUE); + $topics->display(true, true); - // start mod save posts as drafts...show all drafts at the top of the search results page when a user searches for all of his or her posts (egosearch)... if ( $draft_on && $start == 0 ) { $sql = "SELECT p.post_id, p.post_time, pt.post_subject, t.topic_title, f.forum_name @@ -995,7 +952,7 @@ $result = $db->sql_query($sql); - if ( !$result ) + if( !$result ) { message_die(GENERAL_ERROR, "Couldn't obtain draft posts from database", "", __LINE__, __FILE__, $sql); } @@ -1005,7 +962,6 @@ $total_draft_posts = count($draft_posts); // ok, done collecting all draft posts...now let's find the draft pms - $sql = "SELECT privmsgs_id, privmsgs_subject, privmsgs_date FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_type = " . PRIVMSGS_DRAFT_MAIL . " @@ -1014,7 +970,7 @@ $result = $db->sql_query($sql); - if ( !$result ) + if( !$result ) { message_die(GENERAL_ERROR, "Couldn't obtain draft posts from database", "", __LINE__, __FILE__, $sql); } @@ -1030,25 +986,22 @@ { $drafts = array_merge($draft_posts,$draft_pms); } - $total_drafts = count($drafts); // cut this all off if there are no regular search matches and no drafts - if ( $search_results == '' && $total_drafts == 0 ) + if( $search_results == '' && $total_drafts == 0 ) { message_die(GENERAL_MESSAGE, $lang['No_search_match']); } if ( $total_drafts > 0 ) { - $template->assign_block_vars('switch_show_drafts', array()); - $template->assign_block_vars("draft", array()); - - for ( $i = 0; $i < $total_drafts; $i++ ) + $template->assign_block_vars('switch_show_drafts', array()); + $template->assign_block_vars("draft", array()); + for($i = 0; $i < $total_drafts; $i++) { $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; // now set variables, but variables are different depending on if draft post or draft pm so treat differently... - if ( $i < $total_draft_posts ) { $draft_time = create_date($board_config['default_dateformat'], $drafts[$i]['post_time'], $board_config['board_timezone']); @@ -1077,7 +1030,6 @@ } } } - $total_match_count = $total_match_count + $total_drafts; $l_search_matches = ( $total_match_count == 1 ) ? sprintf($lang['Found_search_match'], $total_match_count) : sprintf($lang['Found_search_matches'], $total_match_count); @@ -1089,12 +1041,11 @@ 'L_DRAFT_POST_SUBJECT' => $lang['Draft_post_subject'], 'L_DRAFT_POST_TOPIC' => $lang['Draft_post_topic'], 'L_DRAFT_POST_FORUM' => $lang['Draft_post_forum'])); - - // display + // display $template->set_filenames(array('body' => 'search_results_topics.tpl')); $template->pparse('body'); - include ($config->url('includes/page_tail')); + include($config->url('includes/page_tail')); exit; } @@ -1111,7 +1062,9 @@ AND p.poster_id = u.user_id"; $sql = str_replace('SELECT ', 'SELECT pt.post_sub_title, ', $sql); + $sql = str_replace('SELECT ', 'SELECT u.user_group_id, u.user_session_time, ', $sql); + } else { @@ -1123,14 +1076,14 @@ AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id"; - - $sql = str_replace('SELECT ', 'SELECT u.user_group_id as user_group_id_1, u2.user_group_id as user_group_id_2, u.user_session_time as user_session_time_1, u2.user_session_time as user_session_time_2, ', $sql); + + $sql = str_replace('SELECT ', 'SELECT u.user_group_id as user_group_id_1, u2.user_group_id as user_group_id_2, u.user_session_time as user_session_time_1, u2.user_session_time as user_session_time_2, ', $sql); + } $per_page = ( $show_results == 'posts' ) ? $board_config['posts_per_page'] : $board_config['topics_per_page']; $sql .= " ORDER BY "; - switch ( $sort_by ) { case 1: @@ -1159,19 +1112,17 @@ } $searchset = array(); - - while ( $row = $db->sql_fetchrow($result) ) + while( $row = $db->sql_fetchrow($result) ) { $searchset[] = $row; } $db->sql_freeresult($result); - } + } // // Define censored word matches // - $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); @@ -1179,9 +1130,8 @@ // // Output header // - $page_title = $lang['Search']; - include ($phpbb_root_path . 'includes/page_header.' . $phpEx); + include($phpbb_root_path . 'includes/page_header.'.$phpEx); if ( $show_results == 'posts' ) { @@ -1195,9 +1145,8 @@ 'body' => 'search_results_topics.tpl') ); } - make_jumpbox('viewforum.' . $phpEx); + make_jumpbox('viewforum.'.$phpEx); - // start mod save posts as drafts...show all drafts at the top of the search results page when a user searches for all of his or her posts (egosearch)... if ( $draft_on && $start == 0 ) { $sql = "SELECT p.post_id, p.post_time, pt.post_subject, t.topic_title, f.forum_name @@ -1211,7 +1160,7 @@ $result = $db->sql_query($sql); - if ( !$result ) + if( !$result ) { message_die(GENERAL_ERROR, "Couldn't obtain draft posts from database", "", __LINE__, __FILE__, $sql); } @@ -1221,7 +1170,6 @@ $total_draft_posts = count($draft_posts); // ok, done collecting all draft posts...now let's find the draft pms - $sql = "SELECT privmsgs_id, privmsgs_subject, privmsgs_date FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_type = " . PRIVMSGS_DRAFT_MAIL . " @@ -1230,7 +1178,7 @@ $result = $db->sql_query($sql); - if ( !$result ) + if( !$result ) { message_die(GENERAL_ERROR, "Couldn't obtain draft posts from database", "", __LINE__, __FILE__, $sql); } @@ -1250,22 +1198,19 @@ $total_drafts = count($drafts); // cut this all off if there are no regular search matches and no drafts - - if ( $search_results == '' && $total_drafts == 0 ) + if( $search_results == '' && $total_drafts == 0 ) { message_die(GENERAL_MESSAGE, $lang['No_search_match']); } if ( $total_drafts > 0 ) { - $template->assign_block_vars('switch_show_drafts', array()); - $template->assign_block_vars("draft", array()); - - for ( $i = 0; $i < $total_drafts; $i++) + $template->assign_block_vars('switch_show_drafts', array()); + $template->assign_block_vars("draft", array()); + for($i = 0; $i < $total_drafts; $i++) { $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; // now set variables, but variables are different depending on if draft post or draft pm so treat differently... - if ( $i < $total_draft_posts ) { $draft_time = create_date($board_config['default_dateformat'], $drafts[$i]['post_time'], $board_config['board_timezone']); @@ -1312,8 +1257,7 @@ $highlight_active = ''; $highlight_match = array(); - - for ( $j = 0; $j < count($split_search); $j++ ) + for($j = 0; $j < count($split_search); $j++ ) { $split_word = $split_search[$j]; @@ -1322,7 +1266,7 @@ $highlight_match[] = '#\b(' . str_replace("*", "([\w]+)?", $split_word) . ')\b#is'; $highlight_active .= " " . $split_word; - for ( $k = 0; $k < count($synonym_array); $k++ ) + for ($k = 0; $k < count($synonym_array); $k++) { list($replace_synonym, $match_synonym) = split(' ', trim(strtolower($synonym_array[$k]))); @@ -1337,13 +1281,15 @@ $highlight_active = urlencode(trim($highlight_active)); + // prepare title enhancement - $front_title = new front_title(); - for ( $i = 0; $i < count($searchset); $i++) + for($i = 0; $i < count($searchset); $i++) { - $forum_url = $config->url('index', array(POST_FORUM_URL => $searchset[$i]['forum_id']), TRUE); + + $forum_url = $config->url('index', array(POST_FORUM_URL => $searchset[$i]['forum_id']), true); + $topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $searchset[$i]['topic_id'] . "&highlight=$highlight_active"); $post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id'] . "&highlight=$highlight_active") . '#' . $searchset[$i]['post_id']; @@ -1365,7 +1311,6 @@ // If the board has HTML off but the post has HTML // on then we process it, else leave it alone // - if ( $return_chars != -1 ) { $message = strip_tags($message); @@ -1422,7 +1367,7 @@ { $end_counter--; } - elseif ( substr($message, $end_html, 1) == '<' ) + else if ( substr($message, $end_html, 1) == '<' ) { $end_counter++; } @@ -1435,11 +1380,11 @@ $hold_string = str_replace('<!-- #sh -->', '', $hold_string); $hold_string = str_replace('<!-- #eh -->', '', $hold_string); } - elseif ( $hold_string == '<!-- #sh -->' ) + else if ( $hold_string == '<!-- #sh -->' ) { $hold_string = str_replace('<!-- #sh -->', '<span style="color:#' . $theme['fontcolor3'] . '"><b>', $hold_string); } - elseif ( $hold_string == '<!-- #eh -->' ) + else if ( $hold_string == '<!-- #eh -->' ) { $hold_string = str_replace('<!-- #eh -->', '</b></span>', $hold_string); } @@ -1478,7 +1423,7 @@ $post_subject = ( $searchset[$i]['post_subject'] != '' ) ? $searchset[$i]['post_subject'] : $topic_title; } - if ( $board_config['allow_smilies'] && $searchset[$i]['enable_smilies'] ) + if ($board_config['allow_smilies'] && $searchset[$i]['enable_smilies']) { $message = smilies_pass($message); } @@ -1488,11 +1433,12 @@ } $poster = ( $searchset[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $searchset[$i]['user_id']) . '">' : ''; + $poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? $colors->get_user_color($searchset[$i]['user_group_id'], $searchset[$i]['user_session_time'], $searchset[$i]['username']) : ((!empty($searchset[$i]['post_username'])) ? $colors->get_user_color($searchset[$i]['user_group_id'], '0', $searchset[$i]['post_username']) : $colors->get_user_color($searchset[$i]['user_group_id'], '0', $lang['Guest'])); + $poster .= ( $searchset[$i]['user_id'] != ANONYMOUS ) ? '</a>' : ''; $topic_last_read = intval($user->cookies['unreads'][ $search_set[$i]['topic_id'] ]); - if ( !empty($topic_last_read) && ($searchset[$i]['post_time'] > $topic_last_read) ) { $mini_post_img = $images['icon_minipost_new']; @@ -1523,26 +1469,25 @@ ); // enhance the topic title - $front_title->set('searchresults', $searchset[$i], $searchset[$i]['topic_first_post_id'] == $searchset[$i]['post_id'], $highlight_active); // navigation - - $forums->display_nav($searchset[$i]['forum_id'], 'searchresults.nav', TRUE); + $forums->display_nav($searchset[$i]['forum_id'], 'searchresults.nav', true); + } - } + } $base_url = "search.$phpEx?search_id=$search_id"; + // pagination - $parms = array('search_id' => $search_id); $requester = 'search'; $pagination = new pagination($requester, $parms, 'start'); $pagination->display('pagination', $total_match_count, $per_page, $start, true, 'Posts_count'); $template->assign_vars(array( - 'I_TOPIC' => $user->img('folder')) - ); + 'I_TOPIC' => $user->img('folder'), + )); $template->assign_vars(array( 'PAGINATION' => generate_pagination($base_url, $total_match_count, $per_page, $start), @@ -1564,7 +1509,7 @@ $template->pparse('body'); - include ($phpbb_root_path . 'includes/page_tail.' . $phpEx); + include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } else { @@ -1578,7 +1523,6 @@ $front_pic = $forums->get_front_pic(); $s_forums = ''; - if ( !empty($front_pic) ) { foreach ( $front_pic as $cur_id => $front ) @@ -1586,17 +1530,14 @@ $selected = ($search_forum == $cur_id) ? ' selected="selected"' : ''; $s_forums .= '<option value="' . (($cur_id >= 0) ? $cur_id : -1) . '"' . $selected . '>'; $count_front = strlen($front); - for ( $i = 0; $i < $count_front; $i++ ) { $s_forums .= $user->lang('tree_pic_' . $front[$i]); } - if ( $cur_id >= 0 ) { $s_forums .= $user->lang($forums->data[$cur_id]['forum_name']); } - $s_forums .= '</option>'; } } @@ -1604,7 +1545,6 @@ { message_die(GENERAL_MESSAGE, $lang['No_searchable_forums']); } - $template->assign_vars(array( 'L_SEARCH_FORUM' => $user->lang('Search_in_forum'), 'L_NO_SUBS' => $user->lang('Search_no_subs'), @@ -1620,7 +1560,7 @@ $s_characters .= '<option value="25">25</option>'; $s_characters .= '<option value="50">50</option>'; -for ( $i = 100; $i < 1100 ; $i += 100 ) +for($i = 100; $i < 1100 ; $i += 100) { $selected = ( $i == 200 ) ? ' selected="selected"' : ''; $s_characters .= '<option value="' . $i . '"' . $selected . '>' . $i . '</option>'; @@ -1629,10 +1569,8 @@ // // Sorting // - $s_sort_by = ""; - -for ( $i = 0; $i < count($sort_by_types); $i++ ) +for($i = 0; $i < count($sort_by_types); $i++) { $s_sort_by .= '<option value="' . $i . '">' . $sort_by_types[$i] . '</option>'; } @@ -1640,13 +1578,11 @@ // // Search time // - $previous_days = array(0, 1, 7, 14, 30, 90, 180, 364); $previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']); $s_time = ''; - -for ( $i = 0; $i < count($previous_days); $i++ ) +for($i = 0; $i < count($previous_days); $i++) { $selected = ( $topic_days == $previous_days[$i] ) ? ' selected="selected"' : ''; $s_time .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>'; @@ -1655,9 +1591,8 @@ // // Output the basic page // - $page_title = $lang['Search']; -include ($phpbb_root_path . 'includes/page_header.' . $phpEx); +include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'search_body.tpl') @@ -1698,6 +1633,6 @@ $template->pparse('body'); -include ($phpbb_root_path . 'includes/page_tail.' . $phpEx); +include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <teh...@us...> - 2006-10-24 02:21:02
|
Revision: 264 http://svn.sourceforge.net/phpbbreloaded/?rev=264&view=rev Author: tehphpmaster Date: 2006-10-23 19:20:53 -0700 (Mon, 23 Oct 2006) Log Message: ----------- Making it harder for spammers to phish peoples data (such as MSN addresses etc.) by restricting where guest users can go. With a simple check anybody viewing the memberlist needs to log in, the same applies for viewing profiles. The other thing is a lang change entry; nothing major. Modified Paths: -------------- phpBB Reloaded 2/language/lang_english/lang_main.php phpBB Reloaded 2/memberlist.php phpBB Reloaded 2/privmsg.php phpBB Reloaded 2/profile.php Modified: phpBB Reloaded 2/language/lang_english/lang_main.php =================================================================== --- phpBB Reloaded 2/language/lang_english/lang_main.php 2006-10-23 22:57:16 UTC (rev 263) +++ phpBB Reloaded 2/language/lang_english/lang_main.php 2006-10-24 02:20:53 UTC (rev 264) @@ -203,7 +203,7 @@ $lang['Enter_password'] = 'Please enter your username and password to log in.'; $lang['Login'] = 'Log in'; $lang['Logout'] = 'Log out'; -$lang['Logout_Question'] = 'You are about to log out'; +$lang['Logout_Question'] = 'You are about to log out. Are you sure you want to do this?'; $lang['Forgotten_password'] = 'I forgot my password'; Modified: phpBB Reloaded 2/memberlist.php =================================================================== --- phpBB Reloaded 2/memberlist.php 2006-10-23 22:57:16 UTC (rev 263) +++ phpBB Reloaded 2/memberlist.php 2006-10-24 02:20:53 UTC (rev 264) @@ -26,6 +26,13 @@ // End session management // +//Silly spammers grabbing peoples data of memberlists, this'll stop 'em +if ($userdata['user_id'] == ANONYMOUS) +{ + redirect(append_sid("login.$phpEx?redirect=memberlist.$phpEx", true)); +} + + $navigation = new navigation(); $navigation->add('Memberlist', '', 'memberlist', '', ''); $navigation->display(); Modified: phpBB Reloaded 2/privmsg.php =================================================================== --- phpBB Reloaded 2/privmsg.php 2006-10-23 22:57:16 UTC (rev 263) +++ phpBB Reloaded 2/privmsg.php 2006-10-24 02:20:53 UTC (rev 264) @@ -53,7 +53,7 @@ $delete_all = ( isset($HTTP_POST_VARS['deleteall']) ) ? TRUE : 0; $save = ( isset($HTTP_POST_VARS['save']) ) ? TRUE : 0; -// start mod save posts as drafts...check to see if this is a draft and set parameters accordingly +// Check to see if this is a draft and set parameters accordingly if ( isset($HTTP_POST_VARS['save_as_draft']) ) { @@ -168,7 +168,7 @@ $mode = ( !empty($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; $mode = htmlspecialchars($mode); - // start mod save posts as drafts...check if this is a draft and if so set a flag ($was_a_draft) and set $mode to be 'edit' + // Check if this is a draft and if so set a flag ($was_a_draft) and set $mode to be 'edit' if ( $mode == 'draft' ) { Modified: phpBB Reloaded 2/profile.php =================================================================== --- phpBB Reloaded 2/profile.php 2006-10-23 22:57:16 UTC (rev 263) +++ phpBB Reloaded 2/profile.php 2006-10-24 02:20:53 UTC (rev 264) @@ -86,7 +86,12 @@ if ( $mode == 'viewprofile' ) { - include ($phpbb_root_path . 'includes/usercp_viewprofile.' . $phpEx); + if ($userdata['user_id'] == ANONYMOUS) + { + redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile&" . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]), true)); + } + + include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx); exit; } elseif ( $mode == 'editprofile' || $mode == 'register' ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <teh...@us...> - 2006-10-25 03:57:19
|
Revision: 270 http://svn.sourceforge.net/phpbbreloaded/?rev=270&view=rev Author: tehphpmaster Date: 2006-10-24 20:57:06 -0700 (Tue, 24 Oct 2006) Log Message: ----------- Fixing a small issue that was causing the Registration IP address feature to return 0.0.0.0 all the time (Bug #2). Thanks to Nox for reporting this issue. Modified Paths: -------------- phpBB Reloaded 2/admin/admin_users.php phpBB Reloaded 2/includes/usercp_register.php phpBB Reloaded 2/templates/subC1/admin/user_edit_body.tpl Modified: phpBB Reloaded 2/admin/admin_users.php =================================================================== --- phpBB Reloaded 2/admin/admin_users.php 2006-10-24 05:04:27 UTC (rev 269) +++ phpBB Reloaded 2/admin/admin_users.php 2006-10-25 03:57:06 UTC (rev 270) @@ -321,13 +321,13 @@ $allowbbcode = ( isset( $HTTP_POST_VARS['allowbbcode']) ) ? intval( $HTTP_POST_VARS['allowbbcode'] ) : $board_config['allow_bbcode']; $allowsmilies = ( isset( $HTTP_POST_VARS['allowsmilies']) ) ? intval( $HTTP_POST_VARS['allowsmilies'] ) : $board_config['allow_smilies']; $user_style = ( isset( $HTTP_POST_VARS['style'] ) ) ? intval( $HTTP_POST_VARS['style'] ) : $board_config['default_style']; - $user_lang = ( $HTTP_POST_VARS['language'] ) ? $HTTP_POST_VARS['language'] : $board_config['default_lang']; + $user_lang = ( $HTTP_POST_VARS['language'] ) ? $HTTP_POST_VARS['language'] : $board_config['default_lang']; //-- mod : Advanced Group Color Management ------------------------------------- //-- add $user_group_id = ( $HTTP_POST_VARS['user_group_id'] ) ? intval( $HTTP_POST_VARS['user_group_id'] ) : GROUP_REGISTERED; //-- fin mod : Advanced Group Color Management --------------------------------- - $user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone']; + $user_timezone = ( isset( $HTTP_POST_VARS['timezone']) ) ? doubleval( $HTTP_POST_VARS['timezone'] ) : $board_config['board_timezone']; $user_dateformat = ( $HTTP_POST_VARS['dateformat'] ) ? trim( $HTTP_POST_VARS['dateformat'] ) : $board_config['default_dateformat']; $user_avatar_local = ( isset( $HTTP_POST_VARS['avatarselect'] ) && !empty($HTTP_POST_VARS['submitavatar'] ) && $board_config['allow_avatar_local'] ) ? $HTTP_POST_VARS['avatarselect'] : ( ( isset( $HTTP_POST_VARS['avatarlocal'] ) ) ? $HTTP_POST_VARS['avatarlocal'] : '' ); @@ -826,17 +826,17 @@ } //-- fin mod : Advanced Group Color Management --------------------------------- - // We remove all stored login keys since the password has been updated - // and change the current one (if applicable) - if ( !empty($passwd_sql) ) - { - session_reset_keys($user_id, $user_ip); - } - - $message .= $lang['Admin_user_updated']; - } - else - { + // We remove all stored login keys since the password has been updated + // and change the current one (if applicable) + if ( !empty($passwd_sql) ) + { + session_reset_keys($user_id, $user_ip); + } + + $message .= $lang['Admin_user_updated']; + } + else + { message_die(GENERAL_ERROR, 'Admin_user_fail', '', __LINE__, __FILE__, $sql); } @@ -907,6 +907,7 @@ $user_regip = decode_ip($this_userdata['user_regip']); $icq = $this_userdata['user_icq']; + $user_regip = decode_ip($this_userdata['user_regip']); $aim = htmlspecialchars(str_replace('+', ' ', $this_userdata['user_aim'] )); $msn = htmlspecialchars($this_userdata['user_msnm']); $yim = htmlspecialchars($this_userdata['user_yim']); Modified: phpBB Reloaded 2/includes/usercp_register.php =================================================================== --- phpBB Reloaded 2/includes/usercp_register.php 2006-10-24 05:04:27 UTC (rev 269) +++ phpBB Reloaded 2/includes/usercp_register.php 2006-10-25 03:57:06 UTC (rev 270) @@ -740,8 +740,8 @@ // , user_qp_settings // , '" . $user_qp_settings . "' //-- modify - $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_qp_settings, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_group_id, user_style, user_level, user_allow_pm, user_active, user_actkey) - VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '" . $user_qp_settings . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', '$user_group_id', $user_style, 0, 1, "; + $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_regip, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_qp_settings, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_group_id, user_style, user_level, user_allow_pm, user_active, user_actkey) + VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . $userdata['session_ip'] . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '" . $user_qp_settings . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', '$user_group_id', $user_style, 0, 1, "; //-- fin mod : quick post es --------------------------------------------------- //-- fin mod : Advanced Group Color Management --------------------------------- if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa ) Modified: phpBB Reloaded 2/templates/subC1/admin/user_edit_body.tpl =================================================================== --- phpBB Reloaded 2/templates/subC1/admin/user_edit_body.tpl 2006-10-24 05:04:27 UTC (rev 269) +++ phpBB Reloaded 2/templates/subC1/admin/user_edit_body.tpl 2006-10-25 03:57:06 UTC (rev 270) @@ -39,6 +39,11 @@ </td> </tr> <tr> + <td class="row1"><span class="gen">{L_REGIP}: </span></td> + <td class="row2"><span class="gen">{USER_REGIP}</span></td> + </td> + </tr> + <tr> <td class="catsides" colspan="2"> </td> </tr> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |