[3514] | 1 | /************************************************************************************\ |
---|
| 2 | * Expresso Administração * |
---|
| 3 | * by Joao Alfredo Knopik Junior (joao.alfredo@gmail.com, jakjr@celepar.pr.gov.br) * |
---|
| 4 | * ----------------------------------------------------------------------------------* |
---|
| 5 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 6 | * under the terms of the GNU General Public License as published by the * |
---|
| 7 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 8 | * option) any later version. * |
---|
| 9 | \************************************************************************************/ |
---|
| 10 | |
---|
| 11 | function emailSuggestion_expressoadmin(use_suggestion_in_logon_script, concatenateDomain) |
---|
| 12 | { |
---|
| 13 | if (concatenateDomain == 'true') |
---|
| 14 | { |
---|
| 15 | domain_name = document.forms[0].defaultDomain.value; |
---|
| 16 | document.forms[0].mail1.value = document.forms[0].uid.value + '@' + domain_name; |
---|
| 17 | } |
---|
| 18 | else |
---|
| 19 | { |
---|
| 20 | document.forms[0].mail1.value = document.forms[0].uid.value; |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | if (use_suggestion_in_logon_script == 'true') |
---|
| 24 | document.forms[0].sambalogonscript.value = document.forms[0].uid.value+'.bat'; |
---|
| 25 | document.forms[0].sambahomedirectory.value = '/home/'+document.forms[0].uid.value+'/'; |
---|
| 26 | var re_cpf = /^([0-9])+$/; |
---|
| 27 | if ((document.forms[0].uid.value.length == 11)&&(re_cpf.test(document.forms[0].uid.value))&&(validarCPF(document.forms[0].uid.value))) |
---|
| 28 | { |
---|
| 29 | document.forms[0].corporative_information_cpf.value=document.forms[0].uid.value; |
---|
| 30 | return; |
---|
| 31 | } |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | function FormataValor(event, campo) |
---|
| 35 | { |
---|
| 36 | separador1 = '('; |
---|
| 37 | separador2 = ')'; |
---|
| 38 | separador3 = '-'; |
---|
| 39 | |
---|
| 40 | vr = campo.value; |
---|
| 41 | tam = vr.length; |
---|
| 42 | |
---|
| 43 | if ((tam == 1) && (( event.keyCode != 8 ) || ( event.keyCode != 46 ))) |
---|
| 44 | campo.value = ''; |
---|
| 45 | |
---|
| 46 | if ((tam == 3) && (( event.keyCode != 8 ) || ( event.keyCode != 46 ))) |
---|
| 47 | campo.value = vr.substr( 0, tam - 1 ); |
---|
| 48 | |
---|
| 49 | if (( tam <= 1 ) && ( event.keyCode != 8 ) && ( event.keyCode != 46 )) |
---|
| 50 | campo.value = separador1 + vr; |
---|
| 51 | |
---|
| 52 | if (( tam == 3 ) && ( event.keyCode != 8 ) && ( event.keyCode != 46 )) |
---|
| 53 | campo.value = vr + separador2; |
---|
| 54 | |
---|
| 55 | if (( tam == 8 ) && (( event.keyCode != 8 ) && ( event.keyCode != 46 ))) |
---|
| 56 | campo.value = vr + separador3; |
---|
| 57 | |
---|
| 58 | if ((( tam == 9 ) || ( tam == 8 )) && (( event.keyCode == 8 ) || ( event.keyCode == 46 ))) |
---|
| 59 | campo.value = vr.substr( 0, tam - 1 ); |
---|
| 60 | } |
---|
| 61 | function emailGenerate() |
---|
| 62 | { |
---|
| 63 | document.forms[0].mail.value=document.forms[0].mail1.value; |
---|
| 64 | document.forms[0].mailalternateaddress.value=document.forms[0].uid.value + '@mail.' + document.forms[0].defaultDomain.value; |
---|
| 65 | //document.forms[0].mailalteraddress[].value=document.forms[0].uid.value + '@mail.' + document.forms[0].defaultDomain.value; |
---|
| 66 | } |
---|