Commit b38255d1 authored by HQ's avatar HQ
Browse files

Various improvements

parent f1a547a8
......@@ -14,7 +14,8 @@ sub discourse {
if ($action eq 'form') {
my $form;
my $meref = show_me();
my $email = $meref->{username};
my $email = $meref->{email};
$email = $meref->{username} if (!$email || $email eq '--' || !($email =~ /\w+\@\w+/));
# Redirect to upgrade page if still upgrading
if (-e "/tmp/restoring") {
$form .= qq|<script>loc=document.location.href; setTimeout(function(){document.location=loc;}, 1500); </script>|;
......@@ -86,7 +87,8 @@ END
} elsif ($action eq 'discoursepassword' && defined $in{discoursepassword}) {
my $message;
my $meref = show_me();
my $email = $meref->{username};
my $email = $meref->{email};
$email = $meref->{username} if (!$email || $email eq '--' || !($email =~ /\w+\@\w+/));
my $pwd = $in{discoursepassword};
if ($pwd) {
my $res = `cd /var/discourse ; export RAILS_ENV=production; printf "$email\nY\n$pwd\n$pwd\nY " | rake admin:create`;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment