summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/l10n/lo.js
blob: 5494dcae62e2729f377e3e9a3eed44662ee47cea (plain)
1
2
3
4
5
6
7
OC.L10N.register(
    "user_ldap",
    {
    "_%s group found_::_%s groups found_" : [""],
    "_%s user found_::_%s users found_" : [""]
},
"nplurals=1; plural=0;");
t .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/**
 * Copyright (c) 2013, Sam Tuke <samtuke@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */

function updatePrivateKeyPassword() {
	var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
	var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
	OC.msg.startSaving('#encryption .msg');
	$.post(
		OC.generateUrl('/apps/encryption/ajax/updatePrivateKeyPassword'),
		{ oldPassword: oldPrivateKeyPassword, newPassword: newPrivateKeyPassword }
	).success(function(response) {
		OC.msg.finishedSuccess('#encryption .msg', response.message);
	}).fail(function(response) {
		OC.msg.finishedError('#encryption .msg', response.responseJSON.message);
	});
}

$(document).ready(function(){

	// Trigger ajax on recoveryAdmin status change
	$( 'input:radio[name="userEnableRecovery"]' ).change(
		function() {
			var recoveryStatus = $( this ).val();
			OC.msg.startAction('#userEnableRecovery .msg', 'Updating recovery keys. This can take some time...');
			$.post(
					OC.generateUrl('/apps/encryption/ajax/userSetRecovery'),
				{ userEnableRecovery: recoveryStatus },
				function( data ) {
					OC.msg.finishedAction('#userEnableRecovery .msg', data);
				}
			);
			// Ensure page is not reloaded on form submit
			return false;
		}
	);

	// update private key password

	$('input:password[name="changePrivateKeyPassword"]').keyup(function(event) {
		var oldPrivateKeyPassword = $('input:password[id="oldPrivateKeyPassword"]').val();
		var newPrivateKeyPassword = $('input:password[id="newPrivateKeyPassword"]').val();
		if (newPrivateKeyPassword !== '' && oldPrivateKeyPassword !== '' ) {
			$('button:button[name="submitChangePrivateKeyPassword"]').removeAttr("disabled");
			if(event.which === 13) {
				updatePrivateKeyPassword();
			}
		} else {
			$('button:button[name="submitChangePrivateKeyPassword"]').attr("disabled", "true");
		}
	});

	$('button:button[name="submitChangePrivateKeyPassword"]').click(function() {
		updatePrivateKeyPassword();
	});

});