Skip to content
Snippets Groups Projects
Commit 91a70d0d authored by Tim van Dijen's avatar Tim van Dijen
Browse files

oauth: Add Twig templates

parent 6d71b372
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class sspmod_oauth_Registry {
protected function header($name) {
return '<tr ><td>&nbsp;</td><td class="header">' . $name . '</td></tr>';
return '<tr><td>&nbsp;</td><td class="header">' . $name . '</td></tr>';
}
......@@ -109,10 +109,10 @@ class sspmod_oauth_Registry {
public function metaToForm($metadata) {
return '<form action="registry.edit.php" method="post">' .
'<div id="tabdiv">' .
'<ul>' .
'<li><a href="#basic">Name and descrition</a></li>' .
'<ul class="tabset_tabs">' .
'<li class="tab-link current" data-tab="basic"><a href="#basic">Name and descrition</a></li>' .
'</ul>' .
'<div id="basic"><table class="formtable">' .
'<div id="basic" class="tabset_content current"><table class="formtable">' .
$this->standardField($metadata, 'name', 'Name of client') .
$this->standardField($metadata, 'description', 'Description of client', TRUE) .
$this->readonlyField($metadata, 'owner', 'Owner') .
......@@ -120,10 +120,9 @@ class sspmod_oauth_Registry {
$this->readonlyField($metadata, 'secret', 'Consumer Secret<br/>(Used for HMAC_SHA1 signatures)') .
$this->standardField($metadata, 'RSAcertificate', 'RSA certificate (PEM)<br/>(Used for RSA_SHA1 signatures)', TRUE) .
$this->standardField($metadata, 'callback_url', 'Static/enforcing callback-url') .
$this->hiddenField('field_secret', $metadata['secret']) .
'</table></div>' .
'</div>' .
$this->hiddenField('field_secret', $metadata['secret']) .
'<input type="submit" name="submit" value="Save" style="margin-top: 5px" />' .
'</form>';
}
......
{% set pagetitle = 'SimpleSAMLphp'|trans %}
{% extends "base.twig" %}
{% block preload %}
<link href="{{ baseurlpath }}resources/style.css" rel="stylesheet" />
{% endblock %}
{% block postload %}
<script src="{{ baseurlpath }}resources/javascript.js"></script>
{% endblock %}
{% block content %}
<h1>OAuth Client</h1>
{{ form|raw }}
<p style="float: right">
<a href="registry.php">Return to entity listing <strong>without saving...</strong></a>
</p>
{% endblock %}
{% set pagetitle = 'SimpleSAMLphp'|trans %}
{% extends "base.twig" %}
{% block preload %}
<link href="{{ baseurlpath }}style.css" rel="stylesheet" />
{% endblock %}
{% block content %}
<h1>OAuth Client Registry</h1>
<p>Here you can register new OAuth Clients. You are successfully logged in as {{ userid|escape('html') }}</p>
<h2>Your clients</h2>
<table class="metalist" style="width: 100%;">
{% for key, entryc in entries.mine %}
{% if loop.index0 % 2 == 0 %}
{% set class = 'even' %}
{% else %}
{% set class = 'odd' %}
{% endif %}
{% set entry = entryc.value %}
<tr class="{{ class }}">
<td>{{ entry.name|escape('html') }}</td>
<td><kbd>{{ entry.key|escape('html') }}</kbd></td>
<td>
<a href="registry.edit.php?editkey={{ entry.key|escape('url') }}">edit</a>
<a href="registry.php?delete={{ entry.key|escape('url') }}">delete</a>
</td>
</tr>
{% else %}
<tr><td colspan="3">No entries registered</td></tr>
{% endfor %}
</table>
<p><a href="registry.edit.php">Add new client</a></p>
<h2>Other clients</h2>
<table class="metalist" style="width: 100%">
{% for key, entryc in entries.others %}
{% if loop.index0 % 2 == 0 %}
{% set class = 'even' %}
{% else %}
{% set class = 'odd' %}
{% endif %}
{% set entry = entryc.value %}
<tr class="{{ class }}">
<td>{{ entry.name|escape('html') }}</td>
<td><kbd>{{ entry.key|escape('html') }}</kbd></td>
{% if eentry.owner is defined %}}
<td>{{ entry.owner|escape('html') }}</td>
{% else %}
<td>No owner</td>
{% endif %}
</tr>
{% else %}
<tr><td colspan="3">No entries registered</td></tr>
{% endfor %}
</table>
{% endblock%}
{% set pagetitle = 'SimpleSAMLphp'|trans %}
{% extends "base.twig" %}
{% block content %}
<h1>OAith Client saved</h1>
<p>
<a href="registry.php">Go back to OAuth client listing</a>
</p>
{% endblock %}
......@@ -4,7 +4,6 @@
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getSessionFromRequest();
$oauthconfig = SimpleSAML_Configuration::getOptionalConfig('module_oauth.php');
$store = new sspmod_core_Storage_SQLPermanentStorage('oauth');
$authsource = "admin"; // force admin to authenticate as registry maintainer
......
$(document).ready(function() {
$('ul.tabset_tabs li').click(
function() {
var tab_id = $(this).attr('data-tab');
$('ul.tabset_tabs li').removeClass('current');
$('.tabset_content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
$("html, body").animate({ scrollTop: 0 }, "slow");
}
)
})
......@@ -34,4 +34,52 @@ table.metalist tr td {
}
table.metalist tr.even td {
background: #e5e5e5;
}
\ No newline at end of file
}
@media all {
div#content {
margin: .4em ! important;
}
form {
display: inline;
}
ul.tabset_tabs {
margin: 0px;
padding: 0px;
list-style: none;
}
ul.tabset_tabs li {
background: none;
color: #222;
display: inline-block;
padding: 10px 15px;
cursor: pointer;
}
ul.tabset_tabs li.current {
background: #ededed;
color: #222;
}
.tabset_content {
display: none;
background: #ededed;
padding: 15px;
}
.tabset_content.current {
display: inherit;
}
#graph img {
max-width: 77%;
height: auto;
}
#table img {
max-width: 77%;
height: auto;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment