diff options
Diffstat (limited to 'phpBB')
52 files changed, 382 insertions, 254 deletions
diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index c5c5420c70..fadef07ac3 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -9,8 +9,8 @@ */ /** -* @package acm * ACM File Based Caching +* @package acm */ class acm { @@ -20,12 +20,18 @@ class acm var $sql_rowset = array(); + /** + * Set cache path + */ function acm() { global $phpbb_root_path; $this->cache_dir = $phpbb_root_path . 'cache/'; } + /** + * Load global cache + */ function load() { global $phpEx; @@ -41,6 +47,9 @@ class acm return true; } + /** + * Unload cache object + */ function unload() { $this->save(); @@ -49,6 +58,9 @@ class acm unset($this->sql_rowset); } + /** + * Save modified objects + */ function save() { if (!$this->is_modified) @@ -70,6 +82,9 @@ class acm $this->is_modified = false; } + /** + * Tidy cache + */ function tidy() { global $phpEx; @@ -110,6 +125,9 @@ class acm set_config('cache_last_gc', time(), true); } + /** + * Get saved cache object + */ function get($var_name) { if ($var_name{0} == '_') @@ -130,6 +148,9 @@ class acm } } + /** + * Put data into cache + */ function put($var_name, $var, $ttl = 31536000) { if ($var_name{0} == '_') @@ -152,6 +173,9 @@ class acm } } + /** + * Destroy cache data + */ function destroy($var_name, $table = '') { global $phpEx; @@ -202,6 +226,9 @@ class acm } } + /** + * Check if a given cache entry exist + */ function _exists($var_name) { if ($var_name{0} == '_') @@ -225,6 +252,9 @@ class acm } } + /** + * Format an array to be stored on filesystem + */ function format_array($array) { $lines = array(); @@ -232,24 +262,28 @@ class acm { if (is_array($v)) { - $lines[] = "'$k'=>" . $this->format_array($v); + $lines[] = "\n'$k' => " . $this->format_array($v); } else if (is_int($v)) { - $lines[] = "'$k'=>$v"; + $lines[] = "\n'$k' => $v"; } else if (is_bool($v)) { - $lines[] = "'$k'=>" . (($v) ? 'true' : 'false'); + $lines[] = "\n'$k' => " . (($v) ? 'true' : 'false'); } else { - $lines[] = "'$k'=>'" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'"; + $lines[] = "\n'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'"; } } + return 'array(' . implode(',', $lines) . ')'; } + /** + * Load cached sql query + */ function sql_load($query) { global $phpEx; @@ -278,6 +312,9 @@ class acm return $query_id; } + /** + * Save sql query + */ function sql_save($query, &$query_result, $ttl) { global $db, $phpEx; @@ -309,11 +346,17 @@ class acm } } + /** + * Ceck if a given sql query exist in cache + */ function sql_exists($query_id) { return isset($this->sql_rowset[$query_id]); } + /** + * Fetch row from cache (database) + */ function sql_fetchrow($query_id) { return array_shift($this->sql_rowset[$query_id]); diff --git a/phpBB/includes/acm/acm_main.php b/phpBB/includes/acm/acm_main.php index b4a2669a22..a3a251d194 100644 --- a/phpBB/includes/acm/acm_main.php +++ b/phpBB/includes/acm/acm_main.php @@ -16,8 +16,8 @@ if (!defined('IN_PHPBB')) } /** -* @package acm * Class for grabbing/handling cached entries, extends acm_file or acm_db depending on the setup +* @package acm */ class cache extends acm { @@ -238,7 +238,7 @@ class cache extends acm { $allowed = ($forum_id === 0) ? false : true; } - + if ($allowed) { $return['_allowed_'][$extension] = 0; @@ -282,7 +282,7 @@ class cache extends acm WHERE bot_active = 1 ORDER BY STRLEN(bot_agent) DESC'; break; - + // LENGTH supported by MySQL, IBM DB2 and Oracle for sure... default: $sql = 'SELECT user_id, bot_agent, bot_ip @@ -292,7 +292,7 @@ class cache extends acm break; } $result = $db->sql_query($sql); - + $bots = array(); while ($row = $db->sql_fetchrow($result)) { @@ -330,7 +330,7 @@ class cache extends acm $reparse = false; $filename = $phpbb_root_path . 'styles/' . $theme[$key . '_path'] . '/' . $key . '/' . $key . '.cfg'; - + if (!file_exists($filename)) { continue; @@ -340,7 +340,7 @@ class cache extends acm { $reparse = true; } - + // Re-parse cfg file if ($reparse) { diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 1f99793462..23bd86ea3b 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -9,8 +9,8 @@ */ /** -* @package acp * @todo [smilies] check regular expressions for special char replacements (stored specialchared in db) +* @package acp */ class acp_icons { diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index 155443f04b..cacea98d97 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -9,8 +9,8 @@ */ /** -* @package acp * @todo [words] check regular expressions for special char replacements (stored specialchared in db) +* @package acp */ class acp_words { diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 64421fcda7..0888cae128 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -16,8 +16,8 @@ if (!defined('IN_PHPBB')) } /** -* @package phpBB3 * ACP Permission/Auth class +* @package phpBB3 */ class auth_admin extends auth { diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index edeb72aee6..7a09d2d212 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Permission/Auth class +* @package phpBB3 */ class auth { diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 6736b2f3d3..eb440cab24 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * BBCode class +* @package phpBB3 */ class bbcode { diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index c6fdd0f48b..05fb57c9c1 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -10,11 +10,11 @@ /** -* @package VC * Main gd based captcha class * * Thanks to Robert Hetzler (Xore) * +* @package VC */ class captcha { diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php index 5e3b7abd1c..a019628e4b 100644 --- a/phpBB/includes/captcha/captcha_non_gd.php +++ b/phpBB/includes/captcha/captcha_non_gd.php @@ -10,8 +10,8 @@ /** -* @package VC * Main non-gd captcha class +* @package VC */ class captcha { diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 3ad4bf86ba..e132cec706 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -9,8 +9,8 @@ */ /** -* @package dbal * Database Abstraction Layer +* @package dbal */ class dbal { @@ -122,7 +122,7 @@ class dbal /** * SQL Transaction - * @private + * @access: private */ function sql_transaction($status = 'begin') { diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 616e064176..d5a91fe9bb 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -25,9 +25,9 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * Firebird/Interbase Database Abstraction Layer * Minimum Requirement is Firebird 1.5+/Interbase 7.1+ +* @package dbal */ class dbal_firebird extends dbal { @@ -50,7 +50,7 @@ class dbal_firebird extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -298,7 +298,7 @@ class dbal_firebird extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -307,7 +307,7 @@ class dbal_firebird extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -319,7 +319,7 @@ class dbal_firebird extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -328,7 +328,7 @@ class dbal_firebird extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 2f76f90bbb..cc4de3695a 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -25,9 +25,9 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * MSSQL Database Abstraction Layer * Minimum Requirement is MSSQL 2000+ +* @package dbal */ class dbal_mssql extends dbal { @@ -57,7 +57,7 @@ class dbal_mssql extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -315,7 +315,7 @@ class dbal_mssql extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -354,7 +354,7 @@ class dbal_mssql extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -363,7 +363,7 @@ class dbal_mssql extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -372,7 +372,7 @@ class dbal_mssql extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 80ae25c4be..658251ea2a 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -25,10 +25,10 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * Unified ODBC functions * Unified ODBC functions support any database having ODBC driver, for example Adabas D, IBM DB2, iODBC, Solid, Sybase SQL Anywhere... * Here we only support MSSQL Server 2000+ because of the provided schema +* @package dbal */ class dbal_mssql_odbc extends dbal { @@ -51,7 +51,7 @@ class dbal_mssql_odbc extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -325,7 +325,7 @@ class dbal_mssql_odbc extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -334,7 +334,7 @@ class dbal_mssql_odbc extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -346,7 +346,7 @@ class dbal_mssql_odbc extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -355,7 +355,7 @@ class dbal_mssql_odbc extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index f346663d56..fd7e10a822 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -25,15 +25,15 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * MySQL Database Abstraction Layer * Minimum Requirement is 3.23+/4.0+/4.1+ +* @package dbal */ class dbal_mysql extends dbal { /** * Connect to server - * @public + * @access: public */ function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false) { @@ -57,7 +57,7 @@ class dbal_mysql extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -282,7 +282,7 @@ class dbal_mysql extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -298,7 +298,7 @@ class dbal_mysql extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -318,7 +318,7 @@ class dbal_mysql extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -327,7 +327,7 @@ class dbal_mysql extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php index d98a8069e8..13271d9346 100644 --- a/phpBB/includes/db/mysql4.php +++ b/phpBB/includes/db/mysql4.php @@ -25,12 +25,12 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * MySQL4 Database Abstraction Layer * Compatible with: * MySQL 4.0+ * MySQL 4.1+ * MySQL 5.0+ +* @package dbal */ class dbal_mysql4 extends dbal { @@ -59,7 +59,7 @@ class dbal_mysql4 extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -285,7 +285,7 @@ class dbal_mysql4 extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -301,7 +301,7 @@ class dbal_mysql4 extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -321,7 +321,7 @@ class dbal_mysql4 extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -330,7 +330,7 @@ class dbal_mysql4 extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index cdcdc58d87..b93bf98c1a 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -25,10 +25,10 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * MySQLi Database Abstraction Layer * mysqli-extension has to be compiled with: * MySQL 4.1+ or MySQL 5.0+ +* @package dbal */ class dbal_mysqli extends dbal { @@ -59,7 +59,7 @@ class dbal_mysqli extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -277,7 +277,7 @@ class dbal_mysqli extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -293,7 +293,7 @@ class dbal_mysqli extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -313,7 +313,7 @@ class dbal_mysqli extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -322,7 +322,7 @@ class dbal_mysqli extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 05f910e25d..464e6ad9de 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -25,8 +25,8 @@ if(!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * Oracle Database Abstraction Layer +* @package dbal */ class dbal_oracle extends dbal { @@ -49,7 +49,7 @@ class dbal_oracle extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -355,7 +355,7 @@ class dbal_oracle extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -377,7 +377,7 @@ class dbal_oracle extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -386,7 +386,7 @@ class dbal_oracle extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 3589f0c552..ad8e0a01da 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -25,9 +25,9 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * PostgreSQL Database Abstraction Layer * Minimum Requirement is Version 7.3+ +* @package dbal */ class dbal_postgres extends dbal { @@ -86,7 +86,7 @@ class dbal_postgres extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -164,7 +164,7 @@ class dbal_postgres extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -336,7 +336,7 @@ class dbal_postgres extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -348,7 +348,7 @@ class dbal_postgres extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -357,7 +357,7 @@ class dbal_postgres extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index be2ec3e400..2d4aefcb4b 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -25,8 +25,8 @@ if (!defined('SQL_LAYER')) include($phpbb_root_path . 'includes/db/dbal.' . $phpEx); /** -* @package dbal * Sqlite Database Abstraction Layer +* @package dbal */ class dbal_sqlite extends dbal { @@ -53,7 +53,7 @@ class dbal_sqlite extends dbal /** * SQL Transaction - * @private + * @access: private */ function _sql_transaction($status = 'begin') { @@ -262,7 +262,7 @@ class dbal_sqlite extends dbal /** * return sql error array - * @private + * @access: private */ function _sql_error() { @@ -274,7 +274,7 @@ class dbal_sqlite extends dbal /** * Build db-specific query data - * @private + * @access: private */ function _sql_custom_build($stage, $data) { @@ -283,7 +283,7 @@ class dbal_sqlite extends dbal /** * Close sql connection - * @private + * @access: private */ function _sql_close() { @@ -292,7 +292,7 @@ class dbal_sqlite extends dbal /** * Build db-specific report - * @private + * @access: private */ function _sql_report($mode, $query = '') { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a7adb4d600..0ba6315b5b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -15,7 +15,7 @@ * * Set variable, used by {@link request_var the request_var function} * -* @private +* @access: private */ function set_var(&$result, $var, $type, $multibyte = false) { diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 3be750e9bc..1dc95bc509 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Class for handling archives (compression/decompression) +* @package phpBB3 */ class compress { @@ -121,8 +121,6 @@ class compress } /** -* @package phpBB3 -* * Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux, * Marc Delisle, http://www.phpmyadmin.net/ * @@ -132,6 +130,8 @@ class compress * * Based on work by Eric Mueller and Denis125 * Official ZIP file format: http://www.pkware.com/appnote.txt +* +* @package phpBB3 */ class compress_zip extends compress { @@ -440,10 +440,10 @@ class compress_zip extends compress } /** -* @package phpBB3 -* * Tar/tar.gz compression routine * Header/checksum creation derived from tarfile.pl, (c) Tom Horsley, 1994 +* +* @package phpBB3 */ class compress_tar extends compress { diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 386eee7167..f35f84497b 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -9,7 +9,6 @@ */ /** -* @package phpBB3 * * Class.Jabber.PHP v0.4 * (c) 2002 Carlo "Gossip" Zottmann @@ -24,6 +23,7 @@ * Modified by psoTFX, phpBB Group, 2003. * Removed functions/support not critical to integration with phpBB * +* @package phpBB3 */ class jabber { @@ -629,7 +629,7 @@ class jabber /** * Send auth - * @private + * @access: private */ function _sendauth_ok($zerok_token, $zerok_sequence) { @@ -657,7 +657,7 @@ class jabber /** * Send auth digest - * @private + * @access: private */ function _sendauth_digest() { @@ -673,7 +673,7 @@ class jabber /** * Send auth plain - * @private + * @access: private */ function _sendauth_plaintext() { @@ -689,7 +689,7 @@ class jabber /** * Listen on socket - * @private + * @access: private */ function _listen_incoming() { @@ -706,7 +706,7 @@ class jabber /** * Check if connected - * @private + * @access: private */ function _check_connected() { @@ -735,7 +735,7 @@ class jabber /** * Split incoming packet - * @private + * @access: private */ function _split_incoming($incoming) { @@ -752,7 +752,7 @@ class jabber /** * Get packet type - * @private + * @access: private */ function _get_packet_type($packet = NULL) { @@ -767,7 +767,7 @@ class jabber /** * Recursively prepares the strings in an array to be used in XML data. - * @private + * @access: private */ function _array_xmlspecialchars(&$array) { @@ -789,7 +789,7 @@ class jabber /** * Prepares a string for usage in XML data. - * @private + * @access: private */ function _xmlspecialchars(&$string) { @@ -799,7 +799,7 @@ class jabber /** * Recursively converts all elements in an array to UTF-8 from the encoding stored in {@link encoding the encoding attribute}. - * @private + * @access: private */ function _array_conv_utf8(&$array) { @@ -832,7 +832,7 @@ class jabber * * @return boolean True on success, false on failure. * - * @private + * @access: private */ function _conv_utf8(&$string) { @@ -1149,9 +1149,9 @@ class jabber } /** -* @package phpBB3 * make_xml * Currently not in use +* @package phpBB3 class make_xml extends jabber { var $nodes; @@ -1255,8 +1255,8 @@ class make_xml extends jabber */ /** -* @package phpBB3 * connector +* @package phpBB3 */ class cjp_standard_connector { diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 165ec936c9..5bd9b0ab41 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Messenger +* @package phpBB3 */ class messenger { @@ -465,8 +465,8 @@ class messenger } /** -* @package phpBB3 * handling email and jabber queue +* @package phpBB3 */ class queue { @@ -699,7 +699,7 @@ class queue /** * Format array - * @private + * @access: private */ function format_array($array) { @@ -924,10 +924,10 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers } /** -* @package phpBB3 * SMTP Class * Auth Mechanisms originally taken from the AUTH Modules found within the PHP Extension and Application Repository (PEAR) * See docs/AUTHORS for more details +* @package phpBB3 */ class smtp_class { diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index dfc72b54c4..10a1b899c7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Custom Profile Fields +* @package phpBB3 */ class custom_profile { @@ -21,7 +21,7 @@ class custom_profile /** * Assign editable fields to template, mode can be profile (for profile change) or register (for registration) * Called by ucp_profile and ucp_register - * @public + * @access: public */ function generate_profile_fields($mode, $lang_id) { @@ -74,7 +74,7 @@ class custom_profile /** * Validate entered profile field data - * @public + * @access: public */ function validate_profile_field($field_type, &$field_value, $field_data) { @@ -174,7 +174,7 @@ class custom_profile /** * Build profile cache, used for display - * @private + * @access: private */ function build_cache() { @@ -236,7 +236,7 @@ class custom_profile /** * Submit profile field - * @public + * @access: public */ function submit_cp_field($mode, $lang_id, &$cp_data, &$cp_error) { @@ -328,7 +328,7 @@ class custom_profile /** * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled) * This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template - * @public + * @access: public */ function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false) { @@ -515,7 +515,7 @@ class custom_profile /** * Get field value for registration/profile - * @private + * @access: private */ function get_var($field_validation, &$profile_row, $default_value, $preview) { @@ -570,7 +570,7 @@ class custom_profile /** * Process int-type - * @private + * @access: private */ function generate_int($profile_row, $preview = false) { @@ -582,7 +582,7 @@ class custom_profile /** * Process date-type - * @private + * @access: private */ function generate_date($profile_row, $preview = false) { @@ -641,7 +641,7 @@ class custom_profile /** * Process bool-type - * @private + * @access: private */ function generate_bool($profile_row, $preview = false) { @@ -672,7 +672,7 @@ class custom_profile /** * Process string-type - * @private + * @access: private */ function generate_string($profile_row, $preview = false) { @@ -684,7 +684,7 @@ class custom_profile /** * Process text-type - * @private + * @access: private */ function generate_text($profile_row, $preview = false) { @@ -701,7 +701,7 @@ class custom_profile /** * Process dropdown-type - * @private + * @access: private */ function generate_dropdown($profile_row, $preview = false) { @@ -730,7 +730,7 @@ class custom_profile /** * Return Templated value/field. Possible values for $mode are: * change == user is able to set/enter profile values; preview == just show the value - * @private + * @access: private */ function process_field_row($mode, $profile_row) { @@ -793,7 +793,7 @@ class custom_profile /** * Get profile field value on submit - * @private + * @access: private */ function get_profile_field($profile_row) { @@ -863,8 +863,8 @@ class custom_profile } /** -* @package phpBB3 * Custom Profile Fields ACP +* @package phpBB3 */ class custom_profile_admin extends custom_profile { diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 6416eebda1..9b201871b1 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -16,8 +16,6 @@ if (!defined('IN_PHPBB')) } /** -* @package phpBB3 -* * Extension of template class - Functions needed for compiling templates only. * * psoTFX, phpBB Development Team - Completion of file caching, decompilation @@ -33,6 +31,8 @@ if (!defined('IN_PHPBB')) * to this source * * DEFINE directive inspired by a request by Cyberalien +* +* @package phpBB3 */ class template_compile { @@ -52,7 +52,7 @@ class template_compile /** * Load template source from file - * @private + * @access: private */ function _tpl_load_file($handle) { @@ -70,7 +70,7 @@ class template_compile /** * The all seeing all doing compile method. Parts are inspired by or directly from Smarty - * @private + * @access: private */ function compile($code, $no_echo = false, $echo_var = '') { @@ -198,7 +198,7 @@ class template_compile /** * Compile variables - * @private + * @access: private */ function compile_var_tags(&$text_blocks) { @@ -240,7 +240,7 @@ class template_compile /** * Compile blocks - * @private + * @access: private */ function compile_tag_block($tag_args) { @@ -331,7 +331,7 @@ class template_compile /** * Compile IF tags - much of this is from Smarty with * some adaptions for our block level methods - * @private + * @access: private */ function compile_tag_if($tag_args, $elseif) { @@ -458,7 +458,7 @@ class template_compile /** * Compile DEFINE tags - * @private + * @access: private */ function compile_tag_define($tag_args, $op) { @@ -511,7 +511,7 @@ class template_compile /** * Compile INCLUDE tag - * @private + * @access: private */ function compile_tag_include($tag_args) { @@ -520,7 +520,7 @@ class template_compile /** * Compile INCLUDE_PHP tag - * @private + * @access: private */ function compile_tag_include_php($tag_args) { @@ -530,7 +530,7 @@ class template_compile /** * parse expression * This is from Smarty - * @private + * @access: private */ function _parse_is_expr($is_arg, $tokens) { @@ -601,7 +601,7 @@ class template_compile * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' * It's ready to be inserted into an "echo" line in one of the templates. * NOTE: expects a trailing "." on the namespace. - * @private + * @access: private */ function generate_block_varref($namespace, $varname, $echo = true, $defop = false) { @@ -626,7 +626,7 @@ class template_compile * * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. * NOTE: does not expect a trailing "." on the blockname. - * @private + * @access: private */ function generate_block_data_ref($blockname, $include_last_iterator, $defop = false) { @@ -655,7 +655,7 @@ class template_compile /** * Write compiled file to cache directory - * @private + * @access: private */ function compile_write(&$handle, $data) { diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 05d46be2ea..190447829f 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Transfer class, wrapper for ftp/sftp/ssh +* @package phpBB3 */ class transfer { @@ -227,8 +227,8 @@ class transfer } /** -* @package phpBB3 * FTP transfer class +* @package phpBB3 */ class ftp extends transfer { @@ -272,7 +272,7 @@ class ftp extends transfer /** * Init FTP Session - * @private + * @access: private */ function _init() { @@ -304,7 +304,7 @@ class ftp extends transfer /** * Create Directory (MKDIR) - * @private + * @access: private */ function _mkdir($dir) { @@ -313,7 +313,7 @@ class ftp extends transfer /** * Remove directory (RMDIR) - * @private + * @access: private */ function _rmdir($dir) { @@ -322,7 +322,7 @@ class ftp extends transfer /** * Remove directory (RMDIR) - * @private + * @access: private */ function _rename($old_handle, $new_handle) { @@ -331,7 +331,7 @@ class ftp extends transfer /** * Change current working directory (CHDIR) - * @private + * @access: private */ function _chdir($dir = '') { @@ -345,7 +345,7 @@ class ftp extends transfer /** * change file permissions (CHMOD) - * @private + * @access: private */ function _chmod($file, $perms) { @@ -364,7 +364,7 @@ class ftp extends transfer /** * Upload file to location (PUT) - * @private + * @access: private */ function _put($from_file, $to_file) { @@ -386,7 +386,7 @@ class ftp extends transfer /** * Delete file (DELETE) - * @private + * @access: private */ function _delete($file) { @@ -395,7 +395,7 @@ class ftp extends transfer /** * Close ftp session (CLOSE) - * @private + * @access: private */ function _close() { @@ -410,7 +410,7 @@ class ftp extends transfer /** * Return current working directory (CWD) * At the moment not used by parent class - * @private + * @access: private */ function _cwd() { @@ -420,7 +420,7 @@ class ftp extends transfer /** * Return list of files in a given directory (LS) * At the moment not used by parent class - * @private + * @access: private */ function _ls($dir = './') { @@ -429,7 +429,7 @@ class ftp extends transfer /** * FTP SITE command (ftp-only function) - * @private + * @access: private */ function _site($command) { @@ -438,9 +438,10 @@ class ftp extends transfer } /** -* @package phpBB3 * FTP fsock transfer class +* * @author wGEric +* @package phpBB3 */ class ftp_fsock extends transfer { @@ -486,7 +487,7 @@ class ftp_fsock extends transfer /** * Init FTP Session - * @private + * @access: private */ function _init() { @@ -525,7 +526,7 @@ class ftp_fsock extends transfer /** * Create Directory (MKDIR) - * @private + * @access: private */ function _mkdir($dir) { @@ -534,7 +535,7 @@ class ftp_fsock extends transfer /** * Remove directory (RMDIR) - * @private + * @access: private */ function _rmdir($dir) { @@ -543,7 +544,7 @@ class ftp_fsock extends transfer /** * Change current working directory (CHDIR) - * @private + * @access: private */ function _chdir($dir = '') { @@ -557,7 +558,7 @@ class ftp_fsock extends transfer /** * change file permissions (CHMOD) - * @private + * @access: private */ function _chmod($file, $perms) { @@ -566,7 +567,7 @@ class ftp_fsock extends transfer /** * Upload file to location (PUT) - * @private + * @access: private */ function _put($from_file, $to_file) { @@ -602,7 +603,7 @@ class ftp_fsock extends transfer /** * Delete file (DELETE) - * @private + * @access: private */ function _delete($file) { @@ -611,7 +612,7 @@ class ftp_fsock extends transfer /** * Close ftp session (CLOSE) - * @private + * @access: private */ function _close() { @@ -626,7 +627,7 @@ class ftp_fsock extends transfer /** * Return current working directory (CWD) * At the moment not used by parent class - * @private + * @access: private */ function _cwd() { @@ -637,7 +638,7 @@ class ftp_fsock extends transfer /** * Return list of files in a given directory (LS) * At the moment not used by parent class - * @private + * @access: private */ function _ls($dir = './') { @@ -660,7 +661,7 @@ class ftp_fsock extends transfer /** * Send a command to server (FTP fsock only function) - * @private + * @access: private */ function _send_command($command, $args = '', $check = true) { @@ -681,7 +682,7 @@ class ftp_fsock extends transfer /** * Opens a connection to send data (FTP fosck only function) - * @private + * @access: private */ function _open_data_connection() { @@ -716,7 +717,7 @@ class ftp_fsock extends transfer /** * Closes a connection used to send data - * @private + * @access: private */ function _close_data_connection() { @@ -725,7 +726,7 @@ class ftp_fsock extends transfer /** * Check to make sure command was successful (FTP fsock only function) - * @private + * @access: private */ function _check_command($return = false) { diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 678ca2b493..28701339e4 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -9,9 +9,9 @@ */ /** -* @package phpBB3 * Responsible for holding all file relevant informations, as well as doing file-specific operations. * The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. +* @package phpBB3 */ class filespec { @@ -23,6 +23,7 @@ class filespec var $filesize = 0; var $width = 0; var $height = 0; + var $image_info = array(); var $destination_file = ''; var $destination_path = ''; @@ -37,9 +38,7 @@ class filespec /** * File Class - * - * @access private - * + * @access: private */ function filespec($upload_ary, $upload_namespace) { @@ -61,7 +60,7 @@ class filespec { $this->mimetype = 'application/octetstream'; } - + $this->extension = strtolower($this->get_extension($this->realname)); // Try to get real filesize from temporary folder (not always working) ;) @@ -77,9 +76,9 @@ class filespec /** * Cleans destination filename * - * @access public * @param real|unique $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename * @param string $prefix Prefix applied to filename + * @access public */ function clean_filename($mode = 'unique', $prefix = '') { @@ -87,7 +86,7 @@ class filespec { return; } - + switch ($mode) { case 'real': @@ -104,14 +103,18 @@ class filespec $this->realname = preg_replace("/%(\w{2})/", '_', $this->realname); $this->realname = $prefix . $this->realname . '.' . $this->extension; - break; + break; case 'unique': default: $this->realname = $prefix . md5(unique_id()) . '.' . $this->extension; + break; } } + /** + * Get property from file object + */ function get($property) { if ($this->init_error || !isset($this->$property)) @@ -122,11 +125,21 @@ class filespec return $this->$property; } + /** + * Check if file is an image (mimetype) + * + * @return true if it is an image, false if not + */ function is_image() { return (strpos($this->mimetype, 'image/') !== false) ? true : false; } + /** + * Check if the file got correctly uploaded + * + * @return true if it is a valid upload and the file exist, false if not + */ function is_uploaded() { if (!$this->local && !is_uploaded_file($this->filename)) @@ -137,6 +150,9 @@ class filespec return (file_exists($this->filename)) ? true : false; } + /** + * Remove file + */ function remove() { if ($this->file_moved) @@ -160,7 +176,7 @@ class filespec } /** - * Get mimetype + * Get mimetype. Utilize mime_content_type if the function exist. */ function get_mimetype($filename) { @@ -190,12 +206,11 @@ class filespec /** * Move file to destination folder - * * The phpbb_root_path variable will be applied to the destination path * - * @access public * @param string $destination_path Destination path, for example $config['avatar_path'] * @param octal $chmod Permission mask for chmodding the file after a successful move + * @access public */ function move_file($destination, $chmod = 0666) { @@ -211,7 +226,7 @@ class filespec { $destination = substr($destination, 0, sizeof($destination)-2); } - + $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); if ($destination && ($destination{0} == '/' || $destination{0} == "\\")) { @@ -227,6 +242,7 @@ class filespec switch ($upload_mode) { case 'copy': + if (!@copy($this->filename, $this->destination_file)) { if (!@move_uploaded_file($this->filename, $this->destination_file)) @@ -239,11 +255,13 @@ class filespec { @unlink($this->filename); } - break; + + break; case 'move': + if (!@move_uploaded_file($this->filename, $this->destination_file)) - { + { if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); @@ -253,27 +271,41 @@ class filespec { @unlink($this->filename); } - } - break; + } + + break; case 'local': + if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); return false; } @unlink($this->filename); - break; + + break; } @chmod($this->destination_file, $chmod); - + // Try to get real filesize from destination folder $this->filesize = (@filesize($this->destination_file)) ? @filesize($this->destination_file) : $this->filesize; if ($this->is_image()) { - list($this->width, $this->height) = @getimagesize($this->destination_file); + $this->width = $this->height = 0; + + if (($this->image_info = @getimagesize($this->destination_file)) !== false) + { + $this->width = $this->image_info[0]; + $this->height = $this->image_info[1]; + + if (!empty($this->image_info['mime'])) + { + $this->mimetype = $this->image_info['mime']; + } + } } $this->file_moved = true; @@ -283,6 +315,9 @@ class filespec return true; } + /** + * Performing additional checks + */ function additional_checks() { global $user; @@ -291,13 +326,13 @@ class filespec { return false; } - + // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0)) { $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); $max_filesize = ($this->upload->max_filesize >= 1048576) ? round($this->upload->max_filesize / 1048576 * 100) / 100 : (($this->upload->max_filesize >= 1024) ? round($this->upload->max_filesize / 1024 * 100) / 100 : $this->upload->max_filesize); - + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); return false; @@ -315,8 +350,9 @@ class filespec } /** -* @package phpBB3 * Class for assigning error messages before a real filespec class can be assigned +* +* @package phpBB3 */ class fileerror extends filespec { @@ -327,10 +363,10 @@ class fileerror extends filespec } /** -* @package phpBB3 * File upload class -* * Init class (all parameters optional and able to be set/overwritten seperatly) - scope is global and valid for all uploads +* +* @package phpBB3 */ class fileupload { @@ -343,6 +379,7 @@ class fileupload var $error_prefix = ''; /** + * Init file upload class. * * @param string $error_prefix Used error messages will get prefixed by this string * @param array $allowed_extensions Array of allowed extensions, for example array('jpg', 'jpeg', 'gif', 'png') @@ -361,7 +398,9 @@ class fileupload $this->set_error_prefix($error_prefix); } - // Reset vars + /** + * Reset vars + */ function reset_vars() { $this->max_filesize = 0; @@ -370,7 +409,9 @@ class fileupload $this->allowed_extensions = array(); } - // Set allowed extensions + /** + * Set allowed extensions + */ function set_allowed_extensions($allowed_extensions) { if ($allowed_extensions !== false && is_array($allowed_extensions)) @@ -379,7 +420,9 @@ class fileupload } } - // Set allowed dimensions + /** + * Set allowed dimensions + */ function set_allowed_dimensions($min_width, $min_height, $max_width, $max_height) { $this->min_width = (int) $min_width; @@ -388,7 +431,9 @@ class fileupload $this->max_height = (int) $max_height; } - // Set maximum allowed filesize + /** + * Set maximum allowed filesize + */ function set_max_filesize($max_filesize) { if ($max_filesize !== false && (int) $max_filesize) @@ -397,7 +442,9 @@ class fileupload } } - // Set error prefix + /** + * Set error prefix + */ function set_error_prefix($error_prefix) { $this->error_prefix = $error_prefix; @@ -405,12 +452,11 @@ class fileupload /** * Form upload method - * * Upload file from users harddisk * - * @access public * @param string $form_name Form name assigned to the file input field (if it is an array, the key has to be specified) * @return object $file Object "filespec" is returned, all further operations can be done with this object + * @access public */ function form_upload($form_name) { @@ -424,7 +470,7 @@ class fileupload $file->error[] = ''; return $file; } - + // Error array filled? if (isset($_FILES[$form_name]['error'])) { @@ -463,7 +509,9 @@ class fileupload return $file; } - // Move file from another location to phpBB + /** + * Move file from another location to phpBB + */ function local_upload($source_file, $filedata = false) { global $user; @@ -484,7 +532,7 @@ class fileupload $_FILES[$form_name]['name'] = $filedata['realname']; $_FILES[$form_name]['size'] = $filedata['size']; $_FILES[$form_name]['type'] = $filedata['type']; - } + } $file = new filespec($_FILES[$form_name], $this); @@ -493,7 +541,7 @@ class fileupload $file->error[] = ''; return $file; } - + if (isset($_FILES[$form_name]['error'])) { $error = $this->assign_internal_error($_FILES[$form_name]['error']); @@ -526,21 +574,20 @@ class fileupload /** * Remote upload method - * * Uploads file from given url * - * @access public * @param string $upload_url URL pointing to file to upload, for example http://www.foobar.com/example.gif * @return object $file Object "filespec" is returned, all further operations can be done with this object + * @access public */ function remote_upload($upload_url) { global $user, $phpbb_root_path; - + $upload_ary = array(); $upload_ary['local_mode'] = true; - if (!preg_match('#^(http://).*?\.(' . implode('|', $this->allowed_extensions) . ')$#i', $upload_url, $match)) + if (!preg_match('#^(https?://).*?\.(' . implode('|', $this->allowed_extensions) . ')$#i', $upload_url, $match)) { $file = new fileerror($user->lang[$this->error_prefix . 'URL_INVALID']); return $file; @@ -557,12 +604,12 @@ class fileupload $host = $url['host']; $path = $url['path']; $port = (!empty($url['port'])) ? (int) $url['port'] : 80; - + $upload_ary['type'] = 'application/octet-stream'; - + $url['path'] = explode('.', $url['path']); $ext = array_pop($url['path']); - + $url['path'] = implode('', $url['path']); $upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : ''); $filename = $url['path']; @@ -600,7 +647,7 @@ class fileupload { $upload_ary['type'] = rtrim(str_replace('Content-Type: ', '', $line)); } - else if (strpos($line, 'HTTP/1.1 404 Not Found') !== false) + else if (strpos($line, '404 Not Found') !== false) { $file = new fileerror($user->lang[$this->error_prefix . 'URL_NOT_FOUND']); return $file; @@ -624,6 +671,7 @@ class fileupload $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); return $file; } + $upload_ary['size'] = fwrite($fp, $data); fclose($fp); unset($data); @@ -636,7 +684,10 @@ class fileupload return $file; } - // Private::assign_internal_error + /** + * Assign internal error + * @access private + */ function assign_internal_error($errorcode) { global $user; @@ -655,22 +706,28 @@ class fileupload break; case 3: - $error = 'The uploaded file was only partially uploaded'; - break; + $error = $user->lang[$this->error_prefix . 'PARTIAL_UPLOAD']; + break; + case 4: $error = $user->lang[$this->error_prefix . 'NOT_UPLOADED']; - break; + break; + case 6: $error = 'Temporary folder could not be found. Please check your PHP installation.'; - break; + break; + default: $error = false; + break; } return $error; } - - // Private::common_checks + + /** + * Perform common checks + */ function common_checks(&$file) { global $user; @@ -697,18 +754,24 @@ class fileupload } } + /** + * Check for allowed extension + */ function valid_extension(&$file) { return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false; } + /** + * Check for allowed dimension + */ function valid_dimensions(&$file) { if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height) { return true; } - + if (($file->get('width') > $this->max_width && $this->max_width) || ($file->get('height') > $this->max_height && $this->max_height) || ($file->get('width') < $this->min_width && $this->min_width) || @@ -720,6 +783,9 @@ class fileupload return true; } + /** + * Check if form upload is valid + */ function is_valid($form_name) { return (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none') ? true : false; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 1bbeeff8bc..c246e98396 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -124,7 +124,7 @@ function user_update_name($old_name, $new_name) */ function user_add($user_row, $cp_data = false) { - global $db, $config; + global $db, $user, $auth, $config, $phpbb_root_path, $phpEx; if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type'])) { @@ -182,8 +182,6 @@ function user_add($user_row, $cp_data = false) 'user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => 0, - - 'user_rank' => 0, ); // Now fill the sql array with not required variables @@ -192,6 +190,18 @@ function user_add($user_row, $cp_data = false) $sql_ary[$key] = (isset($user_row[$key])) ? $user_row[$key] : $default_value; } + // Any additional variables in $user_row not covered above? + $remaining_vars = array_diff(array_keys($user_row), array_keys($sql_ary)); + + // Now fill our sql array with the remaining vars + if (sizeof($remaining_vars)) + { + foreach ($remaining_vars as $key) + { + $sql_ary[$key] = $user_row[$key]; + } + } + $db->sql_transaction('begin'); $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); @@ -203,7 +213,14 @@ function user_add($user_row, $cp_data = false) if ($cp_data !== false && sizeof($cp_data)) { $cp_data['user_id'] = (int) $user_id; - $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data)); + + if (!class_exists('custom_profile')) + { + include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); + } + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . + $db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data)); $db->sql_query($sql); } diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index b190c52f43..77837006c9 100755 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_logs * Handling warning the users +* @package mcp */ class mcp_logs { diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 2e9c058bdd..eb77e68585 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_main * Handling mcp actions +* @package mcp */ class mcp_main { diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 6d125bb9d8..1f8e8f63a0 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_notes * Displays notes about a user +* @package mcp */ class mcp_notes { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index e31b9e187e..da7b31f7d9 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_queue * Handling the moderation queue +* @package mcp */ class mcp_queue { diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index ef19dc2e1a..6900c74879 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_reports * Handling the reports queue +* @package mcp */ class mcp_reports { diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index cb33bb6534..a40e53649a 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -9,9 +9,9 @@ */ /** -* @package mcp * mcp_warn * Handling warning the users +* @package mcp */ class mcp_warn { diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 2c76b12c6d..be5669b702 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -22,9 +22,9 @@ if (!class_exists('bbcode')) } /** -* @package phpBB3 * BBCODE FIRSTPASS * BBCODE first pass class (functions for parsing messages for db storage) +* @package phpBB3 */ class bbcode_firstpass extends bbcode { @@ -779,7 +779,7 @@ class bbcode_firstpass extends bbcode * @param string $url the url to check * @return true if the url is pointing to this domain/script_path/php-file, false if not * - * @private + * @access: private */ function path_in_domain($url) { @@ -812,9 +812,9 @@ class bbcode_firstpass extends bbcode } /** -* @package phpBB3 * Main message parser for posting, pm, etc. takes raw message * and parses it for attachments, bbcode and smilies +* @package phpBB3 */ class parse_message extends bbcode_firstpass { diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index ae674e1af7..781bafd41d 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -21,9 +21,9 @@ if (!defined('IN_PHPBB')) include_once($phpbb_root_path . 'includes/search/search.' . $phpEx); /** -* @package search * fulltext_mysql * Fulltext search for MySQL +* @package search */ class fulltext_mysql extends search_backend { diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index d871910198..6bdaaec176 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -21,9 +21,9 @@ if (!defined('IN_PHPBB')) include_once($phpbb_root_path . 'includes/search/search.' . $phpEx); /** -* @package search * fulltext_native * phpBB's own db driven fulltext search +* @package search */ class fulltext_native extends search_backend { diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index 3cbb5be62a..6fcacac483 100755 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -23,10 +23,10 @@ define('SEARCH_RESULT_IN_CACHE', 1); define('SEARCH_RESULT_INCOMPLETE', 2); /** -* @package search * search_backend * optional base class for search plugins providing simple caching based on ACM * and functions to retrieve ignore_words and synonyms +* @package search */ class search_backend { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 3737c21079..09ae84a210 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -9,8 +9,8 @@ */ /** -* @package phpBB3 * Session class +* @package phpBB3 */ class session { @@ -898,11 +898,12 @@ class session /** -* @package phpBB3 * Base user class * * This is the overarching class which contains (through session extend) * all methods utilised for user functionality during a session. +* +* @package phpBB3 */ class user extends session { @@ -1167,7 +1168,7 @@ class user extends session /** * Set language entry (called by add_lang) - * @private + * @access: private */ function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false) { diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 5e7db9acda..1e1ad31193 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -16,8 +16,8 @@ if (!defined('IN_PHPBB')) } /** -* @package phpBB3 * Base Template class. +* @package phpBB3 */ class template { @@ -39,7 +39,7 @@ class template /** * Set template location - * @public + * @access: public */ function set_template() { @@ -56,7 +56,7 @@ class template /** * Set custom template location (able to use directory outside of phpBB) - * @public + * @access: public */ function set_custom_template($template_path, $template_name) { @@ -71,7 +71,7 @@ class template /** * Sets the template filenames for handles. $filename_array * should be a hash of handle => filename pairs. - * @public + * @access: public */ function set_filenames($filename_array) { @@ -96,7 +96,7 @@ class template /** * Destroy template data set - * @public + * @access: public */ function destroy() { @@ -105,7 +105,7 @@ class template /** * Reset/empty complete block - * @public + * @access: public */ function destroy_block_vars($blockname) { @@ -135,7 +135,7 @@ class template /** * Display handle - * @public + * @access: public */ function display($handle, $include_once = true) { @@ -155,7 +155,7 @@ class template /** * Display the handle and assign the output to a template variable or return the compiled result. - * @public + * @access: public */ function assign_display($handle, $template_var = '', $return_content = true, $include_once = false) { @@ -175,7 +175,7 @@ class template /** * Load a compiled template if possible, if not, recompile it - * @private + * @access: private */ function _tpl_load(&$handle) { @@ -267,7 +267,7 @@ class template /** * Assign key variable pairs from an array - * @public + * @access: public */ function assign_vars($vararray) { @@ -281,7 +281,7 @@ class template /** * Assign a single variable to a single key - * @public + * @access: public */ function assign_var($varname, $varval) { @@ -292,7 +292,7 @@ class template /** * Assign key variable pairs from an array to a specified block - * @public + * @access: public */ function assign_block_vars($blockname, $vararray) { @@ -394,7 +394,7 @@ class template * and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars) * * @return false on error, true on success - * @public + * @access: public */ function alter_block_array($blockname, $vararray, $key = false, $mode = 'insert') { @@ -480,7 +480,7 @@ class template /** * Include a seperate template - * @private + * @access: private */ function _tpl_include($filename, $include = true) { diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 87e6cb8169..5f7ba150f4 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_activate * User activation +* @package ucp */ class ucp_activate { diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index c9ae7ed314..08a2549646 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_attachments * User attachments +* @package ucp */ class ucp_attachments { diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 8729b3e854..dd33418054 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -9,7 +9,6 @@ */ /** -* @package VC * ucp_confirm * Visual confirmation * @@ -19,6 +18,8 @@ * to that licence. Do not incorporate this within software * released or distributed in any way under a licence other * than the GPL. We will be watching ... ;) +* +* @package VC */ class ucp_confirm { diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 00da0d9bd6..def101bc5b 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -9,8 +9,8 @@ */ /** -* @package ucp * ucp_groups +* @package ucp */ class ucp_groups { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 9ba40d1a50..6e00a1ed7b 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_main * UCP Front Panel +* @package ucp */ class ucp_main { diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 73b81b0c17..c23456715f 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -8,8 +8,6 @@ */ /** -* @package ucp -* * Private Message Class * * @param int $folder display folder with the id used @@ -30,6 +28,7 @@ * Quoting a PM (action=quote&p=[msg_id]) * Forwarding a PM (action=forward&p=[msg_id]) * +* @package ucp */ class ucp_pm { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 577d89a62a..527c48efa7 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_prefs * Changing user preferences +* @package ucp */ class ucp_prefs { diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 8fa3d1b7a7..82234084da 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_profile * Changing profile settings +* @package ucp */ class ucp_profile { diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 8d59a976be..44c15bfb0e 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_register * Board registration +* @package ucp */ class ucp_register { diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 838cc810ab..9419684725 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_remind * Sending password reminders +* @package ucp */ class ucp_remind { diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 2080feb8be..85ec560d14 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -9,9 +9,9 @@ */ /** -* @package ucp * ucp_resend * Resending activation emails +* @package ucp */ class ucp_resend { diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index df86aae6e4..b5cad8b38b 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -9,8 +9,8 @@ */ /** -* @package ucp * ucp_zebra +* @package ucp */ class ucp_zebra { |