Changeset 10087 for temp/trunk
- Timestamp:
- 2006/12/01 15:49:24 (20 years ago)
- File:
-
- 1 edited
-
temp/trunk/html/test/kakinaka/auth_http.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/html/test/kakinaka/auth_http.php
r10086 r10087 5 5 require_once($include_dir . "/pear/Auth_HTTP.php"); 6 6 7 define("DSN", "pgsql://kakinaka_db_user:[email protected]/kakinaka_db"); 7 //define("DSN", "pgsql://kakinaka_db_user:[email protected]/kakinaka_db"); 8 define("DSN", "mysql://user_db:[email protected]:3308/eccube_db"); 8 9 9 10 // ¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê 10 $AuthOptions = array( 11 'dsn'=>DSN, 12 'table'=>"dtb_member", // ¥Æ¡¼¥Ö¥ë̾ 13 'usernamecol'=>"login_id", // ¥æ¡¼¥¶Ì¾¤Î¥³¥é¥à 14 'passwordcol'=>"password", // ¥Ñ¥¹¥ï¡¼¥É¤Î¥³¥é¥à 15 //'cryptType'=>"none", // ¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Ç¤Î¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½·Á¼° 16 'cryptType'=>"none", // ¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Ç¤Î¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½·Á¼° 17 'db_fields'=>"*", // ¾¤Î¥³¥é¥à¤Î¼èÆÀ¤ò²Äǽ¤Ë¤¹¤ë 11 $arrDbConn = array( 12 'dsn'=>DSN, 13 'table'=>"dtb_member", // ¥Æ¡¼¥Ö¥ë̾ 14 'usernamecol'=>"login_id", // ¥æ¡¼¥¶Ì¾¤Î¥«¥é¥à 15 'passwordcol'=>"password", // ¥Ñ¥¹¥ï¡¼¥É¤Î¥«¥é¥à 16 'cryptType'=>"none", // ¥Ç¡¼¥¿¥Ù¡¼¥¹Ãæ¤Ç¤Î¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½·Á¼° 17 'db_fields'=>"*", // ¾¤Î¥«¥é¥à¤Î¼èÆÀ¤ò²Äǽ¤Ë¤¹¤ë 18 18 ); 19 19 20 $ a= new Auth_HTTP("DB", $AuthOptions);20 $objAuthHttp = new Auth_HTTP("DB", $AuthOptions); 21 21 22 $ a->setRealm('user realm');// Îΰè (realm) ̾23 $ a->setCancelText('<h2>Error 401</h2>');// ǧ¾Ú¤¬¼ºÇÔ¤·¤¿ºÝ¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸24 $ a->start(); // ǧ¾Ú¥×¥í¥»¥¹¤Î³«»Ï22 $objAuthHttp->setRealm('user realm'); // Îΰè (realm) ̾ 23 $objAuthHttp->setCancelText('Àܳ¥¨¥é¡¼'); // ǧ¾Ú¤¬¼ºÇÔ¤·¤¿ºÝ¤Ëɽ¼¨¤µ¤ì¤ë¥á¥Ã¥»¡¼¥¸ 24 $objAuthHttp->start(); // ǧ¾Ú¥×¥í¥»¥¹¤Î³«»Ï 25 25 26 if($ a->getAuth()) // ǧ¾Ú¤¹¤Ù¤¥æ¡¼¥¶¤«¤É¤¦¤«¤Î³Îǧ26 if($objAuthHttp->getAuth()) // ǧ¾Ú¤¹¤Ù¤¥æ¡¼¥¶¤«¤É¤¦¤«¤Î³Îǧ 27 27 { 28 echo "Hello " . $a->username . " welcome to my secret page <BR>"; 29 echo "Your details on file are: <BR>"; 30 echo $a->getAuthData('name'); // ¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¾¤Î¥Ç¡¼¥¿¤ò¼èÆÀ¤·¤Æ¤¤¤ë¡£ 31 echo $a->getAuthData('telephone'); // ¤³¤ÎÎã¤Ç¤Ï¡¢¥æ¡¼¥¶ID (userid)¡¢ÅÅÏÃÈÖ¹æ (telephone) 32 echo $a->getAuthData('name'); // ¤ª¤è¤Ó¥á¡¼¥ë¥¢¥É¥ì¥¹ (email) ¤ò¼èÆÀ¡£ 33 }; 34 35 sfprintr($a); 28 echo "ǧ¾ÚÀ®¸ù"; 29 echo $objAuthHttp->getAuthData('name'); // ¤ª¤è¤Ó¥á¡¼¥ë¥¢¥É¥ì¥¹ (email) ¤ò¼èÆÀ¡£ 30 } 36 31 37 32 ?>
Note: See TracChangeset
for help on using the changeset viewer.
