Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A nicer user interface #37

Merged
merged 2 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 39 additions & 72 deletions oauth/authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,78 +35,45 @@
exit('
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="./style.css">
<title>Authorisation Mattermost</title>
</head>

<body>


<center>
<table background="images/login.png" border="0" width="729" height="343" cellspacing="1" cellpadding="4">
<tr>
<td width="40%">&nbsp;</td>

<td width="60%">
<table border="0" width="100%">

<tr>
<td align="center">
<div class="LoginTitle">Mattermost desires access to your LDAP data:</div>


<form method="post">

<table border="0" width="90%" cellpadding="1">
<tr>
<td colspan="2" align="left">

<div class="messageLogin" align="center">

</div>
&nbsp;
</td>
</tr>
<tr>
<td align="center" width="100%" class="LoginUsername">
Login as : <b>' . $_SESSION['uid'] . ' </b>
</td>
</tr>
<tr>
<td align="left" width="100%" class="LoginUsername">

<br/>
Requested Data : <br/>
&nbsp; -> Username,<br/>
&nbsp; -> Full Name,<br/>
&nbsp; -> Email

</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr>
<td colspan="2" align="center"> <input type="submit" class="GreenButton" name="authorized" value="Authorize" >
<input type="submit" class="GreenButton" name="authorized" value="Deny" > </td>

</tr>


</table>
</form>

</td>
</tr>
</table>

</td>
</tr>
</table>
</center>
</body>
<head>
<link rel="stylesheet" type="text/css" href="./style.css">
<title>Mattermost - LDAP Authorization</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">

</head>

<body>
<div id="form-wrapper" style="text-align: center;">
<div id="form_credentials">
<h1>LDAP Authentication</h1>
<div id="form_icon">
<img src="./auth_icon.png" alt="authentication icon" >

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be: src="./images/auth_icon.png"

</div>
<br>
<h2>Authorize Mattermost to get the following data:</h2>
<table>
<tr>
<td>
&nbsp; <strong>Full Name</strong><br/>
&nbsp; <strong>E-mail</strong><br/>
&nbsp; For the user <strong>' . $_SESSION['uid'] . '</strong><br/>
</td>
</tr>
</table>
<br>

<form method="POST">
<input type="submit" value="Authorize" name="authorized" id="input_accept" class="input_field">
<input type="submit" value="Deny" name="authorized" id="input_deny" class="input_field">
</form>
</div>
</div>
</body>
</html>
');
');
}

// print the authorization code if the user has authorized your client
Expand All @@ -122,4 +89,4 @@
}

// Send message in case of error
$response->send();
$response->send();
77 changes: 0 additions & 77 deletions oauth/connexion.php

This file was deleted.

41 changes: 41 additions & 0 deletions oauth/form_prompt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="./style.css">
<title>LDAP Connection Interface</title>

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400" rel="stylesheet">

</head>

<body>
<div id="form-wrapper" style="text-align: center;">
<div id="form_credentials">
<h1>LDAP Authentication</h1>
<div id="form_icon_prompt">
<img src="./prompt_icon.png" alt="authentication icon" >

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be: src="./images/prompt_icon.png"

</div>
<br>

<form method="POST">
<div class="input_container">
<i class="fas fa-user"></i>
<input placeholder="Username" type="text" name="user" id="field_username" class="input_field">
</div><br>

<div class="input_container">
<i class="fas fa-lock"></i>
<input placeholder="Password" type="password" name="password" id="field_password" class="input_field">
</div><br>

<div class="err_msg">
</div>

<input type="submit" value="Login" name="login" id="input_login" class="input_field">
</form>
</div>
</div>
</body>
</html>
Binary file added oauth/images/auth_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added oauth/images/prompt_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading