mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 16:22:22 +02:00
[feature/avatars] Pass phpbb_user to prepare and process form functions
The phpbb_user object might be used for language variables and other things. PHPBB3-10018
This commit is contained in:
parent
f09e6865f7
commit
2302cd7a42
@ -338,7 +338,7 @@ class acp_groups
|
||||
if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
|
||||
{
|
||||
$driver = $phpbb_avatar_manager->get_driver($driver_name);
|
||||
$result = $driver->process_form($request, $template, $avatar_data, $avatar_error);
|
||||
$result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error);
|
||||
|
||||
if ($result && empty($avatar_error))
|
||||
{
|
||||
@ -532,7 +532,7 @@ class acp_groups
|
||||
'avatar' => "acp_avatar_options_{$config_name}.html",
|
||||
));
|
||||
|
||||
if ($driver->prepare_form($request, $template, $avatar_data, $avatar_error))
|
||||
if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error))
|
||||
{
|
||||
$driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
|
||||
$driver_upper = strtoupper($driver_name);
|
||||
|
@ -1751,7 +1751,7 @@ class acp_users
|
||||
if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
|
||||
{
|
||||
$driver = $phpbb_avatar_manager->get_driver($driver_name);
|
||||
$result = $driver->process_form($request, $template, $avatar_data, $error);
|
||||
$result = $driver->process_form($request, $template, $user, $avatar_data, $error);
|
||||
|
||||
if ($result && empty($error))
|
||||
{
|
||||
@ -1813,7 +1813,7 @@ class acp_users
|
||||
'avatar' => "acp_avatar_options_{$config_name}.html",
|
||||
));
|
||||
|
||||
if ($driver->prepare_form($request, $template, $avatar_data, $error))
|
||||
if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))
|
||||
{
|
||||
$driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
|
||||
$driver_upper = strtoupper($driver_name);
|
||||
|
@ -52,7 +52,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'AVATAR_GRAVATAR_WIDTH' => (($row['avatar_type'] == $this->get_name() || $row['avatar_type'] == 'gravatar') && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_gravatar_width', 0),
|
||||
@ -66,7 +66,7 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$row['avatar'] = $request->variable('avatar_gravatar_email', '');
|
||||
$row['avatar_width'] = $request->variable('avatar_gravatar_width', 0);
|
||||
|
@ -55,6 +55,7 @@ interface phpbb_avatar_driver_interface
|
||||
*
|
||||
* @param phpbb_request $request Request object
|
||||
* @param phpbb_template $template Template object
|
||||
* @param phpbb_user $user User object
|
||||
* @param array $row User data or group data that has been cleaned with
|
||||
* phpbb_avatar_manager::clean_row
|
||||
* @param array &$error Reference to an error array that is filled by this
|
||||
@ -64,7 +65,7 @@ interface phpbb_avatar_driver_interface
|
||||
*
|
||||
* @return bool True if form has been successfully prepared
|
||||
*/
|
||||
public function prepare_form($request, $template, $row, &$error);
|
||||
public function prepare_form($request, $template, $user, $row, &$error);
|
||||
|
||||
/**
|
||||
* Prepare form for changing the acp settings of this avatar
|
||||
@ -82,6 +83,7 @@ interface phpbb_avatar_driver_interface
|
||||
*
|
||||
* @param phpbb_request $request Request object
|
||||
* @param phpbb_template $template Template object
|
||||
* @param phpbb_user $user User object
|
||||
* @param array $row User data or group data that has been cleaned with
|
||||
* phpbb_avatar_manager::clean_row
|
||||
* @param array &$error Reference to an error array that is filled by this
|
||||
@ -92,7 +94,7 @@ interface phpbb_avatar_driver_interface
|
||||
* @return array Array containing the avatar data as follows:
|
||||
* ['avatar'], ['avatar_width'], ['avatar_height']
|
||||
*/
|
||||
public function process_form($request, $template, $row, &$error);
|
||||
public function process_form($request, $template, $user, $row, &$error);
|
||||
|
||||
/**
|
||||
* Delete avatar
|
||||
|
@ -36,7 +36,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$avatar_list = $this->get_avatar_list();
|
||||
$category = $request->variable('avatar_local_cat', '');
|
||||
@ -114,7 +114,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$avatar_list = $this->get_avatar_list();
|
||||
$category = $request->variable('avatar_local_cat', '');
|
||||
|
@ -36,7 +36,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'AVATAR_REMOTE_WIDTH' => ((in_array($row['avatar_type'], array(AVATAR_REMOTE, $this->get_name(), 'remote'))) && $row['avatar_width']) ? $row['avatar_width'] : $request->variable('avatar_remote_width', 0),
|
||||
@ -50,7 +50,7 @@ class phpbb_avatar_driver_remote extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
$url = $request->variable('avatar_remote_url', '');
|
||||
$width = $request->variable('avatar_remote_width', 0);
|
||||
|
@ -36,7 +36,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
if (!$this->can_upload())
|
||||
{
|
||||
@ -54,7 +54,7 @@ class phpbb_avatar_driver_upload extends phpbb_avatar_driver
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
if (!$this->can_upload())
|
||||
{
|
||||
|
@ -526,7 +526,7 @@ class ucp_groups
|
||||
if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
|
||||
{
|
||||
$driver = $phpbb_avatar_manager->get_driver($driver_name);
|
||||
$result = $driver->process_form($request, $template, $avatar_data, $avatar_error);
|
||||
$result = $driver->process_form($request, $template, $user, $avatar_data, $avatar_error);
|
||||
|
||||
if ($result && empty($avatar_error))
|
||||
{
|
||||
@ -657,7 +657,7 @@ class ucp_groups
|
||||
'avatar' => $driver->get_template_name(),
|
||||
));
|
||||
|
||||
if ($driver->prepare_form($request, $template, $avatar_data, $avatar_error))
|
||||
if ($driver->prepare_form($request, $template, $user, $avatar_data, $avatar_error))
|
||||
{
|
||||
$driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
|
||||
$driver_upper = strtoupper($driver_name);
|
||||
|
@ -576,7 +576,7 @@ class ucp_profile
|
||||
if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete'))
|
||||
{
|
||||
$driver = $phpbb_avatar_manager->get_driver($driver_name);
|
||||
$result = $driver->process_form($request, $template, $avatar_data, $error);
|
||||
$result = $driver->process_form($request, $template, $user, $avatar_data, $error);
|
||||
|
||||
if ($result && empty($error))
|
||||
{
|
||||
@ -641,7 +641,7 @@ class ucp_profile
|
||||
'avatar' => $driver->get_template_name(),
|
||||
));
|
||||
|
||||
if ($driver->prepare_form($request, $template, $avatar_data, $error))
|
||||
if ($driver->prepare_form($request, $template, $user, $avatar_data, $error))
|
||||
{
|
||||
$driver_name = $phpbb_avatar_manager->prepare_driver_name($current_driver);
|
||||
$driver_upper = strtoupper($driver_name);
|
||||
|
@ -7,12 +7,12 @@ class phpbb_avatar_driver_barfoo extends phpbb_avatar_driver
|
||||
return array();
|
||||
}
|
||||
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ class phpbb_avatar_driver_foobar extends phpbb_avatar_driver
|
||||
return array();
|
||||
}
|
||||
|
||||
public function prepare_form($request, $template, $row, &$error)
|
||||
public function prepare_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function process_form($request, $template, $row, &$error)
|
||||
public function process_form($request, $template, $user, $row, &$error)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user