Changeset 1713


Ignore:
Timestamp:
11/26/09 16:13:59 (14 years ago)
Author:
niltonneto
Message:

Ticket #795 - Corrigido problema de login com prefixo de organização.

Location:
trunk/phpgwapi/templates/default
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/templates/default/login.tpl

    r1628 r1713  
    6363           <div id="mensagem" class="msgInicial" >{cd}<br>{lang_message}</div> 
    6464           {action} 
    65             <div id="conteudo_login" style="display:{show};"> 
     65            <div id="conteudo_login" style="display:{show};">{select_organization} 
    6666              <div class="login_label"> 
    6767                <label for="usuario">{lang_username}</label> 
  • trunk/phpgwapi/templates/default/login_default.php

    r1247 r1713  
    120120                        } 
    121121                } 
    122         if($_POST['user']) 
    123                 { 
    124                         $_POST['login'] = $_POST['user']; 
    125                 } 
    126 /////   Início - Código temporário: Para renomeação de login com organização para sem. ////// 
    127 /*              $common = CreateObject('phpgwapi.common'); 
    128                 $ldap_conn = $common->ldapConnect(); 
    129                 $justthese = array("uid"); 
    130                 $filter="(&(phpgwAccountType=u)(uid=".$_POST['user']."))"; 
    131                 $ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 
    132                 $ldap_info       = ldap_get_entries($ldap_conn, $ldap_search); 
    133                 if ($ldap_info['count'] != 0) // Verifica se o login existe sem organização. 
    134                 { 
    135                         $_POST['login'] = $_POST['user']; 
    136                 } 
    137                 ldap_close($ldap_conn);*/ 
    138 ///     Fim - Código temporário: Para renomeação de login com organização para sem. ////// 
     122                if($_POST['user']) { 
     123                        if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) { 
     124                                $common = CreateObject('phpgwapi.common'); 
     125                                $ldap_conn = $common->ldapConnect(); 
     126                                $justthese = array("uid"); 
     127                                $filter="(&(phpgwAccountType=u)(uid=".$_POST['user']."))"; 
     128                                $ldap_search = ldap_search($ldap_conn, $GLOBALS['phpgw_info']['server']['ldap_context'], $filter, $justthese); 
     129                                $ldap_info       = ldap_get_entries($ldap_conn, $ldap_search); 
     130                                ldap_close($ldap_conn); 
     131                                if ($ldap_info['count'] != 0) { 
     132                                        $_POST['login'] = $_POST['user']; 
     133                                } 
     134                        } 
     135                        else 
     136                                $_POST['login'] = $_POST['user']; 
     137                } 
    139138                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 
    140139                        !isset($_SERVER['PHP_AUTH_USER']) && !isset($_SERVER['SSL_CLIENT_S_DN'])) 
     
    245244        if($GLOBALS['phpgw_info']['server']['use_prefix_organization']) 
    246245        { 
    247                 $organization_select = "<tr><td width=\"66\" class=\"loginLabel\">"; 
    248                 $organization_select .= lang("organization").":</td>"; 
    249                 $organization_select .="<td width=\"135\">";                                                                                     
    250                 $organization_select .="<select name=\"organization\">\n";               
    251                  
    252246                $obj_organization = CreateObject('phpgwapi.sector_search_ldap'); 
    253247                $organizations = $obj_organization->organization_search($GLOBALS['phpgw_info']['server']['ldap_context']); 
     
    272266                        $organization_select .= '>' . $organization_vars . "</option>\n"; 
    273267                } 
    274                 $organization_select .= "</select>\n"; 
    275                 $organization_select .="</td><td>&nbsp;</td></tr>"; 
     268                $organization_select =  '<div class="login_label"><label>'.lang("organization") 
     269                                                        .'</label><br><select name="organization">' 
     270                                                        .$organization_select.'</select></div>'; 
    276271                $tmpl->set_var('select_organization',$organization_select); 
    277272        } 
Note: See TracChangeset for help on using the changeset viewer.