update openid for snakebite
This commit is contained in:
23
library/openid/example.php
Normal file
23
library/openid/example.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
require 'openid.php';
|
||||
try {
|
||||
# Change 'localhost' to your domain name.
|
||||
$openid = new LightOpenID('localhost');
|
||||
if(!$openid->mode) {
|
||||
if(isset($_POST['openid_identifier'])) {
|
||||
$openid->identity = $_POST['openid_identifier'];
|
||||
header('Location: ' . $openid->authUrl());
|
||||
}
|
||||
?>
|
||||
<form action="" method="post">
|
||||
OpenID: <input type="text" name="openid_identifier" /> <button>Submit</button>
|
||||
</form>
|
||||
<?php
|
||||
} elseif($openid->mode == 'cancel') {
|
||||
echo 'User has canceled authentication!';
|
||||
} else {
|
||||
echo 'User ' . ($openid->validate() ? $openid->identity . ' has ' : 'has not ') . 'logged in.';
|
||||
}
|
||||
} catch(ErrorException $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
Reference in New Issue
Block a user