View | Details | Raw Unified | Return to bug 27060
Collapse All | Expand All

(-)a/admin/smtp_servers.pl (-2 / +3 lines)
Lines 123-132 elsif ( $op eq 'edit_save' ) { Link Here
123
        my $password   = $input->param('smtp_password') || undef;
123
        my $password   = $input->param('smtp_password') || undef;
124
        my $debug      = ( scalar $input->param('smtp_debug_mode') ) ? 1 : 0;
124
        my $debug      = ( scalar $input->param('smtp_debug_mode') ) ? 1 : 0;
125
125
126
        my $password_changed = $input->param('password_changed') // 'no';
127
126
        try {
128
        try {
127
            $smtp_server->password( $password )
129
            $smtp_server->password( $password )
128
                if defined $password and $password ne '****'
130
                if $password_changed eq 'yes';
129
                    or not defined $password;
130
131
131
            $smtp_server->set(
132
            $smtp_server->set(
132
                {
133
                {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smtp_servers.tt (-2 / +12 lines)
Lines 173-182 SMTP servers Link Here
173
                <li>
173
                <li>
174
                    <label for="smtp_password">Password: </label>
174
                    <label for="smtp_password">Password: </label>
175
                    [% IF smtp_server.password %]
175
                    [% IF smtp_server.password %]
176
                        <input type="password" name="smtp_password" id="smtp_password" size="60"  value="****"/>
176
                        <input type="password" name="smtp_password" id="smtp_password" size="60"  value="****"/><a href="#" id="clear_password_changes" title="Clear password changes" aria-label="Clear password changes"> <i class="fa fa-undo" aria-hidden="true"></i></a>
177
                    [% ELSE %]
177
                    [% ELSE %]
178
                        <input type="password" name="smtp_password" id="smtp_password" size="60"  value=""/>
178
                        <input type="password" name="smtp_password" id="smtp_password" size="60"  value=""/>
179
                    [% END %]
179
                    [% END %]
180
                        <input type="hidden" name="password_changed" id="password_changed" value="no"/>
180
                </li>
181
                </li>
181
                <li>
182
                <li>
182
                    <label for="smtp_debug_mode">Debug mode: </label>
183
                    <label for="smtp_debug_mode">Debug mode: </label>
Lines 271-276 SMTP servers Link Here
271
    <script>
272
    <script>
272
        $(document).ready(function() {
273
        $(document).ready(function() {
273
274
275
            $("#smtp_password").on( 'change', function () {
276
                $("#password_changed").val("yes");
277
            });
278
279
            $("#clear_password_changes").on( 'click', function (e) {
280
                e.preventDefault();
281
                $("#smtp_password").val("****");
282
                $("#password_changed").val("no");
283
            });
284
274
            var smtp_servers_url = '/api/v1/config/smtp_servers';
285
            var smtp_servers_url = '/api/v1/config/smtp_servers';
275
            window.smtp_servers = $("#smtp_servers").api({
286
            window.smtp_servers = $("#smtp_servers").api({
276
                "ajax": {
287
                "ajax": {
277
- 

Return to bug 27060