コード例 #1
0
         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
session_start();
include "../../includes/include_geral.inc.php";
include "../../includes/functions/browser_detection.php";
$browser = browser_detection('full');
$_SESSION['s_browser'] = $browser[0];
global $conec;
$conec = new conexao();
$conec->conecta('MYSQL');
if (AUTH_TYPE == "LDAP") {
    $conec->conLDAP(LDAP_HOST, LDAP_DOMAIN, LDAP_DN, LDAP_PASSWORD);
    $conecSec = new conexao();
    //Para testar no LDAP Labin
    $conecSec->conLDAP(LDAP_HOST, LDAP_DOMAIN_SEC, LDAP_DN, LDAP_PASSWORD);
    if (senha_ldap($_POST['login'], $_POST['password'], 'usuarios') == "ok" && ($conec->userLDAP($_POST['login'], $_POST['password']) || $conecSec->userLDAP($_POST['login'], $_POST['password']))) {
        $s_usuario = $_POST['login'];
        $s_senha = $_POST['password'];
        $queryOK = "SELECT u.*, n.*,s.* FROM usuarios u left join sistemas as s on u.AREA = s.sis_id " . "left join nivel as n on n.nivel_cod =u.nivel WHERE u.login = '******'login'] . "'";
        $resultadoOK = mysql_query($queryOK) or die('IMPOSSÍVEL ACESSAR A BASE DE DADOS DE USUÁRIOS: LOGIN.PHP');
        $row = mysql_fetch_array($resultadoOK);
        $s_nivel = $row['nivel'];
        if ($s_nivel < 4) {
            //Verifica se não está desabilitado
            $s_logado = 1;
        }
        $s_nivel_desc = $row['nivel_nome'];
        $s_area = $row['AREA'];
        $s_uid = $row['user_id'];
        $s_area_admin = $row['user_admin'];
        $s_screen = $row['sis_screen'];