Changeset 1991 for trunk


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

Location:
trunk/expressoAdmin1_2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.bosectors.inc.php

    r1850 r1991  
    4747                        $sector_info['objectClass'][0]  = 'top'; 
    4848                        $sector_info['objectClass'][1]  = 'organizationalUnit'; 
    49                          
     49 
     50                        if( isset($_POST['associated_domain']) ) 
     51                        { 
     52                                if ( $_POST['associated_domain'] != "") { 
     53                                        $sector_info['objectClass'][2]  = 'domainRelatedObject'; 
     54                                        $sector_info['associatedDomain'] = trim($_POST['associated_domain']); 
     55                                } 
     56                        } 
     57                 
    5058                        /* 
    5159                         Insere as informações sobre quota total por usuários e por gigabytes de espaço em disco  
  • trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php

    r1975 r1991  
    15321532        } 
    15331533 
     1534        function get_associated_domain($params) 
     1535        { 
     1536                        $justthese = array("associatedDomain"); 
     1537                        $filter="(objectClass=domainRelatedObject)";; 
     1538                        $context = $params['context']; 
     1539                        $search = ldap_search($this->ldap,$context, $filter, $justthese); 
     1540                        $entry = ldap_get_entries($this->ldap, $search); 
     1541                        return $entry[0]['associateddomain'][0]; 
     1542        } 
    15341543         
    15351544        function change_user_context($dn, $newrdn, $newparent) 
  • trunk/expressoAdmin1_2/inc/class.uisectors.inc.php

    r1684 r1991  
    185185                                'context'                       => $context == '' ? $GLOBALS['phpgw_info']['server']['ldap_context'] : $context, 
    186186                                'sector'                        => $_POST['sector'], 
     187                                'associated_domain'             => $_POST['associated_domain'], 
    187188                                'disk_quota'        => $_POST['disk_quota'], 
    188189                                'users_quota'       => $_POST['users_quota'], 
     
    242243                                $sector_disk_quota = $sector_info[0]['diskquota'][0]; 
    243244                                $sector_users_quota = $sector_info[0]['usersquota'][0]; 
     245                                $sector_associated_domain = $sector_info[0]['associateddomain'][0]; 
    244246                                $_POST['sector_visible'] = $sector_info[0]['phpgwaccountvisible'][0]; 
    245247                        }  
     
    254256                                'manager_org'           => $combo_manager_org, 
    255257                                'sector_visible_checked'=> $_POST['sector_visible'] ? 'checked' : '', 
     258                                'associated_domain'        => $_POST['associated_domain'] == '' ? $sector_associated_domain : $_POST['associated_domain'], 
    256259                                'disk_quota'        => $_POST['disk_quota'] == '' ? $sector_disk_quota : $_POST['disk_quota'], 
    257260                                'users_quota'       => $_POST['users_quota'] == '' ? $sector_users_quota : $_POST['users_quota'], 
    258                                  
    259261                                'lang_add'                      => lang('Add'), 
    260262                                'disable'                       => 'disabled', 
  • 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; 
  • trunk/expressoAdmin1_2/templates/default/accounts_form.tpl

    r1329 r1991  
    1515<input type="hidden" name="photo_exist"                 value="{photo_exist}"> 
    1616<input type="hidden" name="user_context"                value="{user_context}"> 
    17 <input type="hidden" name="departmentnumber"    value="{departmentnumber}"> 
     17<input type="hidden" name="departmentnumber"            value="{departmentnumber}"> 
    1818<input type="hidden" name="userSamba"                   value="{userSamba}"> 
    19 <input type="hidden" name="defaultLogonScript"  value="{defaultLogonScript}"> 
     19<input type="hidden" name="defaultLogonScript"          value="{defaultLogonScript}"> 
    2020<input type="hidden" name="imapDelimiter"               value="{imapDelimiter}"> 
    21 <input type="hidden" name="minimumSizeLogin"    value="{minimumSizeLogin}"> 
     21<input type="hidden" name="minimumSizeLogin"            value="{minimumSizeLogin}"> 
    2222<input type="hidden" name="defaultDomain"               value="{defaultDomain}"> 
    2323<input type="hidden" name="ldap_context"                value="{ldap_context}"> 
     24<input type="hidden" name="associated_domain"           value="{associated_domain}"> 
    2425 
    2526<br> 
     
    4243                <tr bgcolor={row_on}> 
    4344                        <td>{lang_search_organization}:</td> 
    44                         <td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td> 
     45                        <td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_associated_domain(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td> 
    4546                </tr> 
    4647 
    4748                <tr bgcolor={row_off}> 
    4849                        <td>{lang_organizations}:</td> 
    49                         <td><select {disabled} id="ea_combo_org_info" name="context" onchange="javascript:sinc_combos_org(this.value); get_available_groups(this.value); get_available_maillists(this.value); get_available_sambadomains(this.value, '{type}')">{sectors}</select></td> 
     50                        <td><select {disabled} id="ea_combo_org_info" name="context" onchange="javascript:sinc_combos_org(this.value); get_associated_domain(this.value); get_available_groups(this.value); get_available_maillists(this.value); get_available_sambadomains(this.value, '{type}')">{sectors}</select></td> 
    5051                </tr> 
    5152                                                         
  • trunk/expressoAdmin1_2/templates/default/institutional_accounts_modal.tpl

    r1975 r1991  
    1717                        <br> 
    1818                        {lang_organization}:<br> 
    19                         <select id="ea_combo_org" name="context" onchange="javascript:sinc_combos_org(this.value);">{manager_organizations}</select><br> 
     19                        <select id="ea_combo_org" name="context" onchange="javascript:sinc_combos_org(this.value);javascript:get_associated_domain(this.value);">{manager_organizations}</select><br> 
     20                         
     21                        <input type="hidden" id="associated_domain" name="associated_domain"> 
    2022                                                         
    2123                        {lang_full_name}: <font color="blue">{lang_eg}: Setor Diser</font><br> 
  • trunk/expressoAdmin1_2/templates/default/sectors_form.tpl

    r1516 r1991  
    2121                        <td> 
    2222                                <input type="text" {disable} autocomplete="off" name="sector" value={sector}> 
     23                        </td> 
     24                </tr> 
     25                <tr>   
     26                        <td> 
     27                                {lang_Associated_domain}: 
     28                        </td> 
     29                        <td> 
     30                                <input type="text" {disable} autocomplete="off" name="associated_domain" value={associated_domain}> 
    2331                        </td> 
    2432                </tr> 
  • trunk/expressoAdmin1_2/templates/default/shared_accounts_modal.tpl

    r1986 r1991  
    1616                         
    1717                        {lang_organization}: 
    18                         <select id="ea_combo_org" name="context" onchange="javascript:sinc_combos_org(this.value);">{manager_organizations}</select><br> 
     18                        <select id="ea_combo_org" name="context" onchange="javascript:sinc_combos_org(this.value);javascript:get_associated_domain(this.value);">{manager_organizations}</select><br> 
     19                         
     20                        <input type="hidden" id="associated_domain" name="associated_domain"> 
    1921                                                         
    2022                        {lang_full_name}:  
Note: See TracChangeset for help on using the changeset viewer.