Ignore:
Timestamp:
10/24/08 14:52:37 (15 years ago)
Author:
eduardoalex
Message:

Adição da funcionalidade Geração automática de login.

Ao criar um usuário, existe a opção de o login ser criado automaticamente
pelo expresso, a partir de um algoritmo existente. Esses algoritmos deverão
estar descritos em classes que implementem a interface login do módulo
expressoAdmin. O nome das classes deverão também possuir a seguinte
estrutura: “class.”+”login_”+nome do algoritmo + “.inc.php”.

File:
1 edited

Legend:

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

    r510 r540  
    191191                select_user_groups.options[i].selected = true; 
    192192        ///////////////////////////////////////////////////////////////////////////////////////////////////////// 
    193          
     193        document.getElementById('uid').disabled = false; //Caso o login seja gerado automático, tirar o disabled. 
    194194        cExecute ('$this.ldap_functions.validate_fields&attributes='+attributes, handler_validate_fields); 
     195} 
     196 
     197function gera_login(first_name,second_name) { 
     198        if ((first_name=='') || (second_name=='')) { 
     199                alert(get_lang("You must type the first and the second name before generate the login")); 
     200                return; 
     201        } 
     202        var attrs_array = new Array(); 
     203        attrs_array['first_name'] = first_name; 
     204        attrs_array['second_name'] = second_name; 
     205        var attributes = connector.serialize(attrs_array); 
     206         
     207        var hangler_gera_login = function(data) { 
     208                if(data['status']) { 
     209                        document.getElementById('uid').value = data['msg']; 
     210                        emailSuggestion_expressoadmin('true','true'); 
     211                        document.getElementById("mail").value=document.getElementById("mail1").value; 
     212                } 
     213                else 
     214                        alert(data['msg']); 
     215        } 
     216 
     217        cExecute ('$this.ldap_functions.gera_login&attributes='+attributes, hangler_gera_login); 
    195218} 
    196219 
Note: See TracChangeset for help on using the changeset viewer.