Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?php
2
require_once "Auth/HTTP.php";
3
define('DSN','sqlite://dummy:@localhost//tmp/user.db?mode=0644');
4
 
5
$options = array('dsn'=>DSN, 'authType'=>'digest');
6
$auth = new Auth_HTTP("DB", $options);
7
 
8
$auth->setRealm('dummy', 'sample');
9
$auth->start();
10
 
11
?>
12
<html>
13
<head><title>HTTP digest authentication for GET method</title></head>
14
<body>
15
<?php
16
print "auth: ".$auth->authMethod."<br />";
17
print "username: ".$auth->username."<br />";
18
print "password: ".$auth->password."<br />";
19
print "auth: ".print_r($auth->auth)."<br />";
20
if($auth->getAuth()) {
21
  print <<<EOS
22
<form action="{$_SERVER['PHP_SELF']}" method="get">
23
<input type="text" name="title" value="php5" />
24
<input type="submit" />
25
</form>
26
EOS;
27
}
28
if (!empty($_POST['title'])) {echo 'Title: '.$_POST['title'];}
29
?>
30
 
31
 
32
</body></html>