indieauth/form.php
2024-07-17 16:00:11 +01:00

34 lines
1.2 KiB
PHP

<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>IndieAuth</title>
<link rel="stylesheet" type="text/css" href="/home.css" />
</head>
<body>
<h1>IndieAuth</h1>
<?php if ( ! is_null( $error ) ) : ?>
<h2 class="centre">Error</h2>
<p class="centre"><?php echo $error; ?></p>
<?php else : ?>
<h2 class="centre">Authenticate</h2>
<form method="POST" action="" class="centre">
<p>You are about to login with client <pre><?php echo htmlspecialchars($client_id); ?></pre></p>
<?php if ( strlen($scope) > 0) : ?>
<p>With the following scopes</p>
<fieldset>
<legend>Scopes</legend>
<?php foreach (explode(' ', $scope) as $n => $checkbox) : ?>
<div>
<input id="scope_<?php echo $n; ?>" type="checkbox" name="scopes[]" value="<?php echo htmlspecialchars($checkbox); ?>" checked />
<label for="scope_<?php echo $n; ?>"><?php echo $checkbox; ?></label>
</div>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<p>After login you will be redirected to <pre><?php echo htmlspecialchars($redirect_uri); ?></pre></p>
<input type="hidden" name="_csrf" value="<?php echo $csrf_code; ?>" />
<input class="submit" type="submit" name="submit" value="Submit" />
</form>
<?php endif ?>
</body>