Announcement

Collapse
No announcement yet.

[UPDATE 20th Feb] sc_set_global and some php code not workinkig since this morning

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [UPDATE 20th Feb] sc_set_global and some php code not workinkig since this morning

    Hi,

    I had a login form with the following "onvalidate" event...

    ________________

    require_once('C:\Program Files\NetMake\v7\components\php\includes\lib\nusoa p.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:

    1) 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.

    2) 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.

  • #2
    Bert reported this global issue. See http://forum.scriptcase.net/showthre...g-to-7-00-0002

    The soap message issue looks like something outside SC. The resultvalue itself is not checked, I mean you only get a result if you succeed? I don't see a catch for a soap fault message.
    Last edited by aducom; 02-20-2013, 06:08 PM.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      Hi,

      I just read the Bert`s post as soon as sent my message.....

      The workaround works perfectly, and someone is playing woth me today, because, as you suggested, I checked the webservice, and now, instead of returning a boolean, retuns a string with the word "true" or "false", so I have modified the if clause, and works Ok too.

      Thanks for you quik help.

      Rgds
      Fer.

      Comment

      Working...
      X