Changeset 2892


Ignore:
Timestamp:
06/01/10 12:48:47 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Corrigindo problema na criação de usuários.

Location:
trunk/expressoAdmin1_2
Files:
4 edited

Legend:

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

    r2878 r2892  
    245245                                $result['status'] = false; 
    246246                                $result['msg'] = $this->functions->lang('Connection with ldap fail') . "."; 
    247                                 return $result; 
     247                                return json_encode( $result ); 
    248248                        } 
    249249                } 
     
    270270                        $result['status'] = false; 
    271271                        $result['msg'] = $this->functions->lang('this login can not be used because is a system account') . "."; 
    272                         return $result; 
     272                        return json_encode( $result ); 
    273273                } 
    274274                 
     
    319319                                $result['status'] = false; 
    320320                                $result['msg'] = $this->functions->lang('this login is already used by') . ":\n" . $users; 
    321                                 return $result; 
     321                                return json_encode( $result ); 
    322322                        } 
    323323 
     
    331331                                $result['status'] = false; 
    332332                                $result['msg'] = $this->functions->lang('This login is being used by a group') . "."; 
    333                                 return $result; 
     333                                return json_encode( $result ); 
    334334                        } 
    335335                         
     
    378378                                                $result['msg'] = $this->functions->lang('this login is already used by a user in another organization') . "."; 
    379379                                                ldap_close($ldap_connection2); 
    380                                                 return $result; 
     380                                                return json_encode( $result ); 
    381381                                        } 
    382382                                } 
     
    387387                if ($type == 'rename_user') 
    388388                { 
    389                         return $result; 
     389                        return json_encode( $result ); 
    390390                } 
    391391                 
     
    399399                                $result['status'] = false; 
    400400                                $result['msg'] = $this->functions->lang('this email address is being used by 1 user') . ": " . $entries[0]['uid'][0]; 
    401                                 return $result; 
     401                                return json_encode( $result ); 
    402402                        } 
    403403                } 
     
    405405                        $result['status'] = false; 
    406406                        $result['msg'] = $this->functions->lang('this email address is being used by 2 or more users') . "."; 
    407                         return $result; 
     407                        return json_encode( $result ); 
    408408                } 
    409409                 
     
    417417                                $result['status'] = false; 
    418418                                $result['msg'] = $this->functions->lang('alternative email is being used by 1 user') . ": " . $entries[0]['uid'][0]; 
    419                                 return $result; 
     419                                return json_encode( $result ); 
    420420                        } 
    421421                } 
     
    423423                        $result['status'] = false; 
    424424                        $result['msg'] = $this->functions->lang('alternative email is being used by 2 or more users') . "."; 
    425                         return $result; 
     425                        return json_encode( $result ); 
    426426                } 
    427427 
     
    435435                                        $result['status'] = false; 
    436436                                        $result['msg'] = $this->functions->lang('Field CPF is invalid') . '.'; 
    437                                         return $result; 
     437                                        return json_encode( $result ); 
    438438                                } 
    439439                                else 
     
    453453                                                $result['status'] = false; 
    454454                                                $result['msg'] = $this->functions->lang('Connection with ldap fail') . "."; 
    455                                                 return $result; 
     455                                                return json_encode( $result ); 
    456456                                        } 
    457457                                 
     
    476476                                                                        $result['question'] .= $entries_text; 
    477477                                                                        $result['question'] .= $this->functions->lang("Do you want to continue anyway") . "?"; 
    478                                                                         return $result; 
     478                                                                        return json_encode( $result ); 
    479479                                                                } else { 
    480480                                                                        $result['status'] = false; 
     
    482482                                                                        $result['msg'] .= $this->functions->lang('Field CPF used by') . ":\n"; 
    483483                                                                        $result['msg'] .= $entries_text; 
    484                                                                         return $result; 
     484                                                                        return json_encode( $result ); 
    485485                                                                }                                                                
    486486                                                                         
     
    494494                                $result['status'] = false; 
    495495                                $result['msg'] = $this->functions->lang('Field CPF must be completed') . '.'; 
    496                                 return $result; 
     496                                return json_encode( $result ); 
    497497                        } 
    498498                } 
    499499                //End: Check CPF 
    500500 
    501                 return $result; 
     501                return json_encode( $result ); 
    502502        } 
    503503         
  • trunk/expressoAdmin1_2/js/jscode/connector.js

    r2459 r2892  
    124124         
    125125                                                        default: 
    126                                                                 showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
     126                                                                //showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
    127127                                                                break; 
    128128                                                } 
     
    153153         
    154154                                default: 
    155                                         showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
     155                                        //showMessage(Element('cc_msg_err_serialize_data_unknown').value); 
    156156                                        return null; 
    157157                        } 
  • trunk/expressoAdmin1_2/js/jscode/expressoadmin.js

    r2712 r2892  
    5555                        // Transformar os DN em User Friendly Naming format 
    5656                        organization_name = organization_context.split(","); 
    57                         for (i in organization_name) { 
    58                                 tmp = organization_name[i].split("="); 
    59                                 context += tmp[1]; 
    60                                 if( i < (organization_name.length - 1) ) context +=  '.'; 
    61                         } 
     57                        for (i in organization_name) 
     58                                if ( ! ( i in Object.prototype ) ) 
     59                                { 
     60                                        tmp = organization_name[i].split("="); 
     61                                        context += tmp[1]; 
     62                                        if( i < (organization_name.length - 1) ) context +=  '.'; 
     63                                } 
    6264                        if (document.forms[0].associated_domain.value != '') 
    6365                        { 
     
    9698                                organization_name = organization_context.split(","); 
    9799                                for (x in organization_name) 
    98                                 { 
    99                                         tmp = organization_name[x].split("="); 
    100                                         context += tmp[1] + '.'; 
    101                                 } 
     100                                        if ( ! ( x in Object.prototype ) ) 
     101                                        { 
     102                                                tmp = organization_name[x].split("="); 
     103                                                context += tmp[1] + '.'; 
     104                                        } 
    102105                        } 
    103106                } 
  • trunk/expressoAdmin1_2/js/jscode/users.js

    r2860 r2892  
    143143        var handler_validate_fields = function(data) 
    144144        { 
     145                data = data.JSON( ); 
    145146                if (!data.status) 
    146147                { 
     
    183184                } 
    184185        } 
    185          
     186 
    186187        // Needed select all options from select 
    187188        select_user_maillists = document.getElementById('ea_select_user_maillists'); 
     
    193194        ///////////////////////////////////////////////////////////////////////////////////////////////////////// 
    194195        document.getElementById('uid').disabled = false; //Caso o login seja gerado automático, tirar o disabled. 
    195         cExecute ('$this.ldap_functions.validate_fields&attributes='+attributes, handler_validate_fields); 
     196        ExpressoLivre.go( { 
     197                "access" : 'expressoAdmin1_2.ldap_functions.validate_fields&attributes='+attributes, 
     198                "handler" : handler_validate_fields 
     199        } ); 
    196200} 
    197201 
     
    535539                var handler_validate_fields = function(data) 
    536540                { 
     541                        data = data.JSON( ); 
    537542                        if (!data.status) 
    538543                                alert(data.msg); 
     
    542547                        return; 
    543548                } 
    544                  
     549 
    545550                // New uid exist? 
    546551                attrs_array = new Array(); 
     
    548553                attrs_array['uid'] = new_uid; 
    549554                attributes = connector.serialize(attrs_array); 
    550          
    551                 cExecute ('$this.ldap_functions.validate_fields&attributes='+attributes, handler_validate_fields); 
     555 
     556                ExpressoLivre.go( { 
     557                        "access" : 'expressoAdmin1_2.ldap_functions.validate_fields&attributes='+attributes, 
     558                        "handler" : handler_validate_fields 
     559                } ); 
    552560        } 
    553561} 
Note: See TracChangeset for help on using the changeset viewer.