Unverified Commit 19d1bb3a authored by gloriarodriguez's avatar gloriarodriguez Committed by GitHub
Browse files

solve some console errors in about and user setting section (#1380)


Co-authored-by: default avatarfrankiejol <frankie@telecos.upc.edu>
parent bc87142f
......@@ -1367,10 +1367,10 @@ sub user_settings {
}
_translations($c);
my @errors;
if ($c->param('button_click')) {
if ($c->param('password-form') && $c->req->method eq 'POST') {
my $auth_ok;
eval { $auth_ok = Ravada::Auth::login($USER->name, $c->param('current_password'))};
if (!$auth_ok || $@) {
if (!$auth_ok || $@ || ($c->param('current_password') eq "")) {
push @errors, ("Current password is wrong");
}
else {
......
......@@ -7,16 +7,16 @@
<div id="page-wrapper">
<!--BASES AND DOMAINS LIST-->
<div ng-controller="user_settings">
<div>
<div class="page-header">
<div class="card card-dark">
<div class="card-header">
<h2 class="text-center"><%=l 'User Settings' %></h2>
</div>
<div>
<div class="card-body">
<div class="card-body">
<h3 class="mb-3"><%=l 'Setting your default language' %></h3>
<form>
<form method='post' enctype="multipart/form-data">
<%=l 'Language:' %> <select onchange="this.form.submit();" id="language" name="language" >
% for my $code (sort { $i18n->localize($lang_name->{$a}) cmp $i18n->localize($lang_name->{$b}) } keys %$lang_name) {
......@@ -26,12 +26,11 @@
</option>
% }
</select>
% if ($changed_lang) {
<font color="green"> <%=l 'Your language has been changed successfully' %></font>
% }
</form>
</div>
</form>
</div>
% if (!$_user->is_external) {
<div class="card-body">
<h3><%=l 'Change password' %></h3>
......@@ -54,7 +53,8 @@
% }
<div class="form-group row mt-3 ml-2">
<button type="reset" class="btn btn-outline-secondary mr-2" onclick = "location='/'"><%=l 'Cancel' %></button>
<input class="btn btn-primary" type='submit' onclick='this.form.submit();' id='button_click' name='button_click' value='<%=l 'Update password' %>'>
<input type="hidden" name="password-form" value="1">
<input class="btn btn-primary" type='submit' onclick='this.form.submit();' id='button_click' name='button_click' value='<%=l 'Update password' %>'>
% if ($changed_pass) {
<font color="green"> <%=l 'Your password has been changed successfully' %></font>
% }
......
......@@ -5,7 +5,7 @@
<div id="wrapper">
%= include 'bootstrap/navigation'
<div id="page-wrapper">
<div ng-controller="about">
<div>
<div class="page-title">
<div class="card col-lg-8 offset-md-2 bg-light">
<h2 class="text-center"><%=l 'About' %></h2>
......
Supports Markdown
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