Skip to content
Snippets Groups Projects
Unverified Commit d332cbdc authored by lukasmatusiewicz's avatar lukasmatusiewicz Committed by GitHub
Browse files

Update: inline CSS

External CSS files don't work with some services. We have to check it before we delete the inline style.
parent 66856386
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,7 @@ if (strlen($this->data['username']) > 0) ...@@ -46,7 +46,7 @@ if (strlen($this->data['username']) > 0)
$this->data['autofocus'] = 'username'; $this->data['autofocus'] = 'username';
} }
$this->data['head'] .= '<link rel="stylesheet" href="' $this->data['head'] .= '<link rel="stylesheet" type="text/css" href="'
. htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/css/loginform.css'), ENT_QUOTES) . htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/css/loginform.css'), ENT_QUOTES)
. '" media="screen" />'; . '" media="screen" />';
...@@ -57,9 +57,9 @@ if ($this->data['errorCode'] !== NULL) ...@@ -57,9 +57,9 @@ if ($this->data['errorCode'] !== NULL)
{ {
?> ?>
<div class="error-dialog"> <div class="error-dialog" style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5">
<img src="/<?php echo htmlspecialchars($this->data['baseurlpath'], ENT_QUOTES); ?>resources/icons/experience/gtk-dialog-error.48x48.png" <img src="/<?php echo htmlspecialchars($this->data['baseurlpath'], ENT_QUOTES); ?>resources/icons/experience/gtk-dialog-error.48x48.png"
class="float-l erroricon" alt="gtk-dialog-error"/> class="float-l erroricon" style="margin: 15px " alt="gtk-dialog-error"/>
<h2><?php echo $this->t('{login:error_header}'); ?></h2> <h2><?php echo $this->t('{login:error_header}'); ?></h2>
<p> <p>
<strong><?php echo htmlspecialchars("Error " . $this->data['errorCode'] . ": " . $this->data['errorMessage']); ?></strong> <strong><?php echo htmlspecialchars("Error " . $this->data['errorCode'] . ": " . $this->data['errorMessage']); ?></strong>
...@@ -70,202 +70,209 @@ if ($this->data['errorCode'] !== NULL) ...@@ -70,202 +70,209 @@ if ($this->data['errorCode'] !== NULL)
} // end of errorcode } // end of errorcode
?> ?>
<div class="container"> <div class="container">
<div class="login"> <div class="login">
<div class="loginlogo"></div> <div class="loginlogo"></div>
<?php <?php
if ($this->data['authProcFilterScenario']) if ($this->data['authProcFilterScenario'])
{ {
echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title_challenge}')) . '</h2>'; echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title_challenge}')) . '</h2>';
} else } else
{
if ($this->data['step'] < 2)
{ {
if ($this->data['step'] < 2) echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title}')) . '</h2>';
{
echo '<h2>' . htmlspecialchars($this->t('{privacyidea:privacyidea:login_title}')) . '</h2>';
}
} }
?> }
?>
<form action="" method="POST" id="piLoginForm" name="piLoginForm" class="loginForm">
<div class="form-panel first valid" id="gaia_firstform"> <form action="" method="POST" id="piLoginForm" name="piLoginForm" class="loginForm">
<div class="slide-out "> <div class="form-panel first valid" id="gaia_firstform">
<div class="input-wrapper focused"> <div class="slide-out ">
<div class="identifier-shown"> <div class="input-wrapper focused">
<div class="identifier-shown">
<?php
if ($this->data['forceUsername'])
{
?>
<h3><?php echo htmlspecialchars($this->data['username']) ?></h3>
<input type="hidden" id="username" name="username"
value="<?php echo htmlspecialchars($this->data['username'], ENT_QUOTES) ?>"/>
<?php <?php
if ($this->data['forceUsername']) } else
{
?>
<label for="username"></label>
<input type="text" id="username" tabindex="1" name="username"
style="width:322px; margin:25px 15px 15px"
value="<?php echo htmlspecialchars($this->data['username'], ENT_QUOTES) ?>"
placeholder="<?php echo htmlspecialchars($this->t('{login:username}'), ENT_QUOTES) ?>"
/>
<br>
<?php
}
// Remember username in authproc
if (!$this->data['authProcFilterScenario'])
{
if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
{ {
?> $rowspan = 1;
<h3><?php echo htmlspecialchars($this->data['username']) ?></h3> } elseif (array_key_exists('organizations', $this->data))
<input type="hidden" id="username" name="username" {
value="<?php echo htmlspecialchars($this->data['username'], ENT_QUOTES) ?>"/> $rowspan = 3;
<?php
} else } else
{ {
?> $rowspan = 2;
<label for="username"></label>
<input type="text" id="username" tabindex="1" name="username"
value="<?php echo htmlspecialchars($this->data['username'], ENT_QUOTES) ?>"
placeholder="<?php echo htmlspecialchars($this->t('{login:username}'), ENT_QUOTES) ?>"
/>
<br>
<?php
} }
if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled'])
// Remember username in authproc
if (!$this->data['authProcFilterScenario'])
{ {
if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled']) if ($this->data['rememberUsernameEnabled'])
{
$rowspan = 1;
} elseif (array_key_exists('organizations', $this->data))
{ {
$rowspan = 3; echo str_repeat("\t", 4);
} else echo '<input type="checkbox" id="rememberUsername" tabindex="4" name="rememberUsername"
{ value="Yes" ';
$rowspan = 2; echo $this->data['rememberUsernameChecked'] ? 'checked="Yes" /> ' : '/> ';
echo htmlspecialchars($this->t('{login:remember_username}'));
} }
if ($this->data['rememberUsernameEnabled'] || $this->data['rememberMeEnabled']) if ($this->data['rememberMeEnabled'])
{ {
if ($this->data['rememberUsernameEnabled']) echo str_repeat("\t", 4);
{ echo '<input type="checkbox" id="rememberMe" tabindex="4" name="rememberMe" value="Yes" ';
echo str_repeat("\t", 4); echo $this->data['rememberMeChecked'] ? 'checked="Yes" /> ' : '/> ';
echo '<input type="checkbox" id="rememberUsername" tabindex="4" name="rememberUsername" echo htmlspecialchars($this->t('{login:remember_me}'));
value="Yes" ';
echo $this->data['rememberUsernameChecked'] ? 'checked="Yes" /> ' : '/> ';
echo htmlspecialchars($this->t('{login:remember_username}'));
}
if ($this->data['rememberMeEnabled'])
{
echo str_repeat("\t", 4);
echo '<input type="checkbox" id="rememberMe" tabindex="4" name="rememberMe" value="Yes" ';
echo $this->data['rememberMeChecked'] ? 'checked="Yes" /> ' : '/> ';
echo htmlspecialchars($this->t('{login:remember_me}'));
}
} }
} ?>
<!-- Pass and OTP fields -->
<label for="password"></label>
<input id="password" name="password" tabindex="1" type="password" value="" class="text"
placeholder="<?php echo htmlspecialchars($passHint, ENT_QUOTES) ?>"/>
<strong id="message"><?php echo $this->data['message'] ?></strong>
<label for="otp"></label>
<input id="otp" name="otp" tabindex="1" type="password" value="" class="text"
placeholder="<?php echo htmlspecialchars($otpHint, ENT_QUOTES) ?>"/>
<br>
<input id="submitButton" tabindex="1" class="rc-button rc-button-submit" type="submit"
name="Submit"
value="<?php echo htmlspecialchars($this->t('{login:login_button}'), ENT_QUOTES) ?>"/>
<!-- Hidden input which store the info about changes for future use in backend-->
<input id="mode" type="hidden" name="mode" value="<?php echo $this->data['mode'] ?>"/>
<input id="pushAvailable" type="hidden" name="pushAvailable"
value="<?php echo $this->data['pushAvailable'] ?>"/>
<input id="otpAvailable" type="hidden" name="otpAvailable"
value="<?php echo $this->data['otpAvailable'] ?>"/>
<input id="webAuthnSignRequest" type="hidden" name="webAuthnSignRequest"
value='<?php echo $this->data['webAuthnSignRequest'] ?>'/>
<input id="u2fSignRequest" type="hidden" name="u2fSignRequest"
value='<?php echo $this->data['u2fSignRequest'] ?>'/>
<input id="modeChanged" type="hidden" name="modeChanged" value="0"/>
<input id="step" type="hidden" name="step"
value="<?php echo $this->data['step'] ?>"/>
<input id="webAuthnSignResponse" type="hidden" name="webAuthnSignResponse" value=""/>
<input id="u2fSignResponse" type="hidden" name="u2fSignResponse" value=""/>
<input id="origin" type="hidden" name="origin" value=""/>
<input id="loadCounter" type="hidden" name="loadCounter"
value="<?php echo $this->data['loadCounter'] ?>"/>
<!-- Additional input to persist the message -->
<input type="hidden" name="message"
value="<?php echo $this->data['message'] ?>"/>
<?php
// If enrollToken load QR Code
if (isset($this->data['tokenQR']))
{
echo htmlspecialchars($this->t('{privacyidea:privacyidea:scanTokenQR}'));
?>
<div class="tokenQR">
<?php echo '<img src="' . $this->data['tokenQR'] . '" />'; ?>
</div>
<?php
} }
?> } ?>
</div>
<!-- Pass and OTP fields -->
<label for="password"></label>
<input id="password" name="password" tabindex="1" type="password" value="" class="text"
placeholder="<?php echo htmlspecialchars($passHint, ENT_QUOTES) ?>"
style="width:322px; margin:15px"/>
<strong id="message"><?php echo $this->data['message'] ?></strong>
<br>
<label for="otp"></label>
<input id="otp" name="otp" tabindex="1" type="password" value="" class="text"
placeholder="<?php echo htmlspecialchars($otpHint, ENT_QUOTES) ?>"
style="width:322px; margin: 25px 15px 7px"/>
<br>
<input id="submitButton" tabindex="1" class="rc-button rc-button-submit" type="submit"
name="Submit" style="width:210px; margin:0 15px 7px"
value="<?php echo htmlspecialchars($this->t('{login:login_button}'), ENT_QUOTES) ?>"/>
<!-- Hidden input which store the info about changes for future use in backend-->
<input id="mode" type="hidden" name="mode" value="<?php echo $this->data['mode'] ?>"/>
<input id="pushAvailable" type="hidden" name="pushAvailable"
value="<?php echo $this->data['pushAvailable'] ?>"/>
<input id="otpAvailable" type="hidden" name="otpAvailable"
value="<?php echo $this->data['otpAvailable'] ?>"/>
<input id="webAuthnSignRequest" type="hidden" name="webAuthnSignRequest"
value='<?php echo $this->data['webAuthnSignRequest'] ?>'/>
<input id="u2fSignRequest" type="hidden" name="u2fSignRequest"
value='<?php echo $this->data['u2fSignRequest'] ?>'/>
<input id="modeChanged" type="hidden" name="modeChanged" value="0"/>
<input id="step" type="hidden" name="step"
value="<?php echo $this->data['step'] ?>"/>
<input id="webAuthnSignResponse" type="hidden" name="webAuthnSignResponse" value=""/>
<input id="u2fSignResponse" type="hidden" name="u2fSignResponse" value=""/>
<input id="origin" type="hidden" name="origin" value=""/>
<input id="loadCounter" type="hidden" name="loadCounter"
value="<?php echo $this->data['loadCounter'] ?>"/>
<!-- Additional input to persist the message -->
<input type="hidden" name="message"
value="<?php echo $this->data['message'] ?>"/>
<?php <?php
// Organizations // If enrollToken load QR Code
if (array_key_exists('organizations', $this->data)) if (isset($this->data['tokenQR']))
{ {
echo htmlspecialchars($this->t('{privacyidea:privacyidea:scanTokenQR}'));
?> ?>
<div class="identifier-shown"> <div class="tokenQR">
<?php echo htmlspecialchars($this->t('{login:organization}')); ?> <?php echo '<img src="' . $this->data['tokenQR'] . '" />'; ?>
<label> </div>
<select name="organization" tabindex="3"> <?php
}
?>
</div>
<?php
// Organizations
if (array_key_exists('organizations', $this->data))
{
?>
<div class="identifier-shown">
<?php echo htmlspecialchars($this->t('{login:organization}')); ?>
<label>
<select name="organization" tabindex="3">
<?php
if (array_key_exists('selectedOrg', $this->data))
{
$selectedOrg = $this->data['selectedOrg'];
} else
{
$selectedOrg = NULL;
}
foreach ($this->data['organizations'] as $orgId => $orgDesc)
{
if (is_array($orgDesc))
{
$orgDesc = $this->t($orgDesc);
}
<?php if ($orgId === $selectedOrg)
if (array_key_exists('selectedOrg', $this->data))
{ {
$selectedOrg = $this->data['selectedOrg']; $selected = 'selected="selected" ';
} else } else
{ {
$selectedOrg = NULL; $selected = '';
} }
foreach ($this->data['organizations'] as $orgId => $orgDesc) echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId, ENT_QUOTES) . '">' . htmlspecialchars($orgDesc) . '</option>';
{ } ?>
if (is_array($orgDesc)) </select>
{ </label>
$orgDesc = $this->t($orgDesc); </div>
} <?php } ?>
</div> <!-- focused -->
if ($orgId === $selectedOrg) </div> <!-- slide-out-->
{ </div> <!-- form-panel -->
$selected = 'selected="selected" ';
} else <div id="AlternateLoginOptions" style="margin-top:35px" class="groupMargin">
{ <h3><label><?php echo $this->t('{privacyidea:privacyidea:alternate_login_options}'); ?></label></h3>
$selected = ''; <!-- Alternate Login Options-->
} <input id="useWebAuthnButton" name="useWebAuthnButton" type="button" value="WebAuthn"
style="width:140px; margin:15px 10px 7px"/>
echo '<option ' . $selected . 'value="' . htmlspecialchars($orgId, ENT_QUOTES) . '">' . htmlspecialchars($orgDesc) . '</option>'; <input id="usePushButton" name="usePushButton" type="button" value="Push"
} ?> style="width:140px; margin:15px 10px 7px"/>
</select> <input id="useOTPButton" name="useOTPButton" type="button" value="OTP"
</label> style="width:140px; margin:15px 15px 7px"/>
</div> <input id="useU2FButton" name="useU2FButton" type="button" value="U2F"
<?php } ?> style="width:140px; margin:15px 10px 7px"/>
</div> <!-- focused --> </div>
</div> <!-- slide-out--> </form>
</div> <!-- form-panel -->
<?php
<div id="AlternateLoginOptions" class="groupMargin"> // Logout
<h3><label><?php echo $this->t('{privacyidea:privacyidea:alternate_login_options}'); ?></label></h3> if (isset($this->data['LogoutURL']))
<!-- Alternate Login Options--> { ?>
<input id="useWebAuthnButton" name="useWebAuthnButton" type="button" value="WebAuthn"/> <p>
<input id="usePushButton" name="usePushButton" type="button" value="Push"/> <a href="<?php echo htmlspecialchars($this->data['LogoutURL']); ?>"><?php echo $this->t('{status:logout}'); ?></a>
<input id="useOTPButton" name="useOTPButton" type="button" value="OTP"/> </p>
<input id="useU2FButton" name="useU2FButton" type="button" value="U2F"/> <?php } ?>
</div> </div> <!-- End of login -->
</form> </div> <!-- End of container -->
<?php
// Logout
if (isset($this->data['LogoutURL']))
{ ?>
<p>
<a href="<?php echo htmlspecialchars($this->data['LogoutURL']); ?>"><?php echo $this->t('{status:logout}'); ?></a>
</p>
<?php } ?>
</div> <!-- End of login -->
</div> <!-- End of container -->
<?php <?php
if (!empty($this->data['links'])) if (!empty($this->data['links']))
{ {
echo '<ul class="links">'; echo '<ul class="links" style="margin-top: 2em">';
foreach ($this->data['links'] as $l) foreach ($this->data['links'] as $l)
{ {
echo '<li><a href="' . htmlspecialchars($l['href'], ENT_QUOTES) . '">' . htmlspecialchars($this->t($l['text'])) . '</a></li>'; echo '<li><a href="' . htmlspecialchars($l['href'], ENT_QUOTES) . '">' . htmlspecialchars($this->t($l['text'])) . '</a></li>';
...@@ -274,33 +281,34 @@ if (!empty($this->data['links'])) ...@@ -274,33 +281,34 @@ if (!empty($this->data['links']))
} }
?> ?>
<script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/webauthn.js'), ENT_QUOTES) ?>"> <script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/webauthn.js'), ENT_QUOTES) ?>">
</script> </script>
<script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/u2f-api.js'), ENT_QUOTES) ?>"> <script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/u2f-api.js'), ENT_QUOTES) ?>">
</script> </script>
<meta id="privacyidea-step" name="privacyidea-step" content="<?php echo $this->data['step'] ?>"> <meta id="privacyidea-step" name="privacyidea-step" content="<?php echo $this->data['step'] ?>">
<meta id="privacyidea-hide-alternate" name="privacyidea-hide-alternate" content="<?php echo ( <meta id="privacyidea-hide-alternate" name="privacyidea-hide-alternate" content="<?php echo (
!$this->data['pushAvailable'] !$this->data['pushAvailable']
&& (($this->data['u2fSignRequest']) == "") && (($this->data['u2fSignRequest']) == "")
&& (($this->data['webAuthnSignRequest']) == "") && (($this->data['webAuthnSignRequest']) == "")
) ? 'true' : 'false'; ?>"> ) ? 'true' : 'false'; ?>">
<meta id="privacyidea-translations" name="privacyidea-translations" content="<?php <meta id="privacyidea-translations" name="privacyidea-translations" content="<?php
$translations = []; $translations = [];
$translation_keys = [ $translation_keys = [
'alert_webauthn_insecure_context', 'alert_webauthn_unavailable', 'alert_webAuthnSignRequest_error', 'alert_webauthn_insecure_context', 'alert_webauthn_unavailable', 'alert_webAuthnSignRequest_error',
'alert_u2f_insecure_context', 'alert_u2f_unavailable', 'alert_U2FSignRequest_error', 'alert_u2f_insecure_context', 'alert_u2f_unavailable', 'alert_U2FSignRequest_error',
]; ];
foreach ($translation_keys as $translation_key) { foreach ($translation_keys as $translation_key)
$translations[$translation_key] = $this->t(sprintf('{privacyidea:privacyidea:%s}', $translation_key)); {
} $translations[$translation_key] = $this->t(sprintf('{privacyidea:privacyidea:%s}', $translation_key));
echo htmlspecialchars(json_encode($translations)); }
?>"> echo htmlspecialchars(json_encode($translations));
?>">
<script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/loginform.js'), ENT_QUOTES) ?>"> <script src="<?php echo htmlspecialchars(SimpleSAML_Module::getModuleUrl('privacyidea/js/loginform.js'), ENT_QUOTES) ?>">
</script> </script>
<?php <?php
$this->includeAtTemplateBase('includes/footer.php'); $this->includeAtTemplateBase('includes/footer.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment