/************************************************************************************\ * Expresso Administração * * by Joao Alfredo Knopik Junior (joao.alfredo@gmail.com, jakjr@celepar.pr.gov.br) * * ----------------------------------------------------------------------------------* * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \************************************************************************************/ function load_lang(){ cExecute ('$this/inc/load_lang', handler_load_lang); } var global_langs = new Array(); var emailSugestion = 1; function handler_load_lang(data) { global_langs = eval(data); } function get_lang(key_raw) { key = key_raw.replace(/ /g,"_"); key = key.replace(/-/g,""); lang = eval("global_langs."+key.toLowerCase()); if (typeof(lang)=='undefined') return key_raw + '*'; else return lang; } function get_associated_domain(context) { var handler_associated_domain = function(data) { if (data != null) { document.forms[0].associated_domain.value = data; } else { document.forms[0].associated_domain.value = ''; } } cExecute ('$this.ldap_functions.get_associated_domain&context='+context, handler_associated_domain); } function emailSugestion_expressoadmin2(email) { if ( email.value.indexOf('@', 0) < 0 ) emailSugestion = 1; if ( (email.value.indexOf('@', 0) == (email.value.length - 1)) && emailSugestion == 1 && email.value.length > 0 ) { var tmp; var context = ""; organization_context = Element('ea_combo_org').value.toLowerCase(); // Transformar os DN em User Friendly Naming format organization_name = organization_context.split(","); for (i in organization_name) { tmp = organization_name[i].split("="); context += tmp[1]; if( i < (organization_name.length - 1) ) context += '.'; } if (document.forms[0].associated_domain.value != '') { associatedDomain_name = document.forms[0].associated_domain.value; email.value = email.value + associatedDomain_name; emailSugestion = 0; } else{ email.value = email.value + context; emailSugestion = 0; } } } function emailSuggestion_expressoadmin(use_suggestion_in_logon_script, concatenateDomain) { if (concatenateDomain == 'true') { // base_dn do LDAP Expresso var ldap_context = document.forms[0].ldap_context.value.toLowerCase(); // OU selecionada organization_context = document.forms[0].context.value.toLowerCase(); select_orgs = document.getElementById('ea_combo_org_info'); for(var i=0; i