first commit

This commit is contained in:
2025-07-18 16:20:14 +07:00
commit 98af45c018
16382 changed files with 3148096 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
{% set pagetitle = 'Test Authentication Sources'|trans %}
{% set frontpage_section = 'test' %}
{% extends "base.twig" %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
<h2>{{ pagetitle }} </h2>
<ul>
{% for key, name in sources %}
<li><a href="{{ moduleURL('admin/test/' ~ name|escape('url')) }}">{{ name }}</a></li>
{% endfor %}
</ul>
{% endblock %}

View File

@@ -0,0 +1,80 @@
{% set pagetitle = 'SimpleSAMLphp installation page'|trans %}
{% set frontpage_section = 'main' %}
{% extends "base.twig" %}
{% block preload %}
<link rel="stylesheet" href="{{ asset('css/admin.css', 'admin') }}">
{% endblock %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
{%- for key, warning in warnings %}
{%- if warning is iterable %}
<div class="message-box warning">{{ warning[0]|trans(warning[1])|raw }}</div>
{%- else %}
<div class="message-box warning">{{ warning|trans|raw }}</div>
{%- endif %}
{%- endfor %}
<div class="message-box">
{% trans %}SimpleSAMLphp is installed in:{% endtrans %}
<kbd>{{ directory }}</kbd><br/>
{% trans with {
'%version%': version
} %}You are running version <kbd>%version%</kbd>.{% endtrans %}
</div>
<h2>{% trans %}Modules{% endtrans %}</h2>
{% trans %}You have the following modules installed{% endtrans %} (<i class="fa fa-ban" title="{% trans %}disabled{% endtrans %}"></i> {% trans %} means the module is not enabled{% endtrans %}):
<ul class="modulelist">
<li>
<i class="fa fa-{%- if enablematrix.saml20idp %}check" title="{% trans %}enabled{% endtrans %}"{% else %}ban" title="{% trans %}disabled{% endtrans %}"{% endif %}></i>
SAML 2.0 IdP
</li>
{% for module, enabled in modulelist %}
<li>
<i class="fa fa-{%- if enabled %}check" title="{% trans %}enabled{% endtrans %}"{% else %}ban" title="{% trans %}disabled{% endtrans %}"{% endif %}></i>
{{ module }}
</li>
{% endfor %}
</ul>
<h2>{% trans %}Details{% endtrans %}</h2>
<ul>
{%- for key, link in links %}
<li><a href="{{ link.href }}">{{ link.text|trans }}</a></li>
{%- endfor %}
</ul>
<h2>{% trans %}Your PHP installation{% endtrans %}</h2>
<div class="enablebox">
<table>
{%- for key, func in funcmatrix %}
<tr class="{%- if func.enabled %}enabled{% else %}disabled{% endif -%}">
<td><i class="fa fa-{%- if func.enabled %}check{% else %}ban{% endif -%}"></i></td>
<td>
{%- if func.required == 'required' %}
{%- trans %}required{% endtrans %}
{%- else %}
{%- trans %}optional{% endtrans %}
{%- endif -%}
</td>
<td>
{%- if func.descr is iterable -%}
{{ func.descr[0]|trans(func.descr[1]|raw) }}
{%- else -%}
{{ func.descr|trans|raw }}
{%- endif -%}
</td>
</tr>
{%- endfor %}
</table>
</div>
{% endblock %}

View File

@@ -0,0 +1,20 @@
{% set pagetitle = 'Diagnostics on hostname, port and protocol'|trans %}
{% set frontpage_section = 'main' %}
{% extends "base.twig" %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
<h2>{{ pagetitle }} </h2>
{%- embed "_table.twig" %}
{%- block namecol %}
<td class="attrname"><samp>{{ name }}</samp></td>
{%- endblock namecol %}
{%- block value %}
{{ value }}
{%- endblock value %}
{%- endembed %}
{% endblock %}

View File

@@ -0,0 +1,158 @@
{% set pagetitle = 'SimpleSAMLphp installation page'|trans %}
{% set frontpage_section = 'federation' %}
{% extends "base.twig" %}
{% block preload %}
<link rel="stylesheet" href="{{ asset('css/admin.css', 'admin') }}">
{% endblock %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
{%- if entries.hosted is iterable %}
<h2>{% trans %}Hosted entities{% endtrans %}</h2>
{%- for key, set in entries.hosted %}
{%- if not loop.first %}
<br/>
{%- endif %}
{%- embed "includes/expander.twig" %}
{%- block general %}
<dl>
<dt>{{ set|entityDisplayName }}</dt>
<dd>EntityID: <code>{{ set.entityid }}</code>
{% if set.type == 'saml20-idp-hosted' and set.host is defined %}
(hostname:
{% if set.host == '__DEFAULT__' %}
<em>{{ 'default'|trans }}</em>
{%- else %}
<code>{{ set.host }}</code>
{%- endif -%}
)
{% endif %}
</dd>
{%- if set.deprecated is defined and set.deprecated %}
<dd><span class="entity-deprecated">{{ 'Deprecated'|trans }}</span></dd>
{%- endif %}
{% set index = attribute(set, 'metadata-index')|default(false) %}
{%- if index and set.entityid != index %}
<dd>Index: <code>{{ index }}</code></dd>
{%- endif %}
<dd>{% trans %}Type:{% endtrans %} <strong>{{ mdtype[set.type]|trans }}</strong></dd>
</dl>
{%- endblock %}
{%- block content %}
<dl>
<dt>{% trans %}SAML Metadata{% endtrans %}</dt>
<dd>{% trans %}You can get the metadata XML on a dedicated URL:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#url-{{ key }}"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
<a class="pure-button hljs" href="{{ set.url }}">
<span class="fa fa-external-link-square-alt"></span>
</a>
</div>
<code id="url-{{ key }}" class="code-box-content">{{ set.url }}</code>
</dd>
<dd>{% trans %}In SAML 2.0 Metadata XML format:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#xml-{{ key }}"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="xml-{{ key }}" class="code-box-content xml">{{ set.metadata }}</div>
</dd>
<dt>{% trans %}SimpleSAMLphp Metadata{% endtrans %}</dt>
<dd>{% trans %}Use this if you are using a SimpleSAMLphp entity on the other side:{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#php-{{ key }}"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="php-{{ key }}" class="code-box-content php">
{#- #}$metadata['{{ set.entityid }}'] = {{ set.metadata_array }};{# -#}
</div>
</dd>
{%- for cert in set.certificates %}
{%- if loop.first %}
<dt>{% trans %}Certificates{% endtrans %}</dt>
<ul>
{%- endif %}
<li>
<a href="{{ cert.url }}"><i class="fa fa-download"></i>{{ cert.name | default('cert') }}
{#- #}{% if cert.signing %}-signing{% endif %}
{#- #}{% if cert.encryption %}-encryption{% endif %}.pem
{#- #}{% if cert.prefix %} ({% trans %}new{% endtrans %}){% endif %}</a>
</li>
{%- if loop.last %}
</ul>
{%- endif %}
{%- endfor %}
</dl>
{%- endblock %}
{%- endembed %}
{%- endfor %}
{%- endif %}
<h2>{% trans %}Trusted entities{% endtrans %}</h2>
{%- if entries.remote is iterable %}
{%- for key, set in entries.remote %}
<fieldset class="fancyfieldset">
<legend>{{ mdtype[key]|trans }}</legend>
<ul>
{% for entityid, entity in set %}
<li><a href="{{ moduleURL('admin/federation/show?entityid=' ~ (entity.entityid|url_encode) ~ '&set=' ~ key) }}">
{{- entity | entityDisplayName -}}
</a>
{% if entity.expire is defined %}
{% if entity.expire < date().timestamp %}
<span class="entity-expired"> ({% trans %}expired{% endtrans %} {{ entity.expire | format_datetime('short', 'short', locale=currentLanguage) }})</span>
{% else %}
<span class="entity-expires"> ({% trans %}expires{% endtrans %} {{ entity.expire | format_datetime('short', 'short', locale=currentLanguage) }})</span>
{% endif %}
{% endif %}
</li>
{% endfor %}
</ul>
</fieldset>
{% endfor %}
{% endif %}
<h2>{% trans %}Tools{% endtrans %}</h2>
<ul>
{%- for key, link in links %}
<li><a href="{{ link.href }}">{{ link.text|trans }}</a></li>
{%- endfor %}
</ul>
<form action="{{ moduleURL('admin/federation/show') }}" method="get" class="pure-form">
<fieldset class="fancyfieldset">
<legend>{% trans %}Look up metadata for entity:{% endtrans %}</legend>
<select name="set" aria-labelledby="lookupbutton">
{%- if entries.remote %}
{%- for key, set in entries.remote %}
<option value="{{ key|escape }}">{{ mdtype[key]|trans }}</option>
{%- endfor %}
{%- endif %}
</select>
<input type="text" name="entityid" placeholder="{% trans %}EntityID{% endtrans %}">
<button class="pure-button pure-button-red" type="submit" id="lookupbutton">{% trans %}Search{% endtrans %}</button>
</fieldset>
</form>
{% endblock %}

View File

@@ -0,0 +1,15 @@
<div class="pure-g frontpage-menu">
<div class="pure-u-2-3">
<div class="pure-menu pure-menu-horizontal">
<ul class="pure-menu-list">
{%- for id,option in menu %}
<li class="pure-menu-item{% if frontpage_section == id %} pure-menu-selected{% endif %}">
<a href="{{ option.url }}" class="pure-menu-link">{{ option.name|trans }}</a>
</li>
{%- endfor %}
</ul>
</div>
</div>
</div>

View File

@@ -0,0 +1,10 @@
{% set pagetitle = 'Logged out'|trans %}
{% extends "base.twig" %}
{% block content %}
<h1>{{ 'Logged out'|trans }}</h1>
<br>
<h3>{% trans %}You have been logged out.{% endtrans %}</h3>
<br>
<p><a href="./">{{ 'Go back to SimpleSAMLphp installation page'|trans }}</a></p>
{% endblock %}

View File

@@ -0,0 +1,65 @@
{% set pagetitle = 'Metadata parser'|trans %}
{% set frontpage_section = 'federation' %}
{% extends "base.twig" %}
{% set i=1 %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
<h2>{{ pagetitle }}</h2>
<form method="post" class="pure-form" enctype="multipart/form-data" action="#converted">
<h3> {{ 'XML metadata'|trans }}</h3>
<div class="pure-control-group">
<textarea name="xmldata" rows="20" class="text-area edge xmldata">{{ xmldata }}</textarea>
</div>
<br>
<div class="center">
{% if upload %}
<div class="pure-button-group two-elements" role="group">
<label class="pure-button">
<span class="fa fa-folder-open"></span>{{ 'or select a file:'|trans }}
<input type="file" name="xmlfile" class="hidden" id="file-input">
</label>
<label id="show-file" class="pure-button hollow show-files" disabled>{{ 'No file selected.'|trans }}</label>
</div>
<br>
{% endif %}
<button class="pure-button pure-button-red pure-input-1-3">{{ 'Parse'|trans }}</button>
</div>
</form>
{% if output -%}
<br>
<h2 id="converted">{{ 'Converted metadata'|trans }}</h2>
{% for type, text in output -%}
{%- if text -%}
<div class="code-box">
<div class="code-box-title">
<h3>{{ type }}</h3>
<button data-clipboard-target="#metadata{{ loop.index }}" id="btn{{ loop.index }}" class="pure-button right clipboard-btn copy">
<i class="fa fa-copy"></i>
</button>
</div>
<div id="metadata{{ loop.index }}" class="code-box-content">
{{- text|escape -}}
</div>
</div>
<br><br>
{%- set i=i+1 %}
{%- endif -%}
{%- endfor -%}
{% elseif error is not null %}
<br>
<h2 id="error">{{ 'An error occurred'|trans }}</h2>
<div class="code-box">
<div class="code-box-content">
<pre id="error" class="fa fa-warning">&nbsp;&nbsp;{{ error }}</pre>
</div>
</div>
{% endif -%}
{% endblock content -%}
{% block postload %}
{% if upload %}
<script src="{{ asset('js/metadata-converter.js', 'admin') }}"></script>
{% endif %}
{% endblock postload %}

View File

@@ -0,0 +1,18 @@
{% set pagetile = 'SimpleSAMLphp Show Metadata'|trans %}
{% extends 'base.twig' %}
{% block content %}
<h2>{{ 'Metadata' | trans }}</h2>
<div class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#metadata"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="metadata" class="code-box-content php">
{#- #}$metadata["{{ entityid }}"] = {{ metadata|escape }};{# -#}
</div>
</div>
<div class="center">
<a href="{{ moduleURL('admin/federation') }}" class="pure-button pure-button-red">{{ 'Back'|trans }}</a>
</div>
{% endblock content %}

View File

@@ -0,0 +1,101 @@
{% set pagetitle = 'SimpleSAMLphp installation page'|trans %}
{% set frontpage_section = 'test' %}
{% extends "base.twig" %}
{% block content %}
{%- include "@admin/includes/menu.twig" %}
<p>{% trans %}Hi, this is the status page of SimpleSAMLphp. Here you can see if your session is timed out, how long it lasts until it times out and all the attributes that are attached to your session.{% endtrans %}</p>
{% if remaining %}
<p>{% trans with {
'%remaining%': remaining
} %}Your session is valid for %remaining% seconds from now.{% endtrans %}</p>
{% endif %}
<h2>{{ 'Your attributes'|trans }}</h2>
{% set items = attributes %}
{% embed '_table.twig' -%}
{% block namecol -%}
{% set translated = name|trans %}
<td class="attrname">{% if translated != name %} {{ translated }} <br>{% endif %} <samp>{{ name }}</samp></td>
{% endblock %}
{% block value -%}
{% if name =='jpegPhoto'-%}
<img src="data:image/jpeg;base64,{{ value }}" alt="{% trans %}Content of jpegPhoto attribute{% endtrans %}">
{% else %}{{ value }}{% endif -%}
{% endblock %}
{%- endembed %}
{%- if nameid or authData %}
<h2>{% trans %}Technical information{% endtrans %}</h2>
{% endif %}
{%- if nameid %}
<h3>{% trans %}SAML Subject{% endtrans %}</h3>
{% set items = {'NameId' : nameid.value} %}
{% if not nameid.value %}
{% set items = items|merge({'NameID' : 'not set'|trans}) %}
{% endif %}
{% if nameid.Format %}
{% set items = items|merge({('Format'|trans) : nameid.Format}) %}
{% endif %}
{% if nameid.NameQualifier %}
{% set items = items|merge({'NameQualifier' : nameid.NameQualifier}) %}
{% endif %}
{% if nameid.SPNameQualifier %}
{% set items = items|merge({'SPNameQualifier' : nameid.SPNameQualifier}) %}
{% endif %}
{% if nameid.SPProvidedID %}
{% set items = items|merge({'SPProvidedID' : nameid.SPProvidedID}) %}
{%- endif %}
<table id="table_with_attributes" class="attributes pure-table pure-table-striped pure-table-attributes"
summary="{% trans %}SAML Subject{% endtrans %}">
{%- for name, value in items %}
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
<td class="attrname">{{ name }}</td>
<td class="attrvalue">{{ value }}</td>
</tr>
{%- endfor %}
</table>
<br/>
{% endif %}
{% if authData %}
<details>
<summary>{% trans %}Authentication data{% endtrans %}</summary>
<div class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#auth-data"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<code id="auth-data" class="code-box-content json">
{{- authData|json_encode(constant("JSON_PRETTY_PRINT") b-or constant("JSON_UNESCAPED_SLASHES")) }}
</code>
</div>
</details>
<br/>
{% endif %}
{%- if logouturl %}
<div class="center">
<a class="pure-button pure-button-red" href="{{ logouturl }}">{{ 'Logout'|trans }}</a>
</div>
{%- endif %}
{% endblock %}