diff --git a/app/config/forms/profile.conf.php b/app/config/forms/profile.conf.php
index e5b2231f5..006ce8276 100644
--- a/app/config/forms/profile.conf.php
+++ b/app/config/forms/profile.conf.php
@@ -57,7 +57,7 @@ return [
'description' => _('All times displayed on the site will be based on this time zone.') . '
' . sprintf(_('Current server time is %s.'),
date('g:ia')),
'options' => \App\Timezone::fetchSelect(),
- 'default' => date_default_timezone_get(),
+ 'default' => 'UTC',
]
],
diff --git a/app/src/AzuraCast/Console/Command/ReprocessMedia.php b/app/src/AzuraCast/Console/Command/ReprocessMedia.php
index 728d54674..b1cfbbcc4 100644
--- a/app/src/AzuraCast/Console/Command/ReprocessMedia.php
+++ b/app/src/AzuraCast/Console/Command/ReprocessMedia.php
@@ -13,7 +13,7 @@ class ReprocessMedia extends \App\Console\Command\CommandAbstract
*/
protected function configure()
{
- $this->setName('media:reprocess')
+ $this->setName('azuracast:media:reprocess')
->setDescription('Manually reload all media metadata from file.');
}
diff --git a/app/src/AzuraCast/Console/Command/ResetPassword.php b/app/src/AzuraCast/Console/Command/ResetPassword.php
new file mode 100644
index 000000000..ee81824d2
--- /dev/null
+++ b/app/src/AzuraCast/Console/Command/ResetPassword.php
@@ -0,0 +1,60 @@
+setName('azuracast:account:reset-password')
+ ->setDescription('Reset the password of the specified account.')
+ ->addArgument(
+ 'email',
+ null,
+ 'The user\'s e-mail address.',
+ null
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ /** @var EntityManager $em */
+ $em = $this->di['em'];
+
+ $user_email = $input->getArgument('email');
+
+ $user = $em->getRepository(Entity\User::class)
+ ->findOneBy(['email' => $user_email ]);
+
+ if ($user instanceof Entity\User) {
+ $temp_pw = \App\Utilities::generatePassword(15);
+
+ $user->setAuthPassword($temp_pw);
+
+ $em->persist($user);
+ $em->flush();
+
+ $output->writeLn([
+ 'The account password has been reset. The new temporary password is:',
+ ' ',
+ $temp_pw,
+ ' ',
+ 'Set a new password using the web interface.',
+ ]);
+ return true;
+ } else {
+ $output->writeln('Account not found.');
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/util/cli.php b/util/cli.php
index c2c98e849..e45452e81 100644
--- a/util/cli.php
+++ b/util/cli.php
@@ -56,6 +56,7 @@ $cli->addCommands([
new \AzuraCast\Console\Command\GenerateApiDocs($di),
new \AzuraCast\Console\Command\UptimeWait($di),
new \AzuraCast\Console\Command\MigrateConfig($di),
+ new \AzuraCast\Console\Command\ResetPassword($di),
]);
$cli->run();
\ No newline at end of file