composer.lock
/vendor
/php-utility-classes
+/app/skin/*
+!/app/skin/default
$utils->sendSecurityHeaders();
// Initialize the HTML document with our basic elements.
-extract($utils->initHTMLDocument('Authorization Request | KaiRo.at', 'KaiRo.at Authentication Server')); // sets $document, $html, $head, $title, $body
+extract($utils->initHTMLDocument(sprintf(_('Authorization Request | %s'), $utils->settings['operator_name']),
+ sprintf(_('%s Authentication Server'), $utils->settings['operator_name']))); // sets $document, $html, $head, $title, $body
if (!count($errors)) {
$session = $utils->initSession(); // Read session or create new session and set cookie.
$user = array('id' => 0, 'email' => '');
}
if (is_null($session)) {
- $errors[] = _('The session system is not working.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('The session system is not working.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
elseif ($session['logged_in']) {
// We are logged in, process authorization request.
body {
font-family: sans-serif;
/* margin: 0; */
- background-color: #FFFFEE;
padding-top: 5em; /* leave space for total height of h1: 4+1(r)em */
}
height: 4rem;
min-height: calc(70px - 1rem);
font-size: 2em;
- background-color: #003366;
- color: #FFFFEE;
- background-image: url("KaiRoLogo-100x62.png");
background-repeat: no-repeat;
background-position: 10px 50%;
overflow: hidden;
}
}
-a:link { color: #669999; }
-a:visited { color: #003366; }
-a:hover, a:active { color: #88BBBB; }
-
ul.flat {
list-style-type: none;
margin: 0em;
border-spacing: 0px;
border-collapse: collapse;
empty-cells: show;
- border-left: 1px solid #336699;
- border-top: 1px solid #336699;
+ border-width: 0;
+ border-left: 1px solid;
+ border-top: 1px solid;
}
table.border th, table.border td {
- border-bottom: 1px solid #336699;
- border-right: 1px solid #336699;
+ border-width: 0;
+ border-bottom: 1px solid;
+ border-right: 1px solid;
}
table.border td {
padding-left: 3px;
}
.otheremaillinks > a {
- background-color: #EEEEDD;
text-decoration: none;
padding: .2em;
border-radius: 3px;
}
-.otheremaillinks > a:link, .otheremaillinks > a:visited { color: #BBBBBB; }
-.otheremaillinks > a:hover, .otheremaillinks > a:active { color: #808080; }
.small {
font-size: 0.75em;
$this->settings['piwik_site_id'] = intval(@$this->settings['piwik_site_id']);
$this->settings['piwik_url'] = strlen(@$this->settings['piwik_url']) ? $this->settings['piwik_url'] : '/piwik/';
$this->settings['piwik_tracker_path'] = strlen(@$this->settings['piwik_tracker_path']) ? $this->settings['piwik_tracker_path'] : '../vendor/piwik/piwik-php-tracker/';
+ $this->settings['skin'] = (@$this->settings['skin'] && is_dir('skin/'.$this->settings['skin'])) ? $this->settings['skin'] : 'default';
+ $this->settings['operator_name'] = (@$this->settings['operator_name']) ? $this->settings['operator_name'] : 'AuthServer';
+ $this->settings['operator_contact_url'] = (@$this->settings['operator_contact_url']) ? $this->settings['operator_contact_url'] : 'https://github.com/KaiRo_at/authserver/';
+ $this->settings['info_from_email'] = (@$this->settings['info_from_email']) ? $this->settings['info_from_email'] : 'noreply@example.com';
// Initialize database.
$config = new \Doctrine\DBAL\Configuration();
}
else {
$utils->log('create_session_failure', 'at login, prev session: '.$session['id'].', new user: '.$userid);
- $errors[] = _('The session system is not working.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('The session system is not working.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $this->settings['operator_contact_url'], $this->settings['operator_name']);
}
}
else {
$result = $this->db->prepare('UPDATE `auth_sessions` SET `sesskey` = :sesskey, `user` = :userid, `logged_in` = TRUE, `time_expire` = :expire WHERE `id` = :sessid;');
if (!$result->execute(array(':sesskey' => $sesskey, ':userid' => $userid, ':expire' => gmdate('Y-m-d H:i:s', strtotime('+1 day')), ':sessid' => $session['id']))) {
$utils->log('login_failure', 'session: '.$session['id'].', user: '.$userid);
- $errors[] = _('Login failed unexpectedly.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Login failed unexpectedly.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $this->settings['operator_contact_url'], $this->settings['operator_name']);
}
else {
// After update, actually fetch the session row from the DB so we have all values.
$style = $head->appendElement('link');
$style->setAttribute('rel', 'stylesheet');
$style->setAttribute('href', 'authsystem.css');
+ $style = $head->appendElement('link');
+ $style->setAttribute('rel', 'stylesheet');
+ $style->setAttribute('href', 'skin/'.$settings['skin'].'/authskin.css');
$head->appendJSFile('authsystem.js');
if ($settings['piwik_enabled']) {
$head->setAttribute('data-piwiksite', $settings['piwik_site_id']);
$head->setAttribute('data-piwikurl', $settings['piwik_url']);
$head->appendJSFile('piwik.js', true, true);
}
+ $icon = $head->appendElement('link');
+ $icon->setAttribute('rel', 'shortcut icon');
+ $icon->setAttribute('href', 'skin/'.$settings['skin'].'/icon32.png');
+ $icon->setAttribute('type', 'image/png');
$title->appendText($titletext);
$h1 = $body->appendElement('h1', $headlinetext);
$utils->sendSecurityHeaders();
// Initialize the HTML document with our basic elements.
-extract($utils->initHTMLDocument('KaiRo.at Authentication Server')); // sets $document, $html, $head, $title, $body
+extract($utils->initHTMLDocument(sprintf(_('%s Authentication Server'), $utils->settings['operator_name']))); // sets $document, $html, $head, $title, $body
if (!count($errors)) {
$session = $utils->initSession(); // Read session or create new session and set cookie.
$user = array('id' => 0, 'email' => '');
$pagetype = 'default';
if (is_null($session)) {
- $errors[] = _('The session system is not working.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('The session system is not working.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
elseif (array_key_exists('logout', $_GET)) {
$result = $db->prepare('UPDATE `auth_sessions` SET `logged_in` = FALSE WHERE `id` = :sessid;');
$result = $db->prepare('INSERT INTO `auth_users` (`email`, `pwdhash`, `status`, `verify_hash`) VALUES (:email, :pwdhash, \'unverified\', :vcode);');
if (!$result->execute(array(':email' => $_POST['email'], ':pwdhash' => $newHash, ':vcode' => $vcode))) {
$utils->log('user_insert_failure', 'email: '.$_POST['email'].' - '.$result->errorInfo()[2]);
- $errors[] = _('Could not add user.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Could not add user.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
$user = array('id' => $db->lastInsertId(),
'email' => $_POST['email'],
$mail->setCharset('utf-8');
$mail->addHeader('X-KAIRO-AUTH', 'email_verification');
$mail->addRecipient($user['email']);
- $mail->setSender('noreply@auth.kairo.at', _('KaiRo.at Authentication Service'));
- $mail->setSubject('Email Verification for KaiRo.at Authentication');
+ $mail->setSender($utils->settings['info_from_email'], sprintf(_('%s Authentication Service'), $utils->settings['operator_name']));
+ $mail->setSubject(sprintf(_('Email Verification for %s Authentication'), $utils->settings['operator_name']));
$mail->addMailText(_('Welcome!')."\n\n");
$mail->addMailText(sprintf(_('This email address, %s, has been used for registration on "%s".'),
- $user['email'], _('KaiRo.at Authentication Service'))."\n\n");
+ $user['email'], sprintf(_('%s Authentication Service'), $utils->settings['operator_name']))."\n\n");
$mail->addMailText(_('Please confirm that registration by clicking the following link (or calling it up in your browser):')."\n");
$mail->addMailText($utils->getDomainBaseURL().strstr($_SERVER['REQUEST_URI'], '?', true)
.'?email='.rawurlencode($user['email']).'&verification_code='.rawurlencode($user['verify_hash'])."\n\n");
$mail->addMailText(_('With this confirmation, you accept that we handle your data for the purpose of logging you into other websites when you request that.')."\n");
$mail->addMailText(_('Those websites will get to know your email address but not your password, which we store securely.')."\n");
$mail->addMailText(_('If you do not call this confirmation link within 72 hours, your data will be deleted from our database.')."\n\n");
- $mail->addMailText(sprintf(_('The %s team'), 'KaiRo.at'));
+ $mail->addMailText(sprintf(_('The %s team'), $utils->settings['operator_name']));
//$mail->setDebugAddress("robert@localhost");
$mailsent = $mail->send();
if ($mailsent) {
}
else {
$utils->log('verify_mail_failure', 'user: '.$user['id'].', email: '.$user['email']);
- $errors[] = _('The confirmation email could not be sent to you.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('The confirmation email could not be sent to you.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
}
else {
$result = $db->prepare('UPDATE `auth_users` SET `verify_hash` = :vcode WHERE `id` = :userid;');
if (!$result->execute(array(':vcode' => $vcode, ':userid' => $user['id']))) {
$utils->log('vhash_set_failure', 'user: '.$user['id']);
- $errors[] = _('Could not initiate reset request.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Could not initiate reset request.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
else {
$utils->log('pwd_reset_request', 'user: '.$user['id'].', email: '.$user['email']);
$mail->setCharset('utf-8');
$mail->addHeader('X-KAIRO-AUTH', 'password_reset');
$mail->addRecipient($user['email']);
- $mail->setSender('noreply@auth.kairo.at', _('KaiRo.at Authentication Service'));
- $mail->setSubject('How to reset your password for KaiRo.at Authentication');
+ $mail->setSender($utils->settings['info_from_email'], sprintf(_('%s Authentication Service'), $utils->settings['operator_name']));
+ $mail->setSubject(sprintf(_('How to reset your password for %s Authentication'), $utils->settings['operator_name']));
$mail->addMailText(_('Hi,')."\n\n");
$mail->addMailText(sprintf(_('A request for setting a new password for this email address, %s, has been submitted on "%s".'),
- $user['email'], _('KaiRo.at Authentication Service'))."\n\n");
+ $user['email'], sprintf(_('%s Authentication Service'), $utils->settings['operator_name']))."\n\n");
$mail->addMailText(_('You can set a new password by clicking the following link (or calling it up in your browser):')."\n");
$mail->addMailText($utils->getDomainBaseURL().strstr($_SERVER['REQUEST_URI'], '?', true)
.'?email='.rawurlencode($user['email']).'&reset_code='.rawurlencode($resetcode)."\n\n");
$mail->addMailText(_('If you do not call this confirmation link within 1 hour, this link expires and the existing password is being kept in place.')."\n\n");
- $mail->addMailText(sprintf(_('The %s team'), 'KaiRo.at'));
+ $mail->addMailText(sprintf(_('The %s team'), $utils->settings['operator_name']));
//$mail->setDebugAddress("robert@localhost");
$mailsent = $mail->send();
if ($mailsent) {
}
else {
$utils->log('pwd_reset_mail_failure', 'user: '.$user['id'].', email: '.$user['email']);
- $errors[] = _('The email with password reset instructions could not be sent to you.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('The email with password reset instructions could not be sent to you.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
}
}
$result = $db->prepare('UPDATE `auth_users` SET `verify_hash` = \'\', `status` = \'ok\' WHERE `id` = :userid;');
if (!$result->execute(array(':userid' => $user['id']))) {
$utils->log('verification_save_failure', 'user: '.$user['id']);
- $errors[] = _('Could not save confirmation.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Could not save confirmation.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
$pagetype = 'verification_done';
}
':scope' => $scope,
':userid' => $user['id']))) {
$utils->log('client_save_failure', 'client: '.$clientid);
- $errors[] = _('Unexpectedly failed to save new client information.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Unexpectedly failed to save new client information.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
}
if (!count($errors)) {
$result = $db->prepare('UPDATE `auth_users` SET `pwdhash` = :pwdhash, `verify_hash` = \'\' WHERE `id` = :userid;');
if (!$result->execute(array(':pwdhash' => $newHash, ':userid' => $session['user']))) {
$utils->log('pwd_reset_failure', 'user: '.$session['user']);
- $errors[] = _('Password reset failed.').' '._('Please <a href="https://www.kairo.at/contact">contact KaiRo.at</a> and tell the team about this.');
+ $errors[] = _('Password reset failed.').' '
+ .sprintf(_('Please <a href="%s">contact %s</a> and tell the team about this.'), $utils->settings['operator_contact_url'], $utils->settings['operator_name']);
}
else {
$pagetype = 'reset_done';
--- /dev/null
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+body {
+ background-color: #FFFFFF;
+}
+
+h1 {
+ background-color: #404040;
+ color: #FFFFFF;
+ background-image: url("logo-100x62.png");
+}
+
+a:link { color: #0000EE; }
+a:visited { color: #8000EE; }
+a:hover, a:active { color: #8080FF; }
+
+table.border {
+ border-color: #404040;
+}
+table.border th, table.border td {
+ border-color: #404040;
+}
+
+.otheremaillinks > a {
+ background-color: #EEEEEE;
+}
+.otheremaillinks > a:link, .otheremaillinks > a:visited { color: #BBBBBB; }
+.otheremaillinks > a:hover, .otheremaillinks > a:active { color: #808080; }
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:ns1="http://sozi.baierouge.fr"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ id="svg18832"
+ sodipodi:docname="login_mini_icon_2.svg"
+ viewBox="0 0 212.6 212.6"
+ sodipodi:version="0.32"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:version="0.45.1"
+ sodipodi:docbase="/home/andre/data/projekte_privat/wiesenschluempfe/bilder/icons"
+ >
+ <sodipodi:namedview
+ id="base"
+ inkscape:zoom="0.98994949"
+ borderopacity="1.0"
+ inkscape:current-layer="layer1"
+ inkscape:cx="116.8274"
+ inkscape:object-bbox="true"
+ inkscape:grid-points="true"
+ inkscape:guide-points="true"
+ showgrid="true"
+ inkscape:document-units="mm"
+ bordercolor="#666666"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ objecttolerance="10000"
+ inkscape:object-nodes="true"
+ inkscape:window-width="858"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ guidetolerance="10000"
+ pagecolor="#ffffff"
+ gridtolerance="10000"
+ inkscape:object-points="true"
+ inkscape:cy="160.64295"
+ inkscape:window-height="580"
+ />
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ transform="translate(-241.43 -409.02)"
+ >
+ <path
+ id="path15809"
+ style="fill-rule:evenodd;fill:#000000"
+ d="m295.02 409.02l-0.44 35.44h124.01v141.73h-124.01v35.43h159.45v-212.6h-159.01z"
+ inkscape:export-ydpi="52.360001"
+ sodipodi:nodetypes="ccccccccc"
+ inkscape:export-filename="/home/andre/data/projekte_privat/wiesenschluempfe/bilder/logout_mini_icon.png"
+ inkscape:export-xdpi="52.360001"
+ />
+ <path
+ id="path15815"
+ style="fill:#000000"
+ d="m241.43 533.04h88.58l-35.43 35.43h53.15l53.15-53.15-53.15-53.15h-53.15l35.43 35.44h-88.58v35.43z"
+ inkscape:export-ydpi="52.360001"
+ sodipodi:nodetypes="cccccccccc"
+ inkscape:export-filename="/home/andre/data/projekte_privat/wiesenschluempfe/bilder/logout_mini_icon.png"
+ inkscape:export-xdpi="52.360001"
+ />
+ </g
+ >
+ <metadata
+ >
+ <rdf:RDF
+ >
+ <cc:Work
+ >
+ <dc:format
+ >image/svg+xml</dc:format
+ >
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage"
+ />
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/publicdomain/"
+ />
+ <dc:publisher
+ >
+ <cc:Agent
+ rdf:about="http://openclipart.org/"
+ >
+ <dc:title
+ >Openclipart</dc:title
+ >
+ </cc:Agent
+ >
+ </dc:publisher
+ >
+ <dc:title
+ >login mini icon</dc:title
+ >
+ <dc:date
+ >2008-02-13T10:41:13</dc:date
+ >
+ <dc:description
+ />
+ <dc:source
+ >https://openclipart.org/detail/13847/login-mini-icon-by-artmaster</dc:source
+ >
+ <dc:creator
+ >
+ <cc:Agent
+ >
+ <dc:title
+ >artmaster</dc:title
+ >
+ </cc:Agent
+ >
+ </dc:creator
+ >
+ <dc:subject
+ >
+ <rdf:Bag
+ >
+ <rdf:li
+ >black</rdf:li
+ >
+ <rdf:li
+ >entry</rdf:li
+ >
+ <rdf:li
+ >icon</rdf:li
+ >
+ <rdf:li
+ >login</rdf:li
+ >
+ <rdf:li
+ >mini</rdf:li
+ >
+ <rdf:li
+ >sign</rdf:li
+ >
+ </rdf:Bag
+ >
+ </dc:subject
+ >
+ </cc:Work
+ >
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/publicdomain/"
+ >
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction"
+ />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution"
+ />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks"
+ />
+ </cc:License
+ >
+ </rdf:RDF
+ >
+ </metadata
+ >
+</svg
+>
""
],
"client_reg_email_whitelist": ["you@example.com"],
+"skin": "default",
+"operator_name": "AuthServer",
+"operator_contact_url": "https://github.com/KaiRo_at/authserver/",
+"info_from_email": "noreply@example.com",
"piwik_enabled": false,
"piwik_url": "/piwik/",
"piwik_site_id": 1,
-"piwik_tracker_path": "/srv/www/piwik/vendor/piwik/piwik-php-tracker/"
+"piwik_tracker_path": "/srv/www/piwik/vendor/piwik/piwik-php-tracker/",
}