0
function User_CustomValidate(&$usr) {
    $appKey = "xxxxx";
    $safeurl =  'https://safe.xxxx.com/login/sso/SSOService?app=playbooks';

    // first call back after safe login - POST is set
    if ($_POST && isset($_POST['digest'])) 
    {
     $digest = $_POST["digest"];

     // set the session variables ...
     $_SESSION['username'] = $_POST["firstname"]." ".$_POST["lastname"];
     $_SESSION['firstname'] = $_POST["firstname"];
     $_SESSION['lastname'] = $_POST["lastname"];
     $_SESSION['email'] = $_POST["email"];
     $_SESSION['uid'] = $_POST["uid"];


     // Needed for key
     $uid = $_POST["uid"];
     $time = $_POST["time"];

     // Read the property file with the key and URL so this won't go into the main code ...
     // this sets $appKey and $safeurl

     $mykey = "".$uid.$time.$appKey;
     $mydigest = md5($mykey);
    }

    // session is not initialized as we never got the post above to set session vars
    // call now the safe login to get the post to set the session vars ...

    if (!isset($_SESSION['uid']) || empty($_SESSION['uid']))
    {

     // Read the property file with the key and URL so this won't go into the main code ...
     // this sets $appKey and $safeurl

     header("Location: ".$safeurl);
    }


    $usr = $_SESSION['uid'];        
    $this->setCurrentUserName($usr);
            return TRUE;   

    }   

SSO ダイジェスト データをアプリケーションに引き継ぐことになっている SSO 関数を作成しています。把握できない変数に問題があります。SESSION 変数はすべて機能しており、すべてのページでその結果を明確に確認できます。$_SESSION['uid'] を echo すると、SSO から渡された uid を確認できます。しかし、$usr からは何も得られません。$usr = $_SESSION['uid'] ステートメントがあり、何も返されません。ただし、$usr を '888888' に設定すると、静的な uid が返され、すべてが機能します。セッション uid を正しく渡すにはどうすればよいですか?

4

0 に答える 0