PHP Code:
/includes/auto_loaders/config.core.php
Line #60 : 'loadFile'=>'class.phpbb.php');
Line #113 : * $phpBB = new phpBB();
Line #123 : 'className'=>'phpBB',
Line #124 : 'objectName'=>'phpBB');
/includes/auto_loaders/paypal_ipn.core.php
Line #84 : * $phpBB = new phpBB();
/includes/classes/class.phpbb.php
Line #2 : * phpBB3 Class.
Line #4 : * This class is used to interact with phpBB3 forum
Line #9 : * @version $Id: class.phpbb.php 14689 2009-10-26 17:06:43Z drbyte $
Line #16 : class phpBB extends base {
Line #18 : var $db_phpbb;
Line #19 : var $phpBB=array();
Line #20 : var $dir_phpbb='';
Line #23 : function phpBB() {
Line #24 : $this->debug = (defined('PHPBB_DEBUG_MODE') && strtoupper(PHPBB_DEBUG_MODE)=='ON') ? (defined('PHPBB_DEBUG_IP') && (PHPBB_DEBUG_IP == '' || PHPBB_DEBUG_IP == $_SERVER['REMOTE_ADDR'] || strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])) ? true : false ) : false;
Line #25 : $this->phpBB = Array();
Line #26 : $this->phpBB['installed'] = false;
Line #27 : if (PHPBB_LINKS_ENABLED =='true') { // if disabled in Zen Cart admin, don't do any checks for phpBB
Line #28 : $this->get_phpBB_info();
Line #30 : $this->db_phpbb = new queryFactory();
Line #31 : $connect_status = $this->db_phpbb->connect($this->phpBB['dbhost'], $this->phpBB['dbuser'], $this->phpBB['dbpasswd'], $this->phpBB['dbname'], USE_PCONNECT, false);
Line #36 : echo "phpBB connection disabled in Admin<br>";
Line #41 : function get_phpBB_info() {
Line #42 : $this->phpBB['db_installed'] = false;
Line #43 : $this->phpBB['files_installed'] = false;
Line #44 : $this->phpBB['phpbb_path']='';
Line #45 : $this->phpBB['phpbb_url']='';
Line #49 : $this->dir_phpbb = str_replace(array('\\', '//'), '/', DIR_WS_PHPBB ); // convert slashes
Line #51 : if (substr($this->dir_phpbb,-1)!='/') $this->dir_phpbb .= '/'; // ensure has a trailing slash
Line #52 : if ($this->debug==true) echo 'dir='.$this->dir_phpbb.'<br>';
Line #55 : if (@file_exists($this->dir_phpbb . 'config.php')) {
Line #56 : $this->phpBB['files_installed'] = true;
Line #59 : $this->phpBB['phpbb_path'] = $this->dir_phpbb;
Line #60 : if ($this->debug==true) echo 'phpbb_path='. $this->dir_phpbb . '<br><br>';
Line #62 : // find phpbb table prefix without including file:
Line #64 : $lines = @file($this->phpBB['phpbb_path']. 'config.php');
Line #72 : if (substr($line,0,7)=='$dbhost') $this->phpBB['dbhost'] = ($def_string[1] == '' ? 'localhost' : $def_string[1]);
Line #73 : if (substr($line,0,7)=='$dbname') $this->phpBB['dbname'] = $def_string[1];
Line #74 : if (substr($line,0,7)=='$dbuser') $this->phpBB['dbuser'] = $def_string[1];
Line #75 : if (substr($line,0,9)=='$dbpasswd') $this->phpBB['dbpasswd'] = $def_string[1];
Line #76 : if (substr($line,0,13)=='$table_prefix') $this->phpBB['table_prefix'] = $def_string[1];
Line #78 : // find phpbb table-names without INCLUDEing file:
Line #79 : if (@file_exists($this->phpBB['phpbb_path'] . 'includes/constants.php')) {
Line #81 : $lines = @file($this->phpBB['phpbb_path']. 'includes/constants.php');
Line #90 : if ($def_string[1]=='USERS_TABLE') $this->phpBB['users_table'] = $this->phpBB['table_prefix'] . $def_string[3];
Line #91 : if ($def_string[1]=='USER_GROUP_TABLE') $this->phpBB['user_group_table'] = $this->phpBB['table_prefix'] . $def_string[3];
Line #92 : if ($def_string[1]=='GROUPS_TABLE') $this->phpBB['groups_table'] = $this->phpBB['table_prefix'] . $def_string[3];
Line #93 : if ($def_string[1]=='CONFIG_TABLE') $this->phpBB['config_table'] = $this->phpBB['table_prefix'] . $def_string[3];
Line #97 : $this->phpBB['files_installed'] = false;
Line #100 : echo 'prefix='.$this->phpBB['table_prefix'].'<br>';
Line #101 : echo 'dbname='.$this->phpBB['dbname'].'<br>';
Line #102 : echo 'dbuser='.$this->phpBB['dbuser'].'<br>';
Line #103 : echo 'dbhost='.$this->phpBB['dbhost'].'<br>';
Line #104 : echo 'dbpasswd='.$this->phpBB['dbpasswd'].'<br>';
Line #105 : echo 'users_table='.$this->phpBB['users_table'].'<br>';
Line #106 : echo 'user_group_table='.$this->phpBB['user_group_table'].'<br>';
Line #107 : echo 'groups_table='.$this->phpBB['groups_table'].'<br>';
Line #108 : echo 'config_table='.$this->phpBB['config_table'].'<br>';
Line #116 : if ($this->phpBB['dbname']!='' && $this->phpBB['dbuser'] !='' && $this->phpBB['dbhost'] !='' && $this->phpBB['config_table']!='' && $this->phpBB['users_table'] !='' && $this->phpBB['user_group_table'] !='' && $this->phpBB['groups_table']!='') {
Line #117 : if ($this->phpBB['dbname'] == DB_DATABASE) {
Line #118 : $this->phpBB['db_installed'] = $this->table_exists_zen($this->phpBB['users_table']);
Line #119 : $this->phpBB['db_installed_config'] = $this->table_exists_zen($this->phpBB['config_table']);
Line #120 : if ($this->debug==true) echo "db_installed -- in ZC Database = ".$this->phpBB['db_installed']."<br>";
Line #122 : $this->phpBB['db_installed'] = $this->table_exists_phpbb($this->phpBB['users_table']);
Line #123 : $this->phpBB['db_installed_config'] = $this->table_exists_phpbb($this->phpBB['config_table']);
Line #124 : if ($this->debug==true) echo "db_installed -- in separate database = ".$this->phpBB['db_installed']."<br>";
Line #136 : if ($this->debug==true) echo "link_enabled_admin_status=".PHPBB_LINKS_ENABLED.'<br>';
Line #138 : if ( ($this->phpBB['db_installed']) && ($this->phpBB['files_installed']) && (PHPBB_LINKS_ENABLED=='true')) {
Line #143 : $this->phpBB['phpbb_url'] = str_replace(array($_SERVER['DOCUMENT_ROOT'],substr($script_filename,0,strpos($script_filename,$_SERVER['PHP_SELF']))),'',$this->phpBB['phpbb_path']);
Line #144 : $this->phpBB['installed'] = true;
Line #145 : if ($this->debug==true) echo 'URL='.$this->phpBB['phpbb_url'].'<br>';
Line #148 : if ($this->debug==true && $this->phpBB['installed']==false) echo "FAILURE: phpBB NOT activated<br><br>";
Line #149 : // will use $phpBB->phpBB['installed'] to check for suitability of calling phpBB in the future.
Line #164 : function table_exists_phpbb($table_name) {
Line #165 : // Check to see if the requested PHPBB table exists, regardless of which database it's set to use
Line #167 : $tables = $this->db_phpbb->Execute($sql);
Line #175 : function phpbb_create_account($nick, $password, $email_address) {
Line #176 : if ($this->phpBB['installed'] != true || !zen_not_null($password) || !zen_not_null($email_address) || !zen_not_null($nick)) return false;
Line #177 : if (!$this->phpbb_check_for_duplicate_email($email_address) == 'already_exists') {
Line #178 : $sql = "select max(user_id) as total from " . $this->phpBB['users_table'];
Line #179 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #180 : $user_id = ($phpbb_users->fields['total'] + 1);
Line #181 : $sql = "insert into " . $this->phpBB['users_table'] . "
Line #185 : $this->db_phpbb->Execute($sql);
Line #186 : $sql = " update " . $this->phpBB['config_table'] . " SET config_value = '{$user_id}' WHERE config_name = 'newest_user_id'";
Line #187 : $this->db_phpbb->Execute($sql);
Line #188 : $sql = " update " . $this->phpBB['config_table'] . " SET config_value = '{$nick}' WHERE config_name = 'newest_username'";
Line #189 : $this->db_phpbb->Execute($sql);
Line #190 : $sql = " update " . $this->phpBB['config_table'] . " SET config_value = config_value + 1 WHERE config_name = 'num_users'";
Line #191 : $this->db_phpbb->Execute($sql);
Line #192 : $sql = "INSERT INTO " . $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending)
Line #194 : $this->db_phpbb->Execute($sql);
Line #197 : function v2phpbb_create_account($nick, $password, $email_address) {
Line #198 : if ($this->phpBB['installed'] != true || !zen_not_null($password) || !zen_not_null($email_address) || !zen_not_null($nick)) return false;
Line #199 : if ($this->phpbb_check_for_duplicate_email($email_address) == 'already_exists') {
Line #200 : // $this->phpbb_change_email($old_email, $email_address);
Line #202 : $sql = "select max(user_id) as total from " . $this->phpBB['users_table'];
Line #203 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #204 : $user_id = ($phpbb_users->fields['total'] + 1);
Line #205 : $sql = "insert into " . $this->phpBB['users_table'] . "
Line #209 : $this->db_phpbb->Execute($sql);
Line #211 : $sql = "INSERT INTO " . $this->phpBB['groups_table'] . " (group_name, group_description, group_single_user, group_moderator)
Line #213 : $this->db_phpbb->Execute($sql);
Line #214 : $group_id = $this->db_phpbb->Insert_ID();
Line #215 : $sql = "INSERT INTO " . $this->phpBB['user_group_table'] . " (user_id, group_id, user_pending)
Line #217 : $this->db_phpbb->Execute($sql);
Line #218 : //might optionally send an extra email welcoming them to the phpBB forum, reminding them of their nickname?
Line #222 : function phpbb_check_for_duplicate_nick($nick='') {
Line #223 : if ($this->phpBB['installed'] != true || empty($nick)) return false;
Line #225 : $sql = "select * from " . $this->phpBB['users_table'] . " where username = '" . $nick . "'";
Line #227 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #228 : //echo "count=".$phpbb_users->RecordCount();
Line #229 : if ($phpbb_users->RecordCount() > 0 ) {
Line #235 : function phpbb_check_for_duplicate_email($email_address) {
Line #236 : if ($this->phpBB['installed'] != true) return false;
Line #238 : $sql = "select * from " . $this->phpBB['users_table'] . " where user_email = '" . $email_address . "'";
Line #239 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #240 : if ($phpbb_users->RecordCount() > 0 ) {
Line #246 : function phpbb_change_password($nick, $newpassword) {
Line #247 : if ($this->phpBB['installed'] != true || !zen_not_null($nick) || $nick == '') return false;
Line #248 : $sql = "update " . $this->phpBB['users_table'] . " set user_password='" . MD5($newpassword) . "'
Line #250 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #253 : function phpbb_change_email($old_email, $email_address) {
Line #255 : if ($this->phpBB['installed'] != true || !zen_not_null($email_address) || $email_address == '') return false;
Line #256 : $sql = "update " . $this->phpBB['users_table'] . " set user_email='" . $email_address . "', user_email_hash = '" . crc32(strtolower($email_address)) . strlen($email_address) . "'
Line #258 : $phpbb_users = $this->db_phpbb->Execute($sql);
Line #261 : function phpbb_change_nick($old_nick, $new_nick) {
Line #263 : if ($this->phpBB['installed'] != true || !zen_not_null($nick) || $nick == '') return false;
Line #264 : $sql = "update " . $this->phpBB['users_table'] . " set username='" . $new_nick . "', username_clean = '" . $new_nick . "'
Line #266 : $phpbb_users = $this->db_phpbb->Execute($sql);
/includes/classes/sniffer.php
Line #26 : $this->phpBB = Array();
/includes/configure.php
Line #36 : define('DIR_WS_PHPBB', '/');
/includes/filenames.php
Line #186 : define('FILENAME_BB_INDEX', 'index.php'); // phpBB main index filename
/includes/modules/create_account.php
Line #141 : if ($phpBB->phpBB['installed'] == true) {
Line #154 : // check phpBB for duplicate nickname
Line #155 : if ($phpBB->phpbb_check_for_duplicate_nick($nick) == 'already_exists' ) {
Line #157 : $messageStack->add('create_account', ENTRY_NICK_DUPLICATE_ERROR . ' (phpBB)');
Line #313 : // phpBB create account
Line #314 : if ($phpBB->phpBB['installed'] == true) {
Line #315 : $phpBB->phpbb_create_account($nick, $password, $email_address);
/includes/modules/pages/account_edit/header_php.php
Line #82 : // check phpBB for duplicate email address
Line #83 : if ($phpBB->phpbb_check_for_duplicate_email(zen_db_input($email_address)) == 'already_exists' ) {
Line #85 : $messageStack->add('account_edit', 'phpBB-'.ENTRY_EMAIL_ADDRESS_ERROR_EXISTS);
Line #97 : //update phpBB with new email address
Line #99 : $phpBB->phpbb_change_email(zen_db_input($old_addr_check->fields['customers_email_address']),zen_db_input($email_address));
/includes/modules/pages/account_password/header_php.php
Line #66 : if ($phpBB->phpBB['installed'] == true) {
Line #68 : $phpBB->phpbb_change_password($nickname, $password_new);
/includes/modules/pure_black/create_account.php
Line #155 : if ($phpBB->phpBB['installed'] == true) {
Line #168 : // check phpBB for duplicate nickname
Line #169 : if ($phpBB->phpbb_check_for_duplicate_nick($nick) == 'already_exists' ) {
Line #171 : $messageStack->add('create_account', ENTRY_NICK_DUPLICATE_ERROR . ' (phpBB)');
Line #327 : // phpBB create account
Line #328 : if ($phpBB->phpBB['installed'] == true) {
Line #329 : $phpBB->phpbb_create_account($nick, $password, $email_address);
/includes/modules/sideboxes/information.php
Line #26 : // Forum (phpBB) link:
Line #27 : if ( (isset($phpBB->phpBB['db_installed_config']) && $phpBB->phpBB['db_installed_config']) && (isset($phpBB->phpBB['files_installed']) && $phpBB->phpBB['files_installed']) && (PHPBB_LINKS_ENABLED=='true')) {
Line #28 : $information[] = '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>';
Line #29 : // or: $phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX
Line #30 : // or: str_replace(str_replace(DIR_WS_CATALOG, '', DIR_FS_CATALOG), '', DIR_WS_PHPBB)
/includes/templates/pure_black.pg-bak/templates/tpl_modules_create_account.php
Line #194 : if ($phpBB->phpBB['installed'] == true) {
/includes/templates/pure_black/templates/tpl_modules_create_account.php
Line #194 : if ($phpBB->phpBB['installed'] == true) {
/includes/templates/template_default/templates/tpl_modules_create_account.php
Line #153 : if ($phpBB->phpBB['installed'] == true) {
/includes/templates/template_default/templates/tpl_site_map_default.php
Line #60 : <?php if ( (isset($phpBB->phpBB['db_installed_config']) && $phpBB->phpBB['db_installed_config']) && (isset($phpBB->phpBB['files_installed']) && $phpBB->phpBB['files_installed']) && (PHPBB_LINKS_ENABLED=='true')) { ?>
Line #61 : <li><?php echo '<a href="' . zen_href_link($phpBB->phpBB['phpbb_url'] . FILENAME_BB_INDEX, '', 'NONSSL', false, '', true) . '" target="_blank">' . BOX_BBINDEX . '</a>'; ?></li>