dump('entering auth/controller.js\n');
+// vim:sw=4:ts=4:noet:
if (typeof auth == 'undefined') auth = {};
auth.controller = function (params) {
} else {
x.appendChild(
document.createTextNode(
- 'Not yet configured for the specified server.'
+ document.getElementById('authStrings').getString('staff.auth.controller.not_configured')
)
);
}
obj.controller.view.submit_button.disabled = true;
obj.controller.view.server_prompt.disabled = true;
var s = document.getElementById('status');
- s.setAttribute('value','Testing hostname...');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.testing_hostname'));
s.setAttribute('style','color: orange;');
document.getElementById('version').value = '';
if (!url) {
- s.setAttribute('value','Please enter a server hostname.');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.prompt_hostname'));
s.setAttribute('style','color: red;');
obj.controller.view.server_prompt.disabled = false;
obj.controller.view.server_prompt.focus();
x.onreadystatechange = function() {
try {
if (x.readyState != 4) return;
- s.setAttribute('value',x.status + ' : ' + x.statusText);
+ s.setAttribute('value', document.getElementById('authStrings').getFormattedString('staff.auth.controller.status', [x.status, x.statusText]));
if (x.status == 200) {
s.setAttribute('style','color: green;');
} else {
} catch(E) {
obj.controller.view.server_prompt.disabled = false;
obj.controller.view.server_prompt.focus();
- s.setAttribute('value','There was an error testing this hostname.');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.error_hostname'));
s.setAttribute('style','color: red;');
obj.error.sdump('D_ERROR',E);
}
}
x.send(null);
} catch(E) {
- s.setAttribute('value','There was an error testing this hostname.');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.error_hostname'));
s.setAttribute('style','color: brown;');
obj.error.sdump('D_ERROR',E);
obj.controller.view.server_prompt.disabled = false;
'test_version' : function(url) {
var obj = this;
var s = document.getElementById('version');
- s.setAttribute('value','Testing version...');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.testing_version'));
s.setAttribute('style','color: orange;');
try {
var x = new XMLHttpRequest();
x.onreadystatechange = function() {
try {
if (x.readyState != 4) return;
- s.setAttribute('value',x.status + ' : ' + x.statusText);
+ s.setAttribute('value', document.getElementById('authStrings').getFormattedString('staff.auth.controller.status', [x.status, x.statusText]));
if (x.status == 200) {
s.setAttribute('style','color: green;');
obj.controller.view.submit_button.disabled = false;
}
obj.controller.view.server_prompt.disabled = false;
} catch(E) {
- s.setAttribute('value','There was an error checking version support.');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.error_version'));
s.setAttribute('style','color: red;');
obj.error.sdump('D_ERROR',E);
obj.controller.view.server_prompt.disabled = false;
}
x.send(null);
} catch(E) {
- s.setAttribute('value','There was an error checking version support.');
+ s.setAttribute('value', document.getElementById('authStrings').getString('staff.auth.controller.error_version'));
s.setAttribute('style','color: brown;');
obj.error.sdump('D_ERROR',E);
obj.controller.view.server_prompt.disabled = false;
if (x.status == 200) {
window.open('data:text/html,'+window.escape(x.responseText),'upgrade','chrome,resizable,modal,centered');
} else {
- alert('This server does not support your version of the staff client. Please check with your system administrator.');
+ alert(document.getElementById('authStrings').getString('staff.auth.controller.version_mismatch'));
}
obj.controller.view.server_prompt.disabled = false;
} catch(E) {
var obj = this;
- this.error.sdump('D_AUTH','login with '
- + this.controller.view.name_prompt.value + ' and '
- + this.controller.view.password_prompt.value + ' at '
- + this.controller.view.server_prompt.value + '\n'
+ this.error.sdump('D_AUTH',
+ document.getElementById('authStrings').getFormattedString(
+ 'staff.auth.controller.error_login', [
+ this.controller.view.name_prompt.value,
+ this.controller.view.password_prompt.value,
+ this.controller.view.server_prompt.value
+ ]
+ )
);
this.controller.view.server_prompt.disabled = true;
this.controller.view.name_prompt.disabled = true;
this.error.sdump('D_AUTH','close' + this.w + '\n');
- if (window.confirm('Are you sure you would like to exit the program completely?')) {
+ if (window.confirm(document.getElementById('authStrings').getString('staff.auth.controller.confirm_close'))) {
this.logoff();
this.w.close(); /* Probably won't go any further */
dump('entering auth/session.js\n');
+// vim:sw=4:ts=4:noet:
if (typeof auth == 'undefined') auth = {};
auth.session = function (view,login_type) {
this.authtime = robj.payload.authtime;
break;
case 1520 /* WORKSTATION_NOT_FOUND */:
- alert(params.workstation + ' is not registered with this server.');
+ alert(document.getElementById('authStrings').getFormattedString('staff.auth.session.unregistered', [params.workstation]));
delete(params.workstation);
delete(data.ws_info[ this.view.server_prompt.value ]);
data.stash('ws_info');
} else {
- var error = 'open-ils.auth.authenticate.init returned false\n';
+ var error = document.getElementById('authStrings').getStrint('staff.auth.session.init_false') + '\n';
this.error.sdump('D_ERROR',error);
throw(error);
}
} catch(E) {
- alert('Login failed. Please check your Server Hostname, Username, Password, and your CAPS LOCK key.');
+ alert(document.getElementById('authStrings').getString('staff.auth.session.login_failed'));
//obj.error.standard_unexpected_error_alert('Error on auth.session.init()',E);
if (typeof this.on_init_error == 'function') {