Hi,
I had a login form with the following “onvalidate” event…
require_once(‘C:\Program Files\NetMake\v7\components\php\includes\lib
usoap.php’);
unset ($result);
$usr = {User};
$pwd = {Password};
$wsdl = “http://xxxxxxxxxxxxxxxxxx/Services/PublicApiService.svc?wsdl”;
$client = new nusoap_client($wsdl, ‘wsdl’);
// Check for an error
$err = $client->getError();
if ($err) {
// Display the error
echo ‘<h2>Constructor error</h2><pre>’ . $err . ‘</pre>’;
// At this point, you know the call that follows will fail
}
$client->soap_defencoding = ‘UTF-8’;
$client->decode_utf8 = false;
$result = $client -> call(‘Logon’, array(‘login’ => $usr, ‘password’ => $pwd));
if (isset ($result[‘LogonResult’]))
{
$sql = “SELECT
usuarios.id_cuenta,
cuentas.nombre
FROM
usuarios INNER JOIN cuentas ON usuarios.id_cuenta = cuentas.id_cuenta
WHERE
(usuarios.login = '”.$usr."’)";
sc_lookup(ds,$sql);
$cuenta = {ds[0][0]};
$nombre = {ds[0][1]};
sc_set_global([nombre]);
sc_redir(Menu.php, glo_cuenta = $cuenta);
}
else
{
sc_error_message (“The system could not log you in. Please check your user login and password and try again.”);
}
With the last update, I have notice two things:
-
The sc_set_global is not working. I use this global variable (out) to show in the menu header the name of the logged user, but now, nothing is showed.
-
The if clause now always goes thru the TRUE side, no matter the value of the boolean, which means I have no security at all.
Has anyone notice something similar?
Thanks for any help.
Rgds
Fernando.