diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 6cc703a5a7..eaa7d3bf7a 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -161,7 +161,7 @@

{L_FORUM_PASSWORD_EXPLAIN}
-
+

{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 03992364dd..4d667d2966 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -38,10 +38,13 @@
+
-

{L_JAB_RESOURCE_EXPLAIN}
-
+

{L_JAB_USE_SSL_EXPLAIN}
+
+
+

{L_JAB_PACKAGE_SIZE_EXPLAIN}
diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 5c3d0077b6..e14e622080 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -129,7 +129,7 @@
{S_HIDDEN_FIELDS} - +
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 2b067cb292..58d742ba62 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -58,6 +58,35 @@ } //--> +
@@ -65,8 +94,8 @@ {L_SELECT_IMAGE} {L_SELECT_IMAGE}:   @@ -80,7 +109,7 @@
-
+
@@ -100,9 +129,19 @@

{L_DIMENSIONS_EXPLAIN}
-
-
+
+
+
+
+

{L_AUTOMATIC_EXPLAIN}
+
+
+
+

{L_AUTOMATIC_EXPLAIN}
+
+
+
diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index eda5a416f4..307ddb75e4 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -173,7 +173,7 @@ - {attach.REAL_FILENAME}
{L_PM}: {L_TOPIC}: {attach.TOPIC_TITLE} + {attach.REAL_FILENAME}
{L_PM}: {L_POST}: {attach.TOPIC_TITLE} {attach.POST_TIME} {attach.SIZE} {attach.DOWNLOAD_COUNT} @@ -184,7 +184,7 @@
-

{L_NO_ENTRIES}

+

{L_USER_NO_ATTACHMENTS}

diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 458cae5d97..f81c56846d 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -191,7 +191,7 @@ a:active { height: 350px; } -.simple-page-body { +#page-body.simple-page-body { padding: 0; padding-right: 10px; min-width: 0; @@ -351,6 +351,12 @@ span.corners-bottom span { margin-left: 2px; } +.rtl #toggle { + left: 75%; + margin-right: 0; + margin-left: 6px; +} + #toggle-handle { display: block; width: 18px; @@ -359,6 +365,11 @@ span.corners-bottom span { background-image: url(../images/toggle.gif); } +.rtl #toggle-handle { + background-image: url(../images/toggle.gif); + background-position: 100% 50%; +} + /* Menu */ #menu { float: left; @@ -721,7 +732,7 @@ option { } option.disabled-option { - color: #aaa; + color: graytext; } .rtl option { diff --git a/phpBB/adm/style/install_convert.html b/phpBB/adm/style/install_convert.html index b17ea838d2..5d52015da6 100755 --- a/phpBB/adm/style/install_convert.html +++ b/phpBB/adm/style/install_convert.html @@ -102,7 +102,7 @@
- +
{options.LEGEND} diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index dd6e615df2..6b361ec3f1 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -22,7 +22,7 @@

{L_UPDATE_INSTALLATION_EXPLAIN}

- +
@@ -100,8 +100,6 @@

{L_PERFORM_DATABASE_UPDATE_EXPLAIN}
-
- » {L_RUN_DATABASE_SCRIPT} «



@@ -109,7 +107,9 @@
- + {L_RUN_DATABASE_SCRIPT} + +
diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index 2fd8142279..794d285574 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -35,7 +35,7 @@ function resize_panel() -

{L_SKIP}

+
+
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index d75d89ab13..4cc4dbd678 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -129,11 +129,17 @@ function switch_menu() main.style.width = '93%'; menu_state = 'hidden'; menu.style.display = 'none'; - toggle.style.left = '0'; toggle.style.width = '20px'; handle.style.backgroundImage = 'url(images/toggle.gif)'; - handle.style.backgroundPosition = '100% 50%'; handle.style.backgroundRepeat = 'no-repeat'; + + + handle.style.backgroundPosition = '0% 50%'; + toggle.style.left = '96%'; + + handle.style.backgroundPosition = '100% 50%'; + toggle.style.left = '0'; + break; // show @@ -141,11 +147,17 @@ function switch_menu() main.style.width = '76%'; menu_state = 'shown'; menu.style.display = 'block'; - toggle.style.left = '15%'; toggle.style.width = '5%'; handle.style.backgroundImage = 'url(images/toggle.gif)'; - handle.style.backgroundPosition = '0% 50%'; handle.style.backgroundRepeat = 'no-repeat'; + + + handle.style.backgroundPosition = '100% 50%'; + toggle.style.left = '75%'; + + handle.style.backgroundPosition = '0% 50%'; + toggle.style.left = '15%'; + break; } } diff --git a/phpBB/adm/style/permission_trace.html b/phpBB/adm/style/permission_trace.html index 96e18c396a..7f7079cc8f 100644 --- a/phpBB/adm/style/permission_trace.html +++ b/phpBB/adm/style/permission_trace.html @@ -46,6 +46,6 @@
- - + + diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index d3efdc45f2..d4821d0d5d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -858,7 +858,7 @@ function get_schema_struct() ), 'PRIMARY_KEY' => array('role_id', 'auth_option_id'), 'KEYS' => array( - 'ath_opt_id' => array('INDEX', 'auth_option_id'), + 'ath_op_id' => array('INDEX', 'auth_option_id'), ), ); @@ -1256,7 +1256,7 @@ function get_schema_struct() 'enable_magic_url' => array('BOOL', 1), 'enable_sig' => array('BOOL', 1), 'post_username' => array('VCHAR_UNI:255', ''), - 'post_subject' => array('XSTEXT_UNI', ''), + 'post_subject' => array('XSTEXT_UNI', '', 'true_sort'), 'post_text' => array('MTEXT_UNI', ''), 'post_checksum' => array('VCHAR:32', ''), 'post_attachment' => array('BOOL', 0), @@ -1643,7 +1643,7 @@ function get_schema_struct() ), 'PRIMARY_KEY' => 'image_id', 'KEYS' => array( - 'i_id' => array('INDEX', 'imageset_id'), + 'i_d' => array('INDEX', 'imageset_id'), ), ); diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index ce19c2a374..047c61fd66 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -378,8 +378,12 @@ fclose($fp); */ $cheats = array( '00DF' => 'ss', # German sharp S + '00C5' => 'ae', # Capital A with diaeresis + '00E4' => 'ae', # Small A with diaeresis '00D6' => 'oe', # Capital O with diaeresis '00F6' => 'oe', # Small O with diaeresis + '00DC' => 'ue', # Capital U with diaeresis + '00FC' => 'ue', # Small U with diaeresis ); /** diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index 02866d7dc1..8033dcea0b 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -18,7 +18,7 @@ phpBB Developers : DavidMJ (David M.) kellanved (Henry Sudhof) naderman (Nils Adermann) subBlue (Tom Beddard) - Vic (Vic D'elfant) + Vic D'Elfant (Vic D'Elfant) -- Previous Contributors -- @@ -46,7 +46,7 @@ Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/ GPL licenced: phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/ -Jabber Class (c) 2004 Nathan Fritz, http://cjphp.netflint.net +Jabber Class (c) 2006 Flyspray.org, http://www.flyspray.org/ Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/ Horde Project (c) 2000-2006, The Horde Project. http://horde.org/ diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 28e8cd63db..72fb2d5ad4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -1,4 +1,3 @@ - @@ -33,8 +32,8 @@ p { font-size: 8pt; } -hr { - height: 0; +hr { + height: 0; border: solid #D1D7DC 0; border-top-width: 1px; } @@ -93,7 +92,7 @@ h3 { } code { - color: #006600; + color: #006600; font-weight: normal; font-family: 'Courier New', monospace; border-color: #D1D7DC; @@ -185,7 +184,120 @@ p a {
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index e67e9b2a10..185e18b7e0 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -33,8 +33,8 @@ p { font-size: 8pt; } -hr { - height: 0; +hr { + height: 0; border: solid #D1D7DC 0; border-top-width: 1px; } @@ -93,7 +93,7 @@ h3 { } code { - color: #006600; + color: #006600; font-weight: normal; font-family: 'Courier New', monospace; border-color: #D1D7DC; @@ -189,6 +189,7 @@ p a {
  • Requirements before converting
  • Converting
  • Things to do after conversion
  • +
  • Common conversion problems
  • Important (security related) post-Install tasks for all installation methods @@ -264,7 +265,7 @@ p a {

    3. New installation

    - +

    Installation of phpBB3 will vary according to your server and database. If you have shell access to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.

    If you do not have shell access or do not wish to use it you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP ALL the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do NOT force filenames to all lower or upper case doing so will cause errors later.

    @@ -427,9 +428,11 @@ p a {

    -

    Before converting we heavily recommend you do a full backup of your database and files! If you are unsure how to achieve this please ask your hosting provider for advice. In order to convert, you need to have a new phpBB3 installation within the same database (but with a different prefix) as your old 2.0.x installation. You basically need to follow the basic instructions given for New installations. Please do not overwrite any old files - install phpBB3 at a different location.

    +

    Before converting we heavily recommend you do a full backup of your database and files! If you are unsure how to achieve this please ask your hosting provider for advice. You basically need to follow the basic instructions given for New installations. Please do not overwrite any old files - install phpBB3 at a different location.

    Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.

    + +

    Note that the conversion requires CREATE and DROP privileges for the phpBB3's database user account.

    Top

    @@ -441,8 +444,8 @@ p a {

    To begin the conversion visit the install folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab Convert. Click this tab.

    -

    As with install the conversion is automated. Your previous 2.0.x database tables will not be touched as well as the original 2.0.x files remaining untouched. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend you disable your old installation while converting, else you may have inconsistent data after the conversion.

    - +

    As with install the conversion is automated. Your previous 2.0.x database tables will not be changed as well as the original 2.0.x files remaining unaltered. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend you disable your old installation while converting, else you may have inconsistent data after the conversion.

    +

    Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server or other timeout issues). If this is the case you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful).

    Once completed your board should be immediately available. If you encountered errors you should report the problems to our bug tracker or seek help via our forums (see README for details).

    @@ -461,12 +464,36 @@ p a {

    Within the conversion the search index has not been created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within Admin -> Maintenance -> Database -> Search Index.

    +

    After verifying the settings in the ACP, you can delete the install directory to enable the board. The board will stay disabled until you do so.

    +

    Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.

    Top

    +5.iv. Common conversion problems +

    + +
    + +

    Broken non-latin characters The conversion script assumes that the database encoding in the source phpBB2 matches the encoding defined in the lang_main.php file of the default language pack of the source installation. Edit that file to match the database's encoding and re-start the conversion procedure.

    + +

    http 500 / white pages The conversion is a load-heavy procedure. Restrictions imposed by some server hosting providers can cause problems. The most common causes are: too low values for the php settings memory_limit and max_execution_time. Limits on the allowed CPU time are also a frequent cause for such errors, as are caps on the number of database queries allowed. If you cannot change such settings, then contact your hosting provider or run the conversion procedure on a different computer. The phpBB.com forums are also an excellent location to ask for support.

    + +

    Password conversion Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the "forgotten password" function.

    + +

    Path to your former board The converter expects the relative path to your old board's files. So, -for instance - if the new board is located at http://www.yourdomain.com/forum and the phpBB3 is located at http://www.yourdomain.com/phpBB3, then the correct value would be ../forum. Note that the webserver user must be able to access the source installation's files.

    + +

    Missing images If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.

    + +

    Smilies During the conversion you might see warnings about image files where the copying failed. That can happen if the old board's smilies have the same file names as those on the new board. Copy those files manually after the conversion, if you want to continue using the old smilies.

    + +
    +Top +

    + +

    6. Important (security related) post-Install tasks for all installation methods

    @@ -476,6 +503,7 @@ p a {

    Once you have succssfully installed phpBB3 you MUST ensure you remove the entire install/ directory. Leaving the install directory in place is a very serious potential security issue which may lead to deletion or alteration of files, etc. Please note that until this directory is not removed phpBB3 will not operate and a warning message will be displayed. Beyond this essential deletion you may also wish to delete the docs/ directories if you wish.

    With these directories deleted you should proceed to the administration panel. Depending on how the installation completed you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the Administration Panel link at the bottom of any page. Ensure that details specified in Admin -> General are correct!

    + Top

    diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index ee1decea1c..65c1f9026d 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -1,10 +1,10 @@ array( - '!([a-z0-9]+://)?([^< "\r\n\t\]]*)!ie' => "(('\$1') ? '\$1\$2' : 'http://\$2')" + '!([a-z0-9]+://)?([^< "\r\n\t\]]*?)!ie' => "(('\$1') ? '\$1\$2' : 'http://\$2')" ), 'LOCAL_URL' => array( - '!([^:]+/[^< "\r\n\t\]]*)!' => '$1' + '!([^:]+/[^< "\r\n\t\]]*?)!' => '$1' ), 'EMAIL' => array( '!([a-z0-9]+[a-z0-9\-\._]*@(?:(?:[0-9]{1,3}\.){3,5}[0-9]{1,3}|[a-z0-9]+[a-z0-9\-\._]*\.[a-z]+))!i' => '$1' @@ -383,10 +383,18 @@ class acp_bbcodes // Lowercase tags $bbcode_tag = preg_replace('/.*?\[([a-z0-9_-]+=?).*/i', '$1', $bbcode_match); - $fp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_match); - $fp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $fp_replace); - $sp_match = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_match); - $sp_replace = preg_replace('#\[/?' . $bbcode_tag . '#ie', "strtolower('\$0')", $sp_replace); + $bbcode_search = preg_replace('/.*?\[([a-z0-9_-]+)=?.*/i', '$1', $bbcode_match); + + if (!preg_match('/^[a-zA-Z0-9_-]+=?$/', $bbcode_tag)) + { + global $user; + trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $fp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_match); + $fp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_replace); + $sp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_match); + $sp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_replace); return array( 'bbcode_tag' => $bbcode_tag, diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 1294f77a0d..c3b6d922b2 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -1,10 +1,10 @@ array('lang' => 'SITE_DESC', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => false), 'board_disable' => array('lang' => 'DISABLE_BOARD', 'validate' => 'bool', 'type' => 'custom', 'method' => 'board_disable', 'explain' => true), 'board_disable_msg' => false, - 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'string', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), + 'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false), 'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true), 'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'string', 'type' => 'select', 'function' => 'tz_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => false), 'board_dst' => array('lang' => 'SYSTEM_DST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -114,7 +114,7 @@ class acp_board 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), - 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'legend2' => 'GENERAL_OPTIONS', 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -125,7 +125,7 @@ class acp_board 'print_pm' => array('lang' => 'ALLOW_PRINT_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'forward_pm' => array('lang' => 'ALLOW_FORWARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'auth_flash_pm' => array('lang' => 'ALLOW_FLASH_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'enable_pm_icons' => array('lang' => 'ENABLE_PM_ICONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false) ) ); @@ -139,6 +139,7 @@ class acp_board 'allow_topic_notify' => array('lang' => 'ALLOW_TOPIC_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_forum_notify' => array('lang' => 'ALLOW_FORUM_NOTIFY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), + 'allow_post_flash' => array('lang' => 'ALLOW_POST_FLASH', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_post_links' => array('lang' => 'ALLOW_POST_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -147,7 +148,7 @@ class acp_board 'legend2' => 'POSTING', 'bump_type' => false, - 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 0f38d6663b..ced09a4708 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1,10 +1,10 @@ $substract) { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = 0 + WHERE user_id = ' . $poster_id . ' + AND user_posts < ' . $substract; + $db->sql_query($sql); $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = user_posts - ' . $substract . ' - WHERE user_id = ' . $poster_id; + WHERE user_id = ' . $poster_id . ' + AND user_posts >= ' . $substract; $db->sql_query($sql); } } diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index d40a8ae47b..07088de75d 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -359,7 +359,7 @@ class acp_groups { if (isset($group_row['group_avatar']) && $group_row['group_avatar']) { - avatar_delete('group', $group_row); + avatar_delete('group', $group_row, true); } } diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index d58fef14f1..9f02530b27 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -1,10 +1,10 @@ lang['JAB_SETTINGS_CHANGED']; - $log = 'JAB_SETTINGS_CHANGED'; - - // Are changing (or initialising) a new host or username? If so run some checks and - // try to create account if it doesn't exist - if ($jab_enable) + if ($submit) { - if (($jab_host != $config['jab_host'] || $jab_username != $config['jab_username']) && $jab_username) + $error = array(); + + $message = $user->lang['JAB_SETTINGS_CHANGED']; + $log = 'JAB_SETTINGS_CHANGED'; + + // Is this feature enabled? Then try to establish a connection + if ($jab_enable) { + $jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_use_ssl); + if (!$jabber->connect()) { - trigger_error($user->lang['ERR_JAB_CONNECT'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang['ERR_JAB_CONNECT'] . '

    ' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); } - // First we'll try to authorise using this account, if that fails we'll try to create it. - if (!($result = $jabber->send_auth())) + // We'll try to authorise using this account + if (!$jabber->login()) { - if (($result = $jabber->account_registration($config['board_email'], $config['sitename'])) <> 2) - { - $error[] = ($result == 1) ? $user->lang['ERR_JAB_USERNAME'] : sprintf($user->lang['ERR_JAB_REGISTER'], $result); - } - else - { - $message = $user->lang['JAB_REGISTERED']; - $log = 'JAB_REGISTER'; - } - } - else - { - $message = $user->lang['JAB_CHANGED']; - $log = 'JAB_CHANGED'; + trigger_error($user->lang['ERR_JAB_AUTH'] . '

    ' . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); } - sleep(1); $jabber->disconnect(); } - else if ($jab_password != $config['jab_password']) - { - if (!$jabber->connect()) - { - trigger_error($user->lang['ERR_JAB_CONNECT'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); - } - if (!$jabber->send_auth()) - { - trigger_error($user->lang['ERR_JAB_AUTH'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); - } - $jabber->send_presence(NULL, NULL, 'online'); + set_config('jab_enable', $jab_enable); + set_config('jab_host', $jab_host); + set_config('jab_port', $jab_port); + set_config('jab_username', $jab_username); + set_config('jab_password', $jab_password); + set_config('jab_package_size', $jab_package_size); + set_config('jab_use_ssl', $jab_use_ssl); - if (($result = $jabber->change_password($jab_password)) <> 2) - { - $error[] = ($result == 1) ? $user->lang['ERR_JAB_PASSCHG'] : sprintf($user->lang['ERR_JAB_PASSFAIL'], $result); - } - else - { - $message = $user->lang['JAB_PASS_CHANGED']; - $log = 'JAB_PASSCHG'; - } - - sleep(1); - $jabber->disconnect(); - } - } - - // Pull relevant config data - $sql = 'SELECT * - FROM ' . CONFIG_TABLE . " - WHERE config_name LIKE 'jab_%'"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $config_name = $row['config_name']; - $config_value = $row['config_value']; - - $default_config[$config_name] = $config_value; - $new[$config_name] = (isset($_POST[$config_name])) ? request_var($config_name, '') : $default_config[$config_name]; - - if ($submit && !sizeof($error)) - { - set_config($config_name, $new[$config_name]); - } - } - - if ($submit && !sizeof($error)) - { add_log('admin', 'LOG_' . $log); trigger_error($message . adm_back_link($this->u_action)); } - if (sizeof($error)) - { - $template->assign_vars(array( - 'S_WARNING' => true, - 'WARNING_MSG' => implode('
    ', $error)) - ); - } - $template->assign_vars(array( 'U_ACTION' => $this->u_action, - 'JAB_ENABLE' => $new['jab_enable'], + 'JAB_ENABLE' => $jab_enable, 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '', ''), - 'JAB_HOST' => $new['jab_host'], - 'JAB_PORT' => $new['jab_port'], - 'JAB_USERNAME' => $new['jab_username'], - 'JAB_PASSWORD' => $new['jab_password'], - 'JAB_RESOURCE' => $new['jab_resource'], - 'JAB_PACKAGE_SIZE' => $new['jab_package_size']) - ); + 'JAB_HOST' => $jab_host, + 'JAB_PORT' => $jab_port, + 'JAB_USERNAME' => $jab_username, + 'JAB_PASSWORD' => $jab_password, + 'JAB_PACKAGE_SIZE' => $jab_package_size, + 'JAB_USE_SSL' => $jab_use_ssl, + 'S_CAN_USE_SSL' => jabber::can_use_ssl(), + )); } } diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 4728168a82..674468a862 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -239,7 +239,7 @@ class acp_permission_roles { $sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '{$permission_type}%' + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . " AND auth_option <> '{$permission_type}' ORDER BY auth_option_id"; $result = $db->sql_query($sql); @@ -305,7 +305,7 @@ class acp_permission_roles // We need to fill the auth options array with ACL_NO options ;) $sql = 'SELECT auth_option_id, auth_option FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '{$permission_type}%' + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . " AND auth_option <> '{$permission_type}' ORDER BY auth_option_id"; $result = $db->sql_query($sql); @@ -490,7 +490,7 @@ class acp_permission_roles // Get complete auth array $sql = 'SELECT auth_option, auth_option_id FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char); $result = $db->sql_query($sql); $auth_settings = array(); diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 71c2c764ed..3a7318231b 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -1,10 +1,10 @@ array(0 => 0))); // User or group to be set? $ug_type = (sizeof($user_id)) ? 'user' : 'group'; @@ -616,7 +616,7 @@ class acp_permissions $assigned_role = (isset($_POST['role'][$ug_id][$forum_id])) ? (int) $_POST['role'][$ug_id][$forum_id] : 0; // Do the admin want to set these permissions to other items too? - $inherit = request_var('inherit', array(0)); + $inherit = request_var('inherit', array(0 => array(0))); $ug_id = array($ug_id); $forum_id = array($forum_id); @@ -1069,8 +1069,8 @@ class acp_permissions global $db, $user; $sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0'); - $sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; - + $sql_permission_option = ' AND o.auth_option ' . $db->sql_like_expression($permission_type . $db->any_char); + $sql = $db->sql_build_query('SELECT_DISTINCT', array( 'SELECT' => 'u.username, u.username_clean, u.user_regdate, u.user_id', diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index da11868cc2..1041acc962 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -1,10 +1,10 @@ vars['columns'] = $row_col[1]; } } - - if ($field_type == FIELD_DATE && $key == 'field_default_value') + else if ($field_type == FIELD_DATE && $key == 'field_default_value') { $always_now = request_var('always_now', 0); @@ -542,12 +540,17 @@ class acp_profile { $cp->vars[$key] = $$key; } - else if ($key == 'l_lang_options' && sizeof($cp->vars[$key]) > 1) + else if ($key == 'l_lang_options' && $field_type == FIELD_BOOL) + { + $cp->vars[$key] = request_var($key, array(0 => array('')), true); + } + else if ($key == 'l_lang_options' && is_array($cp->vars[$key])) { foreach ($cp->vars[$key] as $lang_id => $options) { $cp->vars[$key][$lang_id] = explode("\n", $options); } + } } @@ -622,13 +625,27 @@ class acp_profile foreach ($key_ary as $key) { - if (!isset($_REQUEST[$key])) + if ($field_type == FIELD_TEXT && $key == 'field_length' && isset($_REQUEST['rows'])) { - $var = false; + $cp->vars['rows'] = request_var('rows', 0); + $cp->vars['columns'] = request_var('columns', 0); + $_new_key_ary[$key] = $cp->vars['rows'] . '|' . $cp->vars['columns']; + } + if ($field_type == FIELD_BOOL && $key == 'l_lang_options' && isset($_REQUEST['l_lang_options'])) + { + $_new_key_ary[$key] = request_var($key, array(array('')), true); + } else { - $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? request_var($key, array(''), true) : request_var($key, '', true); + if (!isset($_REQUEST[$key])) + { + $var = false; + } + else + { + $_new_key_ary[$key] = (is_array($_REQUEST[$key])) ? request_var($key, array(''), true) : request_var($key, '', true); + } } } @@ -899,7 +916,7 @@ class acp_profile foreach ($options as $field => $field_type) { $value = ($action == 'create') ? request_var('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field]; - + if ($field == 'lang_options') { $var = ($action == 'create' || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['lang_options'][$lang_id]; @@ -1073,8 +1090,14 @@ class acp_profile $cp->vars['l_lang_name'] = request_var('l_lang_name', array(0 => ''), true); $cp->vars['l_lang_explain'] = request_var('l_lang_explain', array(0 => ''), true); $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => ''), true); - $cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true); - + if ($field_type != FIELD_BOOL) + { + $cp->vars['l_lang_options'] = request_var('l_lang_options', array(0 => ''), true); + } + else + { + $cp->vars['l_lang_default_value'] = request_var('l_lang_default_value', array(0 => array('')), true); + } if ($cp->vars['lang_options']) { if (!is_array($cp->vars['lang_options'])) @@ -1508,7 +1531,7 @@ class acp_profile case 'oracle': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. - $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" "; + $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD $field_ident "; switch ($field_type) { diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index e4defd9d42..14885394e6 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -230,6 +230,7 @@ class acp_prune if ($prune) { $action = request_var('action', 'deactivate'); + $deleteposts = request_var('deleteposts', 0); if (confirm_box(true)) { @@ -361,7 +362,6 @@ class acp_prune global $user, $db; $users = request_var('users', '', true); - $deleteposts = request_var('deleteposts', 0); if ($users) { @@ -393,8 +393,8 @@ class acp_prune $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); $where_sql = ''; - $where_sql .= ($username) ? " AND username_clean LIKE '" . $db->sql_escape(str_replace('*', '%', utf8_clean_string($username))) . "'" : ''; - $where_sql .= ($email) ? " AND user_email LIKE '" . $db->sql_escape(str_replace('*', '%', $email)) . "' " : ''; + $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; + $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; $where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : ''; $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; $where_sql .= (sizeof($active)) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) : ''; diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 1c62982a56..27c3157723 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -1,10 +1,10 @@ assign_vars(array( 'S_CONTINUE_INDEXING' => $this->state[1], 'U_CONTINUE_INDEXING' => $this->u_action . '&action=' . $this->state[1], - 'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_INDEX_DELETING'], - 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_INDEX_DELETING_EXPLAIN']) + 'L_CONTINUE' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING'] : $user->lang['CONTINUE_DELETING_INDEX'], + 'L_CONTINUE_EXPLAIN' => ($this->state[1] == 'create') ? $user->lang['CONTINUE_INDEXING_EXPLAIN'] : $user->lang['CONTINUE_DELETING_INDEX_EXPLAIN']) ); } } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index b876cc2d65..9f2b3579e8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1,10 +1,10 @@ $img_ary) { if ($type !== 'lang' || $sql_extra) @@ -1424,7 +1431,8 @@ parse_css_file = {PARSE_CSS_FILE} $selected = (!empty($imgname) && strpos($image_filename, $imgtext) !== false); if ($selected) { - $template->assign_var('IMAGE_SELECT', true); + $image_found = true; + $img_val = htmlspecialchars($img); } $template->assign_block_vars('imagesetlist.images', array( 'SELECTED' => $selected, @@ -1442,13 +1450,15 @@ parse_css_file = {PARSE_CSS_FILE} 'L_TITLE' => $user->lang[$this->page_title], 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'], 'IMAGE_OPTIONS' => $img_options, - 'IMAGELIST_OPTIONS' => $imagesetlist_options, - 'IMAGE_SIZE' => $imgsize_bool, - 'IMAGE_REQUEST' => $image_request, + 'IMAGE_SIZE' => $image_width, + 'IMAGE_HEIGHT' => $image_height, + 'IMAGE_REQUEST' => (empty($image_filename)) ? 'images/no_image.png' : $image_request, 'U_ACTION' => $this->u_action . "&action=edit&id=$imageset_id", 'U_BACK' => $this->u_action, 'NAME' => $imageset_name, - 'ERROR' => !$valid_name + 'ERROR' => !$valid_name, + 'IMG_SRC' => ($image_found) ? '../styles/' . $imageset_path . '/imageset/' . $img_val : 'images/no_image.png', + 'IMAGE_SELECT' => $image_found )); } @@ -1461,12 +1471,14 @@ parse_css_file = {PARSE_CSS_FILE} $new_id = request_var('new_id', 0); $update = (isset($_POST['update'])) ? true : false; + $sql_where = ''; switch ($mode) { case 'style': $sql_from = STYLES_TABLE; $sql_select = 'style_name'; + $sql_where = 'AND style_active = 1'; break; case 'template': @@ -1501,7 +1513,8 @@ parse_css_file = {PARSE_CSS_FILE} $sql = "SELECT {$mode}_id, {$mode}_name FROM $sql_from - WHERE {$mode}_id <> $style_id + WHERE {$mode}_id <> $style_id + $sql_where ORDER BY {$mode}_name ASC"; $result = $db->sql_query($sql); @@ -1544,14 +1557,14 @@ parse_css_file = {PARSE_CSS_FILE} set_config('default_style', $new_id); } } - else if ($mode == 'imageset') - { - $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " - WHERE imageset_id = $style_id"; - $db->sql_query($sql); - } else { + if ($mode == 'imageset') + { + $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " + WHERE imageset_id = $style_id"; + $db->sql_query($sql); + } $sql = 'UPDATE ' . STYLES_TABLE . " SET {$mode}_id = $new_id WHERE {$mode}_id = $style_id"; diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index a1a5dbaf3a..02d4c6bb3c 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -1,10 +1,10 @@ u_action)); + trigger_error($errstr, E_USER_WARNING); } $info = explode("\n", $info); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 0a09926156..ccb7589aee 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1,10 +1,10 @@ lang['CANNOT_SET_FOUNDER_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + trigger_error($user->lang['CANNOT_SET_FOUNDER_IGNORED'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } if ($user_row['user_type'] == USER_INACTIVE) @@ -970,7 +970,7 @@ class acp_users 'aim' => request_var('aim', $user_row['user_aim']), 'msn' => request_var('msn', $user_row['user_msnm']), 'yim' => request_var('yim', $user_row['user_yim']), - 'jabber' => request_var('jabber', $user_row['user_jabber']), + 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)), 'website' => request_var('website', $user_row['user_website']), 'location' => utf8_normalize_nfc(request_var('location', $user_row['user_from'], true)), 'occupation' => utf8_normalize_nfc(request_var('occupation', $user_row['user_occ'], true)), @@ -999,7 +999,7 @@ class acp_users 'msn' => array('string', true, 5, 255), 'jabber' => array( array('string', true, 5, 255), - array('match', true, '#^[^@:\'"<>&\x00-\x1F\x7F\t\r\n]+@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}(/.*)?$#iu')), + array('jabber')), 'yim' => array('string', true, 5, 255), 'website' => array( array('string', true, 12, 255), @@ -1067,7 +1067,7 @@ class acp_users foreach ($cp_data as $key => $value) { - $cp_data[$right_delim . $key . $left_delim] = $value; + $cp_data[$left_delim . $key . $right_delim] = $value; unset($cp_data[$key]); } @@ -1149,7 +1149,7 @@ class acp_users $data = array( 'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true), - 'lang' => request_var('lang', $user_row['user_lang']), + 'lang' => basename(request_var('lang', $user_row['user_lang'])), 'tz' => request_var('tz', (float) $user_row['user_timezone']), 'style' => request_var('style', $user_row['user_style']), 'dst' => request_var('dst', $user_row['user_dst']), @@ -1616,7 +1616,7 @@ class acp_users } else { - $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}#{$row['post_msg_id']}"); + $view_topic = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_id']}&p={$row['post_msg_id']}") . '#p' . $row['post_msg_id']; } $template->assign_block_vars('attach', array( @@ -1830,19 +1830,14 @@ class acp_users { // Select auth options $sql = 'SELECT auth_option, is_local, is_global - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_'"; - - if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') - { - $sql .= " ESCAPE '\\' "; - } - - $sql .= 'AND is_global = 1 + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE auth_option ' . $db->sql_like_expression($db->any_char . '_') . ' + AND is_global = 1 ORDER BY auth_option'; $result = $db->sql_query($sql); $hold_ary = array(); + while ($row = $db->sql_fetchrow($result)) { $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); @@ -1856,15 +1851,9 @@ class acp_users { $sql = 'SELECT auth_option, is_local, is_global FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_'"; - - if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') - { - $sql .= " ESCAPE '\\' "; - } - - $sql .= 'AND is_local = 1 - ORDER BY is_global DESC, auth_option'; + WHERE auth_option " . $db->sql_like_expression($db->any_char . '_') . " + AND is_local = 1 + ORDER BY is_global DESC, auth_option"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 669613c589..7d0b00cc25 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -587,7 +587,8 @@ class auth_admin extends auth // Get forum names $sql = 'SELECT forum_id, forum_name FROM ' . FORUMS_TABLE . ' - WHERE ' . $db->sql_in_set('forum_id', array_keys($hold_ary)); + WHERE ' . $db->sql_in_set('forum_id', array_keys($hold_ary)) . ' + ORDER BY left_id'; $result = $db->sql_query($sql); $forum_names = array(); @@ -597,16 +598,12 @@ class auth_admin extends auth } $db->sql_freeresult($result); - foreach ($hold_ary as $forum_id => $auth_ary) + foreach ($forum_names as $forum_id => $forum_name) { - // If there is no forum present the database holds auth information for a non-existent forum... continue then - if ($forum_id && !isset($forum_names[$forum_id])) - { - continue; - } + $auth_ary = $hold_ary[$forum_id]; $template->assign_block_vars('role_mask', array( - 'NAME' => ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_names[$forum_id], + 'NAME' => ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_name, 'FORUM_ID' => $forum_id) ); @@ -969,20 +966,9 @@ class auth_admin extends auth if ($permission_type !== false) { // Get permission type - if ($db->sql_layer == 'sqlite') - { - $sql = 'SELECT auth_option, auth_option_id - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; - } - else - { - $sql = 'SELECT auth_option, auth_option_id - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '" . $db->sql_escape(str_replace('_', "\_", $permission_type)) . "%'"; - $sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; - } - + $sql = 'SELECT auth_option, auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char); $result = $db->sql_query($sql); $auth_id_ary = array(); diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 3b05652a87..76d6036c77 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -1,10 +1,10 @@ sql_layer !== 'sqlite') - { - $sql_opts = "AND $key LIKE '" . $db->sql_escape(str_replace('_', "\_", $auth_options)) . "'"; - $sql_opts .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\' " : ''; - } - else - { - $sql_opts = "AND $key LIKE '" . $db->sql_escape($auth_options) . "'"; - } + $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->any_char, $auth_options)); } else { @@ -881,16 +873,7 @@ class auth { if (strpos($option, '%') !== false) { - if (strpos($option, '_') !== false && $db->sql_layer !== 'sqlite') - { - $_sql = $key . " LIKE '" . $db->sql_escape(str_replace('_', "\_", $option)) . "'"; - $_sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; - $sql[] = $_sql; - } - else - { - $sql[] = $key . " LIKE '" . $db->sql_escape($option) . "'"; - } + $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->any_char, $option)); } else { diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index 1f22d60a7f..97b98e1227 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -1,10 +1,10 @@ sql_fetchrow($result)) { - $usernames[] = utf8_clean_string(str_replace('%', '.*?', preg_quote($row['disallow_username'], '$#'))); + $usernames[] = str_replace('%', '.*?', preg_quote(utf8_clean_string($row['disallow_username']), '#')); } $db->sql_freeresult($result); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 8ecb7627e5..aa8adda86c 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -49,6 +49,12 @@ class dbal */ var $sql_layer = ''; + /** + * Wildcards for matching any (%) or exactly one (_) character within LIKE expressions + */ + var $any_char; + var $one_char; + /** * Constructor */ @@ -63,6 +69,10 @@ class dbal // Fill default sql layer based on the class being called. // This can be changed by the specified layer itself later if needed. $this->sql_layer = substr(get_class($this), 5); + + // Do not change this please! This variable is used to easy the use of it - and is hardcoded. + $this->any_char = chr(0) . '%'; + $this->one_char = chr(0) . '_'; } /** @@ -191,6 +201,21 @@ class dbal return false; } + /** + * Correctly adjust LIKE expression for special characters + * Some DBMS are handling them in a different way + * + * @param string $expression The expression to use. Every wildcard is escaped, except $this->any_char and $this->one_char + * @return string LIKE expression including the keyword! + */ + function sql_like_expression($expression) + { + $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression); + $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression); + + return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\''); + } + /** * SQL Transaction * @access private diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 4b3a15dd8d..d9200ee182 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -27,6 +27,7 @@ class dbal_firebird extends dbal { var $last_query_text = ''; var $service_handle = false; + var $affected_rows = 0; /** * Connect to server @@ -109,13 +110,11 @@ class dbal_firebird extends dbal if ($this->query_result === false) { - $prepared = false; + $array = array(); // We overcome Firebird's 32767 char limit by binding vars if (strlen($query) > 32767) { - $array = array(); - - if (preg_match('/^(INSERT INTO[^(]+)\\(([^()]+)\\) VALUES[^(]+\\((.*?)\\)$/s', $query, $regs)) + if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s', $query, $regs)) { if (strlen($regs[3]) > 32767) { @@ -134,45 +133,55 @@ class dbal_firebird extends dbal } $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; - unset($art); - - $prepared = true; } } - else if (preg_match_all('/^(UPDATE ([\\w_]++)\\s+SET )(\\w+ = (?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:, \\w+ = (?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) + else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data)) { - if (strlen($data[0][3]) > 32767) + if (strlen($data[3]) > 32767) { - $update = $data[0][1]; - $where = $data[0][4]; - preg_match_all('/(\\w++) = (\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][3], $temp, PREG_SET_ORDER); + $update = $data[1]; + $where = $data[4]; + preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[3], $temp, PREG_SET_ORDER); unset($data); - $art = array(); + $cols = array(); foreach ($temp as $value) { if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 32769) // check to see if this thing is greater than the max + 'x2 { $array[] = str_replace("''", "'", substr($value[2], 1, -1)); - $art[] = $value[1] . '=?'; + $cols[] = $value[1] . '=?'; } else { - $art[] = $value[1] . '=' . $value[2]; + $cols[] = $value[1] . '=' . $value[2]; } } - $query = $update . implode(', ', $art) . ' ' . $where; - unset($art); - - $prepared = true; + $query = $update . implode(', ', $cols) . ' ' . $where; + unset($cols); } } } - if ($prepared) + if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+))*+\s+(WHERE.*)$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*WHERE\s*(.*)$/s', $query, $regs))) { - $p_query = ibase_prepare($this->db_connect_id, $query); + $affected_sql = 'SELECT COUNT(*) as num_rows_affected FROM ' . $regs[1] . ' ' . $regs[2]; + + if (!($temp_q_id = @ibase_query($this->db_connect_id, $affected_sql))) + { + return false; + } + + $temp_result = @ibase_fetch_assoc($temp_q_id); + @ibase_free_result($temp_q_id); + + $this->affected_rows = ($temp_result) ? $temp_result['NUM_ROWS_AFFECTED'] : false; + } + + if (sizeof($array)) + { + $p_query = @ibase_prepare($this->db_connect_id, $query); array_unshift($array, $p_query); $this->query_result = call_user_func_array('ibase_execute', $array); unset($array); @@ -252,7 +261,7 @@ class dbal_firebird extends dbal } else { - return ($this->query_result) ? true : false; + return $this->affected_rows; } } @@ -298,7 +307,7 @@ class dbal_firebird extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -399,6 +408,15 @@ class dbal_firebird extends dbal return str_replace("'", "''", $msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + /** * Build db-specific query data * @access private diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index bbbe8a6de3..422a5d44a4 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -36,6 +36,8 @@ class dbal_mssql extends dbal $this->dbname = $database; @ini_set('mssql.charset', 'UTF-8'); + @ini_set('mssql.textlimit', 2147483647); + @ini_set('mssql.textsize', 2147483647); $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mssql_connect($this->server, $this->user, $sqlpassword, $new_link); @@ -236,7 +238,7 @@ class dbal_mssql extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -306,6 +308,15 @@ class dbal_mssql extends dbal return str_replace("'", "''", $msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + /** * return sql error array * @access private @@ -372,35 +383,22 @@ class dbal_mssql extends dbal switch ($mode) { case 'start': - $explain_query = $query; - if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) + $html_table = false; + @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id); + if ($result = @mssql_query($query, $this->db_connect_id)) { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - - if (preg_match('/^SELECT/', $explain_query)) - { - $html_table = false; - @mssql_query('SET SHOWPLAN_TEXT ON;', $this->db_connect_id); - if ($result = @mssql_query($explain_query, $this->db_connect_id)) + @mssql_next_result($result); + while ($row = @mssql_fetch_row($result)) { - @mssql_next_result($result); - while ($row = @mssql_fetch_row($result)) - { - $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); - } + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); } - @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id); - @mssql_free_result($result); + } + @mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id); + @mssql_free_result($result); - if ($html_table) - { - $this->html_hold .= ''; - } + if ($html_table) + { + $this->html_hold .= ''; } break; diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 52942ac3bd..290142103f 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -43,8 +43,7 @@ class dbal_mssql_odbc extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; - // - // @ini_set('odbc.defaultlrl', '32M'); + @ini_set('odbc.defaultlrl', 65536); $this->db_connect_id = ($this->persistency) ? @odbc_pconnect($this->server, $this->user, $sqlpassword) : @odbc_connect($this->server, $this->user, $sqlpassword); @@ -226,7 +225,7 @@ class dbal_mssql_odbc extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -320,6 +319,15 @@ class dbal_mssql_odbc extends dbal return str_replace("'", "''", $msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + /** * Build db-specific query data * @access private @@ -359,36 +367,6 @@ class dbal_mssql_odbc extends dbal switch ($mode) { case 'start': - $explain_query = $query; - if (preg_match('/UPDATE ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - else if (preg_match('/DELETE FROM ([a-z0-9_]+).*?WHERE(.*)/s', $query, $m)) - { - $explain_query = 'SELECT * FROM ' . $m[1] . ' WHERE ' . $m[2]; - } - - if (preg_match('/^SELECT/', $explain_query)) - { - $html_table = false; - @odbc_exec($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;'); - if ($result = @odbc_exec($this->db_connect_id, $explain_query)) - { - @odbc_next_result($result); - while ($row = @odbc_fetch_array($result)) - { - $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); - } - } - @odbc_exec($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;'); - @odbc_free_result($result); - - if ($html_table) - { - $this->html_hold .= ''; - } - } break; case 'fromcache': diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index c20e73315a..71a2002eb4 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -212,7 +212,7 @@ class dbal_mysql extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -276,6 +276,15 @@ class dbal_mysql extends dbal return @mysql_real_escape_string($msg, $this->db_connect_id); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression; + } + /** * Build db-specific query data * @access private diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 6f54b5c8b3..660188d1c7 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -192,7 +192,7 @@ class dbal_mysqli extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -245,6 +245,15 @@ class dbal_mysqli extends dbal return @mysqli_real_escape_string($this->db_connect_id, $msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression; + } + /** * Build db-specific query data * @access private @@ -408,7 +417,6 @@ class dbal_mysqli extends dbal break; } - @mysqli_query($this->db_connect_id, "SET profiling = 0;"); } } diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 9c0491d8c8..76a920d4b8 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -1,10 +1,10 @@ user = $sqluser; $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; - - $this->db_connect_id = ($new_link) ? @ocinlogon($this->user, $sqlpassword, $this->dbname, 'UTF8') : (($this->persistency) ? @ociplogon($this->user, $sqlpassword, $this->dbname, 'UTF8') : @ocinlogon($this->user, $sqlpassword, $this->dbname, 'UTF8')); + + $connect = $database; + + // support for "easy connect naming" + if ($sqlserver !== '' && $sqlserver !== '/') + { + if (substr($sqlserver, -1, 1) == '/') + { + $sqlserver == substr($sqlserver, 0, -1); + } + $connect = $sqlserver . (($port) ? ':' . $port : '') . '/' . $database; + } + + $this->db_connect_id = ($new_link) ? @ocinlogon($this->user, $sqlpassword, $connect, 'UTF8') : (($this->persistency) ? @ociplogon($this->user, $sqlpassword, $connect, 'UTF8') : @ocilogon($this->user, $sqlpassword, $connect, 'UTF8')); return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } @@ -73,6 +85,113 @@ class dbal_oracle extends dbal return true; } + /** + * Oracle specific code to handle the fact that it does not compare columns properly + * @access private + */ + function _rewrite_col_compare($args) + { + if (sizeof($args) == 4) + { + if ($args[2] == '=') + { + return '(' . $args[0] . ' OR (' . $args[1] . ' is NULL AND ' . $args[3] . ' is NULL))'; + } + else if ($args[2] == '<>') + { + // really just a fancy way of saying foo <> bar or (foo is NULL XOR bar is NULL) but SQL has no XOR :P + return '(' . $args[0] . ' OR ((' . $args[1] . ' is NULL AND ' . $args[3] . ' is NOT NULL) OR (' . $args[1] . ' is NOT NULL AND ' . $args[3] . ' is NULL)))'; + } + } + else + { + return $this->_rewrite_where($args[0]); + } + } + + /** + * Oracle specific code to handle it's lack of sanity + * @access private + */ + function _rewrite_where($where_clause) + { + preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<>)\s*((?>\'(?>[^\']++|\'\')*+\'|\d+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); + $out = ''; + foreach ($result as $val) + { + if (!isset($val[5])) + { + if ($val[4] !== "''") + { + $out .= $val[0]; + } + else + { + $out .= ' ' . $val[1] . ' ' . $val[2]; + if ($val[3] == '=') + { + $out .= ' is NULL'; + } + else if ($val[3] == '<>') + { + $out .= ' is NOT NULL'; + } + } + } + else + { + $in_clause = array(); + $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1); + $extra = false; + preg_match_all('/\'(?>[^\']++|\'\')*+\'|\d++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); + $i = 0; + foreach ($sub_vals[0] as $sub_val) + { + // two things: + // 1) This determines if an empty string was in the IN clausing, making us turn it into a NULL comparison + // 2) This fixes the 1000 list limit that Oracle has (ORA-01795) + if ($sub_val !== "''") + { + $in_clause[(int) $i++/1000][] = $sub_val; + } + else + { + $extra = true; + } + } + if (!$extra && $i < 1000) + { + $out .= $val[0]; + } + else + { + $out .= ' ' . $val[1] . '('; + $in_array = array(); + + // constuct each IN() clause + foreach ($in_clause as $in_values) + { + $in_array[] = $val[2] . ' ' . (isset($val[6]) ? $val[6] : '') . 'IN(' . implode(', ', $in_values) . ')'; + } + + // Join the IN() clauses against a few ORs (IN is just a nicer OR anyway) + $out .= implode(' OR ', $in_array); + + // handle the empty string case + if ($extra) + { + $out .= ' OR ' . $val[2] . ' is ' . (isset($val[6]) ? $val[6] : '') . 'NULL'; + } + $out .= ')'; + + unset($in_array, $in_clause); + } + } + } + + return $out; + } + /** * Base query method * @@ -110,12 +229,12 @@ class dbal_oracle extends dbal $in_transaction = true; } + $array = array(); + // We overcome Oracle's 4000 char limit by binding vars if (strlen($query) > 4000) { - $array = array(); - - if (preg_match('/^(INSERT INTO[^(]+)\\(([^()]+)\\) VALUES[^(]+\\((.*?)\\)$/s', $query, $regs)) + if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s', $query, $regs)) { if (strlen($regs[3]) > 4000) { @@ -135,38 +254,60 @@ class dbal_oracle extends dbal } $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; - unset($art); } } - else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )(\\w+ = (?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:, \\w+ = (?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) + else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) { if (strlen($data[0][2]) > 4000) { $update = $data[0][1]; $where = $data[0][3]; - preg_match_all('/(\\w++) = (\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER); + preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER); unset($data); - $art = array(); + $cols = array(); foreach ($temp as $value) { if (!empty($value[2]) && $value[2][0] === "'" && strlen($value[2]) > 4002) // check to see if this thing is greater than the max + 'x2 { - $art[] = $value[1] . '=:' . strtoupper($value[1]); + $cols[] = $value[1] . '=:' . strtoupper($value[1]); $array[$value[1]] = str_replace("''", "'", substr($value[2], 1, -1)); } else { - $art[] = $value[1] . '=' . $value[2]; + $cols[] = $value[1] . '=' . $value[2]; } } - $query = $update . implode(', ', $art) . ' ' . $where; - unset($art); + $query = $update . implode(', ', $cols) . ' ' . $where; + unset($cols); } } } + switch (substr($query, 0, 6)) + { + case 'DELETE': + if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))*+)$/', $query, $regs)) + { + $query = $regs[1] . $this->_rewrite_where($regs[2]); + unset($regs); + } + break; + + case 'UPDATE': + if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) + { + $query = $regs[1] . $this->_rewrite_where($regs[2]); + unset($regs); + } + break; + + case 'SELECT': + $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); + break; + } + $this->query_result = @ociparse($this->db_connect_id, $query); foreach ($array as $key => $value) @@ -267,12 +408,18 @@ class dbal_oracle extends dbal $result_row = array(); foreach ($row as $key => $value) { + // Oracle treats empty strings as null + if (is_null($value)) + { + $value = ''; + } + // OCI->CLOB? if (is_object($value)) { $value = $value->load(); } - + $result_row[strtolower($key)] = $value; } @@ -286,7 +433,7 @@ class dbal_oracle extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -386,6 +533,15 @@ class dbal_oracle extends dbal return str_replace("'", "''", $msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression . " ESCAPE '\\'"; + } + function _sql_custom_build($stage, $data) { return $data; @@ -431,6 +587,67 @@ class dbal_oracle extends dbal switch ($mode) { case 'start': + + $html_table = false; + + // Grab a plan table, any will do + $sql = "SELECT table_name + FROM USER_TABLES + WHERE table_name LIKE '%PLAN_TABLE%'"; + $stmt = ociparse($this->db_connect_id, $sql); + ociexecute($stmt); + $result = array(); + + if (ocifetchinto($stmt, $result, OCI_ASSOC + OCI_RETURN_NULLS)) + { + $table = $result['TABLE_NAME']; + + // This is the statement_id that will allow us to track the plan + $statement_id = substr(md5($query), 0, 30); + + // Remove any stale plans + $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'"); + ociexecute($stmt2); + ocifreestatement($stmt2); + + // Explain the plan + $sql = "EXPLAIN PLAN + SET STATEMENT_ID = '$statement_id' + FOR $query"; + $stmt2 = ociparse($this->db_connect_id, $sql); + ociexecute($stmt2); + ocifreestatement($stmt2); + + // Get the data from the plan + $sql = "SELECT operation, options, object_name, object_type, cardinality, cost + FROM plan_table + START WITH id = 0 AND statement_id = '$statement_id' + CONNECT BY PRIOR id = parent_id + AND statement_id = '$statement_id'"; + $stmt2 = ociparse($this->db_connect_id, $sql); + ociexecute($stmt2); + + $row = array(); + while (ocifetchinto($stmt2, $row, OCI_ASSOC + OCI_RETURN_NULLS)) + { + $html_table = $this->sql_report('add_select_row', $query, $html_table, $row); + } + + ocifreestatement($stmt2); + + // Remove the plan we just made, we delete them on request anyway + $stmt2 = ociparse($this->db_connect_id, "DELETE FROM $table WHERE statement_id='$statement_id'"); + ociexecute($stmt2); + ocifreestatement($stmt2); + } + + ocifreestatement($stmt); + + if ($html_table) + { + $this->html_hold .= ''; + } + break; case 'fromcache': diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index 94bc70fa6a..340c32b37a 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -264,7 +264,7 @@ class dbal_postgres extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -345,6 +345,15 @@ class dbal_postgres extends dbal return @pg_escape_string($msg); } + /** + * Build LIKE expression + * @access private + */ + function _sql_like_expression($expression) + { + return $expression; + } + /** * return sql error array * @access private diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 8a50c546a7..3248b439c6 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -188,7 +188,7 @@ class dbal_sqlite extends dbal * Seek to given row number * rownum is zero-based */ - function sql_rowseek($rownum, $query_id = false) + function sql_rowseek($rownum, &$query_id) { global $cache; @@ -241,6 +241,22 @@ class dbal_sqlite extends dbal return @sqlite_escape_string($msg); } + /** + * Correctly adjust LIKE expression for special characters + * For SQLite an underscore is a not-known character... this may change with SQLite3 + */ + function sql_like_expression($expression) + { + // Unlike LIKE, GLOB is case sensitive (unfortunatly). SQLite users need to live with it! + // We only catch * and ? here, not the character map possible on file globbing. + $expression = str_replace(array(chr(0) . '_', chr(0) . '%'), array(chr(0) . '?', chr(0) . '*'), $expression); + + $expression = str_replace(array('?', '*'), array("\?", "\*"), $expression); + $expression = str_replace(array(chr(0) . "\?", chr(0) . "\*"), array('?', '*'), $expression); + + return 'GLOB \'' . $this->sql_escape($expression) . '\''; + } + /** * return sql error array * @access private diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index fee5f49cc1..a91bddd9b8 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1,10 +1,10 @@ $v) { - if (is_array($v)) + set_var($k, $k, $key_type); + if ($type == 'array' && is_array($v)) { foreach ($v as $_k => $_v) { - set_var($k, $k, $key_type); - set_var($_k, $_k, $key_type); - set_var($var[$k][$_k], $_v, $type, $multibyte); + if (is_array($_v)) + { + $_v = null; + } + set_var($_k, $_k, $sub_key_type); + set_var($var[$k][$_k], $_v, $sub_type, $multibyte); } } else { - set_var($k, $k, $key_type); + if ($type == 'array' || is_array($v)) + { + $v = null; + } set_var($var[$k], $v, $type, $multibyte); } } @@ -1257,7 +1272,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti WHERE t.forum_id = ' . $forum_id . ' AND t.topic_last_post_time > ' . $mark_time_forum . ' AND t.topic_moved_id = 0 - AND tt.topic_id IS NULL + AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time) GROUP BY t.forum_id'; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); @@ -1571,11 +1586,30 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Appending custom url parameter? $append_url = (!empty($_EXTRA_URL)) ? implode($amp_delim, $_EXTRA_URL) : ''; + $anchor = ''; + if (strpos($url, '#') !== false) + { + list($url, $anchor) = explode('#', $url, 2); + $anchor = '#' . $anchor; + } + else if (!is_array($params) && strpos($params, '#') !== false) + { + list($params, $anchor) = explode('#', $params, 2); + $anchor = '#' . $anchor; + } + // Use the short variant if possible ;) if ($params === false) { // Append session id - return (!$session_id) ? $url . (($append_url) ? $url_delim . $append_url : '') : $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id; + if (!$session_id) + { + return $url . (($append_url) ? $url_delim . $append_url : '') . $anchor; + } + else + { + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . 'sid=' . $session_id . $anchor; + } } // Build string if parameters are specified as array @@ -1590,6 +1624,12 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) continue; } + if ($key == '#') + { + $anchor = '#' . $item; + continue; + } + $output[] = $key . '=' . $item; } @@ -1598,7 +1638,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false) // Append session id and parameters (even if they are empty) // If parameters are empty, the developer can still append his/her parameters without caring about the delimiter - return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id); + return $url . (($append_url) ? $url_delim . $append_url . $amp_delim : $url_delim) . $params . ((!$session_id) ? '' : $amp_delim . 'sid=' . $session_id) . $anchor; } /** @@ -2090,24 +2130,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // append/replace SID (may change during the session for AOL users) $redirect = reapply_sid($redirect); - // Make sure the user is able to hide his session - if (!$viewonline) - { - $check_auth = new auth(); - $check_auth->acl($user->data); - - // Reset online status if not allowed to hide the session... - if (!$check_auth->acl_get('u_hideonline')) - { - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET session_viewonline = 1 - WHERE session_user_id = ' . $user->data['user_id']; - $db->sql_query($sql); - } - - unset($check_auth); - } - // Special case... the user is effectively banned, but we allow founders to login if (defined('IN_CHECK_BAN') && $result['user_row']['user_type'] != USER_FOUNDER) { @@ -2613,6 +2635,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class // make sure no HTML entities were matched $chars = array('<', '>', '"'); $split = false; + foreach ($chars as $char) { $next_split = strpos($url, $char); @@ -2668,6 +2691,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class { $url = substr($url, 0, -1); } + break; } switch ($type) @@ -2692,8 +2716,8 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class case MAGIC_URL_EMAIL: $tag = 'e'; - $url = 'mailto:' . $url; $text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; + $url = 'mailto:' . $url; break; } @@ -2734,19 +2758,19 @@ function make_clickable($text, $server_url = false, $class = 'postlink') // Be sure to not let the matches cross over. ;) // relative urls for this board - $magic_url_match[] = '#(^|[\n\t (>\]])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (>])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_LOCAL, '\$1', '\$2', '\$3', '$local_class')"; // matches a xxxx://aaaaa.bbb.cccc. ... - $magic_url_match[] = '#(^|[\n\t (>\]])(' . get_preg_expression('url_inline') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_FULL, '\$1', '\$2', '', '$class')"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing - $magic_url_match[] = '#(^|[\n\t (>\]])(' . get_preg_expression('www_url_inline') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_WWW, '\$1', '\$2', '', '$class')"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. - $magic_url_match[] = '/(^|[\n\t (>\]])(' . get_preg_expression('email') . ')/ie'; + $magic_url_match[] = '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/ie'; $magic_url_replace[] = "make_clickable_callback(MAGIC_URL_EMAIL, '\$1', '\$2', '', '')"; } @@ -2788,7 +2812,7 @@ function smiley_text($text, $force_option = false) } else { - return str_replace('', $text); } } @@ -3853,14 +3877,7 @@ function page_header($page_title = '', $display_online_list = true) { $f = request_var('f', 0); - // Do not change this (it is defined as _f_={forum_id}x within session.php) - $reading_sql = " AND s.session_page LIKE '%\_f\_={$f}x%'"; - - // Specify escape character for MSSQL - if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') - { - $reading_sql .= " ESCAPE '\\' "; - } + $reading_sql = ' AND s.session_page ' . $db->sql_like_expression("{$db->any_char}_f_={$f}x{$db->any_char}"); } // Get number of online guests @@ -3917,7 +3934,7 @@ function page_header($page_title = '', $display_online_list = true) $user_colour = ''; } - if ($row['user_allow_viewonline'] && $row['session_viewonline']) + if ($row['session_viewonline']) { $user_online_link = $row['username']; $logged_visible_online++; @@ -3928,7 +3945,7 @@ function page_header($page_title = '', $display_online_list = true) $logged_hidden_online++; } - if (($row['user_allow_viewonline'] && $row['session_viewonline']) || $auth->acl_get('u_viewonline')) + if (($row['session_viewonline']) || $auth->acl_get('u_viewonline')) { if ($row['user_type'] <> USER_IGNORE) { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 97fc9ba73b..5e94b0d9e0 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1,10 +1,10 @@ sql_query($sql, $expire_time); $forum_rows = array(); + + $right = $padding = 0; + $padding_store = array('0' => 0); + while ($row = $db->sql_fetchrow($result)) { + if ($row['left_id'] < $right) + { + $padding++; + $padding_store[$row['parent_id']] = $padding; + } + else if ($row['left_id'] > $right + 1) + { + // Ok, if the $padding_store for this parent is empty there is something wrong. For now we will skip over it. + // @todo digging deep to find out "how" this can happen. + $padding = (isset($padding_store[$row['parent_id']])) ? $padding_store[$row['parent_id']] : $padding; + } + + $right = $row['right_id']; + $row['padding'] = $padding; + $forum_rows[] = $row; } $db->sql_freeresult($result); + unset($padding_store); } $rowset = array(); @@ -559,15 +579,33 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s } unset($table_ary); - $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + $moved_topic_ids = array(); + + // update the other forums + $sql = 'SELECT topic_id, forum_id + FROM ' . TOPICS_TABLE . ' WHERE ' . $db->sql_in_set('topic_moved_id', $topic_ids); - $db->sql_query($sql); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + $moved_topic_ids[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + if (sizeof($moved_topic_ids)) + { + $sql = 'DELETE FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $moved_topic_ids); + $db->sql_query($sql); + } $db->sql_transaction('commit'); if ($auto_sync) { - sync('forum', 'forum_id', $forum_ids, true, true); + sync('forum', 'forum_id', array_unique($forum_ids), true, true); sync('topic_reported', $where_type, $where_ids); } @@ -658,9 +696,15 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = { foreach ($post_counts as $poster_id => $substract) { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_posts = 0 + WHERE user_id = ' . $poster_id . ' + AND user_posts < ' . $substract; + $db->sql_query($sql); $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = user_posts - ' . $substract . ' - WHERE user_id = ' . $poster_id; + WHERE user_id = ' . $poster_id . ' + AND user_posts >= ' . $substract; $db->sql_query($sql); } } @@ -2162,8 +2206,7 @@ function cache_moderators() AND a.group_id = ug.group_id AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " AND ug.user_pending = 0 - AND o.auth_option LIKE 'm\_%'" . - (($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''), + AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char), )); $result = $db->sql_query($sql); @@ -2800,6 +2843,14 @@ function get_database_size() $database_size = $row['size']; } break; + + case 'oracle': + $sql = 'SELECT SUM(bytes) as dbsize + FROM user_segments'; + $result = $db->sql_query($sql); + $database_size = ($row = $db->sql_fetchrow($result)) ? $row['dbsize'] : false; + $db->sql_freeresult($result); + break; } if ($database_size !== false) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 22323a803a..414f6f2f20 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1,10 +1,10 @@ sql_query(str_replace('{' . strtoupper($group) . '}', $group_id . ', 0', $select_query)); + $result = $src_db->sql_query(str_replace('{' . strtoupper($group) . '}', $group_id . ' ', $select_query)); while ($row = $src_db->sql_fetchrow($result)) { - // make sure it's exactly 3 ints that were returned - $data = array(); - reset($row); - for ($i = 0; $i < 3; $i++) - { - $data[] = (int) current($row); - next($row); - } - // this might become quite a lot of INSERTS unfortunately - $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' (user_id, group_id, user_pending) - VALUES (' . implode(', ', $data) . ')'; + $sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, user_pending) + VALUES ({$row['user_id']}, $group_id, 0)"; $db->sql_query($sql); } $src_db->sql_freeresult($result); @@ -1235,7 +1226,7 @@ function get_config() if (!sizeof($convert_config)) { - $convert->p_master->error($lang['CONV_ERROR_CONFIG_EMPTY'], __LINE__, __FILE__); + $convert->p_master->error($user->lang['CONV_ERROR_CONFIG_EMPTY'], __LINE__, __FILE__); } return $convert_config; @@ -1484,7 +1475,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) { $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " - WHERE role_description = 'ROLE_DESCRIPTION_" . $db->sql_escape($acl_list) . "'"; + WHERE role_name = 'ROLE_" . $db->sql_escape($acl_list) . "'"; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -1676,12 +1667,12 @@ function add_default_groups() global $db; $default_groups = array( - 'GUESTS' => array('', 0), - 'REGISTERED' => array('', 0), - 'REGISTERED_COPPA' => array('', 0), - 'GLOBAL_MODERATORS' => array('00AA00', 1), - 'ADMINISTRATORS' => array('AA0000', 1), - 'BOTS' => array('9E8DA7', 0) + 'GUESTS' => array('', 0, 0), + 'REGISTERED' => array('', 0, 0), + 'REGISTERED_COPPA' => array('', 0, 0), + 'GLOBAL_MODERATORS' => array('00AA00', 1, 0), + 'ADMINISTRATORS' => array('AA0000', 1, 1), + 'BOTS' => array('9E8DA7', 0, 0) ); $sql = 'SELECT * @@ -1707,6 +1698,7 @@ function add_default_groups() 'group_type' => GROUP_SPECIAL, 'group_colour' => $data[0], 'group_legend' => $data[1], + 'group_founder_manage' => $data[2] ); } @@ -1716,6 +1708,27 @@ function add_default_groups() } } + +/** +* Sync post count. We might need to do this in batches. +*/ +function sync_post_count($offset, $limit) +{ + global $db; + $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id + FROM ' . POSTS_TABLE . ' + WHERE post_postcount = 1 + GROUP BY poster_id + ORDER BY poster_id'; + $result = $db->sql_query_limit($sql, $limit, $offset); + + while ($row = $db->sql_fetchrow($result)) + { + $db->sql_query('UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['poster_id']}"); + } + $db->sql_freeresult($result); +} + /** * Add the search bots into the database * This code should be used in execute_last if the source database did not have bots @@ -2076,7 +2089,7 @@ function fix_empty_primary_groups() */ function remove_invalid_users() { - global $convert, $db; + global $convert, $db, $phpEx, $phpbb_root_path; // username_clean is UNIQUE $sql = 'SELECT user_id @@ -2393,4 +2406,11 @@ function relative_base($path, $is_relative = true, $line = false, $file = false) return $convert->options['forum_path'] . '/' . $path; } +function get_smiley_display() +{ + static $smiley_count = 0; + $smiley_count++; + return ($smiley_count < 50) ? 1 : 0; +} + ?> \ No newline at end of file diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f56de24a24..92e636af01 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1,10 +1,10 @@ assign_vars(array( - 'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums'), + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums') : '', 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false, 'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'], 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST')) @@ -476,24 +476,27 @@ function generate_forum_nav(&$forum_data) $forum_parents = get_forum_parents($forum_data); // Build navigation links - foreach ($forum_parents as $parent_forum_id => $parent_data) + if (!empty($forum_parents)) { - list($parent_name, $parent_type) = array_values($parent_data); - - // Skip this parent if the user does not have the permission to view it - if (!$auth->acl_get('f_list', $parent_forum_id)) + foreach ($forum_parents as $parent_forum_id => $parent_data) { - continue; - } + list($parent_name, $parent_type) = array_values($parent_data); - $template->assign_block_vars('navlinks', array( - 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, - 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, - 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, - 'FORUM_NAME' => $parent_name, - 'FORUM_ID' => $parent_forum_id, - 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id)) - ); + // Skip this parent if the user does not have the permission to view it + if (!$auth->acl_get('f_list', $parent_forum_id)) + { + continue; + } + + $template->assign_block_vars('navlinks', array( + 'S_IS_CAT' => ($parent_type == FORUM_CAT) ? true : false, + 'S_IS_LINK' => ($parent_type == FORUM_LINK) ? true : false, + 'S_IS_POST' => ($parent_type == FORUM_POST) ? true : false, + 'FORUM_NAME' => $parent_name, + 'FORUM_ID' => $parent_forum_id, + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id)) + ); + } } $template->assign_block_vars('navlinks', array( @@ -1057,6 +1060,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $for { $s_watching['link'] = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&" . (($is_watching) ? 'unwatch' : 'watch') . "=$mode&start=$start"); $s_watching['title'] = $user->lang[(($is_watching) ? 'STOP' : 'START') . '_WATCHING_' . strtoupper($mode)]; + $s_watching['is_watching'] = $is_watching; } return; diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 43d536e7e9..61ac1883b3 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -1,10 +1,10 @@ array( 'LABEL' => 'FireBird', @@ -172,12 +173,14 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 */ function dbms_select($default = '', $only_20x_options = false) { + global $lang; + $available_dbms = get_available_dbms(false, false, $only_20x_options); $dbms_options = ''; foreach ($available_dbms as $dbms_name => $details) { $selected = ($dbms_name == $default) ? ' selected="selected"' : ''; - $dbms_options .= ''; + $dbms_options .= ''; } return $dbms_options; } @@ -280,7 +283,7 @@ function connect_check_db($error_connect, &$error, $dbms, $table_prefix, $dbhost { case 'mysql': case 'mysqli': - if (strpos($table_prefix, '-') !== false) + if (strpos($table_prefix, '-') !== false || strpos($table_prefix, '.') !== false) { $error[] = $lang['INST_ERR_PREFIX_INVALID']; return false; diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 3872346bbc..eb2a7245a5 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -1,112 +1,90 @@ server = ($server) ? $server : 'localhost'; - $this->port = ($port) ? $port : '5222'; + $this->port = ($port) ? $port : 5222; $this->username = $username; $this->password = $password; - $this->resource = ($resource) ? $resource : NULL; + $this->use_ssl = ($use_ssl && $this->can_use_ssl()) ? true : false; + + // Change port if we use SSL + if ($this->port == 5222 && $this->use_ssl) + { + $this->port = 5223; + } $this->enable_logging = true; $this->log_array = array(); + } - $this->version = '1.0'; - $this->show_version = false; + /** + * Able to use the SSL functionality? + */ + function can_use_ssl() + { + // Will not work with PHP >= 5.2.1 or < 5.2.3RC2 until timeout problem with ssl hasn't been fixed (http://bugs.php.net/41236) + return ((version_compare(PHP_VERSION, '5.2.1', '<') || version_compare(PHP_VERSION, '5.2.3RC2', '>=')) && @extension_loaded('openssl')) ? true : false; + } - $this->packet_queue = array(); - $this->iq_sleep_timer = $this->delay_disconnect = 1; + /** + * Able to use TLS? + */ + function can_use_tls() + { + if (!@extension_loaded('openssl') || !function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers')) + { + return false; + } - $this->returned_keep_alive = true; - $this->txnid = 0; + // Make sure the encryption stream is supported + $streams = stream_get_wrappers(); - $this->iq_version_name = "Class.Jabber.PHP -- http://cjphp.netflint.net -- by Nathan 'Fritzy' Fritz, fritz@netflint.net"; - $this->iq_version_version = '0.4'; - $this->iq_version_os = $_SERVER['SERVER_SOFTWARE']; + if (!in_array('streams.crypto', $streams)) + { + return false; + } - $this->error_codes = array( - 400 => 'Bad Request', - 401 => 'Unauthorised', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Registration Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Remove Server Error', - 503 => 'Service Unavailable', - 504 => 'Remove Server Timeout', - 510 => 'Disconnected' - ); + return true; } /** @@ -114,31 +92,28 @@ class jabber */ function connect() { - $this->connector = new cjp_standard_connector; - - if ($this->connector->open_socket($this->server, $this->port)) +/* if (!$this->check_jid($this->username . '@' . $this->server)) { - $this->send_packet("\n"); - $this->send_packet("show_version) ? " version='{$this->version}'" : '') . ">\n"); + $this->add_to_log('Error: Jabber ID is not valid: ' . $this->username . '@' . $this->server); + return false; + }*/ - sleep(2); + $this->session['ssl'] = $this->use_ssl; - if ($this->_check_connected()) - { - $this->connected = true; // Nathan Fritz - return true; - } - else - { - $this->add_to_log('ERROR: connect() #1'); - return false; - } + if ($this->open_socket($this->server, $this->port, $this->use_ssl)) + { + $this->send("\n"); + $this->send("\n"); } else { - $this->add_to_log('ERROR: connect() #2'); + $this->add_to_log('Error: connect() #2'); return false; } + + // Now we listen what the server has to say...and give appropriate responses + $this->response($this->listen()); + return true; } /** @@ -146,529 +121,104 @@ class jabber */ function disconnect() { - if (is_int($this->delay_disconnect)) + if ($this->connected()) { - sleep($this->delay_disconnect); + // disconnect gracefully + if (isset($this->session['sent_presence'])) + { + $this->presence('offline', '', true); + } + + $this->send(''); + $this->session = array(); + return fclose($this->connection); } - $this->send_packet(''); - $this->connector->close_socket(); + return false; } /** - * Send authentication request + * Connected? */ - function send_auth() + function connected() { - $this->auth_id = 'auth_' . md5(time() . $_SERVER['REMOTE_ADDR']); - $this->resource = ($this->resource != NULL) ? $this->resource : ('Class.Jabber.PHP ' . md5($this->auth_id)); - $this->jid = "{$this->username}@{$this->server}/{$this->resource}"; + return (is_resource($this->connection) && !feof($this->connection)) ? true : false; + } - // request available authentication methods - $payload = "{$this->username}"; - $packet = $this->send_iq(NULL, 'get', $this->auth_id, 'jabber:iq:auth', $payload); - // was a result returned? - if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + /** + * Initiates login (using data from contructor, after calling connect()) + * @access public + * @return bool + */ + function login() + { + if (!sizeof($this->features)) { - // yes, now check for auth method availability in descending order (best to worst) - if (isset($packet['iq']['#']['query'][0]['#']['sequence'][0]['#']) && isset($packet['iq']['#']['query'][0]['#']['token'][0]['#'])) - { - // auth_0k - return $this->_sendauth_ok($packet['iq']['#']['query'][0]['#']['token'][0]['#'], $packet['iq']['#']['query'][0]['#']['sequence'][0]['#']); - } - else if (isset($packet['iq']['#']['query'][0]['#']['digest'])) - { - // digest - return $this->_sendauth_digest(); - } - else if ($packet['iq']['#']['query'][0]['#']['password']) - { - // plain text - return $this->_sendauth_plaintext(); - } - else - { - $this->add_to_log('ERROR: send_auth() #2 - No auth method available!'); - return false; - } + $this->add_to_log('Error: No feature information from server available.'); + return false; + } + + return $this->response($this->features); + } + + /** + * Send data to the Jabber server + * @param string $xml + * @access public + * @return bool + */ + function send($xml) + { + if ($this->connected()) + { + $xml = trim($xml); + $this->add_to_log('SEND: '. $xml); + return fwrite($this->connection, $xml); } else { - // no result returned - $this->add_to_log('ERROR: send_auth() #1'); + $this->add_to_log('Error: Could not send, connection lost (flood?).'); return false; } } /** - * Register account + * OpenSocket + * @param string $server host to connect to + * @param int $port port number + * @param bool $use_ssl use ssl or not + * @access public + * @return bool */ - function account_registration($reg_email = NULL, $reg_name = NULL) + function open_socket($server, $port, $use_ssl = false) { - $packet = $this->send_iq($this->server, 'get', 'reg_01', 'jabber:iq:register'); - - if ($packet) + if (@function_exists('dns_get_record')) { - // just in case a key was passed back from the server - $key = $this->get_info_from_iq_key($packet); - unset($packet); - - $payload = "{$this->username} - {$this->password} - $reg_email - $reg_name\n"; - - $payload .= ($key) ? "$key\n" : ''; - - $packet = $this->send_iq($this->server, 'set', 'reg_01', 'jabber:iq:register', $payload); - - if ($this->get_info_from_iq_type($packet) == 'result') + $record = @dns_get_record("_xmpp-client._tcp.$server", DNS_SRV); + if (!empty($record) && !empty($record[0]['target'])) { - $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2; - $this->jid = ($this->resource) ? "{$this->username}@{$this->server}/{$this->resource}" : "{$this->username}@{$this->server}"; + $server = $record[0]['target']; } - else if ($this->get_info_from_iq_type($packet) == 'error' && isset($packet['iq']['#']['error'][0]['#'])) - { - // "conflict" error, i.e. already registered - if ($packet['iq']['#']['error'][0]['@']['code'] == '409') - { - $return_code = 1; - } - else - { - $return_code = 'Error ' . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#']; - } - } - - return $return_code; } else { - return 3; + $this->add_to_log('Warning: dns_get_record() function not found. GTalk will not work.'); } - } - /** - * Change password - */ - function change_password($new_password) - { - $packet = $this->send_iq($this->server, 'get', 'A0', 'jabber:iq:register'); + $server = $use_ssl ? 'ssl://' . $server : $server; - if ($packet) + if ($this->connection = @fsockopen($server, $port, $errorno, $errorstr, $this->timeout)) { - // just in case a key was passed back from the server - $key = $this->get_info_from_iq_key($packet); - unset($packet); + socket_set_blocking($this->connection, 0); + socket_set_timeout($this->connection, 60); - $payload = "{$this->username} - {$new_password}\n"; - $payload .= ($key) ? "$key\n" : ''; - - $packet = $this->send_iq($this->server, 'set', 'A0', 'jabber:iq:register', $payload); - - if ($this->get_info_from_iq_type($packet) == 'result') - { - $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2; - } - else if ($this->get_info_from_iq_type($packet) == 'error' && isset($packet['iq']['#']['error'][0]['#'])) - { - // "conflict" error, i.e. already registered - if ($packet['iq']['#']['error'][0]['@']['code'] == '409') - { - $return_code = 1; - } - else - { - $return_code = 'Error ' . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#']; - } - } - - return $return_code; - } - else - { - return 3; - } - } - - /** - * Send packet - */ - function send_packet($xml) - { - $xml = trim($xml); - - if ($this->connector->write_to_socket($xml)) - { - $this->add_to_log('SEND: ' . $xml); return true; } - else - { - $this->add_to_log('ERROR: send_packet() #1'); - return false; - } - } - /** - * Listen to socket - */ - function listen() - { - $incoming = ''; - - while ($line = $this->connector->read_from_socket(4096)) - { - $incoming .= $line; - } - - $incoming = trim($incoming); - - if ($incoming != '') - { - $this->add_to_log('RECV: ' . $incoming); - $temp = $this->_split_incoming($incoming); - - for ($i = 0, $size = sizeof($temp); $i < $size; $i++) - { - $this->packet_queue[] = $this->xmlize($temp[$i]); - } - } - - return true; - } - - /** - * Strip jid - */ - function strip_jid($jid = NULL) - { - preg_match('#(.*)\/(.*)#Ui', $jid, $temp); - return ($temp[1] != '') ? $temp[1] : $jid; - } - - /** - * Send a message - */ - function send_message($to, $type = 'normal', $id = NULL, $content = NULL, $payload = NULL) - { - if ($to && is_array($content)) - { - if (!$id) - { - $id = $type . '_' . time(); - } - - $this->_array_xmlspecialchars($content); - - $xml = "\n"; - - if (!empty($content['subject'])) - { - $xml .= '' . $content['subject'] . "\n"; - } - - if (!empty($content['thread'])) - { - $xml .= '' . $content['thread'] . "\n"; - } - - $xml .= '' . $content['body'] . "\n"; - $xml .= $payload; - $xml .= "\n"; - - if ($this->send_packet($xml)) - { - return true; - } - else - { - $this->add_to_log('ERROR: send_message() #1'); - } - } - else - { - $this->add_to_log('ERROR: send_message() #2'); - return false; - } - } - - /** - * Send presence - */ - function send_presence($type = NULL, $to = NULL, $status = NULL, $show = NULL, $priority = NULL) - { - $xml = '\n" : " />\n"; - - $xml .= ($status) ? " $status\n" : ''; - $xml .= ($show) ? " $show\n" : ''; - $xml .= ($priority) ? " $priority\n" : ''; - - $xml .= ($status || $show || $priority) ? "\n" : ''; - - if ($this->send_packet($xml)) - { - return true; - } - else - { - $this->add_to_log('ERROR: send_presence() #1'); - return false; - } - } - - /** - * Send error - */ - function send_error($to, $id = NULL, $error_number, $error_message = NULL) - { - $xml = "error_codes[$error_number]; - $xml .= "\n"; - $xml .= ''; - - $this->send_packet($xml); - } - - /** - * Get first from queue - */ - function get_first_from_queue() - { - return array_shift($this->packet_queue); - } - - /** - * Get from queue by id - */ - function get_from_queue_by_id($packet_type, $id) - { - $found_message = false; - - foreach ($this->packet_queue as $key => $value) - { - if ($value[$packet_type]['@']['id'] == $id) - { - $found_message = $value; - unset($this->packet_queue[$key]); - - break; - } - } - - return (is_array($found_message)) ? $found_message : false; - } - - /** - * Call handler - */ - function call_handler($packet = NULL) - { - $packet_type = $this->_get_packet_type($packet); - - if ($packet_type == 'message') - { - $type = $packet['message']['@']['type']; - $type = ($type != '') ? $type : 'normal'; - $funcmeth = "handler_message_$type"; - } - else if ($packet_type == 'iq') - { - $namespace = $packet['iq']['#']['query'][0]['@']['xmlns']; - $namespace = str_replace(':', '_', $namespace); - $funcmeth = "handler_iq_$namespace"; - } - else if ($packet_type == 'presence') - { - $type = $packet['presence']['@']['type']; - $type = ($type != '') ? $type : 'available'; - $funcmeth = "handler_presence_$type"; - } - - if ($funcmeth != '') - { - if (function_exists($funcmeth)) - { - call_user_func($funcmeth, $packet); - } - else if (method_exists($this, $funcmeth)) - { - call_user_func(array(&$this, $funcmeth), $packet); - } - else - { - $this->handler_not_implemented($packet); - $this->add_to_log("ERROR: call_handler() #1 - neither method nor function $funcmeth() available"); - } - } - } - - /** - * Cruise Control - */ - function cruise_control($seconds = -1) - { - $count = 0; - - while ($count != $seconds) - { - $this->listen(); - - do - { - $packet = $this->get_first_from_queue(); - - if ($packet) - { - $this->call_handler($packet); - } - } - while (sizeof($this->packet_queue) > 1); - - $count += 0.25; - usleep(250000); - - if (($this->last_ping_time + 180) < time()) - { - // Modified by Nathan Fritz - if ($this->returned_keep_alive == false) - { - $this->connected = false; - $this->add_to_log('EVENT: Disconnected'); - } - - if ($this->returned_keep_alive == true) - { - $this->connected = true; - } - - $this->returned_keep_alive = false; - - $this->keep_alive_id = 'keep_alive_' . time(); - // $this->send_packet("", 'cruise_control'); - $this->send_packet(""); - $this->last_ping_time = time(); - } - } - - return true; - } - - /** - * Send iq - */ - function send_iq($to = NULL, $type = 'get', $id = NULL, $xmlns = NULL, $payload = NULL, $from = NULL) - { - if (!preg_match('#^(get|set|result|error)$#', $type)) - { - unset($type); - - $this->add_to_log("ERROR: send_iq() #2 - type must be 'get', 'set', 'result' or 'error'"); - return false; - } - else if ($id && $xmlns) - { - $xml = "send_packet($xml); - sleep($this->iq_sleep_timer); - $this->listen(); - - return (preg_match('#^(get|set)$#', $type)) ? $this->get_from_queue_by_id('iq', $id) : true; - } - else - { - $this->add_to_log('ERROR: send_iq() #1 - to, id and xmlns are mandatory'); - return false; - } - } - - /** - * get the transport registration fields - * method written by Steve Blinch, http://www.blitzaffe.com - */ - function transport_registration_details($transport) - { - $this->txnid++; - $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid); - - if ($packet) - { - $res = array(); - - foreach ($packet['iq']['#']['query'][0]['#'] as $element => $data) - { - if ($element != 'instructions' && $element != 'key') - { - $res[] = $element; - } - } - - return $res; - } - else - { - return 3; - } - } - - /** - * register with the transport - * method written by Steve Blinch, http://www.blitzaffe.com - */ - function transport_registration($transport, $details) - { - $this->txnid++; - $packet = $this->send_iq($transport, 'get', "reg_{$this->txnid}", 'jabber:iq:register', NULL, $this->jid); - - if ($packet) - { - // just in case a key was passed back from the server - $key = $this->get_info_from_iq_key($packet); - unset($packet); - - $payload = ($key) ? "$key\n" : ''; - foreach ($details as $element => $value) - { - $payload .= "<$element>$value\n"; - } - - $packet = $this->send_iq($transport, 'set', "reg_{$this->txnid}", 'jabber:iq:register', $payload); - - if ($this->get_info_from_iq_type($packet) == 'result') - { - $return_code = (isset($packet['iq']['#']['query'][0]['#']['registered'][0]['#'])) ? 1 : 2; - } - else if ($this->get_info_from_iq_type($packet) == 'error') - { - if (isset($packet['iq']['#']['error'][0]['#'])) - { - $return_code = 'Error ' . $packet['iq']['#']['error'][0]['@']['code'] . ': ' . $packet['iq']['#']['error'][0]['#']; - $this->add_to_log('ERROR: transport_registration()'); - } - } - - return $return_code; - } - else - { - return 3; - } + // Apparently an error occured... + $this->add_to_log('Error: open_socket() - ' . $errorstr); + return false; } /** @@ -691,640 +241,487 @@ class jabber { if ($this->enable_logging) { - $this->log_array[] = htmlspecialchars($string); + $this->log_array[] = utf8_htmlspecialchars($string); } } - - // ====================================================================== - // private methods - // ====================================================================== - /** - * Send auth - * @access private + * Listens to the connection until it gets data or the timeout is reached. + * Thus, it should only be called if data is expected to be received. + * @access public + * @return mixed either false for timeout or an array with the received data */ - function _sendauth_ok($zerok_token, $zerok_sequence) + function listen($timeout = 10, $wait = false) { - // initial hash of password - $zerok_hash = sha1($this->password); - - // sequence 0: hash of hashed-password and token - $zerok_hash = sha1($zerok_hash . $zerok_token); - - // repeat as often as needed - for ($i = 0; $i < $zerok_sequence; $i++) + if (!$this->connected()) { - $zerok_hash = sha1($zerok_hash); + return false; } - $payload = "{$this->username} - $zerok_hash - {$this->resource}"; + // Wait for a response until timeout is reached + $start = time(); + $data = ''; - $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); - - // was a result returned? - if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + do { - return true; + $read = trim(fread($this->connection, 4096)); + $data .= $read; + } + while (time() <= $start + $timeout && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); + + if ($data != '') + { + $this->add_to_log('RECV: '. $data); + return $this->xmlize($data); } else { - $this->add_to_log('ERROR: _sendauth_ok() #1'); + $this->add_to_log('Timeout, no response from server.'); return false; } } /** - * Send auth digest - * @access private + * Initiates account registration (based on data used for contructor) + * @access public + * @return bool */ - function _sendauth_digest() + function register() { - $payload = "{$this->username} - {$this->resource} - " . sha1($this->stream_id . $this->password) . ""; - - $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); - - // was a result returned? - if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + if (!isset($this->session['id']) || isset($this->session['jid'])) { - return true; - } - else - { - $this->add_to_log('ERROR: _sendauth_digest() #1'); + $this->add_to_log('Error: Cannot initiate registration.'); return false; } + + $this->send(""); + return $this->response($this->listen()); } /** - * Send auth plain - * @access private + * Sets account presence. No additional info required (default is "online" status) + * @param $message online, offline... + * @param $type dnd, away, chat, xa or nothing + * @param $unavailable set this to true if you want to become unavailable + * @access public + * @return bool */ - function _sendauth_plaintext() + function send_presence($message = '', $type = '', $unavailable = false) { - $payload = "{$this->username} - {$this->password} - {$this->resource}"; - - $packet = $this->send_iq(NULL, 'set', $this->auth_id, 'jabber:iq:auth', $payload); - - // was a result returned? - if ($this->get_info_from_iq_type($packet) == 'result' && $this->get_info_from_iq_id($packet) == $this->auth_id) + if (!isset($this->session['jid'])) { - return true; - } - else - { - $this->add_to_log('ERROR: _sendauth_plaintext() #1'); + $this->add_to_log('ERROR: send_presence() - Cannot set presence at this point, no jid given.'); return false; } + + $type = strtolower($type); + $type = (in_array($type, array('dnd', 'away', 'chat', 'xa'))) ? ''. $type .'' : ''; + + $unavailable = ($unavailable) ? " type='unavailable'" : ''; + $message = ($message) ? '' . utf8_htmlspecialchars($message) .'' : ''; + + $this->session['sent_presence'] = !$unavailable; + + return $this->send("" . $type . $message . ''); } /** - * Listen on socket - * @access private + * This handles all the different XML elements + * @param array $xml + * @access public + * @return bool */ - function _listen_incoming() + function response($xml) { - $incoming = ''; - - while ($line = $this->connector->read_from_socket(4096)) + if (!is_array($xml) || !sizeof($xml)) { - $incoming .= $line; + return false; } - $incoming = trim($incoming); - - if ($incoming != '') + // did we get multiple elements? do one after another + // array('message' => ..., 'presence' => ...) + if (sizeof($xml) > 1) { - $this->add_to_log('RECV: ' . $incoming); - } - - return $this->xmlize($incoming); - } - - /** - * Check if connected - * @access private - */ - function _check_connected($in_tls = false) - { - $incoming_array = $this->_listen_incoming(); - - if (is_array($incoming_array)) - { - if ($incoming_array['stream:stream']['@']['from'] == $this->server && $incoming_array['stream:stream']['@']['xmlns'] == 'jabber:client' && $incoming_array['stream:stream']['@']['xmlns:stream'] == 'http://etherx.jabber.org/streams') + foreach ($xml as $key => $value) { - $this->stream_id = $incoming_array['stream:stream']['@']['id']; - - // We only start TLS authentication if not called within TLS authentication itself, which may produce a never ending loop... - if (!$in_tls) + $this->response(array($key => $value)); + } + return; + } + else + { + // or even multiple elements of the same type? + // array('message' => array(0 => ..., 1 => ...)) + if (sizeof(reset($xml)) > 1) + { + foreach (reset($xml) as $value) { - if (!empty($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns']) && $incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls') - { - return $this->_starttls(); - } + $this->response(array(key($xml) => array(0 => $value))); } - - return true; - } - else - { - $this->add_to_log('ERROR: _check_connected() #1'); - return false; + return; } } - else + + switch (key($xml)) { - $this->add_to_log('ERROR: _check_connected() #2'); - return false; - } - } + case 'stream:stream': + // Connection initialised (or after authentication). Not much to do here... + $this->session['id'] = $xml['stream:stream'][0]['@']['id']; - /** - * Start TLS/SSL session if supported (PHP5.1) - * @access private - */ - function _starttls() - { - if (!function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers')) - { - $this->add_to_log('WARNING: TLS is not available'); - return true; - } - - // Make sure the encryption stream is supported - $streams = stream_get_wrappers(); - - if (!in_array('streams.crypto', $streams)) - { - $this->add_to_log('WARNING: SSL/crypto stream not supported'); - return true; - } - - $this->send_packet("\n"); - sleep(2); - $incoming_array = $this->_listen_incoming(); - - if (!is_array($incoming_array)) - { - $this->add_to_log('ERROR: _starttls() #1'); - return false; - } - - if ($incoming_array['proceed']['@']['xmlns'] != 'urn:ietf:params:xml:ns:xmpp-tls') - { - $this->add_to_log('ERROR: _starttls() #2'); - return false; - } - - $meta = stream_get_meta_data($this->connector->active_socket); - socket_set_blocking($this->connector->active_socket, 1); - - $result = @stream_socket_enable_crypto($this->connector->active_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); - if (!$result) - { - socket_set_blocking($this->connector->active_socket, $meta['blocked']); - $this->add_to_log('ERROR: _starttls() #3'); - return false; - } - - socket_set_blocking($this->connector->active_socket, $meta['blocked']); - - $this->send_packet("\n"); - $this->send_packet("show_version) ? " version='{$this->version}'" : '') . ">\n"); - sleep(2); - - if (!$this->_check_connected(true)) - { - $this->add_to_log('ERROR: _starttls() #4'); - return false; - } - - return true; - } - - /** - * Get packet type - * @access private - */ - function _get_packet_type($packet = NULL) - { - if (is_array($packet)) - { - reset($packet); - $packet_type = key($packet); - } - - return ($packet_type) ? $packet_type : false; - } - - /** - * Split incoming packet - * @access private - */ - function _split_incoming($incoming) - { - $temp = preg_split('#<(message|iq|presence|stream)#', $incoming, -1, PREG_SPLIT_DELIM_CAPTURE); - $array = array(); - - for ($i = 1, $size = sizeof($temp); $i < $size; $i += 2) - { - $array[] = '<' . $temp[$i] . $temp[($i + 1)]; - } - - return $array; - } - - /** - * Recursively prepares the strings in an array to be used in XML data. - * @access private - */ - function _array_xmlspecialchars(&$array) - { - if (is_array($array)) - { - foreach ($array as $k => $v) - { - if (is_array($v)) + if (isset($xml['stream:stream'][0]['#']['stream:features'])) { - $this->_array_xmlspecialchars($array[$k]); + // we already got all info we need + $this->features = $xml['stream:stream'][0]['#']; } else { - $this->_xmlspecialchars($array[$k]); + $this->features = $this->listen(); } + + // go on with authentication? + if (isset($this->features['stream:features'][0]['#']['bind'])) + { + return $this->response($this->features); + } + break; + + case 'stream:features': + // Resource binding after successful authentication + if (isset($this->session['authenticated'])) + { + // session required? + $this->session['sess_required'] = isset($xml['stream:features'][0]['#']['session']); + + $this->send(" + + functions_jabber.phpbb.php + + "); + return $this->response($this->listen()); + } + + // Let's use TLS if SSL is not enabled and we can actually use it + if (!$this->session['ssl'] && $this->can_use_tls() && isset($xml['stream:features'][0]['#']['starttls'])) + { + $this->add_to_log('Switching to TLS.'); + $this->send("\n"); + return $this->response($this->listen()); + } + + // Does the server support SASL authentication? + + // I hope so, because we do (and no other method). + if (isset($xml['stream:features'][0]['#']['mechanisms'][0]['@']['xmlns']) && $xml['stream:features'][0]['#']['mechanisms'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-sasl') + { + // Now decide on method + $methods = array(); + + foreach ($xml['stream:features'][0]['#']['mechanisms'][0]['#']['mechanism'] as $value) + { + $methods[] = $value['#']; + } + + // we prefer DIGEST-MD5 + // we don't want to use plain authentication (neither does the server usually) if no encryption is in place + + // http://www.xmpp.org/extensions/attic/jep-0078-1.7.html + // The plaintext mechanism SHOULD NOT be used unless the underlying stream is encrypted (using SSL or TLS) + // and the client has verified that the server certificate is signed by a trusted certificate authority. + + if (in_array('DIGEST-MD5', $methods)) + { + $this->send(""); + } + else if (in_array('PLAIN', $methods) && ($this->session['ssl'] || !empty($this->session['tls']))) + { + $this->send("" + . base64_encode(chr(0) . $this->username . '@' . $this->server . chr(0) . $this->password) . + ''); + } + else if (in_array('ANONYMOUS', $methods)) + { + $this->send(""); + } + else + { + // not good... + $this->add_to_log('Error: No authentication method supported.'); + $this->disconnect(); + return false; + } + + return $this->response($this->listen()); + } + else + { + // ok, this is it. bye. + $this->add_to_log('Error: Server does not offer SASL authentication.'); + $this->disconnect(); + return false; + } + break; + + case 'challenge': + // continue with authentication...a challenge literally -_- + $decoded = base64_decode($xml['challenge'][0]['#']); + $decoded = $this->parse_data($decoded); + + if (!isset($decoded['digest-uri'])) + { + $decoded['digest-uri'] = 'xmpp/'. $this->server; + } + + // better generate a cnonce, maybe it's needed + $str = ''; + mt_srand((double)microtime()*10000000); + + for ($i = 0; $i < 32; $i++) + { + $str .= chr(mt_rand(0, 255)); + } + $decoded['cnonce'] = base64_encode($str); + + // second challenge? + if (isset($decoded['rspauth'])) + { + $this->send(""); + } + else + { + $response = array( + 'username' => $this->username, + 'response' => $this->encrypt_password(array_merge($decoded, array('nc' => '00000001'))), + 'charset' => 'utf-8', + 'nc' => '00000001', + ); + + foreach (array('nonce', 'qop', 'digest-uri', 'realm', 'cnonce') as $key) + { + if (isset($decoded[$key])) + { + $response[$key] = $decoded[$key]; + } + } + + $this->send("" . base64_encode($this->implode_data($response)) . ''); + } + + return $this->response($this->listen()); + break; + + case 'failure': + $this->add_to_log('Error: Server sent "failure".'); + $this->disconnect(); + return false; + break; + + case 'proceed': + // continue switching to TLS + $meta = stream_get_meta_data($this->connection); + socket_set_blocking($this->connection, 1); + + if (!stream_socket_enable_crypto($this->connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + { + $this->add_to_log('Error: TLS mode change failed.'); + return false; + } + + socket_set_blocking($this->connection, $meta['blocked']); + $this->session['tls'] = true; + + // new stream + $this->send("\n"); + $this->send("\n"); + + return $this->response($this->listen()); + break; + + case 'success': + // Yay, authentication successful. + $this->send("\n"); + $this->session['authenticated'] = true; + + // we have to wait for another response + return $this->response($this->listen()); + break; + + case 'iq': + // we are not interested in IQs we did not expect + if (!isset($xml['iq'][0]['@']['id'])) + { + return false; + } + + // multiple possibilities here + switch ($xml['iq'][0]['@']['id']) + { + case 'bind_1': + $this->session['jid'] = $xml['iq'][0]['#']['bind'][0]['#']['jid'][0]['#']; + + // and (maybe) yet another request to be able to send messages *finally* + if ($this->session['sess_required']) + { + $this->send(" + + "); + return $this->response($this->listen()); + } + + return true; + break; + + case 'sess_1': + return true; + break; + + case 'reg_1': + $this->send(" + + " . utf8_htmlspecialchars($this->username) . " + " . utf8_htmlspecialchars($this->password) . " + + "); + return $this->response($this->listen()); + break; + + case 'reg_2': + // registration end + if (isset($xml['iq'][0]['#']['error'])) + { + $this->add_to_log('Warning: Registration failed.'); + return false; + } + return true; + break; + + case 'unreg_1': + return true; + break; + + default: + $this->add_to_log('Notice: Received unexpected IQ.'); + return false; + break; + } + break; + + case 'message': + // we are only interested in content... + if (!isset($xml['message'][0]['#']['body'])) + { + return false; + } + + $message['body'] = $xml['message'][0]['#']['body'][0]['#']; + $message['from'] = $xml['message'][0]['@']['from']; + + if (isset($xml['message'][0]['#']['subject'])) + { + $message['subject'] = $xml['message'][0]['#']['subject'][0]['#']; + } + $this->session['messages'][] = $message; + break; + + default: + // hm...don't know this response + $this->add_to_log('Notice: Unknown server response (' . key($xml) . ')'); + return false; + break; + } + } + + function send_message($to, $text, $subject = '', $type = 'normal') + { + if (!isset($this->session['jid'])) + { + return false; + } + + if (!in_array($type, array('chat', 'normal', 'error', 'groupchat', 'headline'))) + { + $type = 'normal'; + } + + return $this->send(" + " . utf8_htmlspecialchars($subject) . " + " . utf8_htmlspecialchars($text) . " + " + ); + } + + /** + * Encrypts a password as in RFC 2831 + * @param array $data Needs data from the client-server connection + * @access public + * @return string + */ + function encrypt_password($data) + { + // let's me think about again... + foreach (array('realm', 'cnonce', 'digest-uri') as $key) + { + if (!isset($data[$key])) + { + $data[$key] = ''; } } - } - /** - * Prepares a string for usage in XML data. - * @access private - */ - function _xmlspecialchars(&$string) - { - // we only have a few entities in xml - $string = str_replace(array('&', '>', '<', '"', '\''), array('&', '>', '<', '"', '''), $string); - } + $pack = md5($this->username . ':' . $data['realm'] . ':' . $this->password); - // ====================================================================== - // parsers - // ====================================================================== - - /** - * Get info from message (from) - */ - function get_info_from_message_from($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['from'] : false; - } - - /** - * Get info from message (type) - */ - function get_info_from_message_type($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['type'] : false; - } - - /** - * Get info from message (id) - */ - function get_info_from_message_id($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['@']['id'] : false; - } - - /** - * Get info from message (thread) - */ - function get_info_from_message_thread($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['thread'][0]['#'] : false; - } - - /** - * Get info from message (subject) - */ - function get_info_from_message_subject($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['subject'][0]['#'] : false; - } - - /** - * Get info from message (body) - */ - function get_info_from_message_body($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['body'][0]['#'] : false; - } - - /** - * Get info from message (xmlns) - */ - function get_info_from_message_xmlns($packet = NULL) - { - return (is_array($packet)) ? $packet['message']['#']['x'] : false; - } - - /** - * Get info from message (error) - */ - function get_info_from_message_error($packet = NULL) - { - $error = preg_replace('#^\/$#', '', ($packet['message']['#']['error'][0]['@']['code'] . '/' . $packet['message']['#']['error'][0]['#'])); - return (is_array($packet)) ? $error : false; - } - - // ====================================================================== - // parsers - // ====================================================================== - - /** - * Get info from iq (from) - */ - function get_info_from_iq_from($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['from'] : false; - } - - /** - * Get info from iq (type) - */ - function get_info_from_iq_type($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['type'] : false; - } - - /** - * Get info from iq (id) - */ - function get_info_from_iq_id($packet = NULL) - { - return (is_array($packet)) ? $packet['iq']['@']['id'] : false; - } - - /** - * Get info from iq (key) - */ - function get_info_from_iq_key($packet = NULL) - { - return (is_array($packet) && isset($packet['iq']['#']['query'][0]['#']['key'][0]['#'])) ? $packet['iq']['#']['query'][0]['#']['key'][0]['#'] : false; - } - - /** - * Get info from iq (error) - */ - function get_info_from_iq_error($packet = NULL) - { - $error = preg_replace('#^\/$#', '', ($packet['iq']['#']['error'][0]['@']['code'] . '/' . $packet['iq']['#']['error'][0]['#'])); - return (is_array($packet)) ? $error : false; - } - - // ====================================================================== - // handlers - // ====================================================================== - - /** - * Message type normal - */ - function handler_message_normal($packet) - { - $from = $packet['message']['@']['from']; - $this->add_to_log("EVENT: Message (type normal) from $from"); - } - - /** - * Message type chat - */ - function handler_message_chat($packet) - { - $from = $packet['message']['@']['from']; - $this->add_to_log("EVENT: Message (type chat) from $from"); - } - - /** - * Message type groupchat - */ - function handler_message_groupchat($packet) - { - $from = $packet['message']['@']['from']; - $this->add_to_log("EVENT: Message (type groupchat) from $from"); - } - - /** - * Message type headline - */ - function handler_message_headline($packet) - { - $from = $packet['message']['@']['from']; - $this->add_to_log("EVENT: Message (type headline) from $from"); - } - - /** - * Message type error - */ - function handler_message_error($packet) - { - $from = $packet['message']['@']['from']; - $this->add_to_log("EVENT: Message (type error) from $from"); - } - - // ====================================================================== - // handlers - // ====================================================================== - - /** - * application version updates - */ - function handler_iq_jabber_iq_autoupdate($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:autoupdate from $from"); - } - - /** - * interactive server component properties - */ - function handler_iq_jabber_iq_agent($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:agent from $from"); - } - - /** - * method to query interactive server components - */ - function handler_iq_jabber_iq_agents($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:agents from $from"); - } - - /** - * simple client authentication - */ - function handler_iq_jabber_iq_auth($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:auth from $from"); - } - - /** - * out of band data - */ - function handler_iq_jabber_iq_oob($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:oob from $from"); - } - - /** - * method to store private data on the server - */ - function handler_iq_jabber_iq_private($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:private from $from"); - } - - /** - * method for interactive registration - */ - function handler_iq_jabber_iq_register($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:register from $from"); - } - - /** - * client roster management - */ - function handler_iq_jabber_iq_roster($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:roster from $from"); - } - - /** - * method for searching a user database - */ - function handler_iq_jabber_iq_search($packet) - { - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: jabber:iq:search from $from"); - } - - /** - * method for requesting the current time - */ - function handler_iq_jabber_iq_time($packet) - { - if ($this->keep_alive_id == $this->get_info_from_iq_id($packet)) + if (isset($data['authzid'])) { - $this->returned_keep_alive = true; - $this->connected = true; - - $this->add_to_log('EVENT: Keep-Alive returned, connection alive.'); + $a1 = pack('H32', $pack) . sprintf(':%s:%s:%s', $data['nonce'], $data['cnonce'], $data['authzid']); + } + else + { + $a1 = pack('H32', $pack) . sprintf(':%s:%s', $data['nonce'], $data['cnonce']); } - $type = $this->get_info_from_iq_type($packet); - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - $id = ($id != '') ? $id : 'time_' . time(); + // should be: qop = auth + $a2 = 'AUTHENTICATE:'. $data['digest-uri']; - if ($type == 'get') + return md5(sprintf('%s:%s:%s:%s:%s:%s', md5($a1), $data['nonce'], $data['nc'], $data['cnonce'], $data['qop'], md5($a2))); + } + + /** + * parse_data like a="b",c="d",... + * @param string $data + * @access public + * @return array a => b ... + */ + function parse_data($data) + { + // super basic, but should suffice + $data = explode(',', $data); + $pairs = array(); + + foreach ($data as $pair) { - $payload = '' . gmdate("Ydm\TH:i:s") . '' . date('T') . '' . date("Y/d/m h:i:s A") . ''; - $this->send_iq($from, 'result', $id, 'jabber:iq:time', $payload); + $dd = strpos($pair, '='); + if ($dd) + { + $pairs[substr($pair, 0, $dd)] = trim(substr($pair, $dd + 1), '"'); + } } - - $this->add_to_log("EVENT: jabber:iq:time (type $type) from $from"); + return $pairs; } /** + * opposite of jabber::parse_data() + * @param array $data + * @access public + * @return string */ - function handler_iq_error($packet) + function implode_data($data) { - // We'll do something with these later. This is a placeholder so that errors don't bounce back and forth. - } - - /** - * method for requesting version - */ - function handler_iq_jabber_iq_version($packet) - { - $type = $this->get_info_from_iq_type($packet); - $from = $this->get_info_from_iq_from($packet); - $id = $this->get_info_from_iq_id($packet); - $id = ($id != '') ? $id : 'version_' . time(); - - if ($type == 'get') + $return = array(); + foreach ($data as $key => $value) { - $payload = "{$this->iq_version_name} - {$this->iq_version_os} - {$this->iq_version_version}"; - - //$this->SendIq($from, 'result', $id, "jabber:iq:version", $payload); + $return[] = $key . '="' . $value . '"'; } - - $this->add_to_log("EVENT: jabber:iq:version (type $type) from $from -- DISABLED"); + return implode(',', $return); } - // ====================================================================== - // Generic handlers - // ====================================================================== - - /** - * Generic handler for unsupported requests - */ - function handler_not_implemented($packet) - { - $packet_type = $this->_get_packet_type($packet); - $from = call_user_func(array(&$this, 'get_info_from_' . strtolower($packet_type) . '_from'), $packet); - $id = call_user_func(array(&$this, 'get_info_from_' . strtolower($packet_type) . '_id'), $packet); - - $this->send_error($from, $id, 501); - $this->add_to_log("EVENT: Unrecognized <$packet_type/> from $from"); - } - - // ====================================================================== - // Third party code - // m@d pr0ps to the coders ;) - // ====================================================================== - /** * xmlize() * @author Hans Anderson @@ -1334,6 +731,12 @@ class jabber { $data = trim($data); + if (substr($data, 0, 5) != ''. $data . ''; + } + $vals = $index = $array = array(); $parser = xml_parser_create($encoding); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); @@ -1344,8 +747,13 @@ class jabber $i = 0; $tagname = $vals[$i]['tag']; - $array[$tagname]['@'] = (isset($vals[$i]['attributes'])) ? $vals[$i]['attributes'] : array(); - $array[$tagname]['#'] = $this->_xml_depth($vals, $i); + $array[$tagname][0]['@'] = (isset($vals[$i]['attributes'])) ? $vals[$i]['attributes'] : array(); + $array[$tagname][0]['#'] = $this->_xml_depth($vals, $i); + + if (substr($data, 0, 5) != ''; - } - - foreach ($array as $key => $val) - { - if (is_array($val)) - { - $this->traverse_xmlize($val, $arr_name . '[' . $key . ']', $level + 1); - } - else - { - $GLOBALS['traverse_array'][] = '$' . $arr_name . '[' . $key . '] = "' . $val . "\"\n"; - } - } - - if ($level == 0) - { - echo ''; - } - - return 1; - } -} - -/** -* Jabber Connector -* @package phpBB3 -*/ -class cjp_standard_connector -{ - var $active_socket; - - /** - * Open socket - */ - function open_socket($server, $port) - { - if (function_exists('dns_get_record')) - { - $record = dns_get_record("_xmpp-client._tcp.$server", DNS_SRV); - - if (!empty($record)) - { - $server = $record[0]['target']; - $port = $record[0]['port']; - } - } - - $errno = 0; - $errstr = ''; - - if ($this->active_socket = @fsockopen($server, $port, $errno, $errstr, 5)) - { - @socket_set_blocking($this->active_socket, 0); - @socket_set_timeout($this->active_socket, 31536000); - - return true; - } - else - { - return false; - } - } - - /** - * Close socket - */ - function close_socket() - { - return @fclose($this->active_socket); - } - - /** - * Write to socket - */ - function write_to_socket($data) - { - return @fwrite($this->active_socket, $data); - } - - /** - * Read from socket - */ - function read_from_socket($chunksize) - { - $buffer = @fread($this->active_socket, $chunksize); - $buffer = (STRIP) ? stripslashes($buffer) : $buffer; - - return $buffer; - } } ?> \ No newline at end of file diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index d4052a8968..26ff1491fb 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1,10 +1,10 @@ jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']); if (!$this->jabber->connect()) { @@ -466,19 +466,17 @@ class messenger return false; } - if (!$this->jabber->send_auth()) + if (!$this->jabber->login()) { $this->error('JABBER', 'Could not authorise on Jabber server
    ' . $this->jabber->get_log()); return false; } - $this->jabber->send_presence(NULL, NULL, 'online'); foreach ($addresses as $address) { - $this->jabber->send_message($address, 'normal', NULL, array('body' => $this->msg, 'subject' => $this->subject)); + $this->jabber->send_message($address, $this->msg, $this->subject); } - sleep(1); $this->jabber->disconnect(); } else @@ -592,7 +590,7 @@ class queue } include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx); - $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']); if (!$this->jabber->connect()) { @@ -600,12 +598,11 @@ class queue continue 2; } - if (!$this->jabber->send_auth()) + if (!$this->jabber->login()) { messenger::error('JABBER', 'Could not authorise on Jabber server'); continue 2; } - $this->jabber->send_presence(NULL, NULL, 'online'); break; @@ -647,7 +644,7 @@ class queue case 'jabber': foreach ($addresses as $address) { - if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg, 'subject' => $subject)) === false) + if ($this->jabber->send_message($address, $msg, $subject) === false) { messenger::error('JABBER', $this->jabber->get_log()); continue 3; @@ -669,7 +666,6 @@ class queue case 'jabber': // Hang about a couple of secs to ensure the messages are // handled, then disconnect - sleep(1); $this->jabber->disconnect(); break; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 64612f4ca3..282e74fa7c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1635,7 +1635,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_approved' => (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? 0 : 1, 'topic_title' => $subject, 'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), - 'topic_first_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''), + 'topic_first_poster_colour' => $user->data['user_colour'], 'topic_type' => $topic_type, 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : 0, @@ -1774,7 +1774,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'topic_last_post_time' => $current_time, 'topic_last_poster_id' => (int) $user->data['user_id'], 'topic_last_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''), - 'topic_last_poster_colour' => (($user->data['user_id'] != ANONYMOUS) ? $user->data['user_colour'] : ''), + 'topic_last_poster_colour' => $user->data['user_colour'], ); } @@ -2012,7 +2012,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = ' . $current_time; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_poster_id = ' . (int) $user->data['user_id']; $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; - $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . (($user->data['user_id'] != ANONYMOUS) ? $db->sql_escape($user->data['user_colour']) : '') . "'"; + $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'"; } else if ($post_mode == 'edit_last_post') { diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 7f2e3e4c12..862df6e4e1 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1,10 +1,10 @@ $rule_ary) { @@ -517,9 +518,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) case ACTION_PLACE_INTO_FOLDER: // Folder actions have precedence, so we will remove any other ones $folder_action = true; - $_folder_id = (int) $rule_ary['folder_id']; - $move_into_folder = array(); - $move_into_folder[$_folder_id][] = $msg_id; + $move_into_folder[(int) $rule_ary['folder_id']][] = $msg_id; $num_new++; break; @@ -528,15 +527,11 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) { $unread_ids[] = $msg_id; } - - if (!$folder_action) - { - $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; - } break; case ACTION_DELETE_MESSAGE: $delete_ids[] = $msg_id; + $message_removed = true; break; case ACTION_MARK_AS_IMPORTANT: @@ -544,14 +539,16 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) { $important_ids[] = $msg_id; } - - if (!$folder_action) - { - $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; - } break; } } + + // We place this here because it could happen that the messages are doubled if a rule marks a message and then moves it into a specific + // folder. Here we simply move the message into the INBOX if it gets not removed and also not put into a custom folder. + if (!$folder_action && !$message_removed) + { + $move_into_folder[PRIVMSGS_INBOX][] = $msg_id; + } } // $num_new += sizeof(array_unique($delete_ids)); @@ -875,7 +872,7 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id) */ function handle_mark_actions($user_id, $mark_action) { - global $db, $user, $_POST, $phpbb_root_path, $phpEx; + global $db, $user, $phpbb_root_path, $phpEx; $msg_ids = request_var('marked_msg_id', array(0)); $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 51a7fa8bb7..2a38c8c7ad 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -382,7 +382,9 @@ class ftp extends transfer } else { - $chmod_cmd = 'CHMOD ' . $perms . ' ' . $file; + // Unfortunatly CHMOD is not expecting an octal value... + // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;) + $chmod_cmd = 'CHMOD ' . base_convert($perms, 10, 8) . ' ' . $file; $err = $this->_site($chmod_cmd); } @@ -605,7 +607,9 @@ class ftp_fsock extends transfer */ function _chmod($file, $perms) { - return $this->_send_command('SITE CHMOD', $perms . ' ' . $file); + // Unfortunatly CHMOD is not expecting an octal value... + // We need to transform the integer (which was an octal) to an octal representation (to get the int) and then pass as is. ;) + return $this->_send_command('SITE CHMOD', base_convert($perms, 10, 8) . ' ' . $file); } /** diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index cab9d8bc25..50e84fca84 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -143,9 +143,16 @@ function user_add($user_row, $cp_data = false) return false; } + $username_clean = utf8_clean_string($user_row['username']); + + if (empty($username_clean)) + { + return false; + } + $sql_ary = array( 'username' => $user_row['username'], - 'username_clean' => utf8_clean_string($user_row['username']), + 'username_clean' => $username_clean, 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', 'user_pass_convert' => 0, 'user_email' => strtolower($user_row['user_email']), @@ -1262,7 +1269,7 @@ function validate_username($username, $allowed_username = false) } // ... fast checks first. - if (strpos($username, '"') !== false || strpos($username, '"') !== false) + if (strpos($username, '"') !== false || strpos($username, '"') !== false || empty($clean_username)) { return 'INVALID_CHARS'; } @@ -1556,12 +1563,212 @@ function validate_email($email, $allowed_email = false) return false; } +/** +* Validate jabber address +* Taken from the jabber class within flyspray (see author notes) +* +* @author flyspray.org +*/ +function validate_jabber($jid) +{ + if (!$jid) + { + return false; + } + $seperator_pos = strpos($jid, '@'); + + if ($seperator_pos === false) + { + return 'WRONG_DATA'; + } + + $username = substr($jid, 0, $seperator_pos); + $realm = substr($jid, $seperator_pos + 1); + + if (strlen($username) == 0 || strlen($realm) < 3) + { + return 'WRONG_DATA'; + } + + $arr = explode('.', $realm); + + if (sizeof($arr) == 0) + { + return 'WRONG_DATA'; + } + + foreach ($arr as $part) + { + if (substr($part, 0, 1) == '-' || substr($part, -1, 1) == '-') + { + return 'WRONG_DATA'; + } + + if (!preg_match("@^[a-zA-Z0-9-.]+$@", $part)) + { + return 'WRONG_DATA'; + } + } + + $boundary = array(array(0, 127), array(192, 223), array(224, 239), array(240, 247), array(248, 251), array(252, 253)); + + // Prohibited Characters RFC3454 + RFC3920 + $prohibited = array( + // Table C.1.1 + array(0x0020, 0x0020), // SPACE + // Table C.1.2 + array(0x00A0, 0x00A0), // NO-BREAK SPACE + array(0x1680, 0x1680), // OGHAM SPACE MARK + array(0x2000, 0x2001), // EN QUAD + array(0x2001, 0x2001), // EM QUAD + array(0x2002, 0x2002), // EN SPACE + array(0x2003, 0x2003), // EM SPACE + array(0x2004, 0x2004), // THREE-PER-EM SPACE + array(0x2005, 0x2005), // FOUR-PER-EM SPACE + array(0x2006, 0x2006), // SIX-PER-EM SPACE + array(0x2007, 0x2007), // FIGURE SPACE + array(0x2008, 0x2008), // PUNCTUATION SPACE + array(0x2009, 0x2009), // THIN SPACE + array(0x200A, 0x200A), // HAIR SPACE + array(0x200B, 0x200B), // ZERO WIDTH SPACE + array(0x202F, 0x202F), // NARROW NO-BREAK SPACE + array(0x205F, 0x205F), // MEDIUM MATHEMATICAL SPACE + array(0x3000, 0x3000), // IDEOGRAPHIC SPACE + // Table C.2.1 + array(0x0000, 0x001F), // [CONTROL CHARACTERS] + array(0x007F, 0x007F), // DELETE + // Table C.2.2 + array(0x0080, 0x009F), // [CONTROL CHARACTERS] + array(0x06DD, 0x06DD), // ARABIC END OF AYAH + array(0x070F, 0x070F), // SYRIAC ABBREVIATION MARK + array(0x180E, 0x180E), // MONGOLIAN VOWEL SEPARATOR + array(0x200C, 0x200C), // ZERO WIDTH NON-JOINER + array(0x200D, 0x200D), // ZERO WIDTH JOINER + array(0x2028, 0x2028), // LINE SEPARATOR + array(0x2029, 0x2029), // PARAGRAPH SEPARATOR + array(0x2060, 0x2060), // WORD JOINER + array(0x2061, 0x2061), // FUNCTION APPLICATION + array(0x2062, 0x2062), // INVISIBLE TIMES + array(0x2063, 0x2063), // INVISIBLE SEPARATOR + array(0x206A, 0x206F), // [CONTROL CHARACTERS] + array(0xFEFF, 0xFEFF), // ZERO WIDTH NO-BREAK SPACE + array(0xFFF9, 0xFFFC), // [CONTROL CHARACTERS] + array(0x1D173, 0x1D17A), // [MUSICAL CONTROL CHARACTERS] + // Table C.3 + array(0xE000, 0xF8FF), // [PRIVATE USE, PLANE 0] + array(0xF0000, 0xFFFFD), // [PRIVATE USE, PLANE 15] + array(0x100000, 0x10FFFD), // [PRIVATE USE, PLANE 16] + // Table C.4 + array(0xFDD0, 0xFDEF), // [NONCHARACTER CODE POINTS] + array(0xFFFE, 0xFFFF), // [NONCHARACTER CODE POINTS] + array(0x1FFFE, 0x1FFFF), // [NONCHARACTER CODE POINTS] + array(0x2FFFE, 0x2FFFF), // [NONCHARACTER CODE POINTS] + array(0x3FFFE, 0x3FFFF), // [NONCHARACTER CODE POINTS] + array(0x4FFFE, 0x4FFFF), // [NONCHARACTER CODE POINTS] + array(0x5FFFE, 0x5FFFF), // [NONCHARACTER CODE POINTS] + array(0x6FFFE, 0x6FFFF), // [NONCHARACTER CODE POINTS] + array(0x7FFFE, 0x7FFFF), // [NONCHARACTER CODE POINTS] + array(0x8FFFE, 0x8FFFF), // [NONCHARACTER CODE POINTS] + array(0x9FFFE, 0x9FFFF), // [NONCHARACTER CODE POINTS] + array(0xAFFFE, 0xAFFFF), // [NONCHARACTER CODE POINTS] + array(0xBFFFE, 0xBFFFF), // [NONCHARACTER CODE POINTS] + array(0xCFFFE, 0xCFFFF), // [NONCHARACTER CODE POINTS] + array(0xDFFFE, 0xDFFFF), // [NONCHARACTER CODE POINTS] + array(0xEFFFE, 0xEFFFF), // [NONCHARACTER CODE POINTS] + array(0xFFFFE, 0xFFFFF), // [NONCHARACTER CODE POINTS] + array(0x10FFFE, 0x10FFFF), // [NONCHARACTER CODE POINTS] + // Table C.5 + array(0xD800, 0xDFFF), // [SURROGATE CODES] + // Table C.6 + array(0xFFF9, 0xFFF9), // INTERLINEAR ANNOTATION ANCHOR + array(0xFFFA, 0xFFFA), // INTERLINEAR ANNOTATION SEPARATOR + array(0xFFFB, 0xFFFB), // INTERLINEAR ANNOTATION TERMINATOR + array(0xFFFC, 0xFFFC), // OBJECT REPLACEMENT CHARACTER + array(0xFFFD, 0xFFFD), // REPLACEMENT CHARACTER + // Table C.7 + array(0x2FF0, 0x2FFB), // [IDEOGRAPHIC DESCRIPTION CHARACTERS] + // Table C.8 + array(0x0340, 0x0340), // COMBINING GRAVE TONE MARK + array(0x0341, 0x0341), // COMBINING ACUTE TONE MARK + array(0x200E, 0x200E), // LEFT-TO-RIGHT MARK + array(0x200F, 0x200F), // RIGHT-TO-LEFT MARK + array(0x202A, 0x202A), // LEFT-TO-RIGHT EMBEDDING + array(0x202B, 0x202B), // RIGHT-TO-LEFT EMBEDDING + array(0x202C, 0x202C), // POP DIRECTIONAL FORMATTING + array(0x202D, 0x202D), // LEFT-TO-RIGHT OVERRIDE + array(0x202E, 0x202E), // RIGHT-TO-LEFT OVERRIDE + array(0x206A, 0x206A), // INHIBIT SYMMETRIC SWAPPING + array(0x206B, 0x206B), // ACTIVATE SYMMETRIC SWAPPING + array(0x206C, 0x206C), // INHIBIT ARABIC FORM SHAPING + array(0x206D, 0x206D), // ACTIVATE ARABIC FORM SHAPING + array(0x206E, 0x206E), // NATIONAL DIGIT SHAPES + array(0x206F, 0x206F), // NOMINAL DIGIT SHAPES + // Table C.9 + array(0xE0001, 0xE0001), // LANGUAGE TAG + array(0xE0020, 0xE007F), // [TAGGING CHARACTERS] + // RFC3920 + array(0x22, 0x22), // " + array(0x26, 0x26), // & + array(0x27, 0x27), // ' + array(0x2F, 0x2F), // / + array(0x3A, 0x3A), // : + array(0x3C, 0x3C), // < + array(0x3E, 0x3E), // > + array(0x40, 0x40) // @ + ); + + $pos = 0; + $result = true; + + while ($pos < strlen($username)) + { + $len = $uni = 0; + for ($i = 0; $i <= 5; $i++) + { + if (ord($username[$pos]) >= $boundary[$i][0] && ord($username[$pos]) <= $boundary[$i][1]) + { + $len = $i + 1; + $uni = (ord($username[$pos]) - $boundary[$i][0]) * pow(2, $i * 6); + + for ($k = 1; $k < $len; $k++) + { + $uni += (ord($username[$pos + $k]) - 128) * pow(2, ($i - $k) * 6); + } + + break; + } + } + + if ($len == 0) + { + return 'WRONG_DATA'; + } + + foreach ($prohibited as $pval) + { + if ($uni >= $pval[0] && $uni <= $pval[1]) + { + $result = false; + break 2; + } + } + + $pos = $pos + $len; + } + + if (!$result) + { + return 'WRONG_DATA'; + } + + return false; +} /** * Remove avatar */ -function avatar_delete($mode, $row) +function avatar_delete($mode, $row, $clean_db = false) { global $phpbb_root_path, $config, $db, $user; @@ -1574,6 +1781,10 @@ function avatar_delete($mode, $row) } } + if ($clean_db) + { + avatar_remove_db($row[$mode . '_avatar']); + } $filename = get_avatar_filename($row[$mode . '_avatar']); if (file_exists($phpbb_root_path . $config['avatar_path'] . '/' . $filename)) { @@ -1595,8 +1806,7 @@ function avatar_remote($data, &$error) { $data['remotelink'] = 'http://' . $data['remotelink']; } - - if (!preg_match('#^(http|https|ftp)://(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}:?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelink'])) + if (!preg_match('#^(http|https|ftp)://(?:(.*?\.)*?[a-z0-9\-]+?\.[a-z]{2,4}|(?:\d{1,3}\.){3,5}\d{1,3}):?([0-9]*?).*?\.(gif|jpg|jpeg|png)$#i', $data['remotelink'])) { $error[] = $user->lang['AVATAR_URL_INVALID']; return false; @@ -1962,7 +2172,7 @@ function avatar_process_user(&$error, $custom_userdata = false) $sql_ary['user_avatar'] = ''; $sql_ary['user_avatar_type'] = $sql_ary['user_avatar_width'] = $sql_ary['user_avatar_height'] = 0; } - elseif (!empty($userdata['user_avatar'])) + else if (!empty($userdata['user_avatar'])) { // Only update the dimensions @@ -2023,7 +2233,8 @@ function avatar_process_user(&$error, $custom_userdata = false) $userdata = ($custom_userdata === false) ? $user->data : $custom_userdata; // Delete old avatar if present - if ($userdata['user_avatar'] && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] != AVATAR_GALLERY) + if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD) + || ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD && $sql_ary['user_avatar_type'] != AVATAR_UPLOAD)) { avatar_delete('user', $userdata); } @@ -2215,6 +2426,22 @@ function group_correct_avatar($group_id, $old_entry) } } + +/** +* Remove avatar also for users not having the group as default +*/ +function avatar_remove_db($avatar_name) +{ + global $config, $db; + + $sql = 'UPDATE ' . USERS_TABLE . " + SET user_avatar = '', + user_avatar_type = 0 + WHERE user_avatar = '" . $db->sql_escape($avatar_name) . '\''; + $db->sql_query($sql); +} + + /** * Group Delete */ @@ -2702,12 +2929,6 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal continue; } - // Do not update the rank if it is set to "user default" - if (strpos($attribute, 'group_rank') === 0 && !$group_attributes[$attribute]) - { - continue; - } - settype($group_attributes[$attribute], $type); $sql_ary[str_replace('group_', 'user_', $attribute)] = $group_attributes[$attribute]; } diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 4387e02739..0578170d7b 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -63,7 +63,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) } $selected_ids = ''; - if (sizeof($post_id_list)) + if (sizeof($post_id_list) && $action != 'merge_topics') { foreach ($post_id_list as $num => $post_id) { @@ -318,6 +318,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) { global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; + if (!sizeof($topic_ids)) + { + $template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']); + return; + } if (!$to_topic_id) { $template->assign_var('MESSAGE', $user->lang['NO_FINAL_TOPIC_SELECTED']); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 687900e646..a8f6985089 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1,10 +1,10 @@ sql_query($sql); } - sync('forum', 'forum_id', $to_forum_id, true); + sync('forum', 'forum_id', $to_forum_id); set_config('num_topics', $config['num_topics'] + sizeof($new_topic_id_list), true); set_config('num_posts', $config['num_posts'] + $total_posts, true); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 8dbbdba92e..dc8733d0a5 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -1,10 +1,10 @@ assign_vars(array( 'U_MCP_ACTION' => "$url&i=main&quickmod=1", // Use this for mode paramaters 'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_CHGPOSTER' => $auth->acl_get('m_chgposter', $post_info['forum_id']), @@ -403,7 +404,8 @@ function change_poster(&$post_info, $userdata) { $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = user_posts - 1 - WHERE user_id = ' . $post_info['user_id']; + WHERE user_id = ' . $post_info['user_id'] .' + AND user_posts > 0'; $db->sql_query($sql); $sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 1492f64c43..d3af2caa24 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -1,10 +1,10 @@ assign_vars(array( 'S_MCP_QUEUE' => true, - 'S_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"), + 'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], @@ -274,7 +274,7 @@ class mcp_queue $forum_options = ''; foreach ($forum_list_approve as $row) { - $forum_options .= ''; + $forum_options .= ''; } $sort_days = $total = 0; diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index c318472b7d..be94521b14 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -1,10 +1,10 @@ (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'POST_ID' => $row['post_id'], - 'POST_SUBJECT' => $row['post_subject'], + 'POST_SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_TIME' => $user->format_date($row['post_time']), 'REPORT_ID' => $row['report_id'], 'REPORT_TIME' => $user->format_date($row['report_time']), diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 95f8d6c71b..ef41ede5c4 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -37,18 +37,25 @@ function mcp_topic_view($id, $mode, $action) $to_topic_id = request_var('to_topic_id', 0); $to_forum_id = request_var('to_forum_id', 0); $post_id_list = request_var('post_id_list', array(0)); + $sort = isset($_POST['sort']) ? true : false; // Split Topic? if ($action == 'split_all' || $action == 'split_beyond') { - split_topic($action, $topic_id, $to_forum_id, $subject); + if (!$sort) + { + split_topic($action, $topic_id, $to_forum_id, $subject); + } $action = 'split'; } // Merge Posts? if ($action == 'merge_posts') { - merge_posts($topic_id, $to_topic_id); + if (!$sort) + { + merge_posts($topic_id, $to_topic_id); + } $action = 'merge'; } @@ -69,7 +76,10 @@ function mcp_topic_view($id, $mode, $action) trigger_error('NO_POST_SELECTED'); } - approve_post($post_id_list, $id, $mode); + if (!$sort) + { + approve_post($post_id_list, $id, $mode); + } } // Jumpbox, sort selects and that kind of things @@ -407,7 +417,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $post_id_list = array(); while ($row = $db->sql_fetchrow($result)) { - // If splitted from selected post (split_beyond), we split the unapproved items too. + // If split from selected post (split_beyond), we split the unapproved items too. if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id'])) { // continue; diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 681a066af7..16339ddf55 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -291,7 +291,7 @@ class mcp_warn 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, - 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&p=$post_id"), + 'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&p=$post_id#p$post_id"), )); } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index b8f00d71ee..1a70a7fd80 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1,10 +1,10 @@ bbcode_parse_code($stx, $code_block); @@ -514,6 +514,8 @@ class bbcode_firstpass extends bbcode if ($code_block) { $code_block = substr($code_block, 0, -7); + $code_block = preg_replace($htm_match, $htm_replace, $code_block); + $out .= $this->bbcode_parse_code($stx, $code_block); } @@ -688,7 +690,7 @@ class bbcode_firstpass extends bbcode if ($tok == ']') { - if ($buffer == '/quote' && sizeof($close_tags)) + if ($buffer == '/quote' && sizeof($close_tags) && substr($out, -1, 1) == '[') { // we have found a closing tag $out .= array_pop($close_tags) . ']'; @@ -1039,7 +1041,7 @@ class parse_message extends bbcode_firstpass if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) { - $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : $user->lang['TOO_MANY_CHARS']; + $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']); return $this->warn_msg; } } @@ -1237,26 +1239,17 @@ class parse_message extends bbcode_firstpass { if ($max_smilies) { - $count = 0; - foreach ($match as $key => $smilie) + $num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches); + unset($matches); + + if ($num_matches !== false && $num_matches > $max_smilies) { - if ($small_count = preg_match_all($smilie, $this->message, $array)) - { - $count += $small_count; - if ($count > $max_smilies) - { - $this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies); - return; - } - } - $this->message = preg_replace($smilie, $replace[$key], $this->message); + $this->warn_msg[] = sprintf($user->lang['TOO_MANY_SMILIES'], $max_smilies); + return; } - $this->message = trim($this->message); - } - else - { - $this->message = trim(preg_replace($match, $replace, $this->message)); } + + $this->message = trim(preg_replace($match, $replace, $this->message)); } } @@ -1546,15 +1539,18 @@ class parse_message extends bbcode_firstpass // Parse Poll Option text ;) $tmp_message = $this->message; $this->message = $poll['poll_option_text']; + $bbcode_bitfield = $this->bbcode_bitfield; $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); + $this->bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message; // Parse Poll Title $tmp_message = $this->message; $this->message = $poll['poll_title']; + $this->bbcode_bitfield = $bbcode_bitfield; $poll['poll_options'] = explode("\n", trim($poll['poll_option_text'])); $poll['poll_options_size'] = sizeof($poll['poll_options']); @@ -1576,8 +1572,8 @@ class parse_message extends bbcode_firstpass } } + $this->bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); $this->message = $tmp_message; - unset($tmp_message); if (sizeof($poll['poll_options']) == 1) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 67f3258087..760b0753f2 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -1,10 +1,10 @@ sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>=')) { - $alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; + //$alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; } else { diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index ee9fa0ea98..f4a1ddac27 100755 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -273,7 +273,7 @@ class search_backend $sql_where = ''; foreach ($words as $word) { - $sql_where .= ' OR search_keywords LIKE \'%' . $db->sql_escape($word) . '%\''; + $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->any_char . $word . $db->any_char); } $sql = 'SELECT search_key diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index f771f71c22..c297a961a8 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1,10 +1,10 @@ sql_query($sql); $this->data = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $bot = false; } else if ($user_id !== false && !sizeof($this->data)) { @@ -427,8 +428,9 @@ class session $result = $db->sql_query($sql); $this->data = $db->sql_fetchrow($result); $db->sql_freeresult($result); + $bot = false; } - + // If no data was returned one or more of the following occurred: // Key didn't match one in the DB // User does not exist @@ -543,7 +545,6 @@ class session $SID = '?sid='; $_SID = ''; - return true; } else @@ -618,8 +619,10 @@ class session $this->set_login_key(); } + // refresh data $SID = '?sid=' . $this->session_id; $_SID = $this->session_id; + $this->data = array_merge($this->data, $sql_ary); if (!$bot) { @@ -644,7 +647,7 @@ class session $SID = '?sid='; $_SID = ''; } - + return true; } @@ -1203,7 +1206,7 @@ class user extends session if ($this->data['user_id'] != ANONYMOUS) { $this->lang_name = (file_exists($phpbb_root_path . 'language/' . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : $config['default_lang']; - $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; + $this->lang_path = $phpbb_root_path . 'language/' . basename($this->lang_name) . '/'; $this->date_format = $this->data['user_dateformat']; $this->timezone = $this->data['user_timezone'] * 3600; @@ -1212,7 +1215,7 @@ class user extends session else { $this->lang_name = $config['default_lang']; - $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; + $this->lang_path = $phpbb_root_path . 'language/' . basename($this->lang_name) . '/'; $this->date_format = $config['default_dateformat']; $this->timezone = $config['board_timezone'] * 3600; $this->dst = $config['board_dst'] * 3600; @@ -1506,6 +1509,33 @@ class user extends session trigger_error('BOARD_UNAVAILABLE'); } } + + // Make sure the user is able to hide his session + if (!$this->data['session_viewonline']) + { + // Reset online status if not allowed to hide the session... + if (!$auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 1 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 1; + } + } + else if (!$this->data['user_allow_viewonline']) + { + // the user wants to hide and is allowed to -> cloaking device on. + if ($auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 0 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 0; + } + } + // Does the user need to change their password? If so, redirect to the // ucp profile reg_details page ... of course do not redirect if we're already in the ucp @@ -1586,7 +1616,7 @@ class user extends session { global $phpbb_root_path, $config; - $this->lang_path = $phpbb_root_path . 'language/' . $config['default_lang'] . '/'; + $this->lang_path = $phpbb_root_path . 'language/' . basename($config['default_lang']) . '/'; } // $lang == $this->lang @@ -1712,7 +1742,7 @@ class user extends session $img_data = &$imgs[$img]; - if (empty($img_data) || $width !== false) + if (empty($img_data)) { if (!isset($this->img_array[$img])) { @@ -1735,7 +1765,7 @@ class user extends session break; case 'width': - return $img_data['width']; + return ($width === false) ? $img_data['width'] : $width; break; case 'height': @@ -1743,7 +1773,9 @@ class user extends session break; default: - return '' . $alt . ''; + $use_width = ($width === false) ? $img_data['width'] : $width; + + return '' . $alt . ''; break; } } diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 3326852ee7..9095a31dba 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -226,7 +226,7 @@ class template FROM ' . STYLES_TEMPLATE_DATA_TABLE . ' WHERE template_id = ' . $user->theme['template_id'] . " AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "' - OR template_included LIKE '%" . $db->sql_escape($this->filename[$handle]) . ":%')"; + OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')'; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 99371d2024..d926801b2f 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -1,10 +1,10 @@ add_lang(array('acp/groups', 'acp/common')); - $name_ary = request_var('usernames', '', true); + $names = request_var('usernames', '', true); if (!$group_id) { trigger_error($user->lang['NO_GROUP'] . $return_page); } - if (!$name_ary) + if (!$names) { trigger_error($user->lang['NO_USERS'] . $return_page); } @@ -966,15 +966,30 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } - $name_ary = array_unique(explode("\n", $name_ary)); + $name_ary = array_unique(explode("\n", $names)); $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; $default = request_var('default', 0); - - // Add user/s to group - if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) + + if (confirm_box(true)) { - trigger_error($user->lang[$error] . $return_page); + // Add user/s to group + if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, 0, 0, $group_row)) + { + trigger_error($user->lang[$error] . $return_page); + } + } + else + { + $s_hidden_fields = array( + 'default' => $default, + 'usernames' => $names, + 'g' => $group_id, + 'i' => $id, + 'mode' => $mode, + 'action' => $action + ); + confirm_box(false, sprintf($user->lang['GROUP_CONFIRM_ADD_USER' . ((sizeof($name_ary) == 1) ? '' : 'S')], implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields)); } trigger_error($user->lang['GROUP_USERS_ADDED'] . '

    ' . sprintf($user->lang['RETURN_PAGE'], '', '')); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index f827187956..f542bddec9 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -231,8 +231,13 @@ class ucp_main } } + $forbidden_forums = array(); + if ($config['allow_forum_notify']) { + $forbidden_forums = $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + $sql_array = array( 'SELECT' => 'f.*', @@ -242,7 +247,8 @@ class ucp_main ), 'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . ' - AND f.forum_id = fw.forum_id', + AND f.forum_id = fw.forum_id + AND ' . $db->sql_in_set('f.forum_id', $forbidden_forums, true, true), 'ORDER_BY' => 'left_id' ); @@ -330,7 +336,12 @@ class ucp_main // Subscribed Topics if ($config['allow_topic_notify']) { - $this->assign_topiclist('subscribed'); + if (empty($forbidden_forums)) + { + $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + } + $this->assign_topiclist('subscribed', $forbidden_forums); } $template->assign_vars(array( @@ -386,8 +397,10 @@ class ucp_main confirm_box(false, 'REMOVE_SELECTED_BOOKMARKS', build_hidden_fields($s_hidden_fields)); } } - - $this->assign_topiclist('bookmarks'); + $forbidden_forums = $auth->acl_getf('!f_read', true); + $forbidden_forums = array_unique(array_keys($forbidden_forums)); + + $this->assign_topiclist('bookmarks', $forbidden_forums); break; @@ -584,16 +597,26 @@ class ucp_main /** * Build and assign topiclist for bookmarks/subscribed topics */ - function assign_topiclist($mode = 'subscribed') + function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array()) { global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx; $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; $start = request_var('start', 0); - $sql = 'SELECT COUNT(topic_id) as topics_count - FROM ' . $table . ' - WHERE user_id = ' . $user->data['user_id']; + $sql_array = array( + 'SELECT' => 'COUNT(t.topic_id) as topics_count', + + 'FROM' => array( + $table => 'i', + TOPICS_TABLE => 't' + ), + + 'WHERE' => 'i.topic_id = t.topic_id + AND i.user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), + ); + $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query($sql); $topics_count = (int) $db->sql_fetchfield('topics_count'); $db->sql_freeresult($result); @@ -618,7 +641,9 @@ class ucp_main ), 'WHERE' => 'tw.user_id = ' . $user->data['user_id'] . ' - AND t.topic_id = tw.topic_id', + AND t.topic_id = tw.topic_id + AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true), + 'ORDER_BY' => 't.topic_last_post_time DESC' ); @@ -634,7 +659,8 @@ class ucp_main BOOKMARKS_TABLE => 'b', ), - 'WHERE' => 'b.user_id = ' . $user->data['user_id'], + 'WHERE' => 'b.user_id = ' . $user->data['user_id'] . ' + AND ' . $db->sql_in_set('f.forum_id', $forbidden_forum_ary, true, true), 'ORDER_BY' => 't.topic_last_post_time DESC' ); diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 73bb3411cd..63660b006d 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -2,8 +2,8 @@ /** * @package ucp * @version $Id$ -* @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ @@ -271,7 +271,8 @@ class ucp_pm $sql = 'SELECT folder_id FROM ' . PRIVMSGS_TO_TABLE . " WHERE msg_id = $msg_id - AND user_id = " . $user->data['user_id']; + AND folder_id <> " . PRIVMSGS_NO_BOX . ' + AND user_id = ' . $user->data['user_id']; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 7b740c1515..105dda1d8c 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -245,7 +245,7 @@ function compose_pm($id, $mode, $action) $enable_urls = $post['enable_magic_url']; $enable_sig = (isset($post['enable_sig'])) ? $post['enable_sig'] : 0; - $message_attachment = (isset($post['message_attachement'])) ? $post['message_attachement'] : 0; + $message_attachment = (isset($post['message_attachment'])) ? $post['message_attachment'] : 0; $message_subject = $post['message_subject']; $message_time = $post['message_time']; $bbcode_uid = $post['bbcode_uid']; @@ -377,7 +377,7 @@ function compose_pm($id, $mode, $action) if (!in_array($action, array('quote', 'edit', 'delete', 'forward'))) { - $enable_sig = ($config['allow_sig'] && $auth->acl_get('u_sig') && $user->optionget('attachsig')); + $enable_sig = ($config['allow_sig'] && $config['allow_sig_pm'] && $auth->acl_get('u_sig') && $user->optionget('attachsig')); $enable_smilies = ($config['allow_smilies'] && $auth->acl_get('u_pm_smilies') && $user->optionget('smilies')); $enable_bbcode = ($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode') && $user->optionget('bbcode')); $enable_urls = true; @@ -516,7 +516,7 @@ function compose_pm($id, $mode, $action) $enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; $enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; - $enable_sig = (!$config['allow_sig']) ? false : ((isset($_POST['attach_sig'])) ? true : false); + $enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false); if ($submit) { @@ -538,7 +538,7 @@ function compose_pm($id, $mode, $action) } // Parse message - $message_parser->parse($enable_bbcode, ($config['allow_post_links']) ? $enable_urls : false, $enable_smilies, $img_status, $flash_status, true, $config['allow_sig_links']); + $message_parser->parse($enable_bbcode, ($config['allow_post_links']) ? $enable_urls : false, $enable_smilies, $img_status, $flash_status, true, $config['allow_post_links']); // On a refresh we do not care about message parsing errors if (sizeof($message_parser->warn_msg) && !$refresh) @@ -925,11 +925,11 @@ function compose_pm($id, $mode, $action) 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', 'S_SMILIES_ALLOWED' => $smilies_status, 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', - 'S_SIG_ALLOWED' => ($config['allow_sig'] && $auth->acl_get('u_sig')), + 'S_SIG_ALLOWED' => ($config['allow_sig'] && $config['allow_sig_pm'] && $auth->acl_get('u_sig')), 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', 'S_LINKS_ALLOWED' => $url_status, 'S_MAGIC_URL_CHECKED' => ($urls_checked) ? ' checked="checked"' : '', - 'S_SAVE_ALLOWED' => $auth->acl_get('u_savedrafts'), + 'S_SAVE_ALLOWED' => ($auth->acl_get('u_savedrafts') && $action != 'edit') ? true : false, 'S_HAS_DRAFTS' => ($auth->acl_get('u_savedrafts') && $drafts), 'S_FORM_ENCTYPE' => $form_enctype, diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index aa88bfe65f..673da2e819 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -406,7 +406,7 @@ function get_user_information($user_id, $user_row) $update_time = $config['load_online_time'] * 60; if ($row) { - $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] && $user_row['user_allow_viewonline'])) ? true : false; + $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'])) ? true : false; } } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 9ef252b30f..8a10254a6e 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -32,7 +32,7 @@ class ucp_prefs $data = array( 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), - 'lang' => request_var('lang', $user->data['user_lang']), + 'lang' => basename(request_var('lang', $user->data['user_lang'])), 'style' => request_var('style', (int) $user->data['user_style']), 'tz' => request_var('tz', (float) $user->data['user_timezone']), diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index db91c90803..58416f0f98 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -1,10 +1,10 @@ request_var('aim', $user->data['user_aim']), 'msn' => request_var('msn', $user->data['user_msnm']), 'yim' => request_var('yim', $user->data['user_yim']), - 'jabber' => request_var('jabber', $user->data['user_jabber']), + 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)), 'website' => request_var('website', $user->data['user_website']), 'location' => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)), 'occupation' => utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)), @@ -290,7 +290,7 @@ class ucp_profile 'msn' => array('string', true, 5, 255), 'jabber' => array( array('string', true, 5, 255), - array('match', true, '#^[^@:\'"<>&\x00-\x1F\x7F\t\r\n]+@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}(/.*)?$#iu')), + array('jabber')), 'yim' => array('string', true, 5, 255), 'website' => array( array('string', true, 12, 255), @@ -445,8 +445,8 @@ class ucp_profile if (!sizeof($error) && $submit) { $sql_ary = array( - 'user_sig' => (string) $message_parser->message, - 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, + 'user_sig' => (string) $message_parser->message, + 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield ); @@ -491,7 +491,7 @@ class ucp_profile 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), - 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], + 'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'], 'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'], 'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false, 'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index c1978f3723..69328e2ef3 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -34,26 +34,31 @@ class ucp_register $agreed = (!empty($_POST['agreed'])) ? 1 : 0; $submit = (isset($_POST['submit'])) ? true : false; $change_lang = request_var('change_lang', ''); + $user_lang = request_var('lang', $user->lang_name); - if ($change_lang) + if ($change_lang || $user_lang != $config['default_lang']) { - $change_lang = basename($change_lang); + $use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang); - if (file_exists($phpbb_root_path . 'language/' . $change_lang . '/')) + if (file_exists($phpbb_root_path . 'language/' . $use_lang . '/')) { - $submit = false; + if ($change_lang) + { + $submit = false; - $user->lang_name = $lang = $change_lang; + // Setting back agreed to let the user view the agreement in his/her language + $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed; + } + + $user->lang_name = $lang = $use_lang; $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; $user->lang = array(); $user->add_lang(array('common', 'ucp')); - - // Setting back agreed to let the user view the agreement in his/her language - $agreed = (empty($_GET['change_lang'])) ? 0 : $agreed; } else { $change_lang = ''; + $user_lang = $user->lang_name; } } @@ -143,7 +148,7 @@ class ucp_register 'email' => strtolower(request_var('email', '')), 'email_confirm' => strtolower(request_var('email_confirm', '')), 'confirm_code' => request_var('confirm_code', ''), - 'lang' => request_var('lang', $user->lang_name), + 'lang' => basename(request_var('lang', $user->lang_name)), 'tz' => request_var('tz', (float) $timezone), ); diff --git a/phpBB/includes/utf/data/recode_basic.php b/phpBB/includes/utf/data/recode_basic.php index 03391c9376..02e44d3e0d 100644 --- a/phpBB/includes/utf/data/recode_basic.php +++ b/phpBB/includes/utf/data/recode_basic.php @@ -406,9 +406,48 @@ function iso_8859_7($string) return strtr($string, $transform); } +function iso_8859_8($string) +{ + static $transform = array( + "\xC2\xAA" => "\xC3\x97", + "\xC2\xBA" => "\xC3\xB7", + "\xC3\x9F" => "\xE2\x80\x97", + "\xC3\xA0" => "\xD7\x90", + "\xC3\xA1" => "\xD7\x91", + "\xC3\xA2" => "\xD7\x92", + "\xC3\xA3" => "\xD7\x93", + "\xC3\xA4" => "\xD7\x94", + "\xC3\xA5" => "\xD7\x95", + "\xC3\xA6" => "\xD7\x96", + "\xC3\xA7" => "\xD7\x97", + "\xC3\xA8" => "\xD7\x98", + "\xC3\xA9" => "\xD7\x99", + "\xC3\xAA" => "\xD7\x9A", + "\xC3\xAB" => "\xD7\x9B", + "\xC3\xAC" => "\xD7\x9C", + "\xC3\xAD" => "\xD7\x9D", + "\xC3\xAE" => "\xD7\x9E", + "\xC3\xAF" => "\xD7\x9F", + "\xC3\xB0" => "\xD7\xA0", + "\xC3\xB1" => "\xD7\xA1", + "\xC3\xB2" => "\xD7\xA2", + "\xC3\xB3" => "\xD7\xA3", + "\xC3\xB4" => "\xD7\xA4", + "\xC3\xB5" => "\xD7\xA5", + "\xC3\xB6" => "\xD7\xA6", + "\xC3\xB7" => "\xD7\xA7", + "\xC3\xB8" => "\xD7\xA8", + "\xC3\xB9" => "\xD7\xA9", + "\xC3\xBA" => "\xD7\xAA", + "\xC3\xBD" => "\xE2\x80\x8E", + "\xC3\xBE" => "\xE2\x80\x8F", + ); + return strtr(utf8_encode($string), $transform); +} + function iso_8859_9($string) { - static $tranform = array( + static $transform = array( "\xC3\x90" => "\xC4\x9E", "\xC3\x9D" => "\xC4\xB0", "\xC3\x9E" => "\xC5\x9E", @@ -421,7 +460,7 @@ function iso_8859_9($string) function iso_8859_15($string) { - static $tranform = array( + static $transform = array( "\xC2\xA4" => "\xE2\x82\xAC", "\xC2\xA6" => "\xC5\xA0", "\xC2\xA8" => "\xC5\xA1", @@ -965,7 +1004,7 @@ function cp1252($string) function cp1254($string) { - static $tranform = array( + static $transform = array( "\xC2\x80" => "\xE2\x82\xAC", "\xC2\x82" => "\xE2\x80\x9A", "\xC2\x83" => "\xC6\x92", diff --git a/phpBB/includes/utf/data/recode_cjk.php b/phpBB/includes/utf/data/recode_cjk.php index b40728b65d..f3f9a256d7 100644 --- a/phpBB/includes/utf/data/recode_cjk.php +++ b/phpBB/includes/utf/data/recode_cjk.php @@ -7455,7 +7455,7 @@ function gb2312($string) function sjis($string) { - static $array = array( + static $transform = array( "\x5C"=>"\xC2\xA5", "\x7E"=>"\xE2\x80\xBE", "\x81\x40"=>"\xE3\x80\x80", diff --git a/phpBB/includes/utf/data/search_indexer_0.php b/phpBB/includes/utf/data/search_indexer_0.php index 3bf2f68838..3304b18cdd 100644 --- a/phpBB/includes/utf/data/search_indexer_0.php +++ b/phpBB/includes/utf/data/search_indexer_0.php @@ -1 +1 @@ -'0',1=>'1',2=>'2',3=>'3',4=>'4',5=>'5',6=>'6',7=>'7',8=>'8',9=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ª'=>'ª','²'=>'2','³'=>'3','µ'=>'µ','¹'=>'1','º'=>'º','¼'=>'1/4','½'=>'1/2','¾'=>'3/4','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ä','Å'=>'å','Æ'=>'ae','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'oe','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','ß'=>'ss','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ä','å'=>'å','æ'=>'ae','ç'=>'ç','è'=>'è','é'=>'é','ê'=>'ê','ë'=>'ë','ì'=>'ì','í'=>'í','î'=>'î','ï'=>'ï','ð'=>'ð','ñ'=>'ñ','ò'=>'ò','ó'=>'ó','ô'=>'ô','õ'=>'õ','ö'=>'oe','ø'=>'ø','ù'=>'ù','ú'=>'ú','û'=>'û','ü'=>'ü','ý'=>'ý','þ'=>'þ','ÿ'=>'ÿ','Ā'=>'ā','ā'=>'ā','Ă'=>'ă','ă'=>'ă','Ą'=>'ą','ą'=>'ą','Ć'=>'ć','ć'=>'ć','Ĉ'=>'ĉ','ĉ'=>'ĉ','Ċ'=>'ċ','ċ'=>'ċ','Č'=>'č','č'=>'č','Ď'=>'ď','ď'=>'ď','Đ'=>'đ','đ'=>'đ','Ē'=>'ē','ē'=>'ē','Ĕ'=>'ĕ','ĕ'=>'ĕ','Ė'=>'ė','ė'=>'ė','Ę'=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=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','а'=>'а','б'=>'б','в'=>'в','г'=>'г','д'=>'д','е'=>'е','ж'=>'ж','з'=>'з','и'=>'и','й'=>'й','к'=>'к','л'=>'л','м'=>'м','н'=>'н','о'=>'о','п'=>'п','р'=>'р','с'=>'с','т'=>'т','у'=>'у','ф'=>'ф','х'=>'х','ц'=>'ц','ч'=>'ч','ш'=>'ш','щ'=>'щ','ъ'=>'ъ','ы'=>'ы','ь'=>'ь','э'=>'э','ю'=>'ю','я'=>'я','ѐ'=>'ѐ','ё'=>'ё','ђ'=>'ђ','ѓ'=>'ѓ','є'=>'є','ѕ'=>'ѕ','і'=>'і','ї'=>'ї','ј'=>'ј','љ'=>'љ','њ'=>'њ','ћ'=>'ћ','ќ'=>'ќ','ѝ'=>'ѝ','ў'=>'ў','џ'=>'џ','Ѡ'=>'ѡ','ѡ'=>'ѡ','Ѣ'=>'ѣ','ѣ'=>'ѣ','Ѥ'=>'ѥ','ѥ'=>'ѥ','Ѧ'=>'ѧ','ѧ'=>'ѧ','Ѩ'=>'ѩ','ѩ'=>'ѩ','Ѫ'=>'ѫ','ѫ'=>'ѫ','Ѭ'=>'ѭ','ѭ'=>'ѭ','Ѯ'=>'ѯ','ѯ'=>'ѯ','Ѱ'=>'ѱ','ѱ'=>'ѱ','Ѳ'=>'ѳ','ѳ'=>'ѳ','Ѵ'=>'ѵ','ѵ'=>'ѵ','Ѷ'=>'ѷ','ѷ'=>'ѷ','Ѹ'=>'ѹ','ѹ'=>'ѹ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ժ'=>'ժ','Ի'=>'ի','Լ'=>'լ','Խ'=>'խ','Ծ'=>'ծ','Կ'=>'կ','Հ'=>'հ','Ձ'=>'ձ','Ղ'=>'ղ','Ճ'=>'ճ','Մ'=>'մ','Յ'=>'յ','Ն'=>'ն','Շ'=>'շ','Ո'=>'ո','Չ'=>'չ','Պ'=>'պ','Ջ'=>'ջ','Ռ'=>'ռ','Ս'=>'ս','Վ'=>'վ','Տ'=>'տ','Ր'=>'ր','Ց'=>'ց','Ւ'=>'ւ','Փ'=>'փ','Ք'=>'ք','Օ'=>'օ','Ֆ'=>'ֆ','ՙ'=>'ՙ','ա'=>'ա','բ'=>'բ','գ'=>'գ','դ'=>'դ','ե'=>'ե','զ'=>'զ','է'=>'է','ը'=>'ը','թ'=>'թ','ժ'=>'ժ','ի'=>'ի','լ'=>'լ','խ'=>'խ','ծ'=>'ծ','կ'=>'կ','հ'=>'հ','ձ'=>'ձ','ղ'=>'ղ','ճ'=>'ճ','մ'=>'մ','յ'=>'յ','ն'=>'ն','շ'=>'շ','ո'=>'ո','չ'=>'չ','պ'=>'պ','ջ'=>'ջ','ռ'=>'ռ','ս'=>'ս','վ'=>'վ','տ'=>'տ','ր'=>'ր','ց'=>'ց','ւ'=>'ւ','փ'=>'փ','ք'=>'ք','օ'=>'օ','ֆ'=>'ֆ','և'=>'և','֑'=>'֑','֒'=>'֒','֓'=>'֓','֔'=>'֔','֕'=>'֕','֖'=>'֖','֗'=>'֗','֘'=>'֘','֙'=>'֙','֚'=>'֚','֛'=>'֛','֜'=>'֜','֝'=>'֝','֞'=>'֞','֟'=>'֟','֠'=>'֠','֡'=>'֡','֢'=>'֢','֣'=>'֣','֤'=>'֤','֥'=>'֥','֦'=>'֦','֧'=>'֧','֨'=>'֨','֩'=>'֩','֪'=>'֪','֫'=>'֫','֬'=>'֬','֭'=>'֭','֮'=>'֮','֯'=>'֯','ְ'=>'ְ','ֱ'=>'ֱ','ֲ'=>'ֲ','ֳ'=>'ֳ','ִ'=>'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>'ߨ','ߩ'=>'ߩ','ߪ'=>'ߪ','߫'=>'߫','߬'=>'߬','߭'=>'߭','߮'=>'߮','߯'=>'߯','߰'=>'߰','߱'=>'߱','߲'=>'߲','߳'=>'߳','ߴ'=>'ߴ','ߵ'=>'ߵ','ߺ'=>'ߺ'); \ No newline at end of file +'0',1=>'1',2=>'2',3=>'3',4=>'4',5=>'5',6=>'6',7=>'7',8=>'8',9=>'9','A'=>'a','B'=>'b','C'=>'c','D'=>'d','E'=>'e','F'=>'f','G'=>'g','H'=>'h','I'=>'i','J'=>'j','K'=>'k','L'=>'l','M'=>'m','N'=>'n','O'=>'o','P'=>'p','Q'=>'q','R'=>'r','S'=>'s','T'=>'t','U'=>'u','V'=>'v','W'=>'w','X'=>'x','Y'=>'y','Z'=>'z','a'=>'a','b'=>'b','c'=>'c','d'=>'d','e'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','m'=>'m','n'=>'n','o'=>'o','p'=>'p','q'=>'q','r'=>'r','s'=>'s','t'=>'t','u'=>'u','v'=>'v','w'=>'w','x'=>'x','y'=>'y','z'=>'z','ª'=>'ª','²'=>'2','³'=>'3','µ'=>'µ','¹'=>'1','º'=>'º','¼'=>'1/4','½'=>'1/2','¾'=>'3/4','À'=>'à','Á'=>'á','Â'=>'â','Ã'=>'ã','Ä'=>'ae','Å'=>'å','Æ'=>'ae','Ç'=>'ç','È'=>'è','É'=>'é','Ê'=>'ê','Ë'=>'ë','Ì'=>'ì','Í'=>'í','Î'=>'î','Ï'=>'ï','Ð'=>'ð','Ñ'=>'ñ','Ò'=>'ò','Ó'=>'ó','Ô'=>'ô','Õ'=>'õ','Ö'=>'oe','Ø'=>'ø','Ù'=>'ù','Ú'=>'ú','Û'=>'û','Ü'=>'ü','Ý'=>'ý','Þ'=>'þ','ß'=>'ss','à'=>'à','á'=>'á','â'=>'â','ã'=>'ã','ä'=>'ae','å'=>'å','æ'=>'ae','ç'=>'ç','è'=>'è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̌','̍'=>'̍','̎'=>'̎','̏'=>'̏','̐'=>'̐','̑'=>'̑','̒'=>'̒','̓'=>'̓','̔'=>'̔','̕'=>'̕','̖'=>'̖','̗'=>'̗','̘'=>'̘','̙'=>'̙','̚'=>'̚','̛'=>'̛','̜'=>'̜','̝'=>'̝','̞'=>'̞','̟'=>'̟','̠'=>'̠','̡'=>'̡','̢'=>'̢','̣'=>'̣','̤'=>'̤','̥'=>'̥','̦'=>'̦','̧'=>'̧','̨'=>'̨','̩'=>'̩','̪'=>'̪','̫'=>'̫','̬'=>'̬','̭'=>'̭','̮'=>'̮','̯'=>'̯','̰'=>'̰','̱'=>'̱','̲'=>'̲','̳'=>'̳','̴'=>'̴','̵'=>'̵','̶'=>'̶','̷'=>'̷','̸'=>'̸','̹'=>'̹','̺'=>'̺','̻'=>'̻','̼'=>'̼','̽'=>'̽','̾'=>'̾','̿'=>'̿','̀'=>'̀','́'=>'́','͂'=>'͂','̓'=>'̓','̈́'=>'̈́','ͅ'=>'ͅ','͆'=>'͆','͇'=>'͇','͈'=>'͈','͉'=>'͉','͊'=>'͊','͋'=>'͋','͌'=>'͌','͍'=>'͍','͎'=>'͎','͏'=>'͏','͐'=>'͐','͑'=>'͑','͒'=>'͒','͓'=>'͓','͔'=>'͔','͕'=>'͕','͖'=>'͖','͗'=>'͗','͘'=>'͘','͙'=>'͙','͚'=>'͚','͛'=>'͛','͜'=>'͜','͝'=>'͝','͞'=>'͞','͟'=>'͟','͠'=>'͠','͡'=>'͡','͢'=>'͢','ͣ'=>'ͣ','ͤ'=>'ͤ','ͥ'=>'ͥ','ͦ'=>'ͦ','ͧ'=>'ͧ','ͨ'=>'ͨ','ͩ'=>'ͩ','ͪ'=>'ͪ','ͫ'=>'ͫ','ͬ'=>'ͬ','ͭ'=>'ͭ','ͮ'=>'ͮ','ͯ'=>'ͯ','ͺ'=>'ͺ','ͻ'=>'ͻ','ͼ'=>'ͼ','ͽ'=>'ͽ','Ά'=>'ά','Έ'=>'έ','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','ϫ'=>'ϫ','Ϭ'=>'ϭ','ϭ'=>'ϭ','Ϯ'=>'ϯ','ϯ'=>'ϯ','ϰ'=>'ϰ','ϱ'=>'ϱ','ϲ'=>'ϲ','ϳ'=>'ϳ','ϴ'=>'θ','ϵ'=>'ϵ','Ϸ'=>'ϸ','ϸ'=>'ϸ','Ϲ'=>'ϲ','Ϻ'=>'ϻ','ϻ'=>'ϻ','ϼ'=>'ϼ','Ͻ'=>'ͻ','Ͼ'=>'ͼ','Ͽ'=>'ͽ','Ѐ'=>'ѐ','Ё'=>'ё','Ђ'=>'ђ','Ѓ'=>'ѓ','Є'=>'є','Ѕ'=>'ѕ','І'=>'і','Ї'=>'ї','Ј'=>'ј','Љ'=>'љ','Њ'=>'њ','Ћ'=>'ћ','Ќ'=>'ќ','Ѝ'=>'ѝ','Ў'=>'ў','Џ'=>'џ','А'=>'а','Б'=>'б','В'=>'в','Г'=>'г','Д'=>'д','Е'=>'е','Ж'=>'ж','З'=>'з','И'=>'и','Й'=>'й','К'=>'к','Л'=>'л','М'=>'м','Н'=>'н','О'=>'о','П'=>'п','Р'=>'р','С'=>'с','Т'=>'т','У'=>'у','Ф'=>'ф','Х'=>'х','Ц'=>'ц','Ч'=>'ч','Ш'=>'ш','Щ'=>'щ','Ъ'=>'ъ','Ы'=>'ы','Ь'=>'ь','Э'=>'э','Ю'=>'ю','Я'=>'я','а'=>'а','б'=>'б','в'=>'в','г'=>'г','д'=>'д','е'=>'е','ж'=>'ж','з'=>'з','и'=>'и','й'=>'й','к'=>'к','л'=>'л','м'=>'м','н'=>'н','о'=>'о','п'=>'п','р'=>'р','с'=>'с','т'=>'т','у'=>'у','ф'=>'ф','х'=>'х','ц'=>'ц','ч'=>'ч','ш'=>'ш','щ'=>'щ','ъ'=>'ъ','ы'=>'ы','ь'=>'ь','э'=>'э','ю'=>'ю','я'=>'я','ѐ'=>'ѐ','ё'=>'ё','ђ'=>'ђ','ѓ'=>'ѓ','є'=>'є','ѕ'=>'ѕ','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3','߄'=>'4','߅'=>'5','߆'=>'6','߇'=>'7','߈'=>'8','߉'=>'9','ߊ'=>'ߊ','ߋ'=>'ߋ','ߌ'=>'ߌ','ߍ'=>'ߍ','ߎ'=>'ߎ','ߏ'=>'ߏ','ߐ'=>'ߐ','ߑ'=>'ߑ','ߒ'=>'ߒ','ߓ'=>'ߓ','ߔ'=>'ߔ','ߕ'=>'ߕ','ߖ'=>'ߖ','ߗ'=>'ߗ','ߘ'=>'ߘ','ߙ'=>'ߙ','ߚ'=>'ߚ','ߛ'=>'ߛ','ߜ'=>'ߜ','ߝ'=>'ߝ','ߞ'=>'ߞ','ߟ'=>'ߟ','ߠ'=>'ߠ','ߡ'=>'ߡ','ߢ'=>'ߢ','ߣ'=>'ߣ','ߤ'=>'ߤ','ߥ'=>'ߥ','ߦ'=>'ߦ','ߧ'=>'ߧ','ߨ'=>'ߨ','ߩ'=>'ߩ','ߪ'=>'ߪ','߫'=>'߫','߬'=>'߬','߭'=>'߭','߮'=>'߮','߯'=>'߯','߰'=>'߰','߱'=>'߱','߲'=>'߲','߳'=>'߳','ߴ'=>'ߴ','ߵ'=>'ߵ','ߺ'=>'ߺ'); \ No newline at end of file diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index f6ed6c3ed5..0a1409041b 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1,10 +1,10 @@ assign_vars(array( 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, - 'U_MARK_FORUMS' => append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums'), + 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '', 'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '') ); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 14ad45004d..796c2e19d4 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -31,7 +31,7 @@ unset($dbpasswd); */ $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', - 'version' => '0.92', + 'version' => '1.0.RC2', 'phpbb_version' => '3.0.0', 'author' => 'phpBB Group', 'dbms' => $dbms, @@ -184,8 +184,14 @@ if (!$get_info) 'extensions', 'extension_groups' ); + + $src_db->sql_freeresult($result); } - $src_db->sql_freeresult($result); + else if ($result) + { + $src_db->sql_freeresult($result); + } + /** * Tests for further MODs can be included here. @@ -540,9 +546,7 @@ if (!$get_info) array('smiley_width', 'smilies.smile_url', 'get_smiley_width'), array('smiley_height', 'smilies.smile_url', 'get_smiley_height'), array('smiley_order', 'smilies.smilies_id', ''), - array('display_on_posting', 'smilies.smilies_id', array( - 'execute' => '{RESULT} = ({VALUE}[0] <= 20) ? 1 : 0;', - )), + array('display_on_posting', 'smilies.smilies_id', 'get_smiley_display'), 'order_by' => 'smilies.smilies_id ASC', ), @@ -702,7 +706,8 @@ if (!$get_info) array('pm_forwarded', 0, ''), array('folder_id', PRIVMSGS_INBOX, ''), - 'where' => 'privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5', + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND (privmsgs.privmsgs_type = 0 OR privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)', ), // Outbox @@ -714,14 +719,15 @@ if (!$get_info) array('user_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), array('pm_deleted', 0, ''), - array('pm_new', 'privmsgs.privmsgs_type', 'phpbb_new_pm'), - array('pm_unread', 'privmsgs.privmsgs_type', 'phpbb_unread_pm'), + array('pm_new', 0, ''), + array('pm_unread', 0, ''), array('pm_replied', 0, ''), array('pm_marked', 0, ''), array('pm_forwarded', 0, ''), array('folder_id', PRIVMSGS_OUTBOX, ''), - 'where' => 'privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5', + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND (privmsgs.privmsgs_type = 1 OR privmsgs.privmsgs_type = 5)', ), // Sentbox @@ -740,7 +746,8 @@ if (!$get_info) array('pm_forwarded', 0, ''), array('folder_id', PRIVMSGS_SENTBOX, ''), - 'where' => 'privmsgs.privmsgs_type = 2', + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 2', ), // Savebox (SAVED IN) @@ -759,7 +766,8 @@ if (!$get_info) array('pm_forwarded', 0, ''), array('folder_id', 'privmsgs.privmsgs_to_userid', 'phpbb_get_savebox_id'), - 'where' => 'privmsgs.privmsgs_type = 3', + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 3', ), // Savebox (SAVED OUT) @@ -778,7 +786,8 @@ if (!$get_info) array('pm_forwarded', 0, ''), array('folder_id', 'privmsgs.privmsgs_from_userid', 'phpbb_get_savebox_id'), - 'where' => 'privmsgs.privmsgs_type = 4', + 'where' => 'privmsgs.privmsgs_id = privmsgs_text.privmsgs_text_id + AND privmsgs.privmsgs_type = 4', ), array( @@ -853,7 +862,7 @@ if (!$get_info) array('user_lang', $config['default_lang'], ''), array('', 'users.user_lang', ''), array('user_timezone', 'users.user_timezone', ''), - array('user_dateformat', 'users.user_dateformat', ''), + array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding')), array('user_inactive_reason', '', 'phpbb_inactive_reason'), array('user_inactive_time', '', 'phpbb_inactive_time'), @@ -861,10 +870,10 @@ if (!$get_info) array('user_occ', 'users.user_occ', array('function1' => 'phpbb_set_encoding')), array('user_website', 'users.user_website', 'validate_website'), array('user_jabber', '', ''), - array('user_msnm', 'users.user_msnm', ''), - array('user_yim', 'users.user_yim', ''), - array('user_aim', 'users.user_aim', ''), - array('user_icq', 'users.user_icq', ''), + array('user_msnm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')), + array('user_yim', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), + array('user_aim', 'users.user_aim', array('function1' => 'phpbb_set_encoding')), + array('user_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')), array('user_from', 'users.user_from', array('function1' => 'phpbb_set_encoding')), array('user_rank', 'users.user_rank', ''), array('user_permissions', '', ''), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 6788ecd900..eca72b64bd 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -59,6 +59,15 @@ function phpbb_insert_forums() $max_forum_id++; + // pruning disabled globally? + $sql = "SELECT config_value + FROM {$convert->src_table_prefix}config + WHERE config_name = 'prune_enable'"; + $result = $src_db->sql_query($sql); + $prune_enabled = (int) $src_db->sql_fetchfield('config_value'); + $src_db->sql_freeresult($result); + + // Insert categories $sql = 'SELECT cat_id, cat_title FROM ' . $convert->src_table_prefix . 'categories @@ -206,7 +215,7 @@ function phpbb_insert_forums() 'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), - 'enable_prune' => $row['prune_enable'], + 'enable_prune' => ($prune_enabled) ? $row['prune_enable'] : 0, 'prune_next' => null_to_zero($row['prune_next']), 'prune_days' => null_to_zero($row['prune_days']), 'prune_viewed' => 0, @@ -270,10 +279,28 @@ function phpbb_insert_forums() switch ($db->sql_layer) { + case 'postgres': + $db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));'); + break; + case 'mssql': case 'mssql_odbc': $db->sql_query('SET IDENTITY_INSERT ' . FORUMS_TABLE . ' OFF'); break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(forum_id) as max_id FROM ' . FORUMS_TABLE); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . FORUMS_TABLE . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . FORUMS_TABLE . '_seq START WITH ' . ($largest_id + 1)); + } + break; } } @@ -536,7 +563,6 @@ function phpbb_convert_authentication($mode) while ($row = $src_db->sql_fetchrow($result)) { $user_id = (int) phpbb_user_id($row['user_id']); - // Set founder admin... $sql = 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_FOUNDER . " @@ -544,6 +570,13 @@ function phpbb_convert_authentication($mode) $db->sql_query($sql); } $src_db->sql_freeresult($result); + + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); } // Grab forum auth information @@ -564,10 +597,11 @@ function phpbb_convert_authentication($mode) } // Grab user auth information from 2.0.x board $sql = "SELECT ug.user_id, aa.* - FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}user_group ug, {$convert->src_table_prefix}groups g + FROM {$convert->src_table_prefix}auth_access aa, {$convert->src_table_prefix}user_group ug, {$convert->src_table_prefix}groups g, {$convert->src_table_prefix}forums f WHERE g.group_id = aa.group_id AND g.group_single_user = 1 - AND ug.group_id = g.group_id"; + AND ug.group_id = g.group_id + AND f.forum_id = aa.forum_id"; $result = $src_db->sql_query($sql); $user_access = array(); @@ -710,7 +744,7 @@ function phpbb_convert_authentication($mode) if ($mode == 'start') { user_group_auth('guests', 'SELECT user_id, {GUESTS} FROM ' . USERS_TABLE . ' WHERE user_id = ' . ANONYMOUS, false); - user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS, false); + user_group_auth('registered', 'SELECT user_id, {REGISTERED} FROM ' . USERS_TABLE . ' WHERE user_id <> ' . ANONYMOUS . " AND group_id <> $bot_group_id", false); // Selecting from old table if (!empty($config['increment_user_id'])) @@ -1693,7 +1727,7 @@ function phpbb_check_username_collisions() break; case 'oracle': - $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv + $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( user_id number(8) NOT NULL, username_clean varchar2(255) DEFAULT \'\' )'; @@ -1709,15 +1743,15 @@ function phpbb_check_username_collisions() case 'sqlite': $create_sql = 'CREATE TABLE ' . $table_prefix . 'userconv ( user_id INTEGER NOT NULL DEFAULT \'0\', - username_clean varchar(255) NOT NULL DEFAULT \'\', + username_clean varchar(255) NOT NULL DEFAULT \'\' )'; break; } $db->sql_return_on_error(true); $db->sql_query($drop_sql); - $db->sql_query($create_sql); $db->sql_return_on_error(false); + $db->sql_query($create_sql); // now select all user_ids and usernames and then convert the username (this can take quite a while!) $sql = 'SELECT user_id, username diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 194bb5600a..56327f3a8c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.RC1'; +$updates_to_version = '3.0.RC2'; if (defined('IN_PHPBB') && defined('IN_INSTALL')) { @@ -311,168 +311,24 @@ $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); // Only an example, but also commented out $database_update_info = array( - // Changes from 3.0.b5 to the next version - '3.0.b5' => array( - // Add the following columns - 'add_columns' => array( - SEARCH_WORDLIST_TABLE => array( - 'word_count' => array('UINT', 0), - ), - ), - // Change the following columns... - 'change_columns' => array( - TOPICS_TABLE => array( - 'poll_title' => array('STEXT_UNI', ''), - ), - SESSIONS_TABLE => array( - 'session_forwarded_for' => array('VCHAR:255', ''), - ), - ), + // Changes from 3.0.RC1 to the next version + '3.0.RC1' => array( // Remove the following keys 'drop_keys' => array( - USERS_TABLE => array( - 'username_clean', + STYLES_IMAGESET_DATA_TABLE => array( + 'i_id', ), - STYLES_IMAGESET_TABLE => array( - 'imgset_nm', - ), - BOOKMARKS_TABLE => array( - 'order_id', - 'topic_user_id', + ACL_ROLES_DATA_TABLE => array( + 'ath_opt_id', ), ), - 'add_index' => array( - SEARCH_WORDLIST_TABLE => array( - 'wrd_cnt' => array('word_count'), + // Add the following keys + 'add_index' => array( + STYLES_IMAGESET_DATA_TABLE => array( + 'i_d' => array('imageset_id'), ), - ACL_GROUPS_TABLE => array( - 'auth_role_id' => array('auth_role_id'), - ), - ACL_USERS_TABLE => array( - 'auth_role_id' => array('auth_role_id'), - ), - ACL_ROLES_DATA_TABLE => array( - 'ath_opt_id' => array('auth_option_id'), - ), - TOPICS_TABLE => array( - 'forum_appr_last' => array('forum_id', 'topic_approved', 'topic_last_post_id'), - ), - ), - // Add the following unique indexes - 'add_unique_index' => array( - SEARCH_WORDMATCH_TABLE => array( - 'unq_mtch' => array('word_id', 'post_id', 'title_match'), - ), - USERS_TABLE => array( - 'username_clean' => array('username_clean'), - ), - ), - // Drop the following columns - 'drop_columns' => array( - STYLES_IMAGESET_TABLE => array( - 'site_logo', - 'upload_bar', - 'poll_left', - 'poll_center', - 'poll_right', - 'icon_friend', - 'icon_foe', - 'forum_link', - 'forum_read', - 'forum_read_locked', - 'forum_read_subforum', - 'forum_unread', - 'forum_unread_locked', - 'forum_unread_subforum', - 'topic_moved', - 'topic_read', - 'topic_read_mine', - 'topic_read_hot', - 'topic_read_hot_mine', - 'topic_read_locked', - 'topic_read_locked_mine', - 'topic_unread', - 'topic_unread_mine', - 'topic_unread_hot', - 'topic_unread_hot_mine', - 'topic_unread_locked', - 'topic_unread_locked_mine', - 'sticky_read', - 'sticky_read_mine', - 'sticky_read_locked', - 'sticky_read_locked_mine', - 'sticky_unread', - 'sticky_unread_mine', - 'sticky_unread_locked', - 'sticky_unread_locked_mine', - 'announce_read', - 'announce_read_mine', - 'announce_read_locked', - 'announce_read_locked_mine', - 'announce_unread', - 'announce_unread_mine', - 'announce_unread_locked', - 'announce_unread_locked_mine', - 'global_read', - 'global_read_mine', - 'global_read_locked', - 'global_read_locked_mine', - 'global_unread', - 'global_unread_mine', - 'global_unread_locked', - 'global_unread_locked_mine', - 'pm_read', - 'pm_unread', - 'icon_contact_aim', - 'icon_contact_email', - 'icon_contact_icq', - 'icon_contact_jabber', - 'icon_contact_msnm', - 'icon_contact_pm', - 'icon_contact_yahoo', - 'icon_contact_www', - 'icon_post_delete', - 'icon_post_edit', - 'icon_post_info', - 'icon_post_quote', - 'icon_post_report', - 'icon_post_target', - 'icon_post_target_unread', - 'icon_topic_attach', - 'icon_topic_latest', - 'icon_topic_newest', - 'icon_topic_reported', - 'icon_topic_unapproved', - 'icon_user_online', - 'icon_user_offline', - 'icon_user_profile', - 'icon_user_search', - 'icon_user_warn', - 'button_pm_forward', - 'button_pm_new', - 'button_pm_reply', - 'button_topic_locked', - 'button_topic_new', - 'button_topic_reply', - 'user_icon1', - 'user_icon2', - 'user_icon3', - 'user_icon4', - 'user_icon5', - 'user_icon6', - 'user_icon7', - 'user_icon8', - 'user_icon9', - 'user_icon10' - ), - BOOKMARKS_TABLE => array( - 'order_id', - ), - ), - // Adding primary key - 'add_primary_keys' => array( - BOOKMARKS_TABLE => array( - 'topic_id', 'user_id', + ACL_ROLES_DATA_TABLE => array( + 'ath_opt_id' => array('auth_option_id'), ), ), ), @@ -719,439 +575,56 @@ flush(); $no_updates = true; // some code magic -if (version_compare($current_version, '3.0.b5', '<=')) +if (version_compare($current_version, '3.0.RC1', '<=')) { - switch ($map_dbms) - { - case 'sqlite': - case 'firebird': - $db->sql_query('DELETE FROM ' . STYLES_IMAGESET_TABLE); - $db->sql_query('DELETE FROM ' . STYLES_TEMPLATE_TABLE); - $db->sql_query('DELETE FROM ' . STYLES_TABLE); - $db->sql_query('DELETE FROM ' . STYLES_THEME_TABLE); + // we have to remove a few extra entries from converted boards. + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . " + WHERE group_name = '" . $db->sql_escape('BOTS') . "'"; + $result = $db->sql_query($sql); + $bot_group_id = (int) $db->sql_fetchfield('group_id'); + $db->sql_freeresult($result); -// $db->sql_query('DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE); - break; - - default: - $db->sql_query('TRUNCATE TABLE ' . STYLES_IMAGESET_TABLE); - $db->sql_query('TRUNCATE TABLE ' . STYLES_TEMPLATE_TABLE); - $db->sql_query('TRUNCATE TABLE ' . STYLES_TABLE); - $db->sql_query('TRUNCATE TABLE ' . STYLES_THEME_TABLE); - -// This table does not exist, as well as the constant not exist... -// $db->sql_query('TRUNCATE TABLE ' . STYLES_IMAGESET_DATA_TABLE); - break; - } - - $tablename = $table_prefix . 'styles_imageset_data'; - switch ($map_dbms) - { - case 'mysql_41': - $sql_ary = array( - "CREATE TABLE $tablename ( - image_id smallint(4) UNSIGNED NOT NULL auto_increment, - image_name varchar(200) DEFAULT '' NOT NULL, - image_filename varchar(200) DEFAULT '' NOT NULL, - image_lang varchar(30) DEFAULT '' NOT NULL, - image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id tinyint(4) DEFAULT '0' NOT NULL, - PRIMARY KEY (image_id), - KEY i_id (imageset_id) - ) CHARACTER SET `utf8` COLLATE `utf8_bin`"); - break; - - case 'mysql_40': - $sql_ary = array( - "CREATE TABLE $tablename ( - image_id smallint(4) UNSIGNED NOT NULL auto_increment, - image_name varbinary(200) DEFAULT '' NOT NULL, - image_filename varbinary(200) DEFAULT '' NOT NULL, - image_lang varbinary(30) DEFAULT '' NOT NULL, - image_height smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, - imageset_id tinyint(4) DEFAULT '0' NOT NULL, - PRIMARY KEY (image_id), - KEY i_id (imageset_id) - );"); - break; - - case 'mssql': - $sql_ary = array( - "CREATE TABLE [$tablename] ( - [image_id] [int] IDENTITY (1, 1) NOT NULL , - [image_name] [varchar] (200) DEFAULT ('') NOT NULL , - [image_filename] [varchar] (200) DEFAULT ('') NOT NULL , - [image_lang] [varchar] (30) DEFAULT ('') NOT NULL , - [image_height] [int] DEFAULT (0) NOT NULL , - [image_width] [int] DEFAULT (0) NOT NULL , - [imageset_id] [int] DEFAULT (0) NOT NULL - ) ON [PRIMARY]", - - "ALTER TABLE [$tablename] WITH NOCHECK ADD - CONSTRAINT [PK_$tablename] PRIMARY KEY CLUSTERED - ( - [image_id] - ) ON [PRIMARY]", - - "CREATE INDEX [i_id] ON [$tablename]([imageset_id]) ON [PRIMARY]", - ); - break; - - case 'oracle': - $sql_ary = array( - "CREATE TABLE $tablename ( - image_id number(4) NOT NULL, - image_name varchar2(200) DEFAULT '' , - image_filename varchar2(200) DEFAULT '' , - image_lang varchar2(30) DEFAULT '' , - image_height number(4) DEFAULT '0' NOT NULL, - image_width number(4) DEFAULT '0' NOT NULL, - imageset_id number(4) DEFAULT '0' NOT NULL, - CONSTRAINT pk_phpbb_styles_imageset_data PRIMARY KEY (image_id) - )", - - "CREATE INDEX {$tablename}_i_id ON $tablename (imageset_id)", - - "CREATE SEQUENCE {$tablename}_imgset_id_seq", - - "CREATE OR REPLACE TRIGGER t_$tablename - BEFORE INSERT ON $tablename - FOR EACH ROW WHEN ( - new.image_id IS NULL OR new.image_id = 0 - ) - BEGIN - SELECT {$tablename}_seq.nextval - INTO :new.image_id - FROM dual; - END", - ); - break; - - case 'postgres': - $sql_ary = array( - "CREATE SEQUENCE {$tablename}_seq;", - - "CREATE TABLE $tablename ( - image_id INT2 DEFAULT nextval('{$tablename}_seq'), - image_name varchar(200) DEFAULT '' NOT NULL, - image_filename varchar(200) DEFAULT '' NOT NULL, - image_lang varchar(30) DEFAULT '' NOT NULL, - image_height INT2 DEFAULT '0' NOT NULL CHECK (image_height >= 0), - image_width INT2 DEFAULT '0' NOT NULL CHECK (image_width >= 0), - imageset_id INT2 DEFAULT '0' NOT NULL, - PRIMARY KEY (image_id) - );", - - "CREATE INDEX {$tablename}_i_id ON $tablename (imageset_id);" - ); - break; - - case 'sqlite': - $sql_ary = array( - "CREATE TABLE $tablename ( - image_id INTEGER PRIMARY KEY NOT NULL , - image_name varchar(200) NOT NULL DEFAULT '', - image_filename varchar(200) NOT NULL DEFAULT '', - image_lang varchar(30) NOT NULL DEFAULT '', - image_height INTEGER UNSIGNED NOT NULL DEFAULT '0', - image_width INTEGER UNSIGNED NOT NULL DEFAULT '0', - imageset_id tinyint(4) NOT NULL DEFAULT '0' - );", - - "CREATE INDEX {$tablename}_i_id ON $tablename (imageset_id);" - ); - break; - - case 'firebird': - $sql_ary = array( - "CREATE TABLE $tablename ( - image_id INTEGER NOT NULL, - image_name VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, - image_filename VARCHAR(200) CHARACTER SET NONE DEFAULT '' NOT NULL, - image_lang VARCHAR(30) CHARACTER SET NONE DEFAULT '' NOT NULL, - image_height INTEGER DEFAULT 0 NOT NULL, - image_width INTEGER DEFAULT 0 NOT NULL, - imageset_id INTEGER DEFAULT 0 NOT NULL - );", - - "ALTER TABLE $tablename ADD PRIMARY KEY (image_id);", - - "CREATE INDEX {$tablename}_i_id ON $tablename(imageset_id);", - - "CREATE GENERATOR {$tablename}_gen;", - - "SET GENERATOR {$tablename}_gen TO 0;", - - "CREATE TRIGGER t_$tablename FOR $tablename - BEFORE INSERT - AS - BEGIN - NEW.image_id = GEN_ID({$tablename}_gen, 1); - END" - ); - break; - } - - // add the various statements - foreach ($sql_ary as $sql) - { - $db->sql_query($sql); - } - - $data = "INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id, imageset_id) VALUES ('prosilver', '© phpBB Group', 1, 1, 1, 1); - INSERT INTO phpbb_styles (style_name, style_copyright, style_active, template_id, theme_id, imageset_id) VALUES ('subsilver2', '© phpBB Group', 1, 2, 2, 2); - INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path) VALUES ('prosilver', '© phpBB Group', 'prosilver'); - INSERT INTO phpbb_styles_imageset (imageset_name, imageset_copyright, imageset_path) VALUES ('subsilver2', '© phpBB Group', 'subsilver2'); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('site_logo', 'site_logo.gif', '', 94, 170, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('upload_bar', 'upload_bar.gif', '', 16, 280, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('poll_left', 'poll_left.gif', '', 12, 4, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('poll_center', 'poll_center.gif', '', 12, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('poll_right', 'poll_right.gif', '', 12, 4, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_link', 'forum_link.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read', 'forum_read.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_locked', 'forum_read_locked.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_subforum', 'forum_read_subforum.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread', 'forum_unread.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_locked', 'forum_unread_locked.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_subforum', 'forum_unread_subforum.gif', '', 25, 46, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_moved', 'topic_moved.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read', 'topic_read.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_mine', 'topic_read_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot', 'topic_read_hot.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot_mine', 'topic_read_hot_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked', 'topic_read_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked_mine', 'topic_read_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread', 'topic_unread.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_mine', 'topic_unread_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot', 'topic_unread_hot.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot_mine', 'topic_unread_hot_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked', 'topic_unread_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked_mine', 'topic_unread_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read', 'sticky_read.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_mine', 'sticky_read_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked', 'sticky_read_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked_mine', 'sticky_read_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread', 'sticky_unread.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_mine', 'sticky_unread_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked', 'sticky_unread_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked_mine', 'sticky_unread_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read', 'announce_read.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_mine', 'announce_read_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked', 'announce_read_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked_mine', 'announce_read_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread', 'announce_unread.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_mine', 'announce_unread_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked', 'announce_unread_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read', 'announce_read.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_mine', 'announce_read_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked', 'announce_read_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked_mine', 'announce_read_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread', 'announce_unread.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_mine', 'announce_unread_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked', 'announce_unread_locked.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_read', 'topic_read.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_unread', 'topic_unread.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target', 'icon_post_target.gif', '', 9, 12, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target_unread', 'icon_post_target_unread.gif', '', 9, 12, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_attach', 'icon_topic_attach.gif', '', 18, 14, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_latest', 'icon_topic_latest.gif', '', 9, 18, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_newest', 'icon_topic_newest.gif', '', 9, 18, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_reported', 'icon_topic_reported.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_unapproved', 'icon_topic_unapproved.gif', '', 18, 19, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_aim', 'icon_contact_aim.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_email', 'icon_contact_email.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_icq', 'icon_contact_icq.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_jabber', 'icon_contact_jabber.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_msnm', 'icon_contact_msnm.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_pm', 'icon_contact_pm.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_yahoo', 'icon_contact_yahoo.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_www', 'icon_contact_www.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_delete', 'icon_post_delete.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_edit', 'icon_post_edit.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_info', 'icon_post_info.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_quote', 'icon_post_quote.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_report', 'icon_post_report.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_online', 'icon_user_online.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_offline', 'icon_user_offline.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_profile', 'icon_user_profile.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_search', 'icon_user_search.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_warn', 'icon_user_warn.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_pm_new', 'button_pm_new.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_pm_reply', 'button_pm_reply.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_locked', 'button_topic_locked.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_new', 'button_topic_new.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_reply', 'button_topic_reply.gif', 'en', 0, 0, 2); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('site_logo', 'site_logo.gif', '', 52, 139, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_link', 'forum_link.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read', 'forum_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_locked', 'forum_read_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_read_subforum', 'forum_read_subforum.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread', 'forum_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_locked', 'forum_unread_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('forum_unread_subforum', 'forum_unread_subforum.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_moved', 'topic_moved.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read', 'topic_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_mine', 'topic_read_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot', 'topic_read_hot.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_hot_mine', 'topic_read_hot_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked', 'topic_read_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_read_locked_mine', 'topic_read_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread', 'topic_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_mine', 'topic_unread_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot', 'topic_unread_hot.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_hot_mine', 'topic_unread_hot_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked', 'topic_unread_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('topic_unread_locked_mine', 'topic_unread_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read', 'sticky_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_mine', 'sticky_read_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked', 'sticky_read_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_read_locked_mine', 'sticky_read_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread', 'sticky_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_mine', 'sticky_unread_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked', 'sticky_unread_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('sticky_unread_locked_mine', 'sticky_unread_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read', 'announce_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_mine', 'announce_read_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked', 'announce_read_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_read_locked_mine', 'announce_read_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread', 'announce_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_mine', 'announce_unread_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked', 'announce_unread_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('announce_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read', 'announce_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_mine', 'announce_read_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked', 'announce_read_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_read_locked_mine', 'announce_read_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread', 'announce_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_mine', 'announce_unread_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked', 'announce_unread_locked.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('global_unread_locked_mine', 'announce_unread_locked_mine.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_read', 'topic_read.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('pm_unread', 'topic_unread.gif', '', 27, 27, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_back_top', 'icon_back_top.gif', '', 11, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_aim', 'icon_contact_aim.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_email', 'icon_contact_email.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_icq', 'icon_contact_icq.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_jabber', 'icon_contact_jabber.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_msnm', 'icon_contact_msnm.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_www', 'icon_contact_www.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_yahoo', 'icon_contact_yahoo.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_delete', 'icon_post_delete.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_info', 'icon_post_info.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_report', 'icon_post_report.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target', 'icon_post_target.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_target_unread', 'icon_post_target_unread.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_attach', 'icon_topic_attach.gif', '', 10, 7, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_latest', 'icon_topic_latest.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_newest', 'icon_topic_newest.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_reported', 'icon_topic_reported.gif', '', 14, 16, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_topic_unapproved', 'icon_topic_unapproved.gif', '', 14, 16, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_profile', 'icon_user_profile.gif', '', 11, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_warn', 'icon_user_warn.gif', '', 20, 20, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('subforum_read', 'subforum_read.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('subforum_unread', 'subforum_unread.gif', '', 9, 11, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_contact_pm', 'icon_contact_pm.gif', 'en', 20, 28, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_edit', 'icon_post_edit.gif', 'en', 20, 42, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_post_quote', 'icon_post_quote.gif', 'en', 20, 54, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_online', 'icon_user_online.gif', 'en', 58, 58, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_offline', 'icon_user_offline.gif', 'en', 0, 0, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('icon_user_search', 'icon_user_search.gif', 'en', 0, 0, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_pm_forward', 'button_pm_forward.gif', 'en', 25, 96, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_pm_new', 'button_pm_new.gif', 'en', 25, 84, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_pm_reply', 'button_pm_reply.gif', 'en', 25, 96, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_locked', 'button_topic_locked.gif', 'en', 25, 88, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_new', 'button_topic_new.gif', 'en', 25, 96, 1); - INSERT INTO phpbb_styles_imageset_data (image_name, image_filename, image_lang, image_height, image_width, imageset_id) VALUES ('button_topic_reply', 'button_topic_reply.gif', 'en', 25, 96, 1);"; - - $data = str_replace('phpbb_', $table_prefix, $data); - $sql_ary = explode("\n", $data); - - foreach ($sql_ary as $sql) - { - $db->sql_query($sql); - } - - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS', '[\x01-\x7F]+' => 'USERNAME_ASCII'); - - set_config('allow_name_chars', $config['allow_name_chars']); - - // sorting thang - if ($map_dbms === 'mysql_41') - { - sql_column_change($map_dbms, TOPICS_TABLE, 'topic_title', array('XSTEXT_UNI', '', 'true_sort')); - } - - if ($config['fulltext_native_common_thres'] == 20) - { - set_config('fulltext_native_common_thres', '5'); - } - - set_config('default_style', '1'); - - $sql = 'SELECT m.word_id, COUNT(m.word_id) as word_count - FROM ' . SEARCH_WORDMATCH_TABLE . ' m, ' . SEARCH_WORDLIST_TABLE . ' w - WHERE m.word_id = w.word_id - AND w.word_common = 0 - GROUP BY m.word_id - ORDER BY word_count ASC'; + $bots = array(); + $sql = 'SELECT u.user_id + FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug + WHERE ug.group_id = ' . $bot_group_id . ' + AND ug.user_id = u.user_id'; $result = $db->sql_query($sql); - $value = 0; - $sql_in = array(); while ($row = $db->sql_fetchrow($result)) { - if ($value != $row['word_count'] && $value != 0 || sizeof($sql_in) > 500) - { - $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' - SET word_count = ' . $value . ' - WHERE ' . $db->sql_in_set('word_id', $sql_in); - $db->sql_query($sql); - $sql_in = array(); - } - $value = $row['word_count']; - $sql_in[] = $row['word_id']; + $bots[] = (int)$row['user_id']; } - - if (sizeof($sql_in)) + $db->sql_freeresult($result); + + if (sizeof($bots)) { - $sql = 'UPDATE ' . SEARCH_WORDLIST_TABLE . ' - SET word_count = ' . $value . ' - WHERE ' . $db->sql_in_set('word_id', $sql_in); + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " + WHERE group_id <> $bot_group_id + AND " . $db->sql_in_set('user_id', $bots); $db->sql_query($sql); } - unset($sql_in); - set_config('avatar_salt', md5(mt_rand())); - set_config('captcha_gd_x_grid', 25); - set_config('captcha_gd_y_grid', 25); - set_config('captcha_gd_foreground_noise', 1); + if ($map_dbms === 'mysql_41') + { + sql_column_change($map_dbms, POSTS_TABLE, 'post_subject', array('XSTEXT_UNI', '', 'true_sort')); + } - $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . " - SET is_local = 0 - WHERE auth_option = 'm_warn'"; - $db->sql_query($sql); - - $cache->destroy('_acl_options'); - - $sql = 'UPDATE ' . MODULES_TABLE . ' - SET module_auth = \'acl_m_warn && acl_f_read,$id\' - WHERE module_basename = \'warn\' - AND module_mode = \'warn_post\' - AND module_class = \'mcp\''; - $db->sql_query($sql); - - $cache->destroy('_modules_mcp'); - - $sql = 'UPDATE ' . USERS_TABLE . " SET user_permissions = ''"; - $db->sql_query($sql); + $sql = 'DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'jab_resource'"; + _sql($sql, $errored, $error_ary); + set_config('jab_use_ssl', '0'); + set_config('allow_post_flash', '1'); + $no_updates = false; } +//if (version_compare($current_version, '3.0.RC2', '<=')) +//{ +// $no_updates = false; +//} + _write_result($no_updates, $errored, $error_ary); $error_ary = array(); @@ -1220,7 +693,7 @@ else

    -

    ">»

    +

    " class="button1">

    assign_vars(array( + 'TITLE' => $lang['STAGE_SETTINGS'], + 'BODY' => $lang['CONV_OPTIONS_BODY'], 'L_SUBMIT' => $lang['BEGIN_CONVERT'], 'U_ACTION' => $this->p_master->module_url . "?mode={$this->mode}&sub=settings&tag=$convertor_tag", )); @@ -1110,6 +1112,20 @@ class install_convert extends module case 'postgres': $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1)); + } + break; } } } @@ -1157,14 +1173,31 @@ class install_convert extends module $sql .= (!empty($schema['where'])) ? "\nWHERE (" . $schema['where'] . ')' : ''; // Group By - $sql .= (!empty($schema['group_by'])) ? "\nGROUP BY " . $schema['group_by'] : ''; + if (!empty($schema['group_by'])) + { + $schema['group_by'] = array($schema['group_by']); + foreach($sql_data['select_fields'] as $select) + { + $alias = strpos(strtolower($select), ' as '); + $select = ($alias) ? substr($select, 0, $alias) : $select; + if (!in_array($select, $schema['group_by'])) + { + $schema['group_by'][] = $select; + } + } + } + $sql .= (!empty($schema['group_by'])) ? "\nGROUP BY " . implode(', ', $schema['group_by']) : ''; // Having $sql .= (!empty($schema['having'])) ? "\nHAVING " . $schema['having'] : ''; // Order By + if (empty($schema['order_by']) && !empty($schema['primary'])) + { + $schema['order_by'] = $schema['primary']; + } $sql .= (!empty($schema['order_by'])) ? "\nORDER BY " . $schema['order_by'] : ''; - + // Counting basically holds the amount of rows processed. $counting = -1; $batch_time = 0; @@ -1228,7 +1261,6 @@ class install_convert extends module if (!$convert_row) { // move to the next batch or table - $src_db->sql_freeresult($___result); break; } @@ -1349,6 +1381,20 @@ class install_convert extends module case 'postgres': $db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); break; + + case 'oracle': + $result = $db->sql_query('SELECT MAX(' . $schema['autoincrement'] . ') as max_id FROM ' . $schema['target']); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $largest_id = (int) $row['max_id']; + + if ($largest_id) + { + $db->sql_query('DROP SEQUENCE ' . $schema['target'] . '_seq'); + $db->sql_query('CREATE SEQUENCE ' . $schema['target'] . '_seq START WITH ' . ($largest_id + 1)); + } + break; } } } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index ef04a1e3b9..5244e656c9 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -63,7 +63,7 @@ class install_install extends module $template->assign_vars(array( 'TITLE' => $lang['INSTALL_INTRO'], 'BODY' => $lang['INSTALL_INTRO_BODY'], - 'L_SUBMIT' => $lang['NEXT'], + 'L_SUBMIT' => $lang['NEXT_STEP'], 'S_LANG_SELECT' => '', 'U_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language", )); @@ -1359,7 +1359,10 @@ class install_install extends module // We set a (semi-)unique cookie name to bypass login issues related to the cookie name. $cookie_name = 'phpbb3_'; - $cookie_name .= strtolower(gen_rand_string(5)); + $rand_str = md5(mt_rand()); + $rand_str = str_replace('0', 'z', base_convert($rand_str, 16, 35)); + $rand_str = substr($rand_str, 0, 5); + $cookie_name .= strtolower($rand_str); $sql_ary[] = 'UPDATE ' . $table_prefix . "config SET config_value = '" . $db->sql_escape($cookie_name) . "' @@ -1642,14 +1645,19 @@ class install_install extends module AND module_class = '" . $db->sql_escape($module_class) . "' AND module_basename <> ''"; $result = $db->sql_query_limit($sql, 1); - $module_data = $db->sql_fetchrow($result); + $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - unset($module_data['module_id']); - unset($module_data['left_id']); - unset($module_data['right_id']); - - $module_data['parent_id'] = (int) $row2['module_id']; + $module_data = array( + 'module_basename' => $row['module_basename'], + 'module_enabled' => $row['module_enabled'], + 'module_display' => $row['module_display'], + 'parent_id' => (int) $row2['module_id'], + 'module_class' => $row['module_class'], + 'module_langname' => $row['module_langname'], + 'module_mode' => $row['module_mode'], + 'module_auth' => $row['module_auth'], + ); $_module->update_module_data($module_data, true); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 9f08f2ec64..3a68e271ed 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -108,6 +108,9 @@ class install_update extends module } $db->sql_freeresult($result); + // Force template recompile + $config['load_tplcompile'] = 1; + // First of all, init the user session $user->session_begin(); $auth->acl($user->data); @@ -267,7 +270,7 @@ class install_update extends module $template->assign_vars(array( 'S_DB_UPDATE' => true, 'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->latest_version) ? true : false, - 'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&language=' . $language), + 'U_DB_UPDATE' => append_sid($phpbb_root_path . 'install/database_update.' . $phpEx, 'type=1&language=' . $user->data['user_lang']), 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), )); @@ -1172,8 +1175,8 @@ class install_update extends module { // Adjust the update info file to hold some specific style-related information $info['custom'] = array(); - - /* Get custom installed styles... +/* + // Get custom installed styles... $sql = 'SELECT template_name, template_path FROM ' . STYLES_TEMPLATE_TABLE . " WHERE LOWER(template_name) NOT IN ('subsilver2', 'prosilver')"; @@ -1191,16 +1194,16 @@ class install_update extends module foreach ($info['files'] as $filename) { // Template update? - if (strpos(strtolower($filename), 'styles/subsilver2/template/') === 0) + if (strpos(strtolower($filename), 'styles/prosilver/template/') === 0) { foreach ($templates as $row) { - $info['custom'][$filename][] = str_replace('/subsilver2/', '/' . $row['template_path'] . '/', $filename); + $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['template_path'] . '/', $filename); } } } } - */ +*/ } break; diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index f815449d19..f1c74512eb 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -112,7 +112,7 @@ CREATE TABLE phpbb_acl_roles_data ( ALTER TABLE phpbb_acl_roles_data ADD PRIMARY KEY (role_id, auth_option_id);; -CREATE INDEX phpbb_acl_roles_data_ath_opt_id ON phpbb_acl_roles_data(auth_option_id);; +CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data(auth_option_id);; # Table: 'phpbb_acl_users' CREATE TABLE phpbb_acl_users ( @@ -1176,7 +1176,7 @@ CREATE TABLE phpbb_styles_imageset_data ( ALTER TABLE phpbb_styles_imageset_data ADD PRIMARY KEY (image_id);; -CREATE INDEX phpbb_styles_imageset_data_i_id ON phpbb_styles_imageset_data(imageset_id);; +CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data(imageset_id);; CREATE GENERATOR phpbb_styles_imageset_data_gen;; SET GENERATOR phpbb_styles_imageset_data_gen TO 0;; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 3e58881427..6c2e2ee24d 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -141,7 +141,7 @@ ALTER TABLE [phpbb_acl_roles_data] WITH NOCHECK ADD ) ON [PRIMARY] GO -CREATE INDEX [ath_opt_id] ON [phpbb_acl_roles_data]([auth_option_id]) ON [PRIMARY] +CREATE INDEX [ath_op_id] ON [phpbb_acl_roles_data]([auth_option_id]) ON [PRIMARY] GO @@ -1392,7 +1392,7 @@ ALTER TABLE [phpbb_styles_imageset_data] WITH NOCHECK ADD ) ON [PRIMARY] GO -CREATE INDEX [i_id] ON [phpbb_styles_imageset_data]([imageset_id]) ON [PRIMARY] +CREATE INDEX [i_d] ON [phpbb_styles_imageset_data]([imageset_id]) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index db814a3613..b0aed4d177 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -72,7 +72,7 @@ CREATE TABLE phpbb_acl_roles_data ( auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, PRIMARY KEY (role_id, auth_option_id), - KEY ath_opt_id (auth_option_id) + KEY ath_op_id (auth_option_id) ); @@ -788,7 +788,7 @@ CREATE TABLE phpbb_styles_imageset_data ( image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, imageset_id tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (image_id), - KEY i_id (imageset_id) + KEY i_d (imageset_id) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index dee258d888..44b292b7e7 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -72,7 +72,7 @@ CREATE TABLE phpbb_acl_roles_data ( auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, auth_setting tinyint(2) DEFAULT '0' NOT NULL, PRIMARY KEY (role_id, auth_option_id), - KEY ath_opt_id (auth_option_id) + KEY ath_op_id (auth_option_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; @@ -436,7 +436,7 @@ CREATE TABLE phpbb_posts ( enable_magic_url tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_sig tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, post_username varchar(255) DEFAULT '' NOT NULL, - post_subject varchar(100) DEFAULT '' NOT NULL, + post_subject varchar(100) DEFAULT '' NOT NULL COLLATE utf8_unicode_ci, post_text mediumtext NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, @@ -788,7 +788,7 @@ CREATE TABLE phpbb_styles_imageset_data ( image_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, imageset_id tinyint(4) DEFAULT '0' NOT NULL, PRIMARY KEY (image_id), - KEY i_id (imageset_id) + KEY i_d (imageset_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 9660dbf386..489c7e7bc5 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -187,7 +187,7 @@ CREATE TABLE phpbb_acl_roles_data ( ) / -CREATE INDEX phpbb_acl_roles_data_ath_opt_id ON phpbb_acl_roles_data (auth_option_id) +CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id) / /* @@ -1560,7 +1560,7 @@ CREATE TABLE phpbb_styles_imageset_data ( ) / -CREATE INDEX phpbb_styles_imageset_data_i_id ON phpbb_styles_imageset_data (imageset_id) +CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id) / CREATE SEQUENCE phpbb_styles_imageset_data_seq diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index c976a2a157..b1ff1d1d11 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -169,7 +169,7 @@ CREATE TABLE phpbb_acl_roles_data ( PRIMARY KEY (role_id, auth_option_id) ); -CREATE INDEX phpbb_acl_roles_data_ath_opt_id ON phpbb_acl_roles_data (auth_option_id); +CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id); /* Table: 'phpbb_acl_users' @@ -1039,7 +1039,7 @@ CREATE TABLE phpbb_styles_imageset_data ( PRIMARY KEY (image_id) ); -CREATE INDEX phpbb_styles_imageset_data_i_id ON phpbb_styles_imageset_data (imageset_id); +CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id); /* Table: 'phpbb_topics' diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 7122daa8a4..321cae118c 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -20,6 +20,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars', INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_pm_attach', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_flash', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_post_links', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_privmsg', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig', '1'); @@ -113,7 +114,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_host', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_password', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_package_size', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_port', '5222'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_use_ssl', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_email', ''); @@ -148,7 +149,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_login_attempts INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars', '30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options', '10'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '60000'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_font_size', '200'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_height', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_img_width', '0'); @@ -204,7 +205,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC2'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -537,7 +538,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%'; # Standard Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock'); # No Access (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_'; @@ -556,7 +557,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove'); # Standard Access + Polls (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); # Limited Access + Polls (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg'); @@ -677,11 +678,11 @@ INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, disp INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/question.gif', 16, 16, 6, 1); INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/alert.gif', 16, 16, 7, 1); -# -- reasons - the report_description here is not used, only to fill up the db. ;) -INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('warez', 'The reported post contains links to pirated or illegal software', 1); -INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('spam', 'The reported post has for only purpose to advertise for a website or another product', 2); -INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('off_topic', 'The reported post is off topic', 3); -INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('other', 'The reported post does not fit into any other category (please use the description field)', 4); +# -- reasons +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('warez', '{L_REPORT_WAREZ}', 1); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('spam', '{L_REPORT_SPAM}', 2); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('off_topic', '{L_REPORT_OFF_TOPIC}', 3); +INSERT INTO phpbb_reports_reasons (reason_title, reason_description, reason_order) VALUES ('other', '{L_REPORT_OTHER}', 4); # -- extension_groups INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('{L_EXT_GROUP_IMAGES}', 1, 1, 1, '', 0, ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 9f48115874..70b4f8de22 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -73,7 +73,7 @@ CREATE TABLE phpbb_acl_roles_data ( PRIMARY KEY (role_id, auth_option_id) ); -CREATE INDEX phpbb_acl_roles_data_ath_opt_id ON phpbb_acl_roles_data (auth_option_id); +CREATE INDEX phpbb_acl_roles_data_ath_op_id ON phpbb_acl_roles_data (auth_option_id); # Table: 'phpbb_acl_users' CREATE TABLE phpbb_acl_users ( @@ -761,7 +761,7 @@ CREATE TABLE phpbb_styles_imageset_data ( imageset_id tinyint(4) NOT NULL DEFAULT '0' ); -CREATE INDEX phpbb_styles_imageset_data_i_id ON phpbb_styles_imageset_data (imageset_id); +CREATE INDEX phpbb_styles_imageset_data_i_d ON phpbb_styles_imageset_data (imageset_id); # Table: 'phpbb_topics' CREATE TABLE phpbb_topics ( diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 32ef227377..74a80c5047 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -1,12 +1,12 @@ 'Allow BBCode in private messages', 'ALLOW_FLASH_PM' => 'Allow use of [FLASH] BBCode tag', + 'ALLOW_FLASH_PM_EXPLAIN' => 'Note that the ability to use flash in private messages, if enabled here, also depends on the permissions.', 'ALLOW_FORWARD_PM' => 'Allow forwarding of private messages', 'ALLOW_IMG_PM' => 'Allow use of [IMG] BBCode tag', 'ALLOW_MASS_PM' => 'Allow sending of private messages to multiple users and groups', @@ -126,6 +127,8 @@ $lang = array_merge($lang, array( 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting.', 'ALLOW_POST_LINKS' => 'Allow links in posts/private messages', 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', + 'ALLOW_POST_FLASH' => 'Allow use of [FLASH] BBCode tag in posts. ', + 'ALLOW_POST_FLASH_EXPLAIN' => 'If disallowed the [FLASH] BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the [FLASH] BBCode tag.', 'BUMP_INTERVAL' => 'Bump interval', 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.', @@ -181,10 +184,10 @@ $lang = array_merge($lang, array( 'ACC_ACTIVATION' => 'Account activation', 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.', - 'ACC_ADMIN' => 'Admin', + 'ACC_ADMIN' => 'By Admin', 'ACC_DISABLE' => 'Disable', 'ACC_NONE' => 'None', - 'ACC_USER' => 'User', + 'ACC_USER' => 'By User', // 'ACC_USER_ADMIN' => 'User + Admin', 'ALLOW_EMAIL_REUSE' => 'Allow e-mail address re-use', 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same e-mail address.', @@ -193,7 +196,7 @@ $lang = array_merge($lang, array( 'COPPA_MAIL' => 'COPPA mailing address', 'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms.', 'ENABLE_COPPA' => 'Enable COPPA', - 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA Act. If this is disabled the COPPA specific groups will no longer be displayed.', + 'ENABLE_COPPA_EXPLAIN' => 'This requires users to declare whether they are 13 or over for compliance with the U.S. COPPA. If this is disabled the COPPA specific groups will no longer be displayed.', 'MAX_CHARS' => 'Max', 'MIN_CHARS' => 'Min', 'NO_AUTH_PLUGIN' => 'No suitable auth plugin found.', @@ -340,10 +343,10 @@ $lang = array_merge($lang, array( 'ACP_SECURITY_SETTINGS_EXPLAIN' => 'Here you are able to define session and login related settings.', 'ALL' => 'All', - 'ALLOW_AUTOLOGIN' => 'Allow persistent logins', - 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users can autologin when they visit the board.', - 'AUTOLOGIN_LENGTH' => 'Persistent login key expiration length (in days)', - 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.', + 'ALLOW_AUTOLOGIN' => 'Allow persistent logins', + 'ALLOW_AUTOLOGIN_EXPLAIN' => 'Determines whether users can autologin when they visit the board.', + 'AUTOLOGIN_LENGTH' => 'Persistent login key expiration length (in days)', + 'AUTOLOGIN_LENGTH_EXPLAIN' => 'Number of days after which persistent login keys are removed or zero to disable.', 'BROWSER_VALID' => 'Validate browser', 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', 'CHECK_DNSBL' => 'Check IP against DNS Blackhole List', @@ -412,32 +415,24 @@ $lang = array_merge($lang, array( // Jabber settings $lang = array_merge($lang, array( - 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Note that it may take several seconds to update Jabber account details, so do not stop the script until it is completed!', + 'ACP_JABBER_SETTINGS_EXPLAIN' => 'Here you can enable and control the use of Jabber for instant messaging and board notifications. Jabber is an open source protocol and therefore available for use by anyone. Some Jabber servers include gateways or transports which allow you to contact users on other networks. Not all servers offer all transports and changes in protocols can prevent transports from operating. Please be sure to enter already registered account details - phpBB will use the details you enter here as is.', 'ERR_JAB_AUTH' => 'Could not authorise on Jabber server.', 'ERR_JAB_CONNECT' => 'Could not connect to Jabber server.', - 'ERR_JAB_PASSCHG' => 'Could not change password.', - 'ERR_JAB_PASSFAIL' => 'Password update failed, %s.', - 'ERR_JAB_REGISTER' => 'An error occurred trying to register this account, %s.', - 'ERR_JAB_USERNAME' => 'The username specified already exists, please choose an alternative.', - - 'JAB_CHANGED' => 'Jabber account changed successfully.', 'JAB_ENABLE' => 'Enable Jabber', 'JAB_ENABLE_EXPLAIN' => 'Enables use of Jabber messaging and notifications.', 'JAB_PACKAGE_SIZE' => 'Jabber package size', - 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and is not queued for later sending.', + 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.', 'JAB_PASSWORD' => 'Jabber password', - 'JAB_PASS_CHANGED' => 'Jabber password changed successfully.', 'JAB_PORT' => 'Jabber port', 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.', - 'JAB_REGISTERED' => 'New account registered successfully.', - 'JAB_RESOURCE' => 'Jabber resource', - 'JAB_RESOURCE_EXPLAIN' => 'The resource locates this particular connection, e.g. board, home, etc.', 'JAB_SERVER' => 'Jabber server', 'JAB_SERVER_EXPLAIN' => 'See %sjabber.org%s for a list of servers.', 'JAB_SETTINGS_CHANGED' => 'Jabber settings changed successfully.', + 'JAB_USE_SSL' => 'Use SSL to connect', + 'JAB_USE_SSL_EXPLAIN' => 'If enabled a secure connection is tried to be established. The Jabber port will be modified to 5223 if port 5222 is specified.', 'JAB_USERNAME' => 'Jabber username', - 'JAB_USERNAME_EXPLAIN' => 'If this user is not registered it will be created if possible.', + 'JAB_USERNAME_EXPLAIN' => 'Specify a registered username. The username will not be checked for validity.', )); ?> \ No newline at end of file diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 854dc198af..92e6d77dfb 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -1,12 +1,12 @@ 'Edited post “%1$s” written by
    » %2$s', 'LOG_REPORT_CLOSED' => 'Closed report
    » %s', 'LOG_REPORT_DELETED' => 'Deleted report
    » %s', - 'LOG_SPLIT_DESTINATION' => 'Moved splitted posts
    » to %s', - 'LOG_SPLIT_SOURCE' => 'Splitted posts
    » from %s', + 'LOG_SPLIT_DESTINATION' => 'Moved split posts
    » to %s', + 'LOG_SPLIT_SOURCE' => 'Split posts
    » from %s', 'LOG_TOPIC_DELETED' => 'Deleted topic
    » %s', 'LOG_TOPIC_APPROVED' => 'Approved topic
    » %s', @@ -647,7 +647,7 @@ $lang = array_merge($lang, array( 'LOG_USER_DEL_AVATAR_USER' => 'User avatar removed', 'LOG_USER_DEL_SIG_USER' => 'User signature removed', 'LOG_USER_FEEDBACK' => 'Added user feedback
    » %s', - 'LOG_USER_GENERAL' => '%s', + 'LOG_USER_GENERAL' => 'Entry added:
    » %s', 'LOG_USER_INACTIVE_USER' => 'User account de-activated', 'LOG_USER_LOCK' => 'User locked own topic
    » %s', 'LOG_USER_MOVE_POSTS_USER' => 'Moved all posts to forum» %s', diff --git a/phpBB/language/en/acp/database.php b/phpBB/language/en/acp/database.php index e776b13024..8efeaef978 100644 --- a/phpBB/language/en/acp/database.php +++ b/phpBB/language/en/acp/database.php @@ -1,12 +1,12 @@ 'Here you can backup all your phpBB related data. You may store the resulting archive in your store/ folder or download it directly. Depending on your server configuration you may be able to compress the file in a number of formats.', - 'ACP_RESTORE_EXPLAIN' => 'This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may use a gzip or bzip2 compressed text file and it will automatically be decompressed. WARNING This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete.', + 'ACP_RESTORE_EXPLAIN' => 'This will perform a full restore of all phpBB tables from a saved file. If your server supports it you may use a gzip or bzip2 compressed text file and it will automatically be decompressed. WARNING This will overwrite any existing data. The restore may take a long time to process please do not move from this page till it is complete. Backups are stored in the store/ folder and are assumed to be generated by phpBB\'s backup functionality. Restoring backups that were not created by the built in system may or may not work.', 'BACKUP_DELETE' => 'The backup file has been deleted successfully.', 'BACKUP_INVALID' => 'The selected file to backup is invalid.', diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index c831a87981..936dc9bf3c 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -1,12 +1,12 @@ 'This group has no members', 'GROUPS_NO_MODS' => 'No group leaders defined', + 'GROUP_APPROVE' => 'Approve member', 'GROUP_APPROVED' => 'Approved members', 'GROUP_AVATAR' => 'Group avatar', @@ -48,6 +49,8 @@ $lang = array_merge($lang, array( 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.', + 'GROUP_CONFIRM_ADD_USER' => 'Are you sure that you want to add the user %1$s to the group?', + 'GROUP_CONFIRM_ADD_USERS' => 'Are you sure that you want to add the users %1$s to the group?', 'GROUP_CREATED' => 'Group has been created successfully.', 'GROUP_DEFAULT' => 'Make group default for member', 'GROUP_DEFS_UPDATED' => 'Default group set for all selected members.', @@ -90,6 +93,7 @@ $lang = array_merge($lang, array( 'GROUP_TYPE' => 'Group type', 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', 'GROUP_UPDATED' => 'Group preferences updated successfully.', + 'GROUP_USERS_ADDED' => 'New users added to group successfully.', 'GROUP_USERS_EXIST' => 'The selected users are already members.', 'GROUP_USERS_REMOVE' => 'Users removed from group and new defaults set successfully.', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 8cdbc492c4..00c53257ad 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -1,11 +1,11 @@ array('lang' => 'Can read forum', 'cat' => 'post'), 'acl_f_post' => array('lang' => 'Can start new topics', 'cat' => 'post'), 'acl_f_reply' => array('lang' => 'Can reply to topics', 'cat' => 'post'), - 'acl_f_icons' => array('lang' => 'Can use post icons', 'cat' => 'post'), + 'acl_f_icons' => array('lang' => 'Can use topic/post icons', 'cat' => 'post'), 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'), 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'), @@ -191,7 +191,7 @@ $lang = array_merge($lang, array( 'acl_a_forumdel' => array('lang' => 'Can delete forums', 'cat' => 'forums'), 'acl_a_prune' => array('lang' => 'Can prune forums', 'cat' => 'forums'), - 'acl_a_icons' => array('lang' => 'Can alter topic icons and smilies', 'cat' => 'posting'), + 'acl_a_icons' => array('lang' => 'Can alter topic/post icons and smilies', 'cat' => 'posting'), 'acl_a_words' => array('lang' => 'Can alter word censors', 'cat' => 'posting'), 'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'), 'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'), diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index c543c5f246..1644e1393b 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -1,12 +1,12 @@ 'BBCode is a special implementation of HTML offering greater control over what and how something is displayed. From this page you can add, remove and edit custom BBCodes.', @@ -43,6 +43,7 @@ $lang = array_merge($lang, array( 'BBCODE_HELPLINE_EXPLAIN' => 'This field contains the mouse over text of the BBCode.', 'BBCODE_HELPLINE_TEXT' => 'Help line text', 'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected already exists.', + 'BBCODE_INVALID' => 'Your BBCode is constructed in an invalid form.', 'BBCODE_OPEN_ENDED_TAG' => 'Your custom BBCode must contain both an opening and a closing tag.', 'BBCODE_TAG' => 'Tag', 'BBCODE_TAG_TOO_LONG' => 'The tag name you selected is too long.', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index bd4a3f0e6e..24e7b732f2 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -1,12 +1,12 @@ 'Value for a non-entry. If the field is required, the user gets an error if he choose the option selected here.', 'NUMBERS_ONLY' => 'Only numbers (0-9)', - 'PREVIEW_PROFILE_FIELD' => 'Preview profile field', 'PROFILE_BASIC_OPTIONS' => 'Basic options', 'PROFILE_FIELD_ACTIVATED' => 'Profile field successfully activated.', 'PROFILE_FIELD_DEACTIVATED' => 'Profile field successfully deactivated.', @@ -130,7 +129,7 @@ $lang = array_merge($lang, array( 'STEP_1_TITLE_CREATE' => 'Add profile field', 'STEP_1_TITLE_EDIT' => 'Edit profile field', 'STEP_2_EXPLAIN_CREATE' => 'Here you are able to define some common options you may want to adjust.', - 'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options. Further you are able to preview the changed field, as the user will see it. Play around with it until you are satisfied as how the field behaves.
    Please note that changes to profile fields will not affect existing profile fields entered by your users.', + 'STEP_2_EXPLAIN_EDIT' => 'Here you are able to change some common options.
    Please note that changes to profile fields will not affect existing profile fields entered by your users.', 'STEP_2_TITLE_CREATE' => 'Profile type specific options', 'STEP_2_TITLE_EDIT' => 'Profile type specific options', 'STEP_3_EXPLAIN_CREATE' => 'Since you have more than one board language installed, you have to fill out the remaining language items too. The profile field will work with the default language enabled, you are able to fill out the remaining language items later too.', @@ -142,7 +141,6 @@ $lang = array_merge($lang, array( 'TEXT_DEFAULT_VALUE_EXPLAIN' => 'Enter a default text to be displayed, a default value. Leave empty if you want to show it empty at the first place.', 'TRANSLATE' => 'Translate', - 'UPDATE_PREVIEW' => 'Update preview', 'USER_FIELD_NAME' => 'Field name/title presented to the user', 'VISIBILITY_OPTION' => 'Visibility option', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index df14105eb2..4f7472e5ff 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -1,12 +1,12 @@ 'Imagesets comprise all the button, forum, folder, etc. and other non-style specific images used by the board. Here you can edit, export or delete existing imagesets and import or activate new sets.', - 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists off a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterisk (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', + 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists of a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterisk (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', 'ACP_TEMPLATES_EXPLAIN' => 'A template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.', 'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your board. The range of options open to you depends on the configuration of your server and phpBB installation, see the manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.', 'ADD_IMAGESET' => 'Create imageset', @@ -44,6 +44,7 @@ $lang = array_merge($lang, array( 'ADD_THEME' => 'Create theme', 'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).', 'ARCHIVE_FORMAT' => 'Archive file type', + 'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.', 'BACKGROUND' => 'Background', 'BACKGROUND_COLOUR' => 'Background colour', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 7c09a99c42..3a2b8170ab 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -1,12 +1,12 @@ 'You are not allowed to force reactivation of your own account.', 'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.', 'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.', - 'CANNOT_SET_FOUNDER_BOT' => 'You are not able to promote ignored users to be founders.', + 'CANNOT_SET_FOUNDER_IGNORED' => 'You are not able to promote ignored users to be founders.', 'CANNOT_SET_FOUNDER_INACTIVE' => 'You need to activate users before you promote them to founders, only activated users are able to be promoted.', 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing the users e-mail address.', @@ -111,6 +111,7 @@ $lang = array_merge($lang, array( 'USER_GROUP_NORMAL' => 'Normal groups user is a member of', 'USER_GROUP_PENDING' => 'Groups user is in pending mode', 'USER_GROUP_SPECIAL' => 'Special groups user is a member of', + 'USER_NO_ATTACHMENTS' => 'There are no attached files to display.', 'USER_OVERVIEW_UPDATED' => 'User details updated.', 'USER_POSTS_DELETED' => 'Successfully removed all posts made by this user.', 'USER_POSTS_MOVED' => 'Successfully moved users posts to target forum.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 029f63e1c0..9d2755667d 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -1,12 +1,12 @@ 'The avatar’s filesize is too large. The maximum allowed upload size is %d MB.
    Please note this is set in php.ini and cannot be overridden.', 'AVATAR_URL_INVALID' => 'The URL you specified is invalid.', 'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.', - 'AVATAR_WRONG_FILESIZE' => 'The avatar must be between 0 and %1d %2s.', + 'AVATAR_WRONG_FILESIZE' => 'The avatar’s filesize must be between 0 and %1d %2s.', 'AVATAR_WRONG_SIZE' => 'The submitted avatar is %5$d pixels wide and %6$d pixels high. Avatars must be at least %1$d pixels wide and %2$d pixels high, but no larger than %3$d pixels wide and %4$d pixels high.', 'BACK_TO_TOP' => 'Top', @@ -291,7 +291,7 @@ $lang = array_merge($lang, array( 'LOGIN_ERROR_PASSWORD_CONVERT' => 'It was not possible to convert your password when updating this bulletin board’s software. Please %srequest a new password%s. If you continue to have problems please contact the %sBoard Administrator%s.', 'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.', 'LOGIN_FORUM' => 'To view or post in this forum you must enter its password.', - 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', + 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few moments but gives you increased capabilities. The board administrator may also grant additional permissions to registered users. Before you register please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', 'LOGIN_VIEWFORUM' => 'The board requires you to be registered and logged in to view this forum.', 'LOGIN_EXPLAIN_EDIT' => 'In order to edit posts in this forum you have to be registered and logged in.', 'LOGOUT' => 'Logout', @@ -327,7 +327,8 @@ $lang = array_merge($lang, array( 'NEW_PMS' => '%d new messages', 'NEW_POST' => 'New post', 'NEW_POSTS' => 'New posts', - 'NEXT' => 'Next', + 'NEXT' => 'Next', // Used in pagination + 'NEXT_STEP' => 'Next', 'NEVER' => 'Never', 'NO' => 'No', 'NOT_ALLOWED_MANAGE_GROUP' => 'You are not allowed to manage this group.', @@ -412,7 +413,8 @@ $lang = array_merge($lang, array( 'POST_TOPIC' => 'Post a new topic', 'POST_UNAPPROVED' => 'This post is waiting for approval', 'PREVIEW' => 'Preview', - 'PREVIOUS' => 'Previous', + 'PREVIOUS' => 'Previous', // Used in pagination + 'PREVIOUS_STEP' => 'Previous', 'PRIVACY' => 'Privacy policy', 'PRIVATE_MESSAGE' => 'Private message', 'PRIVATE_MESSAGES' => 'Private messages', @@ -490,6 +492,7 @@ $lang = array_merge($lang, array( 'SELECT_DESTINATION_FORUM' => 'Please select a destination forum', 'SELECT_FORUM' => 'Select a forum', 'SEND_EMAIL' => 'E-mail', + 'SEND_EMAIL_USER' => 'E-mail', // Used as: {L_SEND_EMAIL_USER} {USERNAME} -> E-mail UserX 'SEND_PRIVATE_MESSAGE' => 'Send private message', 'SETTINGS' => 'Settings', 'SIGNATURE' => 'Signature', diff --git a/phpBB/language/en/email/coppa_resend_inactive.txt b/phpBB/language/en/email/coppa_resend_inactive.txt index b1e45213e9..ab8363b350 100644 --- a/phpBB/language/en/email/coppa_resend_inactive.txt +++ b/phpBB/language/en/email/coppa_resend_inactive.txt @@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}" - {U_BOARD} {WELCOME_MSG} -In compliance with the COPPA act your account is currently inactive. +In compliance with the COPPA your account is currently inactive. Please print this message out and have your parent or guardian sign and date it. Then fax it to: diff --git a/phpBB/language/en/email/coppa_welcome_inactive.txt b/phpBB/language/en/email/coppa_welcome_inactive.txt index 1167502c8a..f34479a6fe 100644 --- a/phpBB/language/en/email/coppa_welcome_inactive.txt +++ b/phpBB/language/en/email/coppa_welcome_inactive.txt @@ -2,7 +2,7 @@ Subject: Welcome to "{SITENAME}" - {U_BOARD} {WELCOME_MSG} -In compliance with the COPPA act your account is currently inactive. +In compliance with the COPPA your account is currently inactive. Please print this message out and have your parent or guardian sign and date it. Then fax it to: diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index e37efbba6c..2681dc32cc 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -1,12 +1,12 @@ 'What does the “Delete all board cookies” do?', - 1 => '“Delete all board cookies”deletes the cookies created by phpBB which keep you authenticated and logged into the board. It also provides functions such as read tracking if they have been enabled by the board owner. If you are having login or logout problems, deleting board cookies may help.', + 1 => '“Delete all board cookies” deletes the cookies created by phpBB which keep you authenticated and logged into the board. It also provides functions such as read tracking if they have been enabled by the board owner. If you are having login or logout problems, deleting board cookies may help.', ), array( 0 => '--', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index fa176cbaea..8f37b52c09 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -1,12 +1,12 @@ 'Continue previously started conversion', 'CONVERT' => 'Convert', 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and access your board. Remember that help on using phpBB is available online via the Documentation and the support forums.', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.', 'CONVERT_NEW_CONVERSION' => 'New conversion', @@ -106,6 +106,7 @@ $lang = array_merge($lang, array( 'CONV_ERROR_REPLACE_FORUM' => 'Unable to insert new forum replacing old forum.', 'CONV_ERROR_USER_ACCESS' => 'Unable to get user authentication information.', 'CONV_ERROR_WRONG_GROUP' => 'Wrong group "%1$s" defined in %2$s.', + 'CONV_OPTIONS_BODY' => 'This page collects the data required to access the source board. Enter the database details of your former board; the converter will not change anything in the database given below. The source board should be disabled to allow a consistent conversion.', 'CONV_SAVED_MESSAGES' => 'Saved messages', 'COULD_NOT_COPY' => 'Could not copy file %1$s to %2$s

    Please check that the target directory exists and is writable by the webserver.', @@ -162,7 +163,7 @@ $lang = array_merge($lang, array( 'FORUM_ADDRESS' => 'Board address', 'FORUM_ADDRESS_EXPLAIN' => 'This is the URL of your former board, for example http://www.example.com/phpBB2/. If an address is entered here and not left empty every instance of this address will be replaced by your new board address within messages, private messages and signatures.', 'FORUM_PATH' => 'Board path', - 'FORUM_PATH_EXPLAIN' => 'This is the relative path on disk to your former board from the root of your phpBB installation.', + 'FORUM_PATH_EXPLAIN' => 'This is the relative path on disk to your former board from the root of this phpBB3 installation.', 'FOUND' => 'Found', 'FTP_CONFIG' => 'Transfer config by FTP', 'FTP_CONFIG_EXPLAIN' => 'phpBB has detected the presence of the FTP module on this server. You may attempt to install your config.php via this if you wish. You will need to supply the information listed below. Remember your username and password are those to your server! (ask your hosting provider for details if you are unsure what these are).', @@ -330,6 +331,8 @@ $lang = array_merge($lang, array( // TODO: Write some text on obtaining support 'SUPPORT_BODY' => 'During the release candidate phase full support will be given at the phpBB 3.0.x support forums. We will provide answers to general setup questions, configuration problems, conversion problems and support for determining common problems mostly related to bugs. We also allow discussions about modifications and custom code/style additions.

    For additional assistance, please refer to our Quick Start Guide and the online documentation.

    To ensure you stay up to date with the latest news and releases, why not subscribe to our mailing list?', 'SYNC_FORUMS' => 'Starting to sync forums', + 'SYNC_POST_COUNT' => 'Synchronising post_counts', + 'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from entry %1$s to %2$s.', 'SYNC_TOPICS' => 'Starting to sync topics', 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id %1$s to %2$s.', @@ -440,7 +443,7 @@ $lang = array_merge($lang, array( 'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.', 'PERFORM_DATABASE_UPDATE' => 'Perform database update', - 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a link to the database update script. This script needs to be run separately because updating the database might result in unexpected behaviour if you are logged in. The database update can take a while, so please do not stop the execution if it seems to hang. After you performed the database update just follow the link presented to continue the update process.', + 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a link to the database update script. This script needs to be run separately because updating the database might result in unexpected behaviour if you are logged in. The database update can take a while, so please do not stop the execution if it seems to hang. After the database update had been performed just follow the link presented to continue the update process.', 'PREVIOUS_VERSION' => 'Previous version', 'PROGRESS' => 'Progress', @@ -549,6 +552,10 @@ $lang = array_merge($lang, array( 'FORUMS_TEST_FORUM_TITLE' => 'Test Forum 1', 'RANKS_SITE_ADMIN_TITLE' => 'Site Admin', + 'REPORT_WAREZ' => 'The post contains links to illegal or pirated software.', + 'REPORT_SPAM' => 'The reported post has the only purpose to advertise for a website or another product.', + 'REPORT_OFF_TOPIC' => 'The reported post is off topic.', + 'REPORT_OTHER' => 'The reported post does not fit into any other category, please use the description field.', 'SMILIES_ARROW' => 'Arrow', 'SMILIES_CONFUSED' => 'Confused', diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 89b57d5d65..087e8997e5 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -1,12 +1,12 @@ 'You must select at least one post to perform this action.', 'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.', 'NO_REPORT' => 'No report found', - 'NO_REPORTS' => 'No reports', + 'NO_REPORTS' => 'No reports found', 'NO_REPORT_SELECTED' => 'You must select at least one report to perform this action.', 'NO_TOPIC_ICON' => 'None', 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action.', - 'NO_TOPICS_QUEUE' => 'No topics', + 'NO_TOPICS_QUEUE' => 'There are no topics waiting for approval.', 'ONLY_TOPIC' => 'Only topic "%s"', 'OTHER_USERS' => 'Other users posting from this IP', @@ -326,7 +326,7 @@ $lang = array_merge($lang, array( 'UNAPPROVED_POST_TOTAL' => 'In total there is 1 post waiting for approval.', 'UNLOCK' => 'Unlock', 'UNLOCK_POST' => 'Unlock post', - 'UNLOCK_POST_EXPLAIN' => 'Allow editing.', + 'UNLOCK_POST_EXPLAIN' => 'Allow editing', 'UNLOCK_POST_POST' => 'Unlock post', 'UNLOCK_POST_POST_CONFIRM' => 'Are you sure you want to allow editing this post?', 'UNLOCK_POST_POSTS' => 'Unlock selected posts', @@ -346,7 +346,7 @@ $lang = array_merge($lang, array( 'WARNED_USERS_EXPLAIN' => 'This is a list of users with unexpired warnings issued to them.', 'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]', 'WARNING_PM_SUBJECT' => 'Board warning issued', - 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s.', + 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s .', 'WARNINGS_ZERO_TOTAL' => 'No warnings exist.', 'YOU_SELECTED_TOPIC' => 'You selected topic number %d: %s.', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 480a95c392..79b380b14f 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -1,12 +1,12 @@ '%sBBCode%s is ON', 'BBCODE_I_HELP' => 'Italic text: [i]text[/i]', 'BBCODE_L_HELP' => 'List: [list]text[/list]', - 'BBCODE_LISTITEM_HELP' => 'List item: [*]text[/*]', + 'BBCODE_LISTITEM_HELP' => 'List item: [*]text[/*]', 'BBCODE_O_HELP' => 'Ordered list: [list=]text[/list]', 'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]', 'BBCODE_Q_HELP' => 'Quote text: [quote]text[/quote]', @@ -144,6 +144,7 @@ $lang = array_merge($lang, array( 'POLL_MAX_OPTIONS_EXPLAIN' => 'This is the number of options each user may select when voting.', 'POLL_OPTIONS' => 'Poll options', 'POLL_OPTIONS_EXPLAIN' => 'Place each option on a new line. You may enter up to %d options.', + 'POLL_OPTIONS_EDIT_EXPLAIN' => 'Place each option on a new line. You may enter up to %d options. If you remove or add options all previous votes will be reset.', 'POLL_QUESTION' => 'Poll question', 'POLL_TITLE_TOO_LONG' => 'The poll title must contain fewer than 100 characters.', 'POLL_TITLE_COMP_TOO_LONG' => 'The parsed size of your poll title is too large, consider removing BBCodes or smilies.', @@ -183,6 +184,8 @@ $lang = array_merge($lang, array( 'TOO_FEW_POLL_OPTIONS' => 'You must enter at least two poll options.', 'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maximum.', 'TOO_MANY_CHARS' => 'Your message contains too many characters.', + 'TOO_MANY_CHARS_POST' => 'Your message contains %1$d characters. The maximum number of allowed characters is %2$d.', + 'TOO_MANY_CHARS_SIG' => 'Your signature contains %1$d characters. The maximum number of allowed characters is %2$d.', 'TOO_MANY_POLL_OPTIONS' => 'You have tried to enter too many poll options.', 'TOO_MANY_SMILIES' => 'Your message contains too many smilies. The maximum number of smilies allowed is %d.', 'TOO_MANY_URLS' => 'Your message contains too many URLs. The maximum number of URLs allowed is %d.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 65d32cab07..304b9952d1 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -1,12 +1,12 @@ 'Global announcement', 'HIDE_ONLINE' => 'Hide my online status', + 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting to "No" won\'t become effective until your next visit to the board.', 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', 'HOLD_NEW_MESSAGES_SHORT' => 'New messages will be held back', @@ -238,7 +239,7 @@ $lang = array_merge($lang, array( 'MESSAGE_COLOURS' => 'Message colours', 'MESSAGE_DELETED' => 'Message successfully deleted.', 'MESSAGE_HISTORY' => 'Message history', - 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by it’s author before it was delivered.', + 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by its author before it was delivered.', 'MESSAGE_SENT_ON' => 'on', 'MESSAGE_STORED' => 'This message has been sent successfully.', 'MESSAGE_TO' => 'To', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index a8042c5b57..94c17c83f7 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -1,10 +1,10 @@ $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary))) . ' + 'WHERE' => $db->sql_in_set('u.user_id', array_unique(array_merge($admin_id_ary, $mod_id_ary)), false, true) . ' AND u.group_id = g.group_id', 'ORDER_BY' => 'g.group_name ASC, u.username_clean ASC' @@ -930,13 +934,13 @@ switch ($mode) $s_find_active_time .= ''; } - $sql_where .= ($username) ? " AND u.username_clean LIKE '" . str_replace('*', '%', $db->sql_escape(utf8_clean_string($username))) . "'" : ''; - $sql_where .= ($email) ? " AND u.user_email LIKE '" . str_replace('*', '%', $db->sql_escape($email)) . "' " : ''; - $sql_where .= ($icq) ? " AND u.user_icq LIKE '" . str_replace('*', '%', $db->sql_escape($icq)) . "' " : ''; - $sql_where .= ($aim) ? " AND u.user_aim LIKE '" . str_replace('*', '%', $db->sql_escape($aim)) . "' " : ''; - $sql_where .= ($yahoo) ? " AND u.user_yim LIKE '" . str_replace('*', '%', $db->sql_escape($yahoo)) . "' " : ''; - $sql_where .= ($msn) ? " AND u.user_msnm LIKE '" . str_replace('*', '%', $db->sql_escape($msn)) . "' " : ''; - $sql_where .= ($jabber) ? " AND u.user_jabber LIKE '" . str_replace('*', '%', $db->sql_escape($jabber)) . "' " : ''; + $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', '%', utf8_clean_string($username))) : ''; + $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', '%', $email)) . ' ' : ''; + $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', '%', $icq)) . ' ' : ''; + $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', '%', $aim)) . ' ' : ''; + $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', '%', $yahoo)) . ' ' : ''; + $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', '%', $msn)) . ' ' : ''; + $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', '%', $jabber)) . ' ' : ''; $sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; $sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; @@ -1011,12 +1015,12 @@ switch ($mode) { for ($i = 97; $i < 123; $i++) { - $sql_where .= " AND u.username_clean NOT LIKE '" . chr($i) . "%'"; + $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->any_char); } } else if ($first_char) { - $sql_where .= " AND u.username_clean LIKE '" . $db->sql_escape(substr($first_char, 0, 1)) . "%'"; + $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->any_char); } // Are we looking at a usergroup? If so, fetch additional info @@ -1430,7 +1434,7 @@ function show_profile($data) if ($config['load_onlinetrack']) { $update_time = $config['load_online_time'] * 60; - $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['user_allow_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false; + $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline'])) || $auth->acl_get('u_viewonline'))) ? true : false; } else { diff --git a/phpBB/posting.php b/phpBB/posting.php index 77f8aa720d..675b390672 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1,10 +1,10 @@ lang['GUEST']; +} +else +{ + $post_data['quote_username'] = isset($post_data['username']) ? $post_data['username'] : ''; +} $post_data['post_edit_locked'] = (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0; $post_data['post_subject'] = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : ''); $post_data['topic_time_limit'] = (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0; @@ -450,7 +457,7 @@ $bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_i $smilies_status = ($bbcode_status && $config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false; $img_status = ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false; $url_status = ($config['allow_post_links']) ? true : false; -$flash_status = ($bbcode_status && $auth->acl_get('f_flash', $forum_id)) ? true : false; +$flash_status = ($bbcode_status && $auth->acl_get('f_flash', $forum_id) && $config['allow_post_flash']) ? true : false; $quote_status = ($auth->acl_get('f_reply', $forum_id)) ? true : false; // Save Draft @@ -753,7 +760,7 @@ if ($submit || $preview || $refresh) $post_data['poll_last_vote'] = (isset($post_data['poll_last_vote'])) ? $post_data['poll_last_vote'] : 0; if ($post_data['poll_option_text'] && - ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id)))) + ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) && $auth->acl_get('f_poll', $forum_id)) { $poll = array( @@ -844,7 +851,7 @@ if ($submit || $preview || $refresh) $sql = 'SELECT topic_type, forum_id FROM ' . TOPICS_TABLE . " WHERE topic_id = $topic_id"; - $result = $db->sql_query_limit($sql, 1); + $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -852,6 +859,21 @@ if ($submit || $preview || $refresh) { $to_forum_id = request_var('to_forum_id', 0); + if ($to_forum_id) + { + $sql = 'SELECT forum_type + FROM ' . FORUMS_TABLE . ' + WHERE forum_id = ' . $to_forum_id; + $result = $db->sql_query($sql); + $forum_type = (int) $db->sql_fetchfield('forum_type'); + $db->sql_freeresult($result); + + if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id)) + { + $to_forum_id = 0; + } + } + if (!$to_forum_id) { include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); @@ -960,11 +982,22 @@ if ($submit || $preview || $refresh) unset($message_parser); $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message); + $post_need_approval = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? true : false; - meta_refresh(3, $redirect_url); + // If the post need approval we will wait a lot longer. + if ($post_need_approval) + { + meta_refresh(10, $redirect_url); + $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; + } + else + { + meta_refresh(3, $redirect_url); + + $message = ($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'; + $message = $user->lang[$message] . '

    ' . sprintf($user->lang['VIEW_MESSAGE'], '', ''); + } - $message = (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id'])) ? (($mode == 'edit') ? 'POST_EDITED_MOD' : 'POST_STORED_MOD') : (($mode == 'edit') ? 'POST_EDITED' : 'POST_STORED'); - $message = $user->lang[$message] . (($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) ? '

    ' . sprintf($user->lang['VIEW_MESSAGE'], '', '') : ''); $message .= '

    ' . sprintf($user->lang['RETURN_FORUM'], '', ''); trigger_error($message); } @@ -1002,7 +1035,7 @@ if (!sizeof($error) && $preview) $preview_subject = censor_text($post_data['post_subject']); // Poll Preview - if (!$poll_delete && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id)))) + if (!$poll_delete && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) && $auth->acl_get('f_poll', $forum_id)) { $parse_poll = new parse_message($post_data['poll_title']); @@ -1011,13 +1044,18 @@ if (!sizeof($error) && $preview) $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']); + if ($post_data['poll_length']) + { + $poll_end = ($post_data['poll_length'] * 86400) + (($post_data['poll_start']) ? $post_data['poll_start'] : time()); + } + $template->assign_vars(array( 'S_HAS_POLL_OPTIONS' => (sizeof($post_data['poll_options'])), 'S_IS_MULTI_CHOICE' => ($post_data['poll_max_options'] > 1) ? true : false, 'POLL_QUESTION' => $parse_poll->message, - 'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($post_data['poll_length'] + $post_data['poll_start'])) : '', + 'L_POLL_LENGTH' => ($post_data['poll_length']) ? sprintf($user->lang['POLL_RUN_TILL'], $user->format_date($poll_end)) : '', 'L_MAX_VOTES' => ($post_data['poll_max_options'] == 1) ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $post_data['poll_max_options'])) ); @@ -1252,7 +1290,7 @@ $template->assign_vars(array( 'S_SMILIES_CHECKED' => ($smilies_checked) ? ' checked="checked"' : '', 'S_SIG_ALLOWED' => ($auth->acl_get('f_sigs', $forum_id) && $config['allow_sig'] && $user->data['is_registered']) ? true : false, 'S_SIGNATURE_CHECKED' => ($sig_checked) ? ' checked="checked"' : '', - 'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify']) ? false : true, + 'S_NOTIFY_ALLOWED' => (!$user->data['is_registered'] || ($mode == 'edit' && $user->data['user_id'] != $post_data['poster_id']) || !$config['allow_topic_notify'] || !$config['email_enable']) ? false : true, 'S_NOTIFY_CHECKED' => ($notify_checked) ? ' checked="checked"' : '', 'S_LOCK_TOPIC_ALLOWED' => (($mode == 'edit' || $mode == 'reply' || $mode == 'quote') && ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && !empty($post_data['topic_poster']) && $user->data['user_id'] == $post_data['topic_poster'] && $post_data['topic_status'] == ITEM_UNLOCKED))) ? true : false, 'S_LOCK_TOPIC_CHECKED' => ($lock_topic_checked) ? ' checked="checked"' : '', @@ -1278,7 +1316,7 @@ $template->assign_vars(array( display_custom_bbcodes(); // Poll entry -if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id'] && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id)))) +if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/)) && $auth->acl_get('f_poll', $forum_id)) { $template->assign_vars(array( @@ -1287,7 +1325,7 @@ if (($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_ 'S_POLL_DELETE' => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))), 'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false, - 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_EXPLAIN'], $config['max_poll_options']), + 'L_POLL_OPTIONS_EXPLAIN' => sprintf($user->lang['POLL_OPTIONS_' . (($mode == 'edit') ? 'EDIT_' : '') . 'EXPLAIN'], $config['max_poll_options']), 'VOTE_CHANGE_CHECKED' => (!empty($post_data['poll_vote_change'])) ? ' checked="checked"' : '', 'POLL_TITLE' => (isset($post_data['poll_title'])) ? $post_data['poll_title'] : '', diff --git a/phpBB/search.php b/phpBB/search.php index ed1b43fd9e..cbc5b6732f 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -32,7 +32,7 @@ $view = request_var('view', ''); $submit = request_var('submit', false); $keywords = request_var('keywords', '', true); $add_keywords = request_var('add_keywords', '', true); -$author = request_var('author', ''); +$author = request_var('author', '', true); $author_id = request_var('author_id', 0); $show_results = ($topic_id) ? 'posts' : request_var('sr', 'posts'); $show_results = ($show_results == 'posts') ? 'posts' : 'topics'; @@ -84,7 +84,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) // egosearch is an author search if ($search_id == 'egosearch') { - $author = $user->data['username']; + $author_id = $user->data['user_id']; } // If we are looking for authors get their ids @@ -100,10 +100,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) trigger_error(sprintf($user->lang['TOO_FEW_AUTHOR_CHARS'], $config['min_search_author_chars'])); } - $sql_where = (strpos($author, '*') !== false) ? ' LIKE ' : ' = '; + $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'"; + $sql = 'SELECT user_id FROM ' . USERS_TABLE . " - WHERE username_clean $sql_where '" . $db->sql_escape(preg_replace('#\*+#', '%', utf8_clean_string($author))) . "' + WHERE $sql_where AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query_limit($sql, 100); @@ -299,14 +300,14 @@ if ($keywords || $author || $author_id || $search_id || $submit) $last_post_time = ''; } + + if ($sort_key == 'a') + { + $sort_join = USERS_TABLE . ' u, '; + $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort; + } if ($show_results == 'posts') { - if ($sort_key == 'a') - { - $sort_join = USERS_TABLE . ' u, '; - $sql_sort = ' AND u.user_id = p.poster_id ' . $sql_sort; - } - $sql = "SELECT p.post_id FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t WHERE t.topic_replies = 0 diff --git a/phpBB/style.php b/phpBB/style.php index 9be0d6a0dc..58eabd0e7f 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -1,10 +1,10 @@ -obtain_config(); + $user = false; - $sql = 'SELECT u.user_id, u.user_lang - FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u - WHERE s.session_id = '" . $db->sql_escape($sid) . "' - AND s.session_user_id = u.user_id"; - $result = $db->sql_query($sql); - $user = $db->sql_fetchrow($result); + if ($sid) + { + $sql = 'SELECT u.user_id, u.user_lang + FROM ' . SESSIONS_TABLE . ' s, ' . USERS_TABLE . " u + WHERE s.session_id = '" . $db->sql_escape($sid) . "' + AND s.session_user_id = u.user_id"; + $result = $db->sql_query($sql); + $user = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + + $recompile = $config['load_tplcompile']; + if (!$user) + { + $id = $config['default_style']; + $recompile = false; + $user = array('user_id' => ANONYMOUS); + } + + $sql = 'SELECT s.style_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path + FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i + WHERE s.style_id = ' . $id . ' + AND t.template_id = s.template_id + AND c.theme_id = s.theme_id + AND i.imageset_id = s.imageset_id'; + $result = $db->sql_query($sql, 300); + $theme = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($user) + if ($user['user_id'] == ANONYMOUS) { - $sql = 'SELECT s.style_id, c.theme_data, c.theme_path, c.theme_name, c.theme_mtime, i.*, t.template_path - FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . ' i - WHERE s.style_id = ' . $id . ' - AND t.template_id = s.template_id - AND c.theme_id = s.theme_id - AND i.imageset_id = s.imageset_id'; - $result = $db->sql_query($sql, 300); - $theme = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if ($user['user_id'] == ANONYMOUS) - { - $user['user_lang'] = $config['default_lang']; - } - - $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang']; - - $sql = 'SELECT * - FROM ' . STYLES_IMAGESET_DATA_TABLE . ' - WHERE imageset_id = ' . $theme['imageset_id'] . " - AND image_lang IN('" . $db->sql_escape($user_image_lang) . "', '')"; - $result = $db->sql_query($sql, 3600); - - $img_array = array(); - - while ($row = $db->sql_fetchrow($result)) - { - $img_array[$row['image_name']] = $row; - } - - if (!$theme) - { - exit; - } - - // Re-cache stylesheet data if necessary - if ($config['load_tplcompile'] || empty($theme['theme_data'])) - { - $recache = (empty($theme['theme_data'])) ? true : false; - $update_time = time(); - - // We test for stylesheet.css because it is faster and most likely the only file changed on common themes - if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) - { - $recache = true; - $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); - } - else if (!$recache) - { - $last_change = $theme['theme_mtime']; - - foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) - { - if ($last_change < @filemtime($file)) - { - $recache = true; - break; - } - } - } - - if ($recache) - { - include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx); - - $theme['theme_data'] = acp_styles::db_theme_data($theme); - $theme['theme_mtime'] = $update_time; - - // Save CSS contents - $sql_ary = array( - 'theme_mtime' => $theme['theme_mtime'], - 'theme_data' => $theme['theme_data'] - ); - - $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " - WHERE theme_id = $id"; - $db->sql_query($sql); - - $cache->destroy('sql', STYLES_THEME_TABLE); - - header('Expires: 0'); - } - } - else - { - header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600)); - } - - header('Content-type: text/css'); - - // Parse Theme Data - $replace = array( - '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme', - '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template', - '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset', - '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang, - '{T_STYLESHEET_NAME}' => $theme['theme_name'], - '{S_USER_LANG}' => $user['user_lang'] - ); - - $theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']); - - $matches = array(); - preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches); - - $imgs = $find = $replace = array(); - if (isset($matches[0]) && sizeof($matches[0])) - { - foreach ($matches[1] as $i => $img) - { - $img = strtolower($img); - $find[] = $matches[0][$i]; - - if (!isset($img_array[$img])) - { - $replace[] = ''; - continue; - } - - if (!isset($imgs[$img])) - { - $img_data = &$img_array[$img]; - $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename']; - $imgs[$img] = array( - 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc, - 'width' => $img_data['image_width'], - 'height' => $img_data['image_height'], - ); - } - - switch ($matches[2][$i]) - { - case 'SRC': - $replace[] = $imgs[$img]['src']; - break; - - case 'WIDTH': - $replace[] = $imgs[$img]['width']; - break; - - case 'HEIGHT': - $replace[] = $imgs[$img]['height']; - break; - - default: - continue; - } - } - - if (sizeof($find)) - { - $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']); - } - } - - echo $theme['theme_data']; + $user['user_lang'] = $config['default_lang']; } + $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang']; + + $sql = 'SELECT * + FROM ' . STYLES_IMAGESET_DATA_TABLE . ' + WHERE imageset_id = ' . $theme['imageset_id'] . " + AND image_lang IN('" . $db->sql_escape($user_image_lang) . "', '')"; + $result = $db->sql_query($sql, 3600); + + $img_array = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $img_array[$row['image_name']] = $row; + } + + if (!$theme) + { + exit; + } + + // Re-cache stylesheet data if necessary + if ($recompile || empty($theme['theme_data'])) + { + $recache = (empty($theme['theme_data'])) ? true : false; + $update_time = time(); + + // We test for stylesheet.css because it is faster and most likely the only file changed on common themes + if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) + { + $recache = true; + $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); + } + else if (!$recache) + { + $last_change = $theme['theme_mtime']; + + foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) + { + if ($last_change < @filemtime($file)) + { + $recache = true; + break; + } + } + } + + if ($recache) + { + include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx); + + $theme['theme_data'] = acp_styles::db_theme_data($theme); + $theme['theme_mtime'] = $update_time; + + // Save CSS contents + $sql_ary = array( + 'theme_mtime' => $theme['theme_mtime'], + 'theme_data' => $theme['theme_data'] + ); + + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " + WHERE theme_id = $id"; + $db->sql_query($sql); + + $cache->destroy('sql', STYLES_THEME_TABLE); + + header('Expires: 0'); + } + } + else + { + header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600)); + } + + header('Content-type: text/css'); + + // Parse Theme Data + $replace = array( + '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme', + '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template', + '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset', + '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang, + '{T_STYLESHEET_NAME}' => $theme['theme_name'], + '{S_USER_LANG}' => $user['user_lang'] + ); + + $theme['theme_data'] = str_replace(array_keys($replace), array_values($replace), $theme['theme_data']); + + $matches = array(); + preg_match_all('#\{IMG_([A-Za-z0-9_]*?)_(WIDTH|HEIGHT|SRC)\}#', $theme['theme_data'], $matches); + + $imgs = $find = $replace = array(); + if (isset($matches[0]) && sizeof($matches[0])) + { + foreach ($matches[1] as $i => $img) + { + $img = strtolower($img); + $find[] = $matches[0][$i]; + + if (!isset($img_array[$img])) + { + $replace[] = ''; + continue; + } + + if (!isset($imgs[$img])) + { + $img_data = &$img_array[$img]; + $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename']; + $imgs[$img] = array( + 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc, + 'width' => $img_data['image_width'], + 'height' => $img_data['image_height'], + ); + } + + switch ($matches[2][$i]) + { + case 'SRC': + $replace[] = $imgs[$img]['src']; + break; + + case 'WIDTH': + $replace[] = $imgs[$img]['width']; + break; + + case 'HEIGHT': + $replace[] = $imgs[$img]['height']; + break; + + default: + continue; + } + } + + if (sizeof($find)) + { + $theme['theme_data'] = str_replace($find, $replace, $theme['theme_data']); + } + } + + echo $theme['theme_data']; + if (!empty($cache)) { $cache->unload(); diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html index 30d68af614..a600a7c92a 100644 --- a/phpBB/styles/prosilver/template/bbcode.html +++ b/phpBB/styles/prosilver/template/bbcode.html @@ -37,4 +37,4 @@ {DESCRIPTION} - \ No newline at end of file + \ No newline at end of file diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 30c7e5ffee..7d267410aa 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -25,9 +25,9 @@

  • -
    +
    -
    {forumrow.FORUM_IMAGE}
    +
    {forumrow.FORUM_IMAGE}
    {forumrow.FORUM_NAME}
    {forumrow.FORUM_DESC} diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index 96fa57857e..b2f43b79aa 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -1,14 +1,16 @@ -

    {LAST_VISIT_DATE}{CURRENT_TIME}

    +

    {LAST_VISIT_DATE}{CURRENT_TIME}

    {CURRENT_TIME}
    {L_MCP} ]

    {CURRENT_TIME}

    + + @@ -18,7 +20,7 @@ diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 077362e306..369321f36d 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -3,13 +3,13 @@
    -

    {L_RETURN_TO} {FORUM_NAME}

    +

    {L_RETURN_TO} {FORUM_NAME}

    -

    {L_RETURN_TO} {L_INDEX}

    +

    {L_RETURN_TO} {L_INDEX}

    -

    {L_RETURN_TO}: {SEARCH_TOPIC}

    +

    {L_RETURN_TO}: {SEARCH_TOPIC}

    -

    {L_RETURN_TO} {L_SEARCH_ADV}

    +

    {L_RETURN_TO} {L_SEARCH_ADV}

    @@ -18,7 +18,7 @@
    - diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html index 8174a2ddc1..90e53975d2 100644 --- a/phpBB/styles/prosilver/template/login_body.html +++ b/phpBB/styles/prosilver/template/login_body.html @@ -11,11 +11,11 @@
    {LOGIN_ERROR}
    -
    +
    -
    +
    {L_FORGOT_PASS}
    {L_RESEND_ACTIVATION}
    @@ -32,8 +32,8 @@
    -
    -
    +
    +
    diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html index f47586f469..6d388da120 100644 --- a/phpBB/styles/prosilver/template/login_forum.html +++ b/phpBB/styles/prosilver/template/login_forum.html @@ -2,7 +2,7 @@

    {L_LOGIN} {FORUM_NAME}

    - +
    @@ -18,7 +18,7 @@
    -
    +
     
    diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 17e57578ba..1f07777530 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -34,8 +34,8 @@
  • -
    -
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG});"> +
    +
    style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> [ {L_SELECT_MERGE} ]   {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} @@ -61,8 +61,8 @@
    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 722f4d59f5..71126aab01 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -123,7 +123,7 @@ {log.ACTION} {log.USERNAME} {log.IP} - {L_VIEW_TOPIC} + {L_VIEW_TOPIC}  {L_VIEW_TOPIC_LOGS}  {log.TIME} diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html index 4e4e782fca..fb82e4168c 100644 --- a/phpBB/styles/prosilver/template/mcp_logs.html +++ b/phpBB/styles/prosilver/template/mcp_logs.html @@ -47,8 +47,8 @@
    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html index 817c7d235b..bb47956a57 100644 --- a/phpBB/styles/prosilver/template/mcp_notes_user.html +++ b/phpBB/styles/prosilver/template/mcp_notes_user.html @@ -87,8 +87,8 @@
    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index dc0ea9f800..9cfaa05db3 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -54,7 +54,7 @@

    {MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} {L_POSTED_ON_DATE} {POST_DATE}

    - +

      diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index 096ed8243a..744b46e380 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -60,8 +60,8 @@

    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} @@ -77,7 +77,7 @@
  • -

    {L_NO_TOPICS_QUEUE}{L_NO_POSTS}

    +

    {L_NO_TOPICS_QUEUE}{L_UNAPPROVED_POSTS_ZERO_TOTAL}

    diff --git a/phpBB/styles/prosilver/template/mcp_reports.html b/phpBB/styles/prosilver/template/mcp_reports.html index 04e64265f2..89c9276f3d 100644 --- a/phpBB/styles/prosilver/template/mcp_reports.html +++ b/phpBB/styles/prosilver/template/mcp_reports.html @@ -50,8 +50,8 @@
    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 704624b993..52d815eb8e 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -67,7 +67,7 @@ onload_functions.push('subPanels()');
    -
    +
    diff --git a/phpBB/styles/prosilver/template/mcp_whois.html b/phpBB/styles/prosilver/template/mcp_whois.html index 4906816635..2bd065996c 100644 --- a/phpBB/styles/prosilver/template/mcp_whois.html +++ b/phpBB/styles/prosilver/template/mcp_whois.html @@ -4,9 +4,9 @@ diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 3cf276cec6..081352924e 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -146,8 +146,8 @@
    - {L_PREVIOUS} - {L_NEXT} + {L_PREVIOUS} + {L_NEXT}
    diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html index 614efa73ee..cb5bf8d4ea 100644 --- a/phpBB/styles/prosilver/template/memberlist_email.html +++ b/phpBB/styles/prosilver/template/memberlist_email.html @@ -28,7 +28,7 @@ function checkForm(formObj) //--> -

    {L_SEND_EMAIL} {USERNAME}

    +

    {L_SEND_EMAIL_USER} {USERNAME}

    @@ -45,7 +45,7 @@ function checkForm(formObj)
    -
    +
    @@ -54,7 +54,7 @@ function checkForm(formObj)
    -
    +

    diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index 7ebe1e3472..b12d5314c7 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -19,7 +19,7 @@
    -
    +
    @@ -49,6 +49,7 @@
    {L_IM_ADD_CONTACT}
    {L_IM_SEND_MESSAGE}
    +
    diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index ba7cf302ff..ac7ac9821d 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -11,7 +11,10 @@ function insert_marked(users) { if (typeof(users.length) == "undefined") { - insert_user(users.value); + if (users.checked) + { + insert_user(users.value); + } } else if (users.length > 0) { @@ -48,7 +51,7 @@ function insert_single(user)
    -
    +
    diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index 5b50f74689..c30a6d69b5 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -44,7 +44,7 @@

    {L_CONTACT_USER} {USERNAME}

    -
    {L_EMAIL_ADDRESS}:
    {L_SEND_EMAIL} {USERNAME}
    +
    {L_EMAIL_ADDRESS}:
    {L_SEND_EMAIL_USER} {USERNAME}
    {L_WEBSITE}:
    {U_WWW}
    {L_PM}:
    {L_SEND_PRIVATE_MESSAGE}
    @@ -84,8 +84,8 @@
    {L_TOTAL_POSTS}:
    {POSTS} | {L_SEARCH_USER_POSTS}
    ({POSTS_PCT} / {POSTS_DAY})
    -
    {L_ACTIVE_IN_FORUM}:
    {ACTIVE_FORUM}
    ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT}) -
    -
    {L_ACTIVE_IN_TOPIC}:
    {ACTIVE_TOPIC}
    ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT}) -
    +
    {L_ACTIVE_IN_FORUM}:
    {ACTIVE_FORUM}
    ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT}) -
    +
    {L_ACTIVE_IN_TOPIC}:
    {ACTIVE_TOPIC}
    ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT}) -
    diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html index 1fb30a21cf..a1b6ddd530 100644 --- a/phpBB/styles/prosilver/template/message_body.html +++ b/phpBB/styles/prosilver/template/message_body.html @@ -4,7 +4,7 @@

    {MESSAGE_TITLE}

    {MESSAGE_TEXT}

    -

    {L_RETURN_TO_SEARCH_ADV}

    +

    {L_RETURN_TO_SEARCH_ADV}

    diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index 05fc5087bd..a1da979548 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -6,16 +6,14 @@ diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index bb5ca7e35b..1f8bd75718 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -89,6 +89,11 @@ {T_THEME_DATA} + + + + + @@ -125,7 +130,8 @@ diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 0cf67c300b..0e903b1b05 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -30,7 +30,7 @@
    -
    +
    {L_FIND_USERNAME}
    @@ -48,7 +48,7 @@ -
    +
    @@ -86,7 +86,7 @@
    -
    +
    @@ -113,7 +113,7 @@ {smiley.SMILEY_CODE} - +
    {L_MORE_SMILIES} @@ -157,7 +157,7 @@

    -
    {attach_row.FILENAME}
    +
    {attach_row.FILENAME}
      @@ -180,8 +180,8 @@
    {S_HIDDEN_ADDRESS_FIELD} {S_HIDDEN_FIELDS} -   -   +   +   onclick="document.getElementById('postform').action += '#preview';" />    @@ -250,7 +250,7 @@
    -
    +
    diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html index ca721748e9..ba0014ce57 100644 --- a/phpBB/styles/prosilver/template/posting_poll_body.html +++ b/phpBB/styles/prosilver/template/posting_poll_body.html @@ -7,6 +7,12 @@
    + +
    +
    +
    +
    +
    @@ -38,10 +44,10 @@
    - +
    -
    +
    diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html index adb955034f..e62f8f73bc 100644 --- a/phpBB/styles/prosilver/template/search_results.html +++ b/phpBB/styles/prosilver/template/search_results.html @@ -4,9 +4,9 @@

    {L_IGNORED_TERMS}: {IGNORED_WORDS}

    -

    {L_RETURN_TO}: {SEARCH_TOPIC}

    +

    {L_RETURN_TO}: {SEARCH_TOPIC}

    -

    {L_RETURN_TO_SEARCH_ADV}

    +

    {L_RETURN_TO_SEARCH_ADV}

    @@ -52,8 +52,8 @@
  • -
    -
    style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG});"> +
    +
    style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> {NEWEST_POST_IMG} {searchresults.TOPIC_TITLE} {searchresults.ATTACH_ICON_IMG} {searchresults.UNAPPROVED_IMG} @@ -116,7 +116,7 @@ @@ -135,8 +135,8 @@
    - {L_PREVIOUS} - {L_NEXT} + {L_PREVIOUS} + {L_NEXT} diff --git a/phpBB/styles/prosilver/template/ucp_attachments.html b/phpBB/styles/prosilver/template/ucp_attachments.html index 9c4701c1ee..165cf86032 100644 --- a/phpBB/styles/prosilver/template/ucp_attachments.html +++ b/phpBB/styles/prosilver/template/ucp_attachments.html @@ -45,8 +45,8 @@
    - {L_NEXT} - {L_PREVIOUS} + {L_NEXT} + {L_PREVIOUS} diff --git a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html index 7d59df1a02..0011e48c92 100644 --- a/phpBB/styles/prosilver/template/ucp_main_bookmarks.html +++ b/phpBB/styles/prosilver/template/ucp_main_bookmarks.html @@ -31,8 +31,8 @@
    -
    -
    +
    +
    {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
    diff --git a/phpBB/styles/prosilver/template/ucp_main_drafts.html b/phpBB/styles/prosilver/template/ucp_main_drafts.html index b60e478ce3..a7a952fa02 100644 --- a/phpBB/styles/prosilver/template/ucp_main_drafts.html +++ b/phpBB/styles/prosilver/template/ucp_main_drafts.html @@ -60,7 +60,7 @@
    - +
    diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index d49166fe62..4e3b252a92 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -13,8 +13,8 @@
    • -
      -
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG});"> +
      +
      style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"> {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE}
      {topicrow.PAGINATION} {topicrow.ATTACH_ICON_IMG} {L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} {L_POSTED_ON_DATE} {topicrow.FIRST_POST_TIME} @@ -34,8 +34,8 @@
      {L_JOINED}:
      {JOINED}
      {L_VISITED}:
      {LAST_VISIT_YOU}
      {L_TOTAL_POSTS}:
      {POSTS} | {L_SEARCH_YOUR_POSTS}
      ({POSTS_DAY} / {POSTS_PCT}){POSTS}
      -
      {L_ACTIVE_IN_FORUM}:
      {ACTIVE_FORUM}
      ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT}) -
      -
      {L_ACTIVE_IN_TOPIC}:
      {ACTIVE_TOPIC}
      ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT}) -
      +
      {L_ACTIVE_IN_FORUM}:
      {ACTIVE_FORUM}
      ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT}) -
      +
      {L_ACTIVE_IN_TOPIC}:
      {ACTIVE_TOPIC}
      ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT}) -
      {L_YOUR_WARNINGS}:
      {WARNING_IMG} [{WARNINGS}]
      diff --git a/phpBB/styles/prosilver/template/ucp_main_subscribed.html b/phpBB/styles/prosilver/template/ucp_main_subscribed.html index d806507e06..a6fae14507 100644 --- a/phpBB/styles/prosilver/template/ucp_main_subscribed.html +++ b/phpBB/styles/prosilver/template/ucp_main_subscribed.html @@ -21,7 +21,7 @@
    • -
      +
      {forumrow.FORUM_NAME}
      {L_LAST_POST} {L_POST_BY_AUTHOR} {forumrow.LAST_POST_AUTHOR} {forumrow.LAST_POST_AUTHOR} {LAST_POST_IMG} {L_POSTED_ON_DATE} {forumrow.LAST_POST_TIME} @@ -49,8 +49,8 @@
    • -
      -
      +
      +
      {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
      diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index 4a026fccac..2cc3107548 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -19,7 +19,7 @@