cvs: peardoc /ja/package/authentication/auth-http/auth-http example.xml example2.xml

From: Date: Wed, 14 Jul 2004 12:30:56 +0000
Subject: cvs: peardoc /ja/package/authentication/auth-http/auth-http example.xml example2.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-4598@lists.php.net to get a copy of this message
haruki Wed Jul 14 08:30:56 2004 EDT Added files: /peardoc/ja/package/authentication/auth-http/auth-http example.xml example2.xml Log: sync with en http://cvs.php.net/co.php/peardoc/ja/package/authentication/auth-http/auth-http/example.xml?r=1.1&p=1 Index: peardoc/ja/package/authentication/auth-http/auth-http/example.xml +++ peardoc/ja/package/authentication/auth-http/auth-http/example.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: haruki Status: ready --> <refentry id="package.authentication.auth-http.auth-http.example"> <refnamediv> <refname>Auth_HTTP 例</refname> <refpurpose>シンプルなパスワード保護の例</refpurpose> </refnamediv> <refsect1> &title.example; <programlisting role="php"> <![CDATA[ <?php // Auth_HTTP を使った基本的な実装の例 require_once("Auth/HTTP.php"); // データベース接続オプションの設定 $AuthOptions = array( 'dsn'=>"pgsql://test:test@localhost/testdb", 'table'=>"testable", // テーブル名 'usernamecol'=>"username", // ユーザ名のコラム 'passwordcol'=>"password", // パスワードのコラム 'cryptType'=>"none", // データベース中でのパスワードの暗号化形式 ); $a = new Auth_HTTP("DB", $AuthOptions); $a->setRealm('yourrealm'); // 領域 (realm) 名 $a->setCancelText('<h2>Error 401</h2>'); // 認証が失敗した際に表示されるメッセージ $a->start(); // 認証プロセスの開始 if($a->getAuth()) // 認証すべきユーザかどうかの確認 { echo "Hello $a->username welcome to my secret page"; }; ?> ]]> </programlisting> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/peardoc/ja/package/authentication/auth-http/auth-http/example2.xml?r=1.1&p=1 Index: peardoc/ja/package/authentication/auth-http/auth-http/example2.xml +++ peardoc/ja/package/authentication/auth-http/auth-http/example2.xml <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: haruki Status: ready --> <refentry id="package.authentication.auth-http.auth-http.example2"> <refnamediv> <refname>Auth_HTTP 例2</refname> <refpurpose>データベースからの列データの取得と MD5 パスワード使用の例</refpurpose> </refnamediv> <refsect1> &title.example; <programlisting role="php"> <![CDATA[ <?php // データベースからの列データの取得と MD5 パスワードを使用した例 require_once("Auth/HTTP.php"); // データベース接続オプションの設定 $AuthOptions = array( 'dsn'=>"pgsql://test:test@localhost/testdb", 'table'=>"testable", // テーブル名 'usernamecol'=>"username", // ユーザ名のコラム 'passwordcol'=>"password", // パスワードのコラム 'cryptType'=>"md5", // データベース中でのパスワードの暗号化形式 'dbFields'=>"*", // 他のコラムの取得を可能にする ); $a = new Auth_HTTP("DB", $AuthOptions); $a->setRealm('yourrealm'); // 領域 (realm) 名 $a->setCancelText('<h2>Error 401</h2>'); // 認証が失敗した際に表示されるメッセージ $a->start(); // 認証プロセスの開始 if($a->getAuth()) // 認証すべきユーザかどうかの確認 { echo "Hello $a->username welcome to my secret page <BR>"; echo "Your details on file are: <BR>"; echo $a->getAuthData('userid'); // データベースから他のデータを取得している。 echo $a->getAuthData('telephone'); // この例では、ユーザID (userid)、電話番号 (telephone) echo $a->getAuthData('email'); // およびメールアドレス (email) を取得。 }; ?> ]]> </programlisting> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->

« previous php.pear.doc (#4598) next »