예제 #1
0
 public static function authenticate($login, $pwd)
 {
     if (self::isValidFunctionUser($GLOBALS["auth_username"], $GLOBALS["auth_password"])) {
         return true;
     }
     // ------------------------
     var_dump(auth::isValidPamUser($login, $pwd));
     var_dump(auth::isValidImapUser($login, $pwd));
     if (OK_TO_CALL_MYPEAR) {
         var_dump(auth::authenticateByMyPear($login, $pwd));
     }
     // --------------------------------------
     // -- Set access parameters for authenticated user
     // --------------------------------------
     //    self::setAccess($GLOBALS["documentClass"]);
     // ------------------------
     return true;
 }
예제 #2
0
 public static function Test()
 {
     error_reporting(E_ALL | E_STRICT);
     $stdout = "";
     if (!class_exists("auth", FALSE)) {
         require_once PATH_CLASSES . "/lib/auth.php";
     }
     // --------------------
     echo "<br>OK_TO_CALL_MYPEAR=";
     var_dump(OK_TO_CALL_MYPEAR);
     //    auth::initializeBauth();
     if (!isset($_GET["r"])) {
         $_GET["r"] = "";
     }
     if (!isset($_GET["T"])) {
         $_GET["T"] = "";
     }
     echo "<hr>hvzm -- r";
     var_dump(auth::isValidPamUser("hvzm", $_GET["r"]));
     var_dump(auth::isValidImapUser("hvzm", $_GET["r"]));
     echo "<hr>hvzm -- T";
     var_dump(auth::isValidPamUser("hvzm", $_GET["T"]));
     var_dump(auth::isValidImapUser("hvzm", $_GET["T"]));
     // ---------------------------------------
     // CORRECTIONS:
     //
     // /includes/bForm/Organiztion.inc l.16:
     // 'org_affil' => 'Affil' /* HVZM */
     // ---------------------------------------
     if (!empty($_GET["r"]) && !empty($_GET["T"])) {
         echo "<hr>";
         if (isset($_SESSION["nwAuth"])) {
             echo "SESSION[nwAuth]: ";
             debug::rr($_SESSION["nwAuth"]);
         }
         if (isset($_SESSION["bAuth"]["email"])) {
             debug::rr($_SESSION["bAuth"]["email"]);
         } else {
             echo "<p>0. No 'bAuth-email' defined";
         }
         echo "<pre>";
         echo "0. REQUEST ";
         debug::rr($_REQUEST);
         echo "0. SESSION ";
         print_r(array_keys($_SESSION));
         echo "0. COOKIE ";
         debug::rr(array_keys($_COOKIE));
         echo "</pre>";
         if (isset($_COOKIE["Nordita_Session"])) {
             echo "<p>0. session cookie: ";
             echo $_COOKIE["Nordita_Session"];
         } else {
             echo "<p>3. No session cookie";
         }
         #if (isset($_SESSION["nwAuth"]["authenticated"])) echo "<p>0. NW Session variable: ".$_SESSION["nwAuth"]["authenticated"]; else echo "<p>0. No NW session variable";
         #if (isset($_SESSION["bAuth"]["email"])) echo "<p>0. MYPEAR Session variable: ".$_SESSION["bAuth"]["email"]; else echo "<p>0. No MYPEAR session variable";
         if (isset($_SESSION["nwAuth"]["av"]) && is_array($_SESSION["nwAuth"]["av"]) && isset($_SESSION["nwAuth"]["av"]["av_identity"])) {
             echo "<p>0. av_identity: ";
             var_dump($_SESSION["nwAuth"]["av"]["av_identity"]);
         } else {
             echo "<p>0. No av_identity";
         }
     }
     // --------------------
     return $stdout;
 }