Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save the settings in the user management page #19354

Merged
merged 1 commit into from
Sep 25, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions settings/js/users/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,44 +813,73 @@ $(document).ready(function () {
});
});

if ($('#CheckboxStorageLocation').is(':checked')) {
$("#userlist .storageLocation").show();
}
// Option to display/hide the "Storage location" column
$('#CheckboxStorageLocation').click(function() {
if ($('#CheckboxStorageLocation').is(':checked')) {
$("#userlist .storageLocation").show();
OC.AppConfig.setValue('core', 'umgmt_show_storage_location', 'true');
} else {
$("#userlist .storageLocation").hide();
OC.AppConfig.setValue('core', 'umgmt_show_storage_location', 'false');
}
});

if ($('#CheckboxLastLogin').is(':checked')) {
$("#userlist .lastLogin").show();
}
// Option to display/hide the "Last Login" column
$('#CheckboxLastLogin').click(function() {
if ($('#CheckboxLastLogin').is(':checked')) {
$("#userlist .lastLogin").show();
OC.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
} else {
$("#userlist .lastLogin").hide();
OC.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
}
});

if ($('#CheckboxEmailAddress').is(':checked')) {
$("#userlist .mailAddress").show();
}
// Option to display/hide the "Mail Address" column
$('#CheckboxEmailAddress').click(function() {
if ($('#CheckboxEmailAddress').is(':checked')) {
$("#userlist .mailAddress").show();
OC.AppConfig.setValue('core', 'umgmt_show_email', 'true');
} else {
$("#userlist .mailAddress").hide();
OC.AppConfig.setValue('core', 'umgmt_show_email', 'false');
}
});

if ($('#CheckboxUserBackend').is(':checked')) {
$("#userlist .userBackend").show();
}
// Option to display/hide the "User Backend" column
$('#CheckboxUserBackend').click(function() {
if ($('#CheckboxUserBackend').is(':checked')) {
$("#userlist .userBackend").show();
OC.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
} else {
$("#userlist .userBackend").hide();
OC.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
}
});

if ($('#CheckboxMailOnUserCreate').is(':checked')) {
$("#newemail").show();
}
// Option to display/hide the "E-Mail" input field
$('#CheckboxMailOnUserCreate').click(function() {
if ($('#CheckboxMailOnUserCreate').is(':checked')) {
$("#newemail").show();
OC.AppConfig.setValue('core', 'umgmt_send_email', 'true');
} else {
$("#newemail").hide();
OC.AppConfig.setValue('core', 'umgmt_send_email', 'false');
}
});

Expand Down
15 changes: 10 additions & 5 deletions settings/templates/users/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,36 @@

<div id="userlistoptions">
<p>
<input type="checkbox" name="StorageLocation" value="StorageLocation" id="CheckboxStorageLocation">
<input type="checkbox" name="StorageLocation" value="StorageLocation" id="CheckboxStorageLocation"
<?php if ($_['show_storage_location'] === 'true') print_unescaped('checked="checked"'); ?> />
<label for="CheckboxStorageLocation">
<?php p($l->t('Show storage location')) ?>
</label>
</p>
<p>
<input type="checkbox" name="LastLogin" value="LastLogin" id="CheckboxLastLogin">
<input type="checkbox" name="LastLogin" value="LastLogin" id="CheckboxLastLogin"
<?php if ($_['show_last_login'] === 'true') print_unescaped('checked="checked"'); ?> />
<label for="CheckboxLastLogin">
<?php p($l->t('Show last log in')) ?>
</label>
</p>
<p>
<input type="checkbox" name="UserBackend" value="UserBackend" id="CheckboxUserBackend">
<input type="checkbox" name="UserBackend" value="UserBackend" id="CheckboxUserBackend"
<?php if ($_['show_backend'] === 'true') print_unescaped('checked="checked"'); ?> />
<label for="CheckboxUserBackend">
<?php p($l->t('Show user backend')) ?>
</label>
</p>
<p>
<input type="checkbox" name="MailOnUserCreate" value="MailOnUserCreate" id="CheckboxMailOnUserCreate">
<input type="checkbox" name="MailOnUserCreate" value="MailOnUserCreate" id="CheckboxMailOnUserCreate"
<?php if ($_['send_email'] === 'true') print_unescaped('checked="checked"'); ?> />
<label for="CheckboxMailOnUserCreate">
<?php p($l->t('Send email to new user')) ?>
</label>
</p>
<p>
<input type="checkbox" name="EmailAddress" value="EmailAddress" id="CheckboxEmailAddress">
<input type="checkbox" name="EmailAddress" value="EmailAddress" id="CheckboxEmailAddress"
<?php if ($_['show_email'] === 'true') print_unescaped('checked="checked"'); ?> />
<label for="CheckboxEmailAddress">
<?php p($l->t('Show email address')) ?>
</label>
Expand Down
7 changes: 7 additions & 0 deletions settings/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,11 @@
$tmpl->assign('defaultQuotaIsUserDefined', $defaultQuotaIsUserDefined);
$tmpl->assign('recoveryAdminEnabled', $recoveryAdminEnabled);
$tmpl->assign('enableAvatars', \OC::$server->getConfig()->getSystemValue('enable_avatars', true));

$tmpl->assign('show_storage_location', $config->getAppValue('core', 'umgmt_show_storage_location', 'false'));
$tmpl->assign('show_last_login', $config->getAppValue('core', 'umgmt_show_last_login', 'false'));
$tmpl->assign('show_email', $config->getAppValue('core', 'umgmt_show_email', 'false'));
$tmpl->assign('show_backend', $config->getAppValue('core', 'umgmt_show_backend', 'false'));
$tmpl->assign('send_email', $config->getAppValue('core', 'umgmt_send_email', 'false'));

$tmpl->printPage();