/
login.inc.php
72 lines (66 loc) · 2.55 KB
/
login.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
if(!defined('OSTCLIENTINC')) die('Access Denied');
$email=Format::input($_POST['luser']?:$_GET['e']);
$passwd=Format::input($_POST['lpasswd']?:$_GET['t']);
$content = Page::lookupByType('banner-client');
if ($content) {
list($title, $body) = $ost->replaceTemplateVariables(
array($content->getLocalName(), $content->getLocalBody()));
} else {
$title = __('Sign In');
$body = __('To better serve you, we encourage our clients to register for an account and verify the email address we have on record.');
}
?>
<h1><?php echo Format::display($title); ?></h1>
<p><?php echo Format::display($body); ?></p>
<form action="login.php" method="post" id="clientLogin">
<?php csrf_token(); ?>
<div style="display:table-row">
<div class="login-box">
<strong><?php echo Format::htmlchars($errors['login']); ?></strong>
<div>
<input id="username" placeholder="<?php echo __('Email or Username'); ?>" type="text" name="luser" size="30" value="<?php echo $email; ?>" class="nowarn">
</div>
<div>
<input id="passwd" placeholder="<?php echo __('Password'); ?>" type="password" name="lpasswd" size="30" value="<?php echo $passwd; ?>" class="nowarn"></td>
</div>
<p>
<input class="btn" type="submit" value="<?php echo __('Sign In'); ?>">
<?php if ($suggest_pwreset) { ?>
<a style="padding-top:4px;display:inline-block;" href="pwreset.php"><?php echo __('Forgot My Password'); ?></a>
<?php } ?>
</p>
</div>
<div style="display:table-cell;padding: 15px;vertical-align:top">
<?php
$ext_bks = array();
foreach (UserAuthenticationBackend::allRegistered() as $bk)
if ($bk instanceof ExternalAuthentication)
$ext_bks[] = $bk;
if (count($ext_bks)) {
foreach ($ext_bks as $bk) { ?>
<div class="external-auth"><?php $bk->renderExternalLink(); ?></div><?php
}
}
if ($cfg && $cfg->isClientRegistrationEnabled()) {
if (count($ext_bks)) echo '<hr style="width:70%"/>'; ?>
<div style="margin-bottom: 5px">
<?php echo __('Not yet registered?'); ?> <a href="account.php?do=create"><?php echo __('Create an account'); ?></a>
</div>
<?php } ?>
<div>
<b><?php echo __("I'm an agent"); ?></b> —
<a href="<?php echo ROOT_PATH; ?>scp/"><?php echo __('sign in here'); ?></a>
</div>
</div>
</div>
</form>
<br>
<p>
<?php
if ($cfg->getClientRegistrationMode() != 'disabled'
|| !$cfg->isClientLoginRequired()) {
echo sprintf(__('If this is your first time contacting us or you\'ve lost the ticket number, please %s open a new ticket %s'),
'<a href="open.php">', '</a>');
} ?>
</p>