Hi people <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52115&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
CarlN,
there are many ways to disable error reporting in PHP.
For example you can call error_reporting() function at the beginning of the code:
error_reporting(0);
You can find an additional info on this topic in PHP documenttation.
I tried it, but it didn't work <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52115&image=2&table=forumreplies' class='bbc_emoticon' alt=':(' /> . As I said, I tried several ways <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52115&image=3&table=forumreplies' class='bbc_emoticon' alt=':(' />... I think can be the source of PHPRunner...
I also tried to put at the beginning of the code and got failed. At the middle too... and before my function.
To the best of my knowledge the following is an error:
Descrição do Erro ldap_bind() [function.ldap-bind]: Unable to bind to server: Invalid credentials
Make sure username/password that you use to connect to LDAP server are correct.
But the intention is precisely this. If the user or password is invalid, it returns false.
I made a clean code and worked without showing the error and breaking the app hehe... see below please <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52115&image=4&table=forumreplies' class='bbc_emoticon' alt=':)' />
<?php
function ValidarUsuario_FOB($strUsuario, $strSenha)
{
$ldap['user'] = $strUsuario;
$ldap['pass'] = $strSenha;
$ldap['host'] = 'xxx.xx.xx.xx';
$ldap['port'] = 389;
$ldap['dn'] = 'uid='.$ldap['user'].',ou=people,dc=fob,dc=usp,dc=br';
$ldap['base'] = '';
// Conectando ao LDAP
$ldap['conn'] = ldap_connect( $ldap['host'], $ldap['port'] );
ldap_set_option($ldap['conn'], LDAP_OPT_PROTOCOL_VERSION, 3);
//Tenta marcar a conexão... o @ é para evitar a mensdem de advertência
if (@ldap_bind( $ldap['conn'], $ldap['dn'], $ldap['pass'])) return true;
else return false;
}
if (ValidarUsuario_FOB("kaka", "teste")) echo "Authenticated!!!";
else
{
echo "Not authenticated!!!";
exit(0);
}
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");
include("include/dbcommon.php");
add_nocache_headers();
.
.
.
.
When I execute it, it shows "Not authenticated!!" without showing an error or a warning...!
Remember I put this in file called Login.php...
Thanks... <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=52115&image=5&table=forumreplies' class='bbc_emoticon' alt=':D' />