Commit 15067a3c authored by Jacob Priddy's avatar Jacob Priddy 👌
Browse files

I did the wrong thing

parent 5e5c8cea
docker-compose.yml
simplesamlphp-1.18.5.bak
nb
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2016-03-01 14:40+0100\n"
"PO-Revision-Date: 2016-03-01 14:45+0100\n"
"Last-Translator: Hanne Moa <hanne.moa@uninett.no>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.4\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: nb\n"
"X-Poedit-SourceCharset: UTF-8\n"
msgid "Hello, Untranslated World!"
msgstr "Hallo, oversatte verden!"
msgid "Hello, %who%!"
msgstr "Hallo, %who%!"
msgid "World"
msgstr "Verden"
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2016-03-01 14:40+0100\n"
"PO-Revision-Date: 2016-03-01 14:45+0100\n"
"Last-Translator: Hanne Moa <hanne.moa@uninett.no>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.4\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: nb\n"
"X-Poedit-SourceCharset: UTF-8\n"
msgid "Hello, Untranslated World!"
msgstr "Hallo, oversatte verden!"
......@@ -22,7 +22,12 @@ namespace {
'config',
'metadata',
'vendor-bin',
])->in('.')],
])->in('.'),
\Isolated\Symfony\Component\Finder\Finder::create()->append([
'bin/php-scoper',
'composer.json',
]),
],
// PHP-Scoper's goal is to make sure that all code for a project lies in a distinct PHP namespace. However, you
// may want to share a common API between the bundled code of your PHAR and the consumer code. For example if
// you have a PHPUnit PHAR with isolated code, you still want the PHAR to be able to understand the
......@@ -35,8 +40,6 @@ namespace {
'whitelist' => [
// 'PHPUnit\Framework\TestCase', // A specific class
// 'PHPUnit\Framework\*', // The whole namespace
'*',
// Everything
'SimpleSAML*',
'SAML2',
],
......
auth_status.twig
\ No newline at end of file
{% set pagetitle = 'Authentication status'|trans %}
{% extends 'base.twig' %}
{% block content %}
<h2>{{ pagetitle }}</h2>
<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 %}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 }}" />
{% else %}{{ value }}{% endif -%}
{% endblock %}
{%- endembed %}
{% if nameid %}
<h2>{{ 'SAML Subject'|trans }}</h2>
{% 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="attribute overview">
{% 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 %}
<dl>
<dt>{% trans %}Debug information to be used by your support staff{% endtrans %}</dt>
{%- embed "includes/expander.twig" %}
{%- block content %}
<dl>
<dd>{% trans %}Tracking number{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#trackid"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<code id="trackid" class="code-box-content">{{ trackid }}</code>
</dd>
{%- if authData %}
<dd>{% trans %}Information about your current session{% endtrans %}</dd>
<dd class="code-box hljs">
<div class="pure-button-group top-right-corner">
<a class="pure-button copy hljs" data-clipboard-target="#authdata"
title="{% trans %}Copy to clipboard{% endtrans %}"><span class="fa fa-copy"></span></a>
</div>
<div id="authdata" class="code-box-content php">
{{- authData|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_PRETTY_PRINT')) |raw -}}
</div>
</dd>
{%- endif %}
</dl>
{%- endblock content %}
{%- endembed %}
</dl>
<br>
{% if logout %}
<h2>{% trans %}Logout{% endtrans %}</h2>
<p> {{ logout }}</p>
{% endif %}
{% if logouturl %}
<div class="center">
<a class="pure-button pure-button-red" href="{{ logouturl }}">{{ 'Logout'|trans }}</a>
</div>
{% endif %}
{% endblock %}
../gettext/languages/bin/export-plural-rules
\ No newline at end of file
<?php
use Gettext\Languages\Exporter\Exporter;
use Gettext\Languages\Language;
// Let's start by imposing that we don't accept any error or warning.
// This is a really life-saving approach.
error_reporting(E_ALL);
set_error_handler(function ($errno, $errstr, $errfile, $errline) {
fprintf(STDERR, "${errstr}\nFile: ${errfile}\nLine: ${errline}\nCode: ${errno}\n");
die(5);
});
require_once dirname(__DIR__) . '/src/autoloader.php';
// Parse the command line options
Enviro::initialize();
try {
if (isset(Enviro::$languages)) {
$languages = array();
foreach (Enviro::$languages as $languageId) {
$language = Language::getById($languageId);
if (!isset($language)) {
throw new Exception("Unable to find the language with id '${languageId}'");
}
$languages[] = $language;
}
} else {
$languages = Language::getAll();
}
if (Enviro::$reduce) {
$languages = Enviro::reduce($languages);
}
if (Enviro::$noExtraParenthesis) {
$languages = array_map(
function (Language $language) {
$language->formula = $language->buildFormula(true);
return $language;
},
$languages
);
}
if (isset(Enviro::$outputFilename)) {
echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toFile'), $languages, Enviro::$outputFilename, array('us-ascii' => Enviro::$outputUSAscii));
} else {
echo call_user_func(array(Exporter::getExporterClassName(Enviro::$outputFormat), 'toString'), $languages, array('us-ascii' => Enviro::$outputUSAscii));
}
} catch (Exception $x) {
fprintf(STDERR, $x->getMessage() . "\n");
fprintf(STDERR, "Trace:\n");
fprintf(STDERR, $x->getTraceAsString() . "\n");
die(4);
}
die(0);
/**
* Helper class to handle command line options.
*/
class Enviro
{
/**
* Shall the output contain only US-ASCII characters?
*
* @var bool
*/
public static $outputUSAscii;
/**
* The output format.
*
* @var string
*/
public static $outputFormat;
/**
* Output file name.
*
* @var string
*/
public static $outputFilename;
/**
* List of wanted language IDs; it not set: all languages will be returned.
*
* @var array|null
*/
public static $languages;
/**
* Reduce the language list to the minimum common denominator.
*
* @var bool
*/
public static $reduce;
/**
* Omit extra parenthesis in plural rule formulas.
*
* @var bool
*/
public static $noExtraParenthesis;
/**
* Parse the command line options.
*/
public static function initialize()
{
global $argv;
self::$outputUSAscii = false;
self::$outputFormat = null;
self::$outputFilename = null;
self::$languages = null;
self::$reduce = null;
self::$noExtraParenthesis = false;
$exporters = Exporter::getExporters();
if (isset($argv) && is_array($argv)) {
foreach ($argv as $argi => $arg) {
if ($argi === 0) {
continue;
}
if (is_string($arg)) {
$argLC = trim(strtolower($arg));
switch ($argLC) {
case '-h':
case '--help':
self::showSyntax();
die(0);
case '--us-ascii':
self::$outputUSAscii = true;
break;
case '--reduce=yes':
self::$reduce = true;
break;
case '--reduce=no':
self::$reduce = false;
break;
case '--parenthesis=yes':
self::$noExtraParenthesis = false;
break;
case '--parenthesis=no':
self::$noExtraParenthesis = true;
break;
default:
if (preg_match('/^--output=.+$/', $argLC)) {
if (isset(self::$outputFilename)) {
fprintf(STDERR, "The output file name has been specified more than once!\n");
self::showSyntax();
die(3);
}
list(, self::$outputFilename) = explode('=', $arg, 2);
self::$outputFilename = trim(self::$outputFilename);
} elseif (preg_match('/^--languages?=.+$/', $argLC)) {
list(, $s) = explode('=', $arg, 2);
$list = explode(',', $s);
if (is_array(self::$languages)) {
self::$languages = array_merge(self::$languages, $list);
} else {
self::$languages = $list;
}
} elseif (isset($exporters[$argLC])) {
if (isset(self::$outputFormat)) {
fprintf(STDERR, "The output format has been specified more than once!\n");
self::showSyntax();
die(3);
}
self::$outputFormat = $argLC;
} else {
fprintf(STDERR, "Unknown option: ${arg}\n");
self::showSyntax();
die(2);
}
break;
}
}
}
}
if (!isset(self::$outputFormat)) {
self::showSyntax();
die(1);
}
if (isset(self::$languages)) {
self::$languages = array_values(array_unique(self::$languages));
}
if (!isset(self::$reduce)) {
self::$reduce = isset(self::$languages) ? false : true;
}
}
/**
* Write out the syntax.
*/
public static function showSyntax()
{
$basename = basename(__FILE__);
$exporters = array_keys(Exporter::getExporters(true));
$exporterList = implode('|', $exporters);
fprintf(STDERR, <<<EOT
Syntax:
${basename} [-h|--help] [--us-ascii] [--languages=<LanguageId>[,<LanguageId>,...]] [--reduce=yes|no] [--parenthesis=yes|no] [--output=<file name>] <${exporterList}>
Where:
--help
show this help message.
--us-ascii
if specified, the output will contain only US-ASCII characters.
--languages(or --language)
export only the specified language codes.
Separate languages with commas; you can also use this argument
more than once; it's case insensitive and accepts both '_' and
'-' as locale chunks separator (eg we accept 'it_IT' as well as
'it-it').
--reduce
if set to yes the output won't contain languages with the same
base language and rules.
For instance nl_BE ('Flemish') will be omitted because it's the
same as nl ('Dutch').
Defaults to 'no' if --languages is specified, to 'yes' otherwise.
--parenthesis
if set to no, extra parenthesis will be omitted in generated
plural rules formulas.
Those extra parenthesis are needed to create a PHP-compatible
formula.
Defaults to 'yes'
--output
if specified, the output will be saved to <file name>. If not
specified we'll output to standard output.
Output formats
EOT
);
$len = max(array_map('strlen', $exporters));
foreach ($exporters as $exporter) {
fprintf(STDERR, ' ' . str_pad($exporter, $len) . ': ' . Exporter::getExporterDescription($exporter) . "\n");
}
fprintf(STDERR, "\n");
}
/**
* Reduce a language list to the minimum common denominator.
*
* @param Language[] $languages
*
* @return Language[]
*/
public static function reduce($languages)
{
for ($numChunks = 3; $numChunks >= 2; $numChunks--) {
$filtered = array();
foreach ($languages as $language) {
$chunks = explode('_', $language->id);
$compatibleFound = false;
if (count($chunks) === $numChunks) {
$categoriesHash = serialize($language->categories);
$otherIds = array();
$otherIds[] = $chunks[0];
for ($k = 2; $k < $numChunks; $k++) {
$otherIds[] = $chunks[0] . '_' . $chunks[$numChunks - 1];
}
foreach ($languages as $check) {
foreach ($otherIds as $otherId) {
if (($check->id === $otherId) && ($check->formula === $language->formula) && (serialize($check->categories) === $categoriesHash)) {
$compatibleFound = true;
break;
}
}
if ($compatibleFound === true) {
break;
}
}
}
if (!$compatibleFound) {
$filtered[] = $language;
}
}
$languages = $filtered;
}
return $languages;
}
}
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment