Ignore:
Timestamp:
02/10/10 09:58:44 (14 years ago)
Author:
valmir.sena
Message:

Ticket #902 - Permitir que seja definido um dominio diferente por organizacao

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/js/jscode/expressoadmin.js

    r1916 r1991  
    3333} 
    3434 
     35function get_associated_domain(context) 
     36{ 
     37        var handler_associated_domain = function(data) 
     38        { 
     39                if (data != null) 
     40                { 
     41                        document.forms[0].associated_domain.value = data; 
     42                } 
     43                else 
     44                { 
     45                        document.forms[0].associated_domain.value = ''; 
     46                } 
     47        } 
     48        cExecute ('$this.ldap_functions.get_associated_domain&context='+context, handler_associated_domain);     
     49} 
     50 
    3551function emailSugestion_expressoadmin2(email) {          
    3652                if ( email.value.indexOf('@', 0) < 0 )  emailSugestion = 1; 
     
    3955                        var context = ""; 
    4056 
    41                         organization_context = Element('ea_combo_org').value; 
     57                        organization_context = Element('ea_combo_org').value.toLowerCase(); 
    4258                        // Transformar os DN em User Friendly Naming format 
    4359                        organization_name = organization_context.split(","); 
     
    4662                                context += tmp[1]; 
    4763                                if( i < (organization_name.length - 1) ) context +=  '.'; 
    48                         }                         
    49                         email.value = email.value + context; 
    50                         emailSugestion = 0; 
     64                        } 
     65                        if (document.forms[0].associated_domain.value != '') 
     66                        { 
     67                                associatedDomain_name = document.forms[0].associated_domain.value; 
     68                                email.value = email.value + associatedDomain_name; 
     69                                emailSugestion = 0; 
     70                        } else{ 
     71                                email.value = email.value + context; 
     72                                emailSugestion = 0; 
     73                        } 
    5174                }                
    5275} 
     
    91114                org_name = org_name_par.split('.'); 
    92115                org_name = org_name[org_name.length-1]; 
    93          
     116 
    94117                if (org_name != '') 
    95                         document.forms[0].mail1.value = document.forms[0].uid.value + '@' + org_name + '.' + domain_name; 
     118                { 
     119                        if (document.forms[0].associated_domain.value != '') 
     120                        { 
     121                                associatedDomain_name = document.forms[0].associated_domain.value; 
     122                                document.forms[0].mail1.value = document.forms[0].uid.value + '@' + associatedDomain_name; 
     123                        } 
     124                        else 
     125                        { 
     126                                document.forms[0].mail1.value = document.forms[0].uid.value + '@' + org_name + '.' + domain_name; 
     127                        } 
     128                } 
    96129                else 
    97130                        document.forms[0].mail1.value = document.forms[0].uid.value; 
Note: See TracChangeset for help on using the changeset viewer.