include "{$docRoot}/inc/header.php"; ?> <div class="wrapper"> <div class="content"> <?php if (!isset($error)) { ?> <h1>Opth Login</h1> <p>Would you like to authorize <?php echo $server_name; ?> to do these processes :</p> <ul> <?php foreach ($scope as $item) { echo "<li>" . Opth::readable_scope($item) . "</li>"; } ?> </ul> <div class="auth_buttons"> <form method="POST" action="<?php echo \Fr\LS::curPageURL(); ?> "> <button class="button b-green" name="authorize">I Authorize</button> </form> <form method="POST" action="<?php echo \Fr\LS::curPageURL(); ?> "> <button class="button b-red" name="deny">No, I don't</button>
$sql = $OP->dbh->prepare("SELECT * FROM `opth_session` WHERE `uid` = ?"); $sql->execute(array($who)); $sites = $sql->fetchAll(PDO::FETCH_ASSOC); if (count($sites) == 0) { $OP->sss("No Sites", "You haven't authorized any site through Opth."); } else { echo "<table>\n <thead>\n <tr>\n <td>Site</td>\n <td>Permissions</td>\n <td>Authorized</td>\n <td>Expires</td>\n <td></td>\n </tr>\n </thead>\n <tbody>"; foreach ($sites as $site) { $site_info = $OP->dbh->prepare("SELECT `title` FROM `opth_sites` WHERE `id` = ?"); $site_info->execute(array($site['sid'])); $site_info = $site_info->fetch(PDO::FETCH_ASSOC); echo "<tr>"; echo "<td>{$site_info['title']}</td>"; echo "<td>"; foreach (unserialize($site['permissions']) as $perm) { echo "<li>" . Opth::readable_scope($perm) . "</li>"; } echo "</td>"; echo "<td>" . date("F j, Y", $site['created']) . "</td>"; echo "<td>" . date("F j, Y", $site['expiry']) . "</td>"; echo "<td><form method='POST'><input type='hidden' name='action' value='revoke' /><input type='hidden' name='id' value='{$site['sid']}' /><button class='red'>Revoke Access</button></form></td>"; echo "</tr>"; } echo "</tbody></table>"; } ?> <p style="color: red;">Note that after you revoke access, all data on the site being revoked will be lost.</p> <h1>Opth Dev</h1> <p>Would you like to implement Opth into your site ?</p> <p>See <a href="<?php echo HOST . "/opth/sites";