OAuth: show reduced login screen

This commit is contained in:
Michael Kuron 2019-10-22 20:23:00 +02:00
parent 1db4d3d747
commit eccbb98002

View File

@ -31,7 +31,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
<div class="panel-heading"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <?= $lang['login']['login']; ?></div> <div class="panel-heading"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> <?= $lang['login']['login']; ?></div>
<div class="panel-body"> <div class="panel-body">
<div class="text-center mailcow-logo"><img src="<?=($main_logo = customize('get', 'main_logo')) ? $main_logo : '/img/cow_mailcow.svg';?>" alt="mailcow"></div> <div class="text-center mailcow-logo"><img src="<?=($main_logo = customize('get', 'main_logo')) ? $main_logo : '/img/cow_mailcow.svg';?>" alt="mailcow"></div>
<legend><?=$UI_TEXTS['main_name'];?></legend> <legend><?= isset($_SESSION['oauth2_request']) ? $lang['oauth2']['authorize_app'] : $UI_TEXTS['main_name'];?></legend>
<form method="post" autofill="off"> <form method="post" autofill="off">
<div class="form-group"> <div class="form-group">
<label class="sr-only" for="login_user"><?= $lang['login']['username']; ?></label> <label class="sr-only" for="login_user"><?= $lang['login']['username']; ?></label>
@ -49,6 +49,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-success" value="Login"><?= $lang['login']['login']; ?></button> <button type="submit" class="btn btn-success" value="Login"><?= $lang['login']['login']; ?></button>
<?php if(!isset($_SESSION['oauth2_request'])): ?>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button type="button" <?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? 'disabled="true"' : '' ?> class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button type="button" <?=(isset($_SESSION['mailcow_locale']) && count($AVAILABLE_LANGUAGES) === 1) ? 'disabled="true"' : '' ?> class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span> <span class="caret"></span> <span class="lang-sm lang-lbl" lang="<?= $_SESSION['mailcow_locale']; ?>"></span> <span class="caret"></span>
@ -63,6 +64,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
?> ?>
</ul> </ul>
</div> </div>
<?php endif ?>
</div> </div>
</form> </form>
<?php <?php
@ -72,6 +74,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
<?php <?php
endif; endif;
?> ?>
<?php if(!isset($_SESSION['oauth2_request'])): ?>
<legend><?=$UI_TEXTS['apps_name'];?></legend> <legend><?=$UI_TEXTS['apps_name'];?></legend>
<?php <?php
foreach ($MAILCOW_APPS as $app): foreach ($MAILCOW_APPS as $app):
@ -89,10 +92,12 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
endforeach; endforeach;
} }
} }
endif;
?> ?>
</div> </div>
</div> </div>
</div> </div>
<?php if(!isset($_SESSION['oauth2_request'])): ?>
<div class="col-md-offset-3 col-md-6"> <div class="col-md-offset-3 col-md-6">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
@ -112,6 +117,7 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
</div> </div>
</div> </div>
</div> </div>
<?php endif ?>
</div> </div>
</div><!-- /.container --> </div><!-- /.container -->
<?php <?php