mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
3.0.5340.20849
This commit is contained in:
parent
668f8ba11f
commit
4d679e90a4
18 changed files with 276 additions and 133 deletions
|
@ -8,16 +8,19 @@
|
|||
|
||||
Dashboard.setPageTitle(user.Name);
|
||||
|
||||
if (user.HasPassword) {
|
||||
if (user.HasConfiguredPassword) {
|
||||
$('#btnResetPassword', page).show();
|
||||
$('#fldCurrentPassword', page).show();
|
||||
$('.formheader', page).hide();
|
||||
$('.localAccessSection', page).show();
|
||||
} else {
|
||||
$('#btnResetPassword', page).hide();
|
||||
$('#fldCurrentPassword', page).hide();
|
||||
$('.formheader', page).show();
|
||||
$('.localAccessSection', page).hide();
|
||||
}
|
||||
|
||||
$('#chkEnableLocalAccessWithoutPassword', page).checked(user.Configuration.EnableLocalPassword).checkboxradio('refresh');
|
||||
});
|
||||
|
||||
$('#txtCurrentPassword', page).val('');
|
||||
|
@ -29,6 +32,24 @@
|
|||
|
||||
var userId = getParameterByName("userId");
|
||||
|
||||
ApiClient.getUser(userId).done(function (user) {
|
||||
|
||||
user.Configuration.EnableLocalPassword = $('#chkEnableLocalAccessWithoutPassword', page).checked();
|
||||
|
||||
ApiClient.updateUser(user).done(function() {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
Dashboard.alert(Globalize.translate('MessageSettingsSaved'));
|
||||
loadUser(page);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function savePassword(page) {
|
||||
|
||||
var userId = getParameterByName("userId");
|
||||
|
||||
var currentPassword = $('#txtCurrentPassword', page).val();
|
||||
var newPassword = $('#txtNewPassword', page).val();
|
||||
|
||||
|
@ -59,6 +80,19 @@
|
|||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
savePassword(page);
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
|
||||
};
|
||||
|
||||
self.onLocalAccessSubmit = function () {
|
||||
|
||||
var page = $.mobile.activePage;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
save(page);
|
||||
|
||||
// Disable default form submission
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue