function showChangeScreen($extra = NULL, $resettoken = False, $user = NULL) { darwinHeader("Please provide new password"); darwinDialogStart("Change password"); if ($extra !== NULL) { echo "<div class='warning'>" . $extra . "</div>\n"; } echo "<form method='POST' acceptCharset='utf8'>\n"; echo " <table style='border:none'>\n"; if ($resettoken !== FALSE) { echo " <input type='hidden' value='{$resettoken}'/>\n"; echo " <tr><td><label for='#user'>Username:</label></td><td><input name='username' type='text' disabled value='{$user}'></td></tr>\n"; } else { if (is_admin()) { echo " <tr><td><label for='#user'>Username:</label></td><td><input name='username' type='text'></td></tr>\n"; } else { echo " <tr><td><label for='#password'>Current password:</label></td><td><input name='password' type='password'></td></tr>\n"; } } echo " <tr><td><label for='#newpassword'>New password:</label></td><td><input name='newpassword' type='password'></td></tr>\n"; echo " <tr><td><label for='#newpassword2'>Repeat new password:</label></td><td><input name='newpassword2' type='password'></td></tr>\n"; echo " </table><span style='margin-top:1em;float:right;'>"; echo "<input type='submit' value='Change'/>\n</form>"; if ($extra !== NULL) { } darwinDialogEnd(); darwinFooter(); }
function showSuccessScreen($db, $user) { updateauthtoken($db); if (isset($_REQUEST['redirect'])) { error_log(__FILE__ . ": redirecting"); header('Location: ' . $_REQUEST['redirect']); echo "Redirect!\n"; } setDarwinUser($user); darwinHeader("Welcome", "Welcome - Login successful"); echo "<p>Congratulations with successfully authenticating on darwin.</p>"; darwinFooter(); }
function showResetScreen($extra = NULL) { darwinHeader("Please give your username"); darwinDialogStart("Give your username"); if ($extra !== NULL) { echo "<div class='warning'>" . $extra . "</div>\n"; } echo "<form method='POST' acceptCharset='utf8'>\n"; echo " <div class='centerContents'><p style='width:22em;'>Please provide your BU username such that a reset email can be sent to your email address.</p></div>\n"; echo " <table style='border:none'>\n"; echo " <tr><td for='#user'><label>Username:</label></td><td><input name='user' type='text' />@bournemouth.ac.uk</td></tr>\n"; echo " </table><span style='margin-top:1em;float:right;'>"; echo "<input type='button' value='Cancel' onclick='window.open(\"login\")'/>"; echo "<input type='submit' value='Reset'/></span>\n</form>"; darwinDialogEnd(); darwinFooter(); }
function handleError($error, $code = 500, $status = "Server error") { global $__ERROR_HANDLING; if ($__ERROR_HANDLING) { echo "<div>Error handler called while handling error({$code}): {$error}</div>\n"; return; } $__ERROR_HANDLING = TRUE; header("HTTP/1.1 {$code} {$status}"); darwinHeader("Error: " . htmlentities($code . ' ' . $status), "Error (" . htmlentities($code) . ")", FALSE, TRUE); ?> <h2><?php print htmlentities($status); ?> </h2> <p style="margin-top: 2em"> <?php print " " . htmlentities(str_replace("\n", "<br />\n ", trim($error))) . "\n"; ?> </p> <h3>Backtrace</h3> <?php debug_print_backtrace(); darwinFooter(); exit; }
function showSuccessScreen() { darwinHeader("Bye", "Bye - Logged out"); echo "<p>You have successfully logged out</p>"; darwinFooter(); }
<?php require_once 'lib/authbase.php'; darwinHeader("Darwin", "Welcome"); darwinDialogStart("loading", "banner"); echo '<img src="assets/progress_large.gif" width="192" height="192" />'; darwinDialogEnd(); ?> <form id="xloginform" style="display:none;" method='POST' accept-charset='utf8' action='/accounts/login'> <table style='border:none'> <tr><td><label for='#username'>User name:</label></td><td><input name='username' type='text' /></td></tr> <tr><td><label for='#password'>Password:</label></td><td><input name='password' type='password' /></td></tr> </table> <input type='hidden' name="redirect" value="/"/> <span style='margin-top:1em;float:right;'><!-- --><input type='button' value='Cancel' name="cancel"/><!-- --><input type='button' value='Log in' name="login"/></span> <div id='forgotpasswd'><a href='/accounts/resetpasswd'>Forgot password</a></div> </form> <?php darwinFooter();