Commit e331110e authored by Michael Herold's avatar Michael Herold
Browse files

Adds pattern checks for email localpart

parent f52d87c6
......@@ -2,5 +2,6 @@ language: php
php:
- 5.6
- 7.0
- 7.1
install:
- make dev
......@@ -14,7 +14,7 @@
"require": {
"php": ">=5.6",
"symfony/yaml": "3.*",
"hemio/form": "0.4.*"
"hemio/form": "0.4.2"
},
"require-dev": {
"phpunit/phpunit": "5.*",
......
......@@ -4,21 +4,21 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "ea8b7e5489b9010caca2ea1361ec1b10",
"content-hash": "c13f25c1aca3809e46bddf22bacb67de",
"hash": "fae4fdf857c7e7a31a7e546750cc7955",
"content-hash": "a499249ef1bfb6eb7cbbd51ccf2533f9",
"packages": [
{
"name": "hemio/form",
"version": "v0.4.0",
"version": "v0.4.2",
"source": {
"type": "git",
"url": "https://github.com/qua-bla/form.git",
"reference": "103b69a2ee0e6a5eef3b9152512401d9ee7097e8"
"reference": "190dd9053c4dc2cce566eed7d347220cc4859cbf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/qua-bla/form/zipball/103b69a2ee0e6a5eef3b9152512401d9ee7097e8",
"reference": "103b69a2ee0e6a5eef3b9152512401d9ee7097e8",
"url": "https://api.github.com/repos/qua-bla/form/zipball/190dd9053c4dc2cce566eed7d347220cc4859cbf",
"reference": "190dd9053c4dc2cce566eed7d347220cc4859cbf",
"shasum": ""
},
"require": {
......@@ -50,7 +50,7 @@
"keywords": [
"html"
],
"time": "2015-11-19 12:40:21"
"time": "2016-10-12 16:16:31"
},
{
"name": "hemio/html",
......@@ -98,16 +98,16 @@
},
{
"name": "symfony/yaml",
"version": "v3.1.3",
"version": "v3.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac"
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac",
"reference": "1819adf2066880c7967df7180f4f662b6f0567ac",
"url": "https://api.github.com/repos/symfony/yaml/zipball/368b9738d4033c8b93454cb0dbd45d305135a6d3",
"reference": "368b9738d4033c8b93454cb0dbd45d305135a6d3",
"shasum": ""
},
"require": {
......@@ -143,7 +143,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-07-17 14:02:08"
"time": "2016-09-25 08:27:07"
}
],
"packages-dev": [
......@@ -203,16 +203,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.5.1",
"version": "1.5.4",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "a8773992b362b58498eed24bf85005f363c34771"
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/a8773992b362b58498eed24bf85005f363c34771",
"reference": "a8773992b362b58498eed24bf85005f363c34771",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
"reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f",
"shasum": ""
},
"require": {
......@@ -241,7 +241,7 @@
"object",
"object graph"
],
"time": "2015-11-20 12:04:31"
"time": "2016-09-16 13:37:59"
},
{
"name": "phpdocumentor/reflection-common",
......@@ -299,16 +299,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "3.1.0",
"version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd"
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd",
"reference": "9270140b940ff02e58ec577c237274e92cd40cdd",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e",
"reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e",
"shasum": ""
},
"require": {
......@@ -340,7 +340,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2016-06-10 09:48:41"
"time": "2016-09-30 07:12:33"
},
{
"name": "phpdocumentor/type-resolver",
......@@ -697,24 +697,24 @@
},
{
"name": "phpunit/phpunit",
"version": "5.5.2",
"version": "5.6.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "46ec2d1522ae8c9a12aca6b7650e0be78bbb0502"
"reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46ec2d1522ae8c9a12aca6b7650e0be78bbb0502",
"reference": "46ec2d1522ae8c9a12aca6b7650e0be78bbb0502",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60c32c5b5e79c2248001efa2560f831da11cc2d7",
"reference": "60c32c5b5e79c2248001efa2560f831da11cc2d7",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-json": "*",
"ext-pcre": "*",
"ext-reflection": "*",
"ext-spl": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-xml": "*",
"myclabs/deep-copy": "~1.3",
"php": "^5.6 || ^7.0",
"phpspec/prophecy": "^1.3.1",
......@@ -736,7 +736,11 @@
"conflict": {
"phpdocumentor/reflection-docblock": "3.0.2"
},
"require-dev": {
"ext-pdo": "*"
},
"suggest": {
"ext-xdebug": "*",
"phpunit/php-invoker": "~1.1"
},
"bin": [
......@@ -745,7 +749,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.5.x-dev"
"dev-master": "5.6.x-dev"
}
},
"autoload": {
......@@ -771,20 +775,20 @@
"testing",
"xunit"
],
"time": "2016-08-18 11:10:44"
"time": "2016-10-07 13:03:26"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "3.2.4",
"version": "3.4.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "4e83390f64e7ce04fcaec2ce95cd72823b431d19"
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/4e83390f64e7ce04fcaec2ce95cd72823b431d19",
"reference": "4e83390f64e7ce04fcaec2ce95cd72823b431d19",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
"reference": "238d7a2723bce689c79eeac9c7d5e1d623bb9dc2",
"shasum": ""
},
"require": {
......@@ -830,7 +834,7 @@
"mock",
"xunit"
],
"time": "2016-08-17 09:33:51"
"time": "2016-10-09 07:01:45"
},
{
"name": "producer/producer",
......@@ -893,22 +897,30 @@
},
{
"name": "psr/log",
"version": "1.0.0",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-0": {
"Psr\\Log\\": ""
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
......@@ -922,12 +934,13 @@
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2012-12-21 11:40:51"
"time": "2016-10-10 12:19:37"
},
{
"name": "sebastian/code-unit-reverse-lookup",
......
msgid ""
msgstr ""
"Project-Id-Version: edentata\n"
"POT-Creation-Date: 2016-03-18 19:23+0100\n"
"PO-Revision-Date: 2016-03-18 19:23+0100\n"
"POT-Creation-Date: 2016-10-12 18:12+0200\n"
"PO-Revision-Date: 2016-10-12 18:13+0200\n"
"Last-Translator: Michael Herold <quabla@hemio.de>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"X-Generator: Poedit 1.8.9\n"
"X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
......@@ -21,6 +21,10 @@ msgstr ""
msgid "Unknown setting \"%s\""
msgstr "Unbekannte Einstellung \"%s\"."
#: src/class/ContentFooter.php:40
msgid "Site Information"
msgstr "Impressum"
#: src/class/ContentNav.php:58
msgid "Services"
msgstr "Dienste"
......@@ -130,14 +134,22 @@ msgstr "Unbekannte Modul-Aktion \"%s\"."
msgid "Warning"
msgstr "Warnung"
#: src/class/gui/FieldEmailWithSelect.php:54
#: src/class/gui/FieldEmailWithSelect.php:50
msgid "Local Part"
msgstr "Lokalteil"
#: src/class/gui/FieldEmailWithSelect.php:57
#: src/class/gui/FieldEmailWithSelect.php:53
msgid "Domain"
msgstr "Domain"
#: src/class/gui/FieldEmailWithSelect.php:66
msgid ""
"Local part: May only contain letters \"a-z\", numbers \"0-9\", dashes \"-\" "
"and dots \".\""
msgstr ""
"Lokalteil: Darf nur Buchstaben \"a-z\", Zahlen \"0-9\", Bindestriche \"-\" "
"und Punkte \".\" enthalten"
#: src/class/gui/FieldNewPassword.php:39
msgid "New Password"
msgstr "Neues Passwort"
......@@ -272,9 +284,5 @@ msgstr "Optionen"
msgid "Tried to access unknown or disabled module"
msgstr ""
#: src/load/main.php:310
msgid "Site Information"
msgstr "Impressum"
#~ msgid "User Settings"
#~ msgstr "Benutzereinstellungen"
msgid ""
msgstr ""
"Project-Id-Version: edentata\n"
"POT-Creation-Date: 2016-01-06 15:06+0100\n"
"PO-Revision-Date: 2016-01-06 15:06+0100\n"
"POT-Creation-Date: 2016-10-12 18:12+0200\n"
"PO-Revision-Date: 2016-10-12 18:12+0200\n"
"Last-Translator: Michael Herold <quabla@hemio.de>\n"
"Language-Team: \n"
"Language: en_US\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"
"X-Generator: Poedit 1.8.9\n"
"X-Poedit-Basepath: ../../..\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
......@@ -21,6 +21,10 @@ msgstr ""
msgid "Unknown setting \"%s\""
msgstr ""
#: src/class/ContentFooter.php:40
msgid "Site Information"
msgstr ""
#: src/class/ContentNav.php:58
msgid "Services"
msgstr ""
......@@ -130,14 +134,20 @@ msgstr ""
msgid "Warning"
msgstr ""
#: src/class/gui/FieldEmailWithSelect.php:54
#: src/class/gui/FieldEmailWithSelect.php:50
msgid "Local Part"
msgstr ""
#: src/class/gui/FieldEmailWithSelect.php:57
#: src/class/gui/FieldEmailWithSelect.php:53
msgid "Domain"
msgstr ""
#: src/class/gui/FieldEmailWithSelect.php:66
msgid ""
"Local part: May only contain letters \"a-z\", numbers \"0-9\", dashes \"-\" "
"and dots \".\""
msgstr ""
#: src/class/gui/FieldNewPassword.php:39
msgid "New Password"
msgstr ""
......@@ -194,21 +204,25 @@ msgstr ""
msgid "Overview"
msgstr ""
#: src/class/sql/ExceptionMapping.php:42
#: src/class/sql/ExceptionMapping.php:41
msgid "Invalid unser login."
msgstr ""
#: src/class/sql/ExceptionMapping.php:52
#: src/class/sql/ExceptionMapping.php:48
msgid "Acting as deputy failed."
msgstr ""
#: src/class/sql/ExceptionMapping.php:58
msgid ""
"The operation you want to perform would exceed your current contingent. "
"Please contact the support to extend your contingent."
msgstr ""
#: src/class/sql/ExceptionMapping.php:60
#: src/class/sql/ExceptionMapping.php:66
msgid "The object you tried to change is inaccessible or missing."
msgstr ""
#: src/load/main.php:40 src/load/main.php:69
#: src/load/main.php:39 src/load/main.php:67
#, php-format
msgid ""
"An error has occured. We are sorry. You should contact the support and "
......@@ -216,11 +230,11 @@ msgid ""
"and try again."
msgstr ""
#: src/load/main.php:143
#: src/load/main.php:140
msgid "Logout successfull"
msgstr ""
#: src/load/main.php:155 src/load/main.php:176
#: src/load/main.php:152 src/load/main.php:173
msgid "Login failed"
msgstr ""
......@@ -228,34 +242,30 @@ msgstr ""
msgid "User"
msgstr ""
#: src/load/main.php:189
msgid "User Settings"
#: src/load/main.php:198
msgid "Act as Deputy"
msgstr ""
#: src/load/main.php:203
msgid "Stop acting as deputy"
#: src/load/main.php:200
msgid "In Place of"
msgstr ""
#: src/load/main.php:213
msgid "Act as Deputy"
msgid "Stop acting as deputy"
msgstr ""
#: src/load/main.php:223
#: src/load/main.php:230
msgid "Support"
msgstr ""
#: src/load/main.php:229
#: src/load/main.php:236
msgid "Logout"
msgstr ""
#: src/load/main.php:250 src/load/main.php:252
#: src/load/main.php:257 src/load/main.php:259
msgid "Settings"
msgstr ""
#: src/load/main.php:276
#: src/load/main.php:283
msgid "Tried to access unknown or disabled module"
msgstr ""
#: src/load/main.php:305
msgid "Site Information"
msgstr ""
<?php
/*
* Copyright (C) 2015 Michael Herold <quabla@hemio.de>
*
......@@ -26,15 +27,13 @@ use hemio\form;
*
* @author Michael Herold <quabla@hemio.de>
*/
class FieldEmailWithSelect extends \hemio\form\Container
{
class FieldEmailWithSelect extends \hemio\form\Container {
/**
*
* @return form\FieldSelect
*/
public function getDomain()
{
public function getDomain() {
return $this['p']['select']['select'];
}
......@@ -42,41 +41,42 @@ class FieldEmailWithSelect extends \hemio\form\Container
*
* @return form\FieldText
*/
public function getLocalPart()
{
public function getLocalPart() {
return $this['p']['text'];
}
public function __construct($name1 = 'localpart', $name2 = 'domain',
$title1 = null, $title2 = null)
{
public function __construct($name1 = 'localpart', $name2 = 'domain', $title1 = null, $title2 = null) {
if ($title1 === null)
$title1 = _('Local Part');
if ($title2 === null)
$title2 = _('Domain');
$p = new html\P();
$p = new html\P();
$p->addCssClass('multiple');
$this['p'] = $p;
$p['text'] = new form\FieldText($name1, $title1);
$p['text']->setRequired(true);
$p['text']->addInheritableAppendage(
form\FormPost::FORM_FIELD_TEMPLATE,
new form\template\FormPlainControl
form\FormPost::FORM_FIELD_TEMPLATE, new form\template\FormPlainControl
);
$p['text']->setPattern(
'[a-zA-Z0-9.-]+'
, _('Local part: May only contain letters "a-z", numbers "0-9", dashes "-" and dots "."')
);
$p['at'] = new html\Span();
$p['at']->addCssClass('between');
$p['at']->addChild(new html\Str('@'));
$p['select'] = new html\Span();
$p['select'] = new html\Span();
$p['select']->addCssClass('select');
$p['select']['select'] = new form\FieldSelect($name2, $title2);
$p['select']['select']->addInheritableAppendage(
form\FormPost::FORM_FIELD_TEMPLATE.'_SELECT',
new form\template\FormPlainControl
form\FormPost::FORM_FIELD_TEMPLATE . '_SELECT', new form\template\FormPlainControl
);
}
}
......@@ -23,7 +23,7 @@ Abc<br /><span>Subtitle</span>
<label for="form_test_switch"><span><u>S</u>witch</span><span class="switch "></span></label>
</p>
<p class="multiple ">
<input type="text" accesskey="L" required="required" title="Local Part" name="form_test_localpart" id="form_test_localpart" /><span class="between ">@</span><span class="select "><select accesskey="D" title="Domain" name="form_test_domain" id="form_test_domain"><option value="test1">Test Nr. 1</option><option value="test2">Test Nr. 2</option><option value="test3">Test Nr. 3</option></select></span>
<input type="text" accesskey="L" required="required" pattern="[a-zA-Z0-9.-]+" title="Local part: May only contain letters &quot;a-z&quot;, numbers &quot;0-9&quot;, dashes &quot;-&quot; and dots &quot;.&quot;" name="form_test_localpart" id="form_test_localpart" /><span class="between ">@</span><span class="select "><select accesskey="D" title="Domain" name="form_test_domain" id="form_test_domain"><option value="test1">Test Nr. 1</option><option value="test2">Test Nr. 2</option><option value="test3">Test Nr. 3</option></select></span>
</p>
<input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test1" value="test1" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test2" value="test2" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test3" value="test3" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_lorem" value="lorem" class="list " /><ul class="listbox radio ">
<li class="listbox_link_color "><label for="form_test_radio_list_test1" class="listbox_link "><span>Test Nr. 1</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_test2" class="listbox_link "><span>Test Nr. 2</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_test3" class="listbox_link "><span>Test Nr. 3</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_lorem" class="listbox_link "><span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span></label></li>
......
......@@ -23,7 +23,7 @@ Abc<br /><span>Subtitle</span>
<label for="form_test_switch"><span><u>S</u>witch</span><span class="switch "></span></label>
</p>
<p class="multiple ">
<input type="text" accesskey="L" required="required" title="Local Part" name="form_test_localpart" id="form_test_localpart" /><span class="between ">@</span><span class="select "><select accesskey="D" title="Domain" name="form_test_domain" id="form_test_domain"><option value="test1">Test Nr. 1</option><option value="test2">Test Nr. 2</option><option value="test3">Test Nr. 3</option></select></span>
<input type="text" accesskey="L" required="required" pattern="[a-zA-Z0-9.-]+" title="Local part: May only contain letters &quot;a-z&quot;, numbers &quot;0-9&quot;, dashes &quot;-&quot; and dots &quot;.&quot;" name="form_test_localpart" id="form_test_localpart" /><span class="between ">@</span><span class="select "><select accesskey="D" title="Domain" name="form_test_domain" id="form_test_domain"><option value="test1">Test Nr. 1</option><option value="test2">Test Nr. 2</option><option value="test3">Test Nr. 3</option></select></span>
</p>
<input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test1" value="test1" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test2" value="test2" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_test3" value="test3" class="list " /><input type="radio" accesskey="R" title="Radio List" name="form_test_radio_list" id="form_test_radio_list_lorem" value="lorem" class="list " /><ul class="listbox radio ">
<li class="listbox_link_color "><label for="form_test_radio_list_test1" class="listbox_link "><span>Test Nr. 1</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_test2" class="listbox_link "><span>Test Nr. 2</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_test3" class="listbox_link "><span>Test Nr. 3</span></label></li><li class="listbox_link_color "><label for="form_test_radio_list_lorem" class="listbox_link "><span>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</span></label></li>
......
Markdown is supported
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