mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/12074] Don't log errors
PHPBB3-12074
This commit is contained in:
@@ -92,19 +92,16 @@ class acp_extensions
|
|||||||
case 'enable_pre':
|
case 'enable_pre':
|
||||||
if (!$md_manager->validate_dir())
|
if (!$md_manager->validate_dir())
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_DIR_INVALID_ERROR', time(), array($ext_name));
|
|
||||||
trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$md_manager->validate_enable())
|
if (!$md_manager->validate_enable())
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_NOT_AVAILABLE_ERROR', time(), array($ext_name));
|
|
||||||
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($phpbb_extension_manager->enabled($ext_name))
|
if ($phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_ALREADY_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,19 +117,16 @@ class acp_extensions
|
|||||||
case 'enable':
|
case 'enable':
|
||||||
if (!$md_manager->validate_dir())
|
if (!$md_manager->validate_dir())
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_DIR_INVALID_ERROR', time(), array($ext_name));
|
|
||||||
trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$md_manager->validate_enable())
|
if (!$md_manager->validate_enable())
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_NOT_AVAILABLE_ERROR', time(), array($ext_name));
|
|
||||||
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($phpbb_extension_manager->enabled($ext_name))
|
if ($phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_ALREADY_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +146,6 @@ class acp_extensions
|
|||||||
}
|
}
|
||||||
catch (\phpbb\db\migration\exception $e)
|
catch (\phpbb\db\migration\exception $e)
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE_MIGRATION_ERROR', time(), array($ext_name));
|
|
||||||
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,7 +159,6 @@ class acp_extensions
|
|||||||
case 'disable_pre':
|
case 'disable_pre':
|
||||||
if (!$phpbb_extension_manager->enabled($ext_name))
|
if (!$phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_DISABLE_NOT_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +174,6 @@ class acp_extensions
|
|||||||
case 'disable':
|
case 'disable':
|
||||||
if (!$phpbb_extension_manager->enabled($ext_name))
|
if (!$phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_DISABLE_NOT_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +199,6 @@ class acp_extensions
|
|||||||
case 'delete_data_pre':
|
case 'delete_data_pre':
|
||||||
if ($phpbb_extension_manager->enabled($ext_name))
|
if ($phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_PURGE_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
$this->tpl_name = 'acp_ext_delete_data';
|
$this->tpl_name = 'acp_ext_delete_data';
|
||||||
@@ -223,7 +213,6 @@ class acp_extensions
|
|||||||
case 'delete_data':
|
case 'delete_data':
|
||||||
if ($phpbb_extension_manager->enabled($ext_name))
|
if ($phpbb_extension_manager->enabled($ext_name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_PURGE_ENABLED_ERROR', time(), array($ext_name));
|
|
||||||
redirect($this->u_action);
|
redirect($this->u_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +232,6 @@ class acp_extensions
|
|||||||
}
|
}
|
||||||
catch (\phpbb\db\migration\exception $e)
|
catch (\phpbb\db\migration\exception $e)
|
||||||
{
|
{
|
||||||
$this->log->add('critical', $user->data['user_id'], $user->ip, 'LOG_EXT_PURGE_MIGRATION_ERROR', time(), array($ext_name));
|
|
||||||
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
$template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -780,19 +780,5 @@ $lang = array_merge($lang, array(
|
|||||||
|
|
||||||
'LOG_EXT_ENABLE' => '<strong>Extension enabled</strong><br />» %s',
|
'LOG_EXT_ENABLE' => '<strong>Extension enabled</strong><br />» %s',
|
||||||
'LOG_EXT_DISABLE' => '<strong>Extension disabled</strong><br />» %s',
|
'LOG_EXT_DISABLE' => '<strong>Extension disabled</strong><br />» %s',
|
||||||
'LOG_EXT_PURGE' => '<strong>Extension’s data deleted</strong><br />» %s',
|
'LOG_EXT_PURGE' => '<strong>Extension’s data deleted</strong><br />» %s',
|
||||||
|
|
||||||
'LOG_EXT_ENABLE_ERROR' => '<strong>Error while enabling an extension</strong><br />» %s',
|
|
||||||
'LOG_EXT_DISABLE_ERROR' => '<strong>Error while disabling an extension</strong><br />» %s',
|
|
||||||
'LOG_EXT_PURGE_ERROR' => '<strong>Error while deleted the data of an extension</strong><br />» %s',
|
|
||||||
|
|
||||||
'LOG_EXT_ENABLE_DIR_INVALID_ERROR' => '<strong>Error while enabling the extension "%s"</strong><br />» Invalid directory structure.',
|
|
||||||
'LOG_EXT_ENABLE_NOT_AVAILABLE_ERROR' => '<strong>Error while enabling the extension "%s"</strong><br />» Extension unavailable for this board.',
|
|
||||||
'LOG_EXT_ENABLE_ALREADY_ENABLED_ERROR' => '<strong>Error while enabling the extension "%s"</strong><br />» Extension already enabled.',
|
|
||||||
'LOG_EXT_ENABLE_MIGRATION_ERROR' => '<strong>Error while enabling the extension "%s"</strong><br />» Migration error.',
|
|
||||||
|
|
||||||
'LOG_EXT_DISABLE_NOT_ENABLED_ERROR' => '<strong>Error while disabling the extension "%s"</strong><br />» Extension not enabled.',
|
|
||||||
|
|
||||||
'LOG_EXT_PURGE_ENABLED_ERROR' => '<strong>Error while deleting the data of the extension "%s"</strong><br />» Extension enabled.',
|
|
||||||
'LOG_EXT_PURGE_MIGRATION_ERROR' => '<strong>Error while deleting the data of the extension "%s"</strong><br />» Migration error.',
|
|
||||||
));
|
));
|
||||||
|
@@ -35,7 +35,6 @@ class disable extends command
|
|||||||
|
|
||||||
if ($this->manager->enabled($name))
|
if ($this->manager->enabled($name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_DISABLE_ERROR', time(), array($name));
|
|
||||||
$output->writeln("<error>Could not disable extension $name</error>");
|
$output->writeln("<error>Could not disable extension $name</error>");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -41,7 +41,6 @@ class enable extends command
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_ENABLE_ERROR', time(), array($name));
|
|
||||||
$output->writeln("<error>Could not enable extension $name</error>");
|
$output->writeln("<error>Could not enable extension $name</error>");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,6 @@ class purge extends command
|
|||||||
|
|
||||||
if ($this->manager->enabled($name))
|
if ($this->manager->enabled($name))
|
||||||
{
|
{
|
||||||
$this->log->add('critical', ANONYMOUS, '', 'LOG_EXT_PURGE_ERROR', time(), array($name));
|
|
||||||
$output->writeln("<error>Could not purge extension $name</error>");
|
$output->writeln("<error>Could not purge extension $name</error>");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user