cvs: peardoc /ja/package/authentication/auth-http/auth-http example.xml example2.xml
| From: | Haruki Setoyama | 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
-->