diff --git a/ihtml/themes/breezy/islocked.tpl b/ihtml/themes/breezy/islocked.tpl index 464f78b70f67016417cb373632c87d62788d5f38..1d6cbbc0e2ff58ee4d4b5cb98cf0de6db0f5d675 100644 --- a/ihtml/themes/breezy/islocked.tpl +++ b/ihtml/themes/breezy/islocked.tpl @@ -24,7 +24,7 @@ <input type="submit" name="open_readonly" value="{t}Read only{/t}"/> {/if} - <input type="submit" name="cancel_lock" value="{t}Cancel{/t}"/> + <input type="submit" formnovalidate="formnovalidate" name="cancel_lock" value="{t}Cancel{/t}"/> </p> <input type="hidden" name="dn" value="{$dn}"/> diff --git a/ihtml/themes/breezy/management/actionmenu.tpl b/ihtml/themes/breezy/management/actionmenu.tpl index faa3cb5ce04ab24a7ed0f27798593916a6614c17..8d9d3f491154d7851c2c1f403208e713e8ee080e 100644 --- a/ihtml/themes/breezy/management/actionmenu.tpl +++ b/ihtml/themes/breezy/management/actionmenu.tpl @@ -24,7 +24,7 @@ <div id="pulldown"> <input type="hidden" name="act" id="actionmenu" value=""/> - <div style="display:none"><input type="submit" name="exec_act" id="exec_act" value=""/></div> + <div style="display:none"><input type="submit" formnovalidate="formnovalidate" name="exec_act" id="exec_act" value=""/></div> <ul class="level1" id="root"> <li> <a href="#">{t}Actions{/t} <img class="center optional" src="images/down-arrow.png" alt="down arrow"/></a> diff --git a/ihtml/themes/breezy/management/filter.tpl b/ihtml/themes/breezy/management/filter.tpl index 8b8441a2c4f5753f4a3a08a3378f560daddb05e4..1991fa4648d9f664a0bc8229f1a79ef1bd67d74f 100644 --- a/ihtml/themes/breezy/management/filter.tpl +++ b/ihtml/themes/breezy/management/filter.tpl @@ -36,7 +36,7 @@ <hr/> <label for="SEARCH" title="{$SEARCHDESC|escape}"><img src="geticon.php?context=actions&icon=system-search&size=16" alt="Search"/> - <input class="filter_textfield" id="SEARCH" name="SEARCH" type="text" value="{$SEARCH}"/> + <input class="filter_textfield" id="SEARCH" name="SEARCH" type="search" value="{$SEARCH}"/> </label> <div> <input type="submit" name="apply" value="{t}Apply filter{/t}"/> diff --git a/ihtml/themes/breezy/management/tabfooter.tpl b/ihtml/themes/breezy/management/tabfooter.tpl index 0d9f8477d64122e2aa0d0b669f1ece45caf2a4e6..aa1e7ad469c18af88077005a7cd8987ec91e7273 100644 --- a/ihtml/themes/breezy/management/tabfooter.tpl +++ b/ihtml/themes/breezy/management/tabfooter.tpl @@ -1,6 +1,6 @@ {if $readOnly} <p class="plugbottom"> - <input type="submit" name="edit_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="{msgPool type=cancelButton}"/> </p> {else} <p class="plugbottom"> @@ -10,6 +10,6 @@ <input type="submit" name="edit_apply" value="{msgPool type=applyButton}"/> {/if} - <input type="submit" name="edit_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="{msgPool type=cancelButton}"/> </p> {/if} diff --git a/ihtml/themes/breezy/restore-confirm.tpl b/ihtml/themes/breezy/restore-confirm.tpl index 782f734a8b19033be5aabeeaaf01e9ae451ac257..17df7ff41c1790c9f36615bd18933a24fbf917b8 100644 --- a/ihtml/themes/breezy/restore-confirm.tpl +++ b/ihtml/themes/breezy/restore-confirm.tpl @@ -23,7 +23,7 @@ <p class="plugbottom"> <input type="submit" name="restore_confirmed" value="{t}Continue{/t}"/> - <input type="submit" name="restore_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="restore_cancel" value="{msgPool type=cancelButton}"/> </p> </div> </div> diff --git a/ihtml/themes/breezy/simple-remove.tpl b/ihtml/themes/breezy/simple-remove.tpl index e182eeb36a95024fba6521b731463624c9d68f15..2f40e836219654a0d2837c9617e036e984d1b0c2 100644 --- a/ihtml/themes/breezy/simple-remove.tpl +++ b/ihtml/themes/breezy/simple-remove.tpl @@ -22,7 +22,7 @@ <p class="plugbottom"> <input type="submit" name="delete_confirmed" value="{msgPool type=delButton}"/> - <input type="submit" name="delete_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="delete_cancel" value="{msgPool type=cancelButton}"/> </p> </div> </div> diff --git a/ihtml/themes/breezy/simple-select-list.tpl b/ihtml/themes/breezy/simple-select-list.tpl index 0e3284fa0fe3f66c0c6e56326d18fb3fef8f2adf..8465f4c00bab32e2895e1e1e0557d0ccedb9b6ba 100644 --- a/ihtml/themes/breezy/simple-select-list.tpl +++ b/ihtml/themes/breezy/simple-select-list.tpl @@ -5,5 +5,5 @@ <input type="submit" name="add_finish" value="{msgPool type=addButton}"/> {/if} - <input type="submit" name="add_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="add_cancel" value="{msgPool type=cancelButton}"/> </p> diff --git a/ihtml/themes/breezy/template.tpl b/ihtml/themes/breezy/template.tpl index 0aa9b9cab6a730ff5c9bc9628e770acdffedae96..1dc41fa52d3a81e78ffb6011790f1599d9528a4b 100644 --- a/ihtml/themes/breezy/template.tpl +++ b/ihtml/themes/breezy/template.tpl @@ -23,5 +23,5 @@ <p class="plugbottom"> <input type="submit" name="template_continue" value="{t}Continue{/t}"/> - <input type="submit" name="template_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="template_cancel" value="{msgPool type=cancelButton}"/> </p> diff --git a/include/class_CopyPasteHandler.inc b/include/class_CopyPasteHandler.inc index a3ba4c952818062952312cba8ad026179693921b..890c40f193dd4ddfec87d08e12ed8dc7dc7bf7e9 100644 --- a/include/class_CopyPasteHandler.inc +++ b/include/class_CopyPasteHandler.inc @@ -256,8 +256,8 @@ class CopyPasteHandler $display .= '<p class="plugbottom">'."\n"; $display .= '<input type="submit" name="edit_finish" style="width:80px" value="'.msgPool::okButton().'"/>'."\n"; $display .= " \n"; - $display .= '<input type="submit" name="abort_current_cut-copy_operation" value="'.msgPool::cancelButton().'"/>'."\n"; - $display .= '<input type="submit" name="abort_all_cut-copy_operations" value="'._('Cancel all').'"/>'."\n"; + $display .= '<input type="submit" formnovalidate="formnovalidate" name="abort_current_cut-copy_operation" value="'.msgPool::cancelButton().'"/>'."\n"; + $display .= '<input type="submit" formnovalidate="formnovalidate" name="abort_all_cut-copy_operations" value="'._('Cancel all').'"/>'."\n"; $display .= '</p>'; } return $display; diff --git a/include/class_SnapshotDialogs.inc b/include/class_SnapshotDialogs.inc index 52385a6242ad99f3cc39022eb6a1835ecb48500a..9fbbe4f753ae3419af51f6724a503b0322f71b77 100644 --- a/include/class_SnapshotDialogs.inc +++ b/include/class_SnapshotDialogs.inc @@ -107,7 +107,7 @@ class SnapshotCreateDialog extends simplePlugin $str .= '<p class="plugbottom">'. ' <input type="submit" name="edit_finish" value="'.msgPool::saveButton().'"/> '. - ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'. '</p>'; return $str; @@ -342,7 +342,7 @@ class SnapshotRestoreDialog extends simplePlugin $smarty->assign('SnapshotHandlerACL', $acl); $str = parent::execute(); $str .= '<p class="plugbottom">'. - ' <input type="submit" name="edit_cancel" value="'.msgPool::backButton().'"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::backButton().'"/>'. '</p>'; } diff --git a/include/class_baseSelector.inc b/include/class_baseSelector.inc index 5050b7ca0c6c4140182e526327c48fede84d2dfe..f4311c2d9987d525a259b664d0ed60a73628ea8c 100644 --- a/include/class_baseSelector.inc +++ b/include/class_baseSelector.inc @@ -260,7 +260,7 @@ class baseSelector if ($this->submitButton) { $this->tree .= " <input class='center' type='image' src='geticon.php?context=actions&icon=submit&size=16' title='"._("Submit")."' name='submit_base_".$this->pid."' id='submit_base_".$this->pid."' alt='"._("Submit")."'>"; } - $this->tree .= '<input type="submit" style="display:none" name="submit_tree_base_'.$this->pid.'" id="submit_tree_base_'.$this->pid.'"/>'; + $this->tree .= '<input type="submit" formnovalidate="formnovalidate" style="display:none" name="submit_tree_base_'.$this->pid.'" id="submit_tree_base_'.$this->pid.'"/>'; $this->tree .= '<input type="hidden" name="bs_rebase_'.$this->pid.'" id="bs_rebase_'.$this->pid.'"/>'; $this->tree .= '<input type="hidden" name="BPID" id="BPID" value="'.$this->pid.'"/>'; } diff --git a/include/class_ldapSizeLimit.inc b/include/class_ldapSizeLimit.inc index 32d3666fb721c0ef9b634097e8f9d454d3a3b9b5..69d5e35ca090de6b4a0489d678da6e93fec6c8df 100644 --- a/include/class_ldapSizeLimit.inc +++ b/include/class_ldapSizeLimit.inc @@ -128,7 +128,7 @@ class ldapSizeLimit function renderWarning() { if (($this->sizeLimit >= 10000000) || $this->limitExceeded) { - $config = '<input type="submit" name="edit_sizelimit" value="'._('Configure').'"/>'; + $config = '<input type="submit" name="edit_sizelimit" value="'._('Configure').'" formnovalidate="formnovalidate"/>'; } else { $config = ''; } diff --git a/include/class_listing.inc b/include/class_listing.inc index 5c7a6ca8970f0f5d3c45a69685b790fa3608ae7a..0db3db001043c6ac33106f27e52530e798f41ba8 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -1309,7 +1309,7 @@ class listing // Load shortcut $result = '<input type="hidden" name="act" id="actionmenu" value="">'. - '<div style="display:none"><input type="submit" name="exec_act" id="exec_act" value=""/></div>'. + '<div style="display:none"><input type="submit" formnovalidate="formnovalidate" name="exec_act" id="exec_act" value=""/></div>'. '<ul class="level1" id="root"><li><a href="#">'._('Actions'). ' <img class="center optional" src="images/down-arrow.png" alt="down arrow"/></a>'; diff --git a/include/class_tests.inc b/include/class_tests.inc index 2dc73fdf88cad21f6b6555f86b64dacc2ff8bcc0..93d90912311a82776abe996c6b657a31aa96bb2c 100644 --- a/include/class_tests.inc +++ b/include/class_tests.inc @@ -166,7 +166,7 @@ class tests */ public static function is_mac($mac) { - return preg_match("/^[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]:[a-f0-9][a-f0-9]$/i", $mac); + return preg_match('/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', $mac); } diff --git a/include/management/class_ManagementConfigurationDialog.inc b/include/management/class_ManagementConfigurationDialog.inc index 70e3664e1a2f22ee3995b1964bf9fd572c3b422f..cfdcc22b788f864ce39afdec52deba6372405132 100644 --- a/include/management/class_ManagementConfigurationDialog.inc +++ b/include/management/class_ManagementConfigurationDialog.inc @@ -128,7 +128,7 @@ class ManagementConfigurationDialog extends simplePlugin $str .= '<p class="plugbottom">'. ' <input type="submit" name="edit_finish" value="'.msgPool::saveButton().'"/> '. - ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'. '</p>'; return $str; diff --git a/include/simpleplugin/attributes/class_FileAttribute.inc b/include/simpleplugin/attributes/class_FileAttribute.inc index 2ad49b65e6dbe934fd9954d67ee6b5159419653b..388112074afd0c382f494196c1d88946d08c9e3d 100644 --- a/include/simpleplugin/attributes/class_FileAttribute.inc +++ b/include/simpleplugin/attributes/class_FileAttribute.inc @@ -169,7 +169,7 @@ class FileDownloadAttribute extends FileAttribute $display = ''; if ($this->upload) { $display .= $this->renderInputField('file', $id); - $display .= $this->renderInputField('submit', 'upload'.$id, array('value' => _('Upload'))); + $display .= $this->renderInputField('submit', 'upload'.$id, array('value' => _('Upload'), 'formnovalidate' => 'formnovalidate')); } $display .= $this->renderInputField( 'image', 'download'.$id, diff --git a/include/simpleplugin/attributes/class_IntAttribute.inc b/include/simpleplugin/attributes/class_IntAttribute.inc index 476f16607ac17a4ff894f8cb12c7cf89a62d3cc1..7ca5e42159b7a4d108befbededdd251e0b985cfe 100644 --- a/include/simpleplugin/attributes/class_IntAttribute.inc +++ b/include/simpleplugin/attributes/class_IntAttribute.inc @@ -108,6 +108,9 @@ class IntAttribute extends Attribute $js = $this->managedAttributesJS(); $attributes['onChange'] = 'javascript:'.htmlentities($js, ENT_COMPAT, 'UTF-8'); } + if ($this->isRequired()) { + $attributes['required'] = 'required'; + } $display = $this->renderInputField('number', $id, $attributes); return $this->renderAcl($display); } diff --git a/include/simpleplugin/attributes/class_PhoneNumberAttribute.inc b/include/simpleplugin/attributes/class_PhoneNumberAttribute.inc index 320c7a5842188dd6b0d3806358f0aad68d737315..9a5ced3fbcbd30c812687311aac76794cedb1218 100644 --- a/include/simpleplugin/attributes/class_PhoneNumberAttribute.inc +++ b/include/simpleplugin/attributes/class_PhoneNumberAttribute.inc @@ -108,10 +108,15 @@ class phoneSelectDialog extends GenericDialog /*! \brief This class allow to handle easily an LDAP attribute that contains a phone number */ -class PhoneNumberAttribute extends TestValidateAttribute +class PhoneNumberAttribute extends StringAttribute { - protected $trim = TRUE; - protected $testFunc = 'is_phone_nr'; + protected $trim = TRUE; + protected $inputType = 'tel'; + + function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = '', $acl = '', $regexp = '/^[\/0-9 ()+*-]+$/', $example = NULL) + { + parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl, $regexp, $example); + } } /*! \brief Displays a text field and a button to select the phone from object list diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc index ddd05f6f86b44d0d6433b9eadacc230ab7342f76..90d16938dd25347c0bd149aded872676067918cd 100644 --- a/include/simpleplugin/attributes/class_SetAttribute.inc +++ b/include/simpleplugin/attributes/class_SetAttribute.inc @@ -43,7 +43,7 @@ class SetAttribute extends Attribute $values ); $this->attribute = $attribute; - $this->attribute->setRequired(TRUE); + $this->attribute->setRequired(FALSE); $this->valueUnicity = $valueUnicity; } @@ -278,8 +278,8 @@ class SetAttribute extends Attribute function renderButtons () { $id = $this->getHtmlId(); - $buttons = $this->renderInputField('submit', 'add'.$id, array('value' => '{msgPool type=addButton}')); - $buttons .= $this->renderInputField('submit', 'del'.$id, array('value' => '{msgPool type=delButton}')); + $buttons = $this->renderInputField('submit', 'add'.$id, array('value' => '{msgPool type=addButton}', 'formnovalidate' => 'formnovalidate')); + $buttons .= $this->renderInputField('submit', 'del'.$id, array('value' => '{msgPool type=delButton}', 'formnovalidate' => 'formnovalidate')); return $buttons; } @@ -656,7 +656,7 @@ class OrderedArrayAttribute extends SetAttribute function renderButtons () { $id = $this->getHtmlId(); - $buttons = $this->renderInputField('submit', 'add'.$id, array('value' => '{msgPool type=addButton}')); + $buttons = $this->renderInputField('submit', 'add'.$id, array('value' => '{msgPool type=addButton}', 'formnovalidate' => 'formnovalidate')); return $buttons; } } diff --git a/include/simpleplugin/attributes/class_StringAttribute.inc b/include/simpleplugin/attributes/class_StringAttribute.inc index 97471ab52dc59df6deb3983af915fbd34aff5401..3ea86764bf6477549fadd9ebe8fc1d2b3e5dd3aa 100644 --- a/include/simpleplugin/attributes/class_StringAttribute.inc +++ b/include/simpleplugin/attributes/class_StringAttribute.inc @@ -27,6 +27,8 @@ class StringAttribute extends Attribute protected $example; protected $autocomplete = NULL; protected $trim = FALSE; + protected $inputType = 'text'; + protected $html5pattern = NULL; /*! \brief The constructor of StringAttribute * @@ -42,7 +44,7 @@ class StringAttribute extends Attribute function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = "", $acl = "", $regexp = "", $example = NULL) { parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl); - $this->pattern = $regexp; + $this->setPattern($regexp); $this->example = ($example === NULL ? $defaultValue : $example); } @@ -54,6 +56,14 @@ class StringAttribute extends Attribute function setPattern ($pattern) { $this->pattern = $pattern; + if (preg_match('/^(.)\^(.*)\$\1$/', $pattern, $m)) { + /* Only convert anchored patterns + * First and last characters are the same means no modifiers are in use + */ + $this->html5pattern = $m[2]; + } else { + $this->html5pattern = NULL; + } } function renderFormInput () @@ -69,7 +79,13 @@ class StringAttribute extends Attribute if ($this->autocomplete !== NULL) { $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' ); } - $display = $this->renderInputField('text', $id, $attributes); + if ($this->html5pattern !== NULL) { + $attributes['pattern'] = '{literal}'.htmlentities($this->html5pattern, ENT_COMPAT, 'UTF-8').'{/literal}'; + } + if ($this->isRequired()) { + $attributes['required'] = 'required'; + } + $display = $this->renderInputField($this->inputType, $id, $attributes); return $this->renderAcl($display); } @@ -142,7 +158,9 @@ class TextAreaAttribute extends StringAttribute { $id = $this->getHtmlId(); $display = '<textarea name="'.$id.'" id="'.$id.'"'. - ($this->disabled ? ' disabled="disabled"' : '').'>'. + ($this->disabled ? ' disabled="disabled"' : ''). + ($this->isRequired() ? ' required="required"' : ''). + '>'. '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}</textarea>'; return $this->renderAcl($display); } diff --git a/include/simpleplugin/class_dialogAttributes.inc b/include/simpleplugin/class_dialogAttributes.inc index f9afa2314873fca3974c72e4aab6177f05c28211..997f560261c75007975a334e8ee5f5c3877e3a0c 100644 --- a/include/simpleplugin/class_dialogAttributes.inc +++ b/include/simpleplugin/class_dialogAttributes.inc @@ -249,20 +249,27 @@ class DialogAttribute extends SetAttribute ); $buttons .= $this->renderInputField( 'submit', 'add'.$id, - array('value' => '{msgPool type=addButton}') + array( + 'value' => '{msgPool type=addButton}', + 'formnovalidate' => 'formnovalidate' + ) ); $dialogButtonValue = _('Add (dialog)'); } $buttons .= $this->renderInputField( 'submit', 'add'.$id.'_dialog', array( - 'class' => 'dialog', - 'value' => $dialogButtonValue + 'class' => 'dialog', + 'value' => $dialogButtonValue, + 'formnovalidate' => 'formnovalidate' ) ); $buttons .= $this->renderInputField( 'submit', 'del'.$id, - array('value' => '{msgPool type=delButton}') + array( + 'value' => '{msgPool type=delButton}', + 'formnovalidate' => 'formnovalidate' + ) ); return $buttons; } @@ -337,8 +344,9 @@ class DialogOrderedArrayAttribute extends OrderedArrayAttribute return $this->renderInputField( 'submit', 'add'.$id.'_dialog', array( - 'class' => 'dialog', - 'value' => '{msgPool type=addButton}' + 'class' => 'dialog', + 'value' => '{msgPool type=addButton}', + 'formnovalidate' => 'formnovalidate' ) ); } @@ -882,7 +890,7 @@ class GenericSimplePluginDialog extends GenericDialog { return '<div style="width:100%; text-align:right; clear:both; float:none;">'. ' <input type="submit" name="'.$this->post_finish.'" value="'.msgPool::saveButton().'"/> '. - ' <input type="submit" name="'.$this->post_cancel.'" value="'.msgPool::cancelButton().'"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="'.$this->post_cancel.'" value="'.msgPool::cancelButton().'"/>'. '</div>'; } diff --git a/include/simpleplugin/class_helpersAttribute.inc b/include/simpleplugin/class_helpersAttribute.inc index 60b7802352f50e30222a3b883b9b002f1e97407a..f2538d0120702d817b1c79c7b783980dc5b1b671 100644 --- a/include/simpleplugin/class_helpersAttribute.inc +++ b/include/simpleplugin/class_helpersAttribute.inc @@ -18,21 +18,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -/*! \brief This class allow to handle easily a String LDAP attribute that contains a mail address - * - */ -class MailAttribute extends StringAttribute -{ - protected $trim = TRUE; - - function validate () - { - if (!tests::is_email($this->value)) { - return msgPool::invalid($this->getLabel(), $this->value); - } - } -} - /*! \brief This class allow to handle easily a String LDAP attribute that needs to be validated by a test from class tests * @@ -50,6 +35,16 @@ class TestValidateAttribute extends StringAttribute } } +/*! \brief This class allow to handle easily a String LDAP attribute that contains a mail address + * + */ +class MailAttribute extends TestValidateAttribute +{ + protected $trim = TRUE; + protected $testFunc = 'is_email'; + protected $inputType = 'email'; +} + /*! \brief This class allow to handle easily a String LDAP attribute that contains a host name * */ @@ -81,9 +76,9 @@ class PathAttribute extends TestValidateAttribute */ class URLAttribute extends TestValidateAttribute { - protected $trim = TRUE; - - protected $testFunc = 'is_url'; + protected $trim = TRUE; + protected $testFunc = 'is_url'; + protected $inputType = 'url'; } /*! \brief This class allow to handle easily a String LDAP attribute that contains an IP (v4 or v6) @@ -123,16 +118,14 @@ class MacAddressAttribute extends StringAttribute { protected $trim = TRUE; - function setValue ($value) + function __construct ($label, $description, $ldapName, $required = FALSE, $defaultValue = '', $acl = '') { - return parent::setValue(strtolower($value)); + parent::__construct($label, $description, $ldapName, $required, $defaultValue, $acl, '/^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$/', '5E:FF:56:A2:AF:15'); } - function validate () + function setValue ($value) { - if (!tests::is_mac($this->value)) { - return msgPool::invalid($this->getLabel(), $this->value); - } + return parent::setValue(strtolower($value)); } } diff --git a/include/simpleplugin/class_simpleManagement.inc b/include/simpleplugin/class_simpleManagement.inc index d1d525eaa9eb9be1cfefa77f9fa86f195cfa155e..64f49534176afbfb92b6d05e50b6508ad3ae6035 100644 --- a/include/simpleplugin/class_simpleManagement.inc +++ b/include/simpleplugin/class_simpleManagement.inc @@ -637,7 +637,7 @@ class simpleManagement $str = ''; if ($this->tabObject->readOnly()) { $str .= '<p class="plugbottom">'."\n". - '<input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'">'."\n". + '<input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::cancelButton().'">'."\n". '</p>'; return $str; } else { @@ -649,7 +649,7 @@ class simpleManagement $str .= '<input type="submit" name="edit_apply" value="'.msgPool::applyButton().'"/>'."\n"; $str .= " \n"; } - $str .= '<input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n"; + $str .= '<input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n"; $str .= '</p>'; } return $str; diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index c23ee21a9607d838050044892f4f0e426bbd0b4f..cdec82addf9ee88e38cf666cc8761e02767c6391 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -788,7 +788,7 @@ class simplePlugin $state = ''; } $display = '<div width="100%"><p><b>'.$text.'</b><br/>'."\n"; - $display .= '<input type="submit" value="'.$button_text.'" name="'.$name.'" '.$state.'></p></div><hr class="separator"/>'; + $display .= '<input type="submit" formnovalidate="formnovalidate" value="'.$button_text.'" name="'.$name.'" '.$state.'></p></div><hr class="separator"/>'; return $display; } @@ -2174,7 +2174,7 @@ class simplePlugin if (session::is_set('edit')) { $display .= '<input type="submit" name="edit_finish" style="width:80px" value="'.msgPool::okButton().'"/>'."\n"; $display .= ' '; - $display .= '<input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n"; + $display .= '<input type="submit" formnovalidate="formnovalidate" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n"; } else { /* Only display edit button if there is at least one attribute editable */ if (preg_match('/r/', $ui->get_permissions($entry_dn, $plCategory.'/'.$tabObject->current))) { diff --git a/include/simpleplugin/class_simpleService.inc b/include/simpleplugin/class_simpleService.inc index d552dd10f3a746e8eb7639516d6b252b595775c3..f7d52841dac5c44607b490167c6c4e3312f854b7 100644 --- a/include/simpleplugin/class_simpleService.inc +++ b/include/simpleplugin/class_simpleService.inc @@ -54,7 +54,7 @@ class simpleService extends simplePlugin if (!$this->dialog) { $str .= '<p class="plugbottom servicebottom">'. ' <input type="submit" name="SaveService" value="'.msgPool::saveButton().'"/> '. - ' <input type="submit" name="CancelService" value="'.msgPool::cancelButton().'"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="CancelService" value="'.msgPool::cancelButton().'"/>'. '</div>'; } diff --git a/plugins/admin/acl/class_aclAssignment.inc b/plugins/admin/acl/class_aclAssignment.inc index 0421a222b64cebf5ca592f8a4a98a9ce49d2f3d0..721eff3291a160f710055794528ddc2f1de9b802 100644 --- a/plugins/admin/acl/class_aclAssignment.inc +++ b/plugins/admin/acl/class_aclAssignment.inc @@ -101,7 +101,7 @@ class aclAssignmentDialogWindow extends simplePlugin '<p class="plugbottom">'. ' <input type="submit" name="add_acl_finish" value="{msgPool type=addButton}"/>'. ' '. - ' <input type="submit" name="add_acl_cancel" value="{msgPool type=cancelButton}"/>'. + ' <input type="submit" formnovalidate="formnovalidate" name="add_acl_cancel" value="{msgPool type=cancelButton}"/>'. '</p>'); } return $display; diff --git a/plugins/admin/acl/class_aclManagement.inc b/plugins/admin/acl/class_aclManagement.inc index 540d53c1ba885ca9c1b2e074a3dcebb569c010dc..439a9619bee2a98b181f29f34927c1bd95066337 100644 --- a/plugins/admin/acl/class_aclManagement.inc +++ b/plugins/admin/acl/class_aclManagement.inc @@ -92,7 +92,7 @@ class aclAssignmentCreationDialog extends simplePlugin return parent::execute()."\n". '<p class="plugbottom">'."\n". ' <input type="submit" name="'.$this->post_finish.'" value="'.msgPool::addButton().'"/> '."\n". - ' <input type="submit" name="'.$this->post_cancel.'" value="'.msgPool::cancelButton().'"/>'."\n". + ' <input type="submit" formnovalidate="formnovalidate" name="'.$this->post_cancel.'" value="'.msgPool::cancelButton().'"/>'."\n". '</p>'; } } diff --git a/plugins/admin/acl/remove.tpl b/plugins/admin/acl/remove.tpl index ea079d26479ca65c9dff717b1fafdcf865a65478..817e0e926477afd3f690c6fbc376af3084225f2e 100644 --- a/plugins/admin/acl/remove.tpl +++ b/plugins/admin/acl/remove.tpl @@ -22,7 +22,7 @@ <p class="plugbottom"> <input type="submit" name="delete_confirmed" value="{msgPool type=delButton}"/> - <input type="submit" name="delete_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="delete_cancel" value="{msgPool type=cancelButton}"/> </p> </div> </div> diff --git a/plugins/admin/aclrole/acleditiondialog.tpl b/plugins/admin/aclrole/acleditiondialog.tpl index b92d8a12280619a602bce5f0e204ae0ada9e294d..36174c6ee53ae03145d520f1a619fff21a19cee1 100644 --- a/plugins/admin/aclrole/acleditiondialog.tpl +++ b/plugins/admin/aclrole/acleditiondialog.tpl @@ -4,13 +4,13 @@ {if $dialogState eq 'create'} <p class="plugbottom"> <input type="submit" name="add_finish" value="{msgPool type=applyButton}"/> - <input type="submit" name="add_cancel" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="add_cancel" value="{msgPool type=cancelButton}"/> </p> {/if} {if $dialogState eq 'edit'} <p class="plugbottom"> <input type="submit" name="submit_edit_acl" value="{msgPool type=applyButton}"/> - <input type="submit" name="cancel_edit_acl" value="{msgPool type=cancelButton}"/> + <input type="submit" formnovalidate="formnovalidate" name="cancel_edit_acl" value="{msgPool type=cancelButton}"/> </> {/if} diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 972c070bc8047bd87aa255fed79fe12260623966..1a44faa4f79ad0bf94f35d0ba0c80cbac5f296e0 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -93,12 +93,12 @@ class user extends simplePlugin new StringAttribute ( _('Last name'), _('Last name of this user'), 'sn', TRUE, - '', '', '/[^,+"?()=<>;\\\\]/' + '', '', '/^[^,+"?()=<>;\\\\]+$/' ), new StringAttribute ( _('First name'), _('First name of this user'), 'givenName', TRUE, - '', '', '/[^,+"?()=<>;\\\\]/' + '', '', '/^[^,+"?()=<>;\\\\]+$/' ), new TextAreaAttribute ( _('Description'), _('Short description of the user'), diff --git a/setup/setup_migrate_accounts.tpl b/setup/setup_migrate_accounts.tpl index a2ebcdd4795042ad22aa069b060976d440c9fcfa..0d2bcbebaa17d4938e3d4af9aab8d67471379373 100644 --- a/setup/setup_migrate_accounts.tpl +++ b/setup/setup_migrate_accounts.tpl @@ -65,7 +65,7 @@ dn: {$entry.dn} <div style="width:99%; text-align:right; padding-top:5px;"> <input type="submit" name="dialog_confirm" value="{t}Apply{/t}"/> - <input type="submit" name="dialog_cancel" value="{t}Cancel{/t}"/> + <input type="submit" formnovalidate="formnovalidate" name="dialog_cancel" value="{t}Cancel{/t}"/> </div> </div> </div> diff --git a/setup/setup_migrate_adminAccount.tpl b/setup/setup_migrate_adminAccount.tpl index ae5ca8bbc5e9b05c22e6d7cc290f11359098d245..a7cd35fffa0b26e7f8c23aab558a93bb40a9719f 100644 --- a/setup/setup_migrate_adminAccount.tpl +++ b/setup/setup_migrate_adminAccount.tpl @@ -51,7 +51,7 @@ <hr/> <div style='width:99%; text-align:right; padding:5px;'> <input type='submit' name='dialog_confirm' value='{t}Apply{/t}'/> - <input type='submit' name='dialog_cancel' value='{t}Cancel{/t}'/> + <input type='submit' formnovalidate="formnovalidate" name='dialog_cancel' value='{t}Cancel{/t}'/> </div> </div> </div> diff --git a/setup/setup_migrate_baseOC.tpl b/setup/setup_migrate_baseOC.tpl index 4a85846dff236694f76c63d6a5d104d290a971fc..bec45cc2f90c31c2a097eaaafddead5e1124adf9 100644 --- a/setup/setup_migrate_baseOC.tpl +++ b/setup/setup_migrate_baseOC.tpl @@ -22,7 +22,7 @@ <hr/> <div style='width:100%; text-align:right; padding:5px;'> - <input type='submit' name='dialog_cancel' value='{t}Close{/t}'> + <input type='submit' formnovalidate="formnovalidate" name='dialog_cancel' value='{t}Close{/t}'> </div> </div> </div>