Suppression fichiers
@@ -1,40 +0,0 @@
|
|||||||
<!-- INCLUDE overall_header.html -->
|
|
||||||
|
|
||||||
<a id="maincontent"></a>
|
|
||||||
|
|
||||||
<h1>{L_EXTENSIONS_ADMIN}</h1>
|
|
||||||
|
|
||||||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
|
||||||
<p>{L_EXTENSION_DELETE_DATA_EXPLAIN}</p>
|
|
||||||
|
|
||||||
<!-- IF MIGRATOR_ERROR -->
|
|
||||||
<div class="errorbox">
|
|
||||||
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
|
|
||||||
<p>{MIGRATOR_ERROR}</p>
|
|
||||||
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
|
|
||||||
</div>
|
|
||||||
<!-- ELSEIF PRE -->
|
|
||||||
<div class="errorbox">
|
|
||||||
<p>{L_CONFIRM_MESSAGE}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form id="acp_extensions" method="post" action="{U_PURGE}">
|
|
||||||
<fieldset class="submit-buttons">
|
|
||||||
<legend>{L_EXTENSION_DELETE_DATA}</legend>
|
|
||||||
<input class="button1" type="submit" name="delete_data" value="{L_EXTENSION_DELETE_DATA}" />
|
|
||||||
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<!-- ELSEIF S_NEXT_STEP -->
|
|
||||||
<div class="errorbox">
|
|
||||||
<p>{L_EXTENSION_DELETE_DATA_IN_PROGRESS}</p>
|
|
||||||
</div>
|
|
||||||
<!-- ELSE -->
|
|
||||||
<div class="successbox">
|
|
||||||
<p>{L_EXTENSION_DELETE_DATA_SUCCESS}</p>
|
|
||||||
<br />
|
|
||||||
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
|
|
||||||
</div>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
<!-- INCLUDE overall_header.html -->
|
|
||||||
|
|
||||||
<a id="maincontent"></a>
|
|
||||||
|
|
||||||
<h1>{L_EXTENSIONS_ADMIN}</h1>
|
|
||||||
|
|
||||||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
|
||||||
<p>{L_EXTENSION_DISABLE_EXPLAIN}</p>
|
|
||||||
|
|
||||||
<!-- IF PRE -->
|
|
||||||
<fieldset>
|
|
||||||
<h2>{L_CONFIRM}</h2>
|
|
||||||
<p>{L_CONFIRM_MESSAGE}</p>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<form id="acp_extensions" method="post" action="{U_DISABLE}">
|
|
||||||
<fieldset class="submit-buttons">
|
|
||||||
<input class="button1" type="submit" name="disable" value="{L_EXTENSION_DISABLE}" />
|
|
||||||
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<!-- ELSEIF S_NEXT_STEP -->
|
|
||||||
<div class="successbox notice">
|
|
||||||
<p>{L_EXTENSION_DISABLE_IN_PROGRESS}</p>
|
|
||||||
</div>
|
|
||||||
<!-- ELSE -->
|
|
||||||
<div class="successbox">
|
|
||||||
<p>{L_EXTENSION_DISABLE_SUCCESS}</p>
|
|
||||||
<br />
|
|
||||||
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
|
|
||||||
</div>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<!-- INCLUDE overall_header.html -->
|
|
||||||
|
|
||||||
<a id="maincontent"></a>
|
|
||||||
|
|
||||||
<h1>{L_EXTENSIONS_ADMIN}</h1>
|
|
||||||
|
|
||||||
<p>{L_EXTENSIONS_EXPLAIN}</p>
|
|
||||||
<p>{L_EXTENSION_ENABLE_EXPLAIN}</p>
|
|
||||||
|
|
||||||
<!-- IF MIGRATOR_ERROR -->
|
|
||||||
<div class="errorbox">
|
|
||||||
<p><strong>{L_MIGRATION_EXCEPTION_ERROR}</strong></p>
|
|
||||||
<p>{MIGRATOR_ERROR}</p>
|
|
||||||
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
|
|
||||||
</div>
|
|
||||||
<!-- ELSEIF PRE -->
|
|
||||||
<fieldset>
|
|
||||||
<h2>{L_CONFIRM}</h2>
|
|
||||||
<p>{L_CONFIRM_MESSAGE}</p>
|
|
||||||
</fieldset>
|
|
||||||
|
|
||||||
<form id="acp_extensions" method="post" action="{U_ENABLE}">
|
|
||||||
<fieldset class="submit-buttons">
|
|
||||||
<input class="button1" type="submit" name="enable" value="{L_EXTENSION_ENABLE}" />
|
|
||||||
<input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
|
|
||||||
</fieldset>
|
|
||||||
</form>
|
|
||||||
<!-- ELSEIF S_NEXT_STEP -->
|
|
||||||
<div class="successbox notice">
|
|
||||||
<p>{L_EXTENSION_ENABLE_IN_PROGRESS}</p>
|
|
||||||
</div>
|
|
||||||
<!-- ELSE -->
|
|
||||||
<div class="successbox">
|
|
||||||
<p>{L_EXTENSION_ENABLE_SUCCESS}</p>
|
|
||||||
<br />
|
|
||||||
<p><a href="{U_RETURN}">{L_RETURN_TO_EXTENSION_LIST}</a></p>
|
|
||||||
</div>
|
|
||||||
<!-- ENDIF -->
|
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
|
||||||
5
assets/javascript/jquery.min.js
vendored
|
Before Width: | Height: | Size: 254 B |
@@ -1,174 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ignore
|
|
||||||
*/
|
|
||||||
if (!defined('IN_PHPBB'))
|
|
||||||
{
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ucp_remind
|
|
||||||
* Sending password reminders
|
|
||||||
*/
|
|
||||||
class ucp_remind
|
|
||||||
{
|
|
||||||
var $u_action;
|
|
||||||
|
|
||||||
function main($id, $mode)
|
|
||||||
{
|
|
||||||
global $config, $phpbb_root_path, $phpEx, $request;
|
|
||||||
global $db, $user, $template, $phpbb_container, $phpbb_dispatcher;
|
|
||||||
|
|
||||||
if (!$config['allow_password_reset'])
|
|
||||||
{
|
|
||||||
trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$username = $request->variable('username', '', true);
|
|
||||||
$email = strtolower($request->variable('email', ''));
|
|
||||||
$submit = (isset($_POST['submit'])) ? true : false;
|
|
||||||
|
|
||||||
add_form_key('ucp_remind');
|
|
||||||
|
|
||||||
if ($submit)
|
|
||||||
{
|
|
||||||
if (!check_form_key('ucp_remind'))
|
|
||||||
{
|
|
||||||
trigger_error('FORM_INVALID');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($email))
|
|
||||||
{
|
|
||||||
trigger_error('NO_EMAIL_USER');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql_array = array(
|
|
||||||
'SELECT' => 'user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason',
|
|
||||||
'FROM' => array(USERS_TABLE => 'u'),
|
|
||||||
'WHERE' => "user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'" .
|
|
||||||
(!empty($username) ? " AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : ''),
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Change SQL query for fetching user data
|
|
||||||
*
|
|
||||||
* @event core.ucp_remind_modify_select_sql
|
|
||||||
* @var string email User's email from the form
|
|
||||||
* @var string username User's username from the form
|
|
||||||
* @var array sql_array Fully assembled SQL query with keys SELECT, FROM, WHERE
|
|
||||||
* @since 3.1.11-RC1
|
|
||||||
*/
|
|
||||||
$vars = array(
|
|
||||||
'email',
|
|
||||||
'username',
|
|
||||||
'sql_array',
|
|
||||||
);
|
|
||||||
extract($phpbb_dispatcher->trigger_event('core.ucp_remind_modify_select_sql', compact($vars)));
|
|
||||||
|
|
||||||
$sql = $db->sql_build_query('SELECT', $sql_array);
|
|
||||||
$result = $db->sql_query_limit($sql, 2); // don't waste resources on more rows than we need
|
|
||||||
$rowset = $db->sql_fetchrowset($result);
|
|
||||||
|
|
||||||
if (count($rowset) > 1)
|
|
||||||
{
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
|
||||||
'USERNAME_REQUIRED' => true,
|
|
||||||
'EMAIL' => $email,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$message = $user->lang['PASSWORD_UPDATED_IF_EXISTED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
|
|
||||||
|
|
||||||
if (empty($rowset))
|
|
||||||
{
|
|
||||||
trigger_error($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$user_row = $rowset[0];
|
|
||||||
$db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if (!$user_row)
|
|
||||||
{
|
|
||||||
trigger_error($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($user_row['user_type'] == USER_IGNORE || $user_row['user_type'] == USER_INACTIVE)
|
|
||||||
{
|
|
||||||
trigger_error($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check users permissions
|
|
||||||
$auth2 = new \phpbb\auth\auth();
|
|
||||||
$auth2->acl($user_row);
|
|
||||||
|
|
||||||
if (!$auth2->acl_get('u_chgpasswd'))
|
|
||||||
{
|
|
||||||
trigger_error($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$server_url = generate_board_url();
|
|
||||||
|
|
||||||
// Make password at least 8 characters long, make it longer if admin wants to.
|
|
||||||
// gen_rand_string() however has a limit of 12 or 13.
|
|
||||||
$user_password = gen_rand_string_friendly(max(8, mt_rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
|
|
||||||
|
|
||||||
// For the activation key a random length between 6 and 10 will do.
|
|
||||||
$user_actkey = gen_rand_string(mt_rand(6, 10));
|
|
||||||
|
|
||||||
// Instantiate passwords manager
|
|
||||||
/* @var $manager \phpbb\passwords\manager */
|
|
||||||
$passwords_manager = $phpbb_container->get('passwords.manager');
|
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
|
||||||
SET user_newpasswd = '" . $db->sql_escape($passwords_manager->hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'
|
|
||||||
WHERE user_id = " . $user_row['user_id'];
|
|
||||||
$db->sql_query($sql);
|
|
||||||
|
|
||||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
|
||||||
|
|
||||||
$messenger = new messenger(false);
|
|
||||||
|
|
||||||
$messenger->template('user_activate_passwd', $user_row['user_lang']);
|
|
||||||
|
|
||||||
$messenger->set_addresses($user_row);
|
|
||||||
|
|
||||||
$messenger->anti_abuse_headers($config, $user);
|
|
||||||
|
|
||||||
$messenger->assign_vars(array(
|
|
||||||
'USERNAME' => htmlspecialchars_decode($user_row['username']),
|
|
||||||
'PASSWORD' => htmlspecialchars_decode($user_password),
|
|
||||||
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k=$user_actkey")
|
|
||||||
);
|
|
||||||
|
|
||||||
$messenger->send($user_row['user_notify_type']);
|
|
||||||
|
|
||||||
trigger_error($message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$template->assign_vars(array(
|
|
||||||
'USERNAME' => $username,
|
|
||||||
'EMAIL' => $email,
|
|
||||||
'S_PROFILE_ACTION' => append_sid($phpbb_root_path . 'ucp.' . $phpEx, 'mode=sendpassword'))
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->tpl_name = 'ucp_remind';
|
|
||||||
$this->page_title = 'UCP_REMIND';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
Subject: New password activation
|
|
||||||
|
|
||||||
Hello {USERNAME}
|
|
||||||
|
|
||||||
You are receiving this notification because you have (or someone pretending to be you has) requested a new password be sent for your account on "{SITENAME}". If you did not request this notification then please ignore it, if you keep receiving it please contact the board administrator.
|
|
||||||
|
|
||||||
To use the new password you need to activate it. To do this click the link provided below.
|
|
||||||
|
|
||||||
{U_ACTIVATE}
|
|
||||||
|
|
||||||
If successful you will be able to login using the following password:
|
|
||||||
|
|
||||||
Password: {PASSWORD}
|
|
||||||
|
|
||||||
You can of course change this password yourself via the profile page. If you have any difficulties please contact the board administrator.
|
|
||||||
|
|
||||||
{EMAIL_SIG}
|
|
||||||
70
phpbb/cache/driver/apc.php
vendored
@@ -1,70 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\cache\driver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ACM for APC
|
|
||||||
*/
|
|
||||||
class apc extends \phpbb\cache\driver\memory
|
|
||||||
{
|
|
||||||
var $extension = 'apc';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function purge()
|
|
||||||
{
|
|
||||||
apc_clear_cache('user');
|
|
||||||
|
|
||||||
parent::purge();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return mixed Cached data
|
|
||||||
*/
|
|
||||||
function _read($var)
|
|
||||||
{
|
|
||||||
return apc_fetch($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store data in the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @param mixed $data Data to store
|
|
||||||
* @param int $ttl Time-to-live of cached data
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _write($var, $data, $ttl = 2592000)
|
|
||||||
{
|
|
||||||
return apc_store($this->key_prefix . $var, $data, $ttl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _delete($var)
|
|
||||||
{
|
|
||||||
return apc_delete($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
107
phpbb/cache/driver/eaccelerator.php
vendored
@@ -1,107 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\cache\driver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ACM for eAccelerator
|
|
||||||
* @todo Missing locks from destroy() talk with David
|
|
||||||
*/
|
|
||||||
class eaccelerator extends \phpbb\cache\driver\memory
|
|
||||||
{
|
|
||||||
var $extension = 'eaccelerator';
|
|
||||||
var $function = 'eaccelerator_get';
|
|
||||||
|
|
||||||
var $serialize_header = '#phpbb-serialized#';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function purge()
|
|
||||||
{
|
|
||||||
foreach (eaccelerator_list_keys() as $var)
|
|
||||||
{
|
|
||||||
// @todo Check why the substr()
|
|
||||||
// @todo Only unset vars matching $this->key_prefix
|
|
||||||
eaccelerator_rm(substr($var['name'], 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::purge();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function tidy()
|
|
||||||
{
|
|
||||||
global $config;
|
|
||||||
|
|
||||||
eaccelerator_gc();
|
|
||||||
|
|
||||||
$config->set('cache_last_gc', time(), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return mixed Cached data
|
|
||||||
*/
|
|
||||||
function _read($var)
|
|
||||||
{
|
|
||||||
$result = eaccelerator_get($this->key_prefix . $var);
|
|
||||||
|
|
||||||
if ($result === null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle serialized objects
|
|
||||||
if (is_string($result) && strpos($result, $this->serialize_header . 'O:') === 0)
|
|
||||||
{
|
|
||||||
$result = unserialize(substr($result, strlen($this->serialize_header)));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store data in the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @param mixed $data Data to store
|
|
||||||
* @param int $ttl Time-to-live of cached data
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _write($var, $data, $ttl = 2592000)
|
|
||||||
{
|
|
||||||
// Serialize objects and make them easy to detect
|
|
||||||
$data = (is_object($data)) ? $this->serialize_header . serialize($data) : $data;
|
|
||||||
|
|
||||||
return eaccelerator_put($this->key_prefix . $var, $data, $ttl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _delete($var)
|
|
||||||
{
|
|
||||||
return eaccelerator_rm($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
122
phpbb/cache/driver/memcache.php
vendored
@@ -1,122 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\cache\driver;
|
|
||||||
|
|
||||||
if (!defined('PHPBB_ACM_MEMCACHE_PORT'))
|
|
||||||
{
|
|
||||||
define('PHPBB_ACM_MEMCACHE_PORT', 11211);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined('PHPBB_ACM_MEMCACHE_COMPRESS'))
|
|
||||||
{
|
|
||||||
define('PHPBB_ACM_MEMCACHE_COMPRESS', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
|
|
||||||
{
|
|
||||||
define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!defined('PHPBB_ACM_MEMCACHE'))
|
|
||||||
{
|
|
||||||
//can define multiple servers with host1/port1,host2/port2 format
|
|
||||||
define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ACM for Memcached
|
|
||||||
*/
|
|
||||||
class memcache extends \phpbb\cache\driver\memory
|
|
||||||
{
|
|
||||||
var $extension = 'memcache';
|
|
||||||
|
|
||||||
var $memcache;
|
|
||||||
var $flags = 0;
|
|
||||||
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
// Call the parent constructor
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
$this->memcache = new \Memcache;
|
|
||||||
foreach (explode(',', PHPBB_ACM_MEMCACHE) as $u)
|
|
||||||
{
|
|
||||||
preg_match('#(.*)/(\d+)#', $u, $parts);
|
|
||||||
$this->memcache->addServer(trim($parts[1]), (int) trim($parts[2]));
|
|
||||||
}
|
|
||||||
$this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function unload()
|
|
||||||
{
|
|
||||||
parent::unload();
|
|
||||||
|
|
||||||
$this->memcache->close();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function purge()
|
|
||||||
{
|
|
||||||
$this->memcache->flush();
|
|
||||||
|
|
||||||
parent::purge();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return mixed Cached data
|
|
||||||
*/
|
|
||||||
function _read($var)
|
|
||||||
{
|
|
||||||
return $this->memcache->get($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store data in the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @param mixed $data Data to store
|
|
||||||
* @param int $ttl Time-to-live of cached data
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _write($var, $data, $ttl = 2592000)
|
|
||||||
{
|
|
||||||
if (!$this->memcache->replace($this->key_prefix . $var, $data, $this->flags, $ttl))
|
|
||||||
{
|
|
||||||
return $this->memcache->set($this->key_prefix . $var, $data, $this->flags, $ttl);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _delete($var)
|
|
||||||
{
|
|
||||||
return $this->memcache->delete($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
107
phpbb/cache/driver/xcache.php
vendored
@@ -1,107 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\cache\driver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ACM for XCache
|
|
||||||
*
|
|
||||||
* To use this module you need ini_get() enabled and the following INI settings configured as follows:
|
|
||||||
* - xcache.var_size > 0
|
|
||||||
* - xcache.admin.enable_auth = off (or xcache.admin.user and xcache.admin.password set)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
class xcache extends \phpbb\cache\driver\memory
|
|
||||||
{
|
|
||||||
var $extension = 'XCache';
|
|
||||||
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
if (!function_exists('ini_get') || (int) ini_get('xcache.var_size') <= 0)
|
|
||||||
{
|
|
||||||
trigger_error('Increase xcache.var_size setting above 0 or enable ini_get() to use this ACM module.', E_USER_ERROR);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function purge()
|
|
||||||
{
|
|
||||||
// Run before for XCache, if admin functions are disabled it will terminate execution
|
|
||||||
parent::purge();
|
|
||||||
|
|
||||||
// If the admin authentication is enabled but not set up, this will cause a nasty error.
|
|
||||||
// Not much we can do about it though.
|
|
||||||
$n = xcache_count(XC_TYPE_VAR);
|
|
||||||
|
|
||||||
for ($i = 0; $i < $n; $i++)
|
|
||||||
{
|
|
||||||
xcache_clear_cache(XC_TYPE_VAR, $i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return mixed Cached data
|
|
||||||
*/
|
|
||||||
function _read($var)
|
|
||||||
{
|
|
||||||
$result = xcache_get($this->key_prefix . $var);
|
|
||||||
|
|
||||||
return ($result !== null) ? $result : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Store data in the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @param mixed $data Data to store
|
|
||||||
* @param int $ttl Time-to-live of cached data
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _write($var, $data, $ttl = 2592000)
|
|
||||||
{
|
|
||||||
return xcache_set($this->key_prefix . $var, $data, $ttl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Remove an item from the cache
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return bool True if the operation succeeded
|
|
||||||
*/
|
|
||||||
function _delete($var)
|
|
||||||
{
|
|
||||||
return xcache_unset($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check if a cache var exists
|
|
||||||
*
|
|
||||||
* @access protected
|
|
||||||
* @param string $var Cache key
|
|
||||||
* @return bool True if it exists, otherwise false
|
|
||||||
*/
|
|
||||||
function _isset($var)
|
|
||||||
{
|
|
||||||
return xcache_isset($this->key_prefix . $var);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
namespace phpbb\console\command\fixup;
|
|
||||||
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
|
||||||
|
|
||||||
class recalculate_email_hash extends \phpbb\console\command\command
|
|
||||||
{
|
|
||||||
/** @var \phpbb\db\driver\driver_interface */
|
|
||||||
protected $db;
|
|
||||||
|
|
||||||
public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db)
|
|
||||||
{
|
|
||||||
$this->db = $db;
|
|
||||||
|
|
||||||
parent::__construct($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function configure()
|
|
||||||
{
|
|
||||||
$this
|
|
||||||
->setName('fixup:recalculate-email-hash')
|
|
||||||
->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH'))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
|
||||||
{
|
|
||||||
$io = new SymfonyStyle($input, $output);
|
|
||||||
|
|
||||||
$sql = 'SELECT user_id, user_email, user_email_hash
|
|
||||||
FROM ' . USERS_TABLE . '
|
|
||||||
WHERE user_type <> ' . USER_IGNORE . "
|
|
||||||
AND user_email <> ''";
|
|
||||||
$result = $this->db->sql_query($sql);
|
|
||||||
|
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
|
||||||
{
|
|
||||||
$user_email_hash = phpbb_email_hash($row['user_email']);
|
|
||||||
if ($user_email_hash !== $row['user_email_hash'])
|
|
||||||
{
|
|
||||||
$sql_ary = array(
|
|
||||||
'user_email_hash' => $user_email_hash,
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
|
||||||
SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . '
|
|
||||||
WHERE user_id = ' . (int) $row['user_id'];
|
|
||||||
$this->db->sql_query($sql);
|
|
||||||
|
|
||||||
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG)
|
|
||||||
{
|
|
||||||
$io->table(
|
|
||||||
array('user_id', 'user_email', 'user_email_hash'),
|
|
||||||
array(array($row['user_id'], $row['user_email'], $user_email_hash))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$io->success($this->user->lang('CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,503 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\db\driver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MySQL4 Database Abstraction Layer
|
|
||||||
* Compatible with:
|
|
||||||
* MySQL 3.23+
|
|
||||||
* MySQL 4.0+
|
|
||||||
* MySQL 4.1+
|
|
||||||
* MySQL 5.0+
|
|
||||||
*/
|
|
||||||
class mysql extends \phpbb\db\driver\mysql_base
|
|
||||||
{
|
|
||||||
var $multi_insert = true;
|
|
||||||
var $connect_error = '';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
|
|
||||||
{
|
|
||||||
$this->persistency = $persistency;
|
|
||||||
$this->user = $sqluser;
|
|
||||||
$this->server = $sqlserver . (($port) ? ':' . $port : '');
|
|
||||||
$this->dbname = $database;
|
|
||||||
|
|
||||||
$this->sql_layer = 'mysql4';
|
|
||||||
|
|
||||||
if ($this->persistency)
|
|
||||||
{
|
|
||||||
if (!function_exists('mysql_pconnect'))
|
|
||||||
{
|
|
||||||
$this->connect_error = 'mysql_pconnect function does not exist, is mysql extension installed?';
|
|
||||||
return $this->sql_error('');
|
|
||||||
}
|
|
||||||
$this->db_connect_id = @mysql_pconnect($this->server, $this->user, $sqlpassword);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!function_exists('mysql_connect'))
|
|
||||||
{
|
|
||||||
$this->connect_error = 'mysql_connect function does not exist, is mysql extension installed?';
|
|
||||||
return $this->sql_error('');
|
|
||||||
}
|
|
||||||
$this->db_connect_id = @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->db_connect_id && $this->dbname != '')
|
|
||||||
{
|
|
||||||
if (@mysql_select_db($this->dbname, $this->db_connect_id))
|
|
||||||
{
|
|
||||||
// Determine what version we are using and if it natively supports UNICODE
|
|
||||||
if (version_compare($this->sql_server_info(true), '4.1.0', '>='))
|
|
||||||
{
|
|
||||||
@mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
|
|
||||||
|
|
||||||
// enforce strict mode on databases that support it
|
|
||||||
if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
|
|
||||||
{
|
|
||||||
$result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$row = mysql_fetch_assoc($result);
|
|
||||||
mysql_free_result($result);
|
|
||||||
$modes = array_map('trim', explode(',', $row['sql_mode']));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$modes = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
|
|
||||||
if (!in_array('TRADITIONAL', $modes))
|
|
||||||
{
|
|
||||||
if (!in_array('STRICT_ALL_TABLES', $modes))
|
|
||||||
{
|
|
||||||
$modes[] = 'STRICT_ALL_TABLES';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!in_array('STRICT_TRANS_TABLES', $modes))
|
|
||||||
{
|
|
||||||
$modes[] = 'STRICT_TRANS_TABLES';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$mode = implode(',', $modes);
|
|
||||||
@mysql_query("SET SESSION sql_mode='{$mode}'", $this->db_connect_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (version_compare($this->sql_server_info(true), '4.0.0', '<'))
|
|
||||||
{
|
|
||||||
$this->sql_layer = 'mysql';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->db_connect_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->sql_error('');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_server_info($raw = false, $use_cache = true)
|
|
||||||
{
|
|
||||||
global $cache;
|
|
||||||
|
|
||||||
if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
|
|
||||||
{
|
|
||||||
$result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
$row = mysql_fetch_assoc($result);
|
|
||||||
mysql_free_result($result);
|
|
||||||
|
|
||||||
$this->sql_server_version = $row['version'];
|
|
||||||
|
|
||||||
if (!empty($cache) && $use_cache)
|
|
||||||
{
|
|
||||||
$cache->put('mysql_version', $this->sql_server_version);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ($raw) ? $this->sql_server_version : 'MySQL ' . $this->sql_server_version;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SQL Transaction
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function _sql_transaction($status = 'begin')
|
|
||||||
{
|
|
||||||
switch ($status)
|
|
||||||
{
|
|
||||||
case 'begin':
|
|
||||||
return @mysql_query('BEGIN', $this->db_connect_id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'commit':
|
|
||||||
return @mysql_query('COMMIT', $this->db_connect_id);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'rollback':
|
|
||||||
return @mysql_query('ROLLBACK', $this->db_connect_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_query($query = '', $cache_ttl = 0)
|
|
||||||
{
|
|
||||||
if ($query != '')
|
|
||||||
{
|
|
||||||
global $cache;
|
|
||||||
|
|
||||||
// EXPLAIN only in extra debug mode
|
|
||||||
if (defined('DEBUG'))
|
|
||||||
{
|
|
||||||
$this->sql_report('start', $query);
|
|
||||||
}
|
|
||||||
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
|
|
||||||
{
|
|
||||||
$this->curtime = microtime(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->query_result = ($cache && $cache_ttl) ? $cache->sql_load($query) : false;
|
|
||||||
$this->sql_add_num_queries($this->query_result);
|
|
||||||
|
|
||||||
if ($this->query_result === false)
|
|
||||||
{
|
|
||||||
if (($this->query_result = @mysql_query($query, $this->db_connect_id)) === false)
|
|
||||||
{
|
|
||||||
$this->sql_error($query);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (defined('DEBUG'))
|
|
||||||
{
|
|
||||||
$this->sql_report('stop', $query);
|
|
||||||
}
|
|
||||||
else if (defined('PHPBB_DISPLAY_LOAD_TIME'))
|
|
||||||
{
|
|
||||||
$this->sql_time += microtime(true) - $this->curtime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->query_result)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cache && $cache_ttl)
|
|
||||||
{
|
|
||||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
|
||||||
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
|
|
||||||
}
|
|
||||||
else if (strpos($query, 'SELECT') === 0)
|
|
||||||
{
|
|
||||||
$this->open_queries[(int) $this->query_result] = $this->query_result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (defined('DEBUG'))
|
|
||||||
{
|
|
||||||
$this->sql_report('fromcache', $query);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->query_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_affectedrows()
|
|
||||||
{
|
|
||||||
if ($this->db_connect_id)
|
|
||||||
{
|
|
||||||
// We always want the number of matched rows
|
|
||||||
// instead of changed rows, when running an update.
|
|
||||||
// So when mysql_info() returns the number of matched rows
|
|
||||||
// we return that one instead of mysql_affected_rows()
|
|
||||||
$mysql_info = @mysql_info($this->db_connect_id);
|
|
||||||
if ($mysql_info !== false)
|
|
||||||
{
|
|
||||||
$match = array();
|
|
||||||
preg_match('#^Rows matched: (\d)+ Changed: (\d)+ Warnings: (\d)+$#', $mysql_info, $match);
|
|
||||||
if (isset($match[1]))
|
|
||||||
{
|
|
||||||
return $match[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return @mysql_affected_rows($this->db_connect_id);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_fetchrow($query_id = false)
|
|
||||||
{
|
|
||||||
global $cache;
|
|
||||||
|
|
||||||
if ($query_id === false)
|
|
||||||
{
|
|
||||||
$query_id = $this->query_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cache && $cache->sql_exists($query_id))
|
|
||||||
{
|
|
||||||
return $cache->sql_fetchrow($query_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ($query_id) ? mysql_fetch_assoc($query_id) : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_rowseek($rownum, &$query_id)
|
|
||||||
{
|
|
||||||
global $cache;
|
|
||||||
|
|
||||||
if ($query_id === false)
|
|
||||||
{
|
|
||||||
$query_id = $this->query_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cache && $cache->sql_exists($query_id))
|
|
||||||
{
|
|
||||||
return $cache->sql_rowseek($rownum, $query_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ($query_id !== false) ? @mysql_data_seek($query_id, $rownum) : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_nextid()
|
|
||||||
{
|
|
||||||
return ($this->db_connect_id) ? @mysql_insert_id($this->db_connect_id) : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_freeresult($query_id = false)
|
|
||||||
{
|
|
||||||
global $cache;
|
|
||||||
|
|
||||||
if ($query_id === false)
|
|
||||||
{
|
|
||||||
$query_id = $this->query_result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
|
|
||||||
{
|
|
||||||
return $cache->sql_freeresult($query_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this->open_queries[(int) $query_id]))
|
|
||||||
{
|
|
||||||
unset($this->open_queries[(int) $query_id]);
|
|
||||||
return mysql_free_result($query_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritDoc}
|
|
||||||
*/
|
|
||||||
function sql_escape($msg)
|
|
||||||
{
|
|
||||||
if (!$this->db_connect_id)
|
|
||||||
{
|
|
||||||
return @mysql_real_escape_string($msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
return @mysql_real_escape_string($msg, $this->db_connect_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* return sql error array
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function _sql_error()
|
|
||||||
{
|
|
||||||
if ($this->db_connect_id)
|
|
||||||
{
|
|
||||||
$error = array(
|
|
||||||
'message' => @mysql_error($this->db_connect_id),
|
|
||||||
'code' => @mysql_errno($this->db_connect_id),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else if (function_exists('mysql_error'))
|
|
||||||
{
|
|
||||||
$error = array(
|
|
||||||
'message' => @mysql_error(),
|
|
||||||
'code' => @mysql_errno(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$error = array(
|
|
||||||
'message' => $this->connect_error,
|
|
||||||
'code' => '',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $error;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Close sql connection
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function _sql_close()
|
|
||||||
{
|
|
||||||
return @mysql_close($this->db_connect_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Build db-specific report
|
|
||||||
* @access private
|
|
||||||
*/
|
|
||||||
function _sql_report($mode, $query = '')
|
|
||||||
{
|
|
||||||
static $test_prof;
|
|
||||||
|
|
||||||
// current detection method, might just switch to see the existance of INFORMATION_SCHEMA.PROFILING
|
|
||||||
if ($test_prof === null)
|
|
||||||
{
|
|
||||||
$test_prof = false;
|
|
||||||
if (version_compare($this->sql_server_info(true), '5.0.37', '>=') && version_compare($this->sql_server_info(true), '5.1', '<'))
|
|
||||||
{
|
|
||||||
$test_prof = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
// begin profiling
|
|
||||||
if ($test_prof)
|
|
||||||
{
|
|
||||||
@mysql_query('SET profiling = 1;', $this->db_connect_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id))
|
|
||||||
{
|
|
||||||
while ($row = mysql_fetch_assoc($result))
|
|
||||||
{
|
|
||||||
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
|
|
||||||
}
|
|
||||||
mysql_free_result($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($html_table)
|
|
||||||
{
|
|
||||||
$this->html_hold .= '</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($test_prof)
|
|
||||||
{
|
|
||||||
$html_table = false;
|
|
||||||
|
|
||||||
// get the last profile
|
|
||||||
if ($result = @mysql_query('SHOW PROFILE ALL;', $this->db_connect_id))
|
|
||||||
{
|
|
||||||
$this->html_hold .= '<br />';
|
|
||||||
while ($row = mysql_fetch_assoc($result))
|
|
||||||
{
|
|
||||||
// make <unknown> HTML safe
|
|
||||||
if (!empty($row['Source_function']))
|
|
||||||
{
|
|
||||||
$row['Source_function'] = str_replace(array('<', '>'), array('<', '>'), $row['Source_function']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove unsupported features
|
|
||||||
foreach ($row as $key => $val)
|
|
||||||
{
|
|
||||||
if ($val === null)
|
|
||||||
{
|
|
||||||
unset($row[$key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
|
|
||||||
}
|
|
||||||
mysql_free_result($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($html_table)
|
|
||||||
{
|
|
||||||
$this->html_hold .= '</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
@mysql_query('SET profiling = 0;', $this->db_connect_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'fromcache':
|
|
||||||
$endtime = explode(' ', microtime());
|
|
||||||
$endtime = $endtime[0] + $endtime[1];
|
|
||||||
|
|
||||||
$result = @mysql_query($query, $this->db_connect_id);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
while ($void = mysql_fetch_assoc($result))
|
|
||||||
{
|
|
||||||
// Take the time spent on parsing rows into account
|
|
||||||
}
|
|
||||||
mysql_free_result($result);
|
|
||||||
}
|
|
||||||
|
|
||||||
$splittime = explode(' ', microtime());
|
|
||||||
$splittime = $splittime[0] + $splittime[1];
|
|
||||||
|
|
||||||
$this->sql_report('record_fromcache', $query, $endtime, $splittime);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* This file is part of the phpBB Forum Software package.
|
|
||||||
*
|
|
||||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
||||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
||||||
*
|
|
||||||
* For full copyright and license information, please see
|
|
||||||
* the docs/CREDITS.txt file.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace phpbb\db;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated 3.2.0-dev (To be removed 3.3.0) use \phpbb\db\tools\tools instead
|
|
||||||
*/
|
|
||||||
class tools extends \phpbb\db\tools\tools
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
<!-- INCLUDE overall_header.html -->
|
|
||||||
|
|
||||||
<form action="{S_PROFILE_ACTION}" method="post" id="remind">
|
|
||||||
|
|
||||||
<div class="panel">
|
|
||||||
<div class="inner">
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<h2>{L_SEND_PASSWORD}</h2>
|
|
||||||
|
|
||||||
<fieldset>
|
|
||||||
{% if USERNAME_REQUIRED %}
|
|
||||||
<p class="error">{{ lang('EMAIL_NOT_UNIQUE') }}</p>
|
|
||||||
{% endif %}
|
|
||||||
<dl>
|
|
||||||
<dt><label for="email">{L_EMAIL_ADDRESS}{L_COLON}</label><br /><span>{L_EMAIL_REMIND}</span></dt>
|
|
||||||
<dd><input class="inputbox narrow" type="email" name="email" id="email" size="25" maxlength="100" value="{{ EMAIL }}" autofocus /></dd>
|
|
||||||
</dl>
|
|
||||||
{% if USERNAME_REQUIRED %}
|
|
||||||
<dl>
|
|
||||||
<dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
|
|
||||||
<dd><input class="inputbox narrow" type="text" name="username" id="username" size="25" /></dd>
|
|
||||||
</dl>
|
|
||||||
{% endif %}
|
|
||||||
<dl>
|
|
||||||
<dt> </dt>
|
|
||||||
<dd>{S_HIDDEN_FIELDS}<input type="submit" name="submit" id="submit" class="button1" value="{L_SUBMIT}" tabindex="2" /> <input type="reset" value="{L_RESET}" name="reset" class="button2" /></dd>
|
|
||||||
</dl>
|
|
||||||
{S_FORM_TOKEN}
|
|
||||||
</fieldset>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
|
||||||
|
Before Width: | Height: | Size: 198 B |
|
Before Width: | Height: | Size: 322 B |
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 465 B |
|
Before Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 153 B |
|
Before Width: | Height: | Size: 154 B |
|
Before Width: | Height: | Size: 5.0 KiB |