From 6c2eb1528d00f1844aedd594b416bf04d210c2eb Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 13:42:12 +0200 Subject: [PATCH 01/10] new loginpage --- .../themes/fancytheme/core/loginuserpass.php | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index d97dbe4..93e4d7b 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -40,28 +40,29 @@ if ($this->data['errorcode'] !== null) { <?php } ?> - <div class="container"> -<br/> - <form action="?" method="post" name="f" class="form-signin"> - <img src="/images/demo/m4lab_logo.jpg" class="img-responsive center-block" width="185" height="192"/> - <br/> - <input type="text" id="username" name="username" placeholder="Email" class="form-control"/> - <br/> - <input type="password" placeholder="Password" id="password" name="password" class="form-control"/> <br/> - <button id="submit_button" class="btn btn-outline-dark btn-block" name="Submit" value="Login" type="Submit" - >Login</button> - <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> - <?php - foreach ($this->data['stateparams'] as $name => $value) { - echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; - } - ?> - </form> - - <p align="middle">Need an account?!! <a href="https://m4lab.hft-stuttgart.de/account/registration">Signup</a>. Or go <a href="https://transfer.hft-stuttgart.de/">Home</a>.</p> - <p align="middle"><a href="https://m4lab.hft-stuttgart.de/account/forgotPwd">Reset Password</a></p> -</div> - + <div> + <div class="container"> + <div class="row"> + <div class="col-md-12" style="margin-bottom: 40px;"><img class="mx-auto" src="/img/Anmelden.png" width="100%"></div> + </div> + </div> + + <div class="login-clean" style="background-color: rgb(234,234,234);"> + <form method="post"> + <h2 class="sr-only">Login Form</h2> + <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> + <div class="form-group"><input class="form-control" type="email" name="email" placeholder="E-Mail-Adresse"></div> + <div class="form-group"><input class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> + <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> + <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> + <?php + foreach ($this->data['stateparams'] as $name => $value) { + echo '<input type="hidden" name="'.htmlspecialchars($name).'" value="'.htmlspecialchars($value).'" />'; + } + ?> + </form> + </div> + </div> <?php if (!empty($this->data['links'])) { echo '<ul class="links" style="margin-top: 2em">'; -- GitLab From 39cb6067a139e7328cd616a139e5a2322e66ce0a Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 13:56:54 +0200 Subject: [PATCH 02/10] changed css for login form --- mymodule/themes/fancytheme/includes/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mymodule/themes/fancytheme/includes/header.php b/mymodule/themes/fancytheme/includes/header.php index 7a6d839..0cc2e03 100644 --- a/mymodule/themes/fancytheme/includes/header.php +++ b/mymodule/themes/fancytheme/includes/header.php @@ -48,7 +48,7 @@ header('X-Frame-Options: SAMEORIGIN'); <title>M4_LAB: User Login</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.css"/> -<link rel="stylesheet" type="text/css" href="/css/custom/login.css"/> + <link rel="stylesheet" href="assets/css/Login-Form-Clean.css"> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -- GitLab From e61d1ed7495b423ec5b38e6597750cd443c899e7 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 14:03:27 +0200 Subject: [PATCH 03/10] changed css for login form --- mymodule/themes/fancytheme/includes/header.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mymodule/themes/fancytheme/includes/header.php b/mymodule/themes/fancytheme/includes/header.php index 0cc2e03..257a7a1 100644 --- a/mymodule/themes/fancytheme/includes/header.php +++ b/mymodule/themes/fancytheme/includes/header.php @@ -48,7 +48,7 @@ header('X-Frame-Options: SAMEORIGIN'); <title>M4_LAB: User Login</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" /> <link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.css"/> - <link rel="stylesheet" href="assets/css/Login-Form-Clean.css"> +<link rel="stylesheet" type="text/css" href="/css/Login-Form-Clean.css"/> <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -- GitLab From 94f7e4443b1f838d94fb2e8c4cb9297cdcac2dec Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 14:22:30 +0200 Subject: [PATCH 04/10] changed ids for login form --- mymodule/themes/fancytheme/core/loginuserpass.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index 93e4d7b..6b02f5e 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -51,8 +51,8 @@ if ($this->data['errorcode'] !== null) { <form method="post"> <h2 class="sr-only">Login Form</h2> <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> - <div class="form-group"><input class="form-control" type="email" name="email" placeholder="E-Mail-Adresse"></div> - <div class="form-group"><input class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> + <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> + <div class="form-group"><input id="password" class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> <?php -- GitLab From d54a4fad503f33dc66e1217e06dd201152ecb7c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 15:02:56 +0200 Subject: [PATCH 05/10] folder structure adapted --- mymodule/themes/fancytheme/{ => default}/includes/footer.php | 0 mymodule/themes/fancytheme/{ => default}/includes/header.php | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename mymodule/themes/fancytheme/{ => default}/includes/footer.php (100%) rename mymodule/themes/fancytheme/{ => default}/includes/header.php (100%) diff --git a/mymodule/themes/fancytheme/includes/footer.php b/mymodule/themes/fancytheme/default/includes/footer.php similarity index 100% rename from mymodule/themes/fancytheme/includes/footer.php rename to mymodule/themes/fancytheme/default/includes/footer.php diff --git a/mymodule/themes/fancytheme/includes/header.php b/mymodule/themes/fancytheme/default/includes/header.php similarity index 100% rename from mymodule/themes/fancytheme/includes/header.php rename to mymodule/themes/fancytheme/default/includes/header.php -- GitLab From 03fa79fa8a82cf6b852f4963ca439e52582fc34d Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Tue, 21 Apr 2020 15:05:57 +0200 Subject: [PATCH 06/10] adapted copyright notice to clarify simplesamlphp is meant --- mymodule/themes/fancytheme/default/includes/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mymodule/themes/fancytheme/default/includes/footer.php b/mymodule/themes/fancytheme/default/includes/footer.php index 82827ad..36b75fc 100644 --- a/mymodule/themes/fancytheme/default/includes/footer.php +++ b/mymodule/themes/fancytheme/default/includes/footer.php @@ -14,7 +14,7 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) { <div id="footer"> <hr /> <img src="/<?php echo $this->data['baseurlpath']; ?>resources/icons/ssplogo-fish-small.png" alt="Small fish logo" style="float: right" /> - Copyright © 2007-2019 <a href="http://uninett.no/">UNINETT AS</a> + simplesamlphp Copyright © 2007-2019 <a href="http://uninett.no/">UNINETT AS</a> <br style="clear: right" /> -- GitLab From 74c75ddbb0894203310d1f38bd6d600957fb02bc Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Wed, 22 Apr 2020 06:06:27 +0000 Subject: [PATCH 07/10] Update loginuserpass.php, moved error message beneath header graphic --- .../themes/fancytheme/core/loginuserpass.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index 6b02f5e..428329d 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -7,7 +7,16 @@ if (strlen($this->data['username']) > 0) { $this->data['autofocus'] = 'username'; } $this->includeAtTemplateBase('includes/header.php'); +?> + <div> + <div class="container"> + <div class="row"> + <div class="col-md-12" style="margin-bottom: 40px;"><img class="mx-auto" src="/img/Anmelden.png" width="100%"></div> + </div> + </div> + +<?php if ($this->data['errorcode'] !== null) { ?> <div style="border-left: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; background: #f5f5f5"> @@ -40,13 +49,7 @@ if ($this->data['errorcode'] !== null) { <?php } ?> - <div> - <div class="container"> - <div class="row"> - <div class="col-md-12" style="margin-bottom: 40px;"><img class="mx-auto" src="/img/Anmelden.png" width="100%"></div> - </div> - </div> - + <div class="login-clean" style="background-color: rgb(234,234,234);"> <form method="post"> <h2 class="sr-only">Login Form</h2> -- GitLab From fceb3f6846e4f3179580073bf2aabf935757e519 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Thu, 23 Apr 2020 11:38:45 +0200 Subject: [PATCH 08/10] hack to get admin recognized again --- mymodule/themes/fancytheme/core/loginuserpass.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index 428329d..0d6898f 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -14,7 +14,6 @@ $this->includeAtTemplateBase('includes/header.php'); <div class="col-md-12" style="margin-bottom: 40px;"><img class="mx-auto" src="/img/Anmelden.png" width="100%"></div> </div> </div> - <?php if ($this->data['errorcode'] !== null) { @@ -54,7 +53,14 @@ if ($this->data['errorcode'] !== null) { <form method="post"> <h2 class="sr-only">Login Form</h2> <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> - <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> + <?php + #hacky workaround: if admin is contained in AuthState string, don't dispaly email login field + if (strpos(_GET('AuthState'), 'admin') !== false){ + <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeholder="Administrator"></div> + }else{ + <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> + } + ?> <div class="form-group"><input id="password" class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> -- GitLab From e0b58d23f5121f2b95720550c26dcc2256b72258 Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Thu, 23 Apr 2020 11:52:15 +0200 Subject: [PATCH 09/10] hack to get admin recognized again --- .../themes/fancytheme/core/loginuserpass.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index 0d6898f..fc97c9b 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -54,13 +54,16 @@ if ($this->data['errorcode'] !== null) { <h2 class="sr-only">Login Form</h2> <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> <?php - #hacky workaround: if admin is contained in AuthState string, don't dispaly email login field - if (strpos(_GET('AuthState'), 'admin') !== false){ - <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeholder="Administrator"></div> - }else{ - <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> - } - ?> + if (strpos($_GET['AuthState'], 'admin') !== false){ + ?> + <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeho$ + <?php + }else{ + ?> + <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeh$ + <?php + } + ?> <div class="form-group"><input id="password" class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> -- GitLab From 1931ff7c5887b83dc8998f135db99efd4c00545b Mon Sep 17 00:00:00 2001 From: Wolfgang Knopki <wolfgang.knopki@hft-stuttgart.de> Date: Thu, 23 Apr 2020 12:16:31 +0200 Subject: [PATCH 10/10] hack to get admin recognized again --- .../themes/fancytheme/core/loginuserpass.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mymodule/themes/fancytheme/core/loginuserpass.php b/mymodule/themes/fancytheme/core/loginuserpass.php index fc97c9b..0e4b87f 100644 --- a/mymodule/themes/fancytheme/core/loginuserpass.php +++ b/mymodule/themes/fancytheme/core/loginuserpass.php @@ -53,17 +53,11 @@ if ($this->data['errorcode'] !== null) { <form method="post"> <h2 class="sr-only">Login Form</h2> <div class="illustration"><img src="/img/M4_LAB_LOGO.png" width="130"></div> - <?php - if (strpos($_GET['AuthState'], 'admin') !== false){ - ?> - <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeho$ - <?php - }else{ - ?> - <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeh$ - <?php - } - ?> + <?php if (strpos($_GET['AuthState'], 'admin') !== false) : ?> + <div class="form-group"><input id="username" class="form-control" type="text" name="username" placeholder="Administrator"></div> + <?php else : ?> + <div class="form-group"><input id="username" class="form-control" type="email" name="username" placeholder="E-Mail-Adresse"></div> + <?php endif; ?> <div class="form-group"><input id="password" class="form-control" type="password" name="password" placeholder="Passwort"></div><a class="text-right forgot" href="/account/forgotPwd">Passwort vergessen?</a> <div class="form-group"><button class="btn btn-primary btn-block" type="submit" style="background-color: #8a348b;"><strong>Anmelden</strong></button><a class="btn btn-primary btn-block" type="" style="background-color: rgb(234,234,234);color: rgb(0,0,0);" href="/account/registration"><strong>Neues Benutzerkonto anlegen</strong></a></div> <input type="hidden" id="processing_trans" value="<?php echo $this->t('{login:processing}'); ?>" /> -- GitLab