mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/16955] Clean up cron and console classes
PHPBB3-16955
This commit is contained in:
parent
a8b878349a
commit
b855b8a5a5
6 changed files with 9 additions and 10 deletions
|
@ -101,7 +101,7 @@ class update_hashes extends \phpbb\console\command\command
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$old_hash = preg_replace('/^\$CP\$/', '', $row['user_password']);
|
$old_hash = preg_replace('/^\$CP\$/', '', $row['user_password']);
|
||||||
$new_hash = $this->passwords_manager->hash($old_hash, array($this->default_type));
|
$new_hash = $this->passwords_manager->hash($old_hash, [$this->default_type]);
|
||||||
|
|
||||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||||
SET user_password = '" . $this->db->sql_escape($new_hash) . "'
|
SET user_password = '" . $this->db->sql_escape($new_hash) . "'
|
||||||
|
|
|
@ -164,7 +164,7 @@ class manager
|
||||||
* Web runner uses this method to resolve names to tasks.
|
* Web runner uses this method to resolve names to tasks.
|
||||||
*
|
*
|
||||||
* @param string $name Name of the task to look up.
|
* @param string $name Name of the task to look up.
|
||||||
* @return wrapper A wrapped task corresponding to the given name, or null.
|
* @return wrapper|null A wrapped task corresponding to the given name, or null.
|
||||||
*/
|
*/
|
||||||
public function find_task($name)
|
public function find_task($name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,7 +166,8 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
||||||
* @param int $prune_flags Prune flags
|
* @param int $prune_flags Prune flags
|
||||||
* @param int $prune_days Prune date in days
|
* @param int $prune_days Prune date in days
|
||||||
* @param int $prune_freq Prune frequency
|
* @param int $prune_freq Prune frequency
|
||||||
* @return null
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function auto_prune_shadow_topics($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq)
|
protected function auto_prune_shadow_topics($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq)
|
||||||
{
|
{
|
||||||
|
@ -194,7 +195,5 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
|
||||||
|
|
||||||
$this->log->add('admin', $user_id, $user_ip, 'LOG_PRUNE_SHADOW', false, array($row['forum_name']));
|
$this->log->add('admin', $user_id, $user_ip, 'LOG_PRUNE_SHADOW', false, array($row['forum_name']));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ class update_hashes extends \phpbb\cron\task\base
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$old_hash = preg_replace('/^\$CP\$/', '', $row['user_password']);
|
$old_hash = preg_replace('/^\$CP\$/', '', $row['user_password']);
|
||||||
$new_hash = $this->passwords_manager->hash($old_hash, array($this->default_type));
|
$new_hash = $this->passwords_manager->hash($old_hash, [$this->default_type]);
|
||||||
|
|
||||||
// Increase number so we know that users were selected from the database
|
// Increase number so we know that users were selected from the database
|
||||||
$affected_rows++;
|
$affected_rows++;
|
||||||
|
|
|
@ -91,7 +91,7 @@ class wrapper
|
||||||
{
|
{
|
||||||
$params = [];
|
$params = [];
|
||||||
$params['cron_type'] = $this->get_name();
|
$params['cron_type'] = $this->get_name();
|
||||||
if ($this->is_parametrized())
|
if ($this->task instanceof parametrized)
|
||||||
{
|
{
|
||||||
$params = array_merge($params, $this->task->get_parameters());
|
$params = array_merge($params, $this->task->get_parameters());
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ class wrapper
|
||||||
|
|
||||||
$this->template->assign_var('CRON_TASK_URL', $this->get_url());
|
$this->template->assign_var('CRON_TASK_URL', $this->get_url());
|
||||||
|
|
||||||
return $this->template->assign_display('cron_html_tag');
|
return (string) $this->template->assign_display('cron_html_tag');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -206,8 +206,8 @@ class manager
|
||||||
* Hash supplied password
|
* Hash supplied password
|
||||||
*
|
*
|
||||||
* @param string $password Password that should be hashed
|
* @param string $password Password that should be hashed
|
||||||
* @param string $type Hash type. Will default to standard hash type if
|
* @param string|array $type Hash type. Will default to standard hash type if
|
||||||
* none is supplied
|
* none is supplied, array for combined hashing
|
||||||
* @return string|bool Password hash of supplied password or false if
|
* @return string|bool Password hash of supplied password or false if
|
||||||
* if something went wrong during hashing
|
* if something went wrong during hashing
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue