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/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/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_StringAttribute.inc b/include/simpleplugin/attributes/class_StringAttribute.inc index 575ae19eedb8c9af9de7f2aff38dba82cf9b3653..632ec4bea79869ad0b2cf9af0d357275ab166e42 100644 --- a/include/simpleplugin/attributes/class_StringAttribute.inc +++ b/include/simpleplugin/attributes/class_StringAttribute.inc @@ -28,6 +28,7 @@ class StringAttribute extends Attribute protected $autocomplete = NULL; protected $trim = FALSE; protected $inputType = 'text'; + protected $html5pattern = NULL; /*! \brief The constructor of StringAttribute * @@ -43,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); } @@ -55,6 +56,12 @@ class StringAttribute extends Attribute function setPattern ($pattern) { $this->pattern = $pattern; + if (preg_match('/^(.)(.*)\1$/', $pattern, $m)) { + // First and last characters are the same means no modifiers are in use + $this->html5pattern = $m[2]; + } else { + $this->html5pattern = NULL; + } } function renderFormInput () @@ -70,6 +77,9 @@ class StringAttribute extends Attribute if ($this->autocomplete !== NULL) { $attributes['autocomplete'] = ($this->autocomplete ? 'on' : 'off' ); } + if ($this->html5pattern !== NULL) { + $attributes['pattern'] = htmlentities($this->html5pattern, ENT_COMPAT, 'UTF-8'); + } $display = $this->renderInputField($this->inputType, $id, $attributes); return $this->renderAcl($display); } diff --git a/include/simpleplugin/class_dialogAttributes.inc b/include/simpleplugin/class_dialogAttributes.inc index f9afa2314873fca3974c72e4aab6177f05c28211..c0169875b6a89254deea88ffa4efb5d0cdafb634 100644 --- a/include/simpleplugin/class_dialogAttributes.inc +++ b/include/simpleplugin/class_dialogAttributes.inc @@ -882,7 +882,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_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>