File tree Expand file tree Collapse file tree 7 files changed +40
-12
lines changed
Expand file tree Collapse file tree 7 files changed +40
-12
lines changed Original file line number Diff line number Diff line change 137137 'username ' => array (
138138 'datatype ' => 'VARCHAR ' ,
139139 'formtype ' => 'TEXT ' ,
140- 'regex ' => '/^.{1,30}$/ ' ,
141- 'errmsg ' => 'username_err ' ,
140+ 'validators ' => array ( 0 => array ( 'type ' => 'NOTEMPTY ' ,
141+ 'errmsg ' => 'username_empty ' ),
142+ 1 => array ( 'type ' => 'UNIQUE ' ,
143+ 'errmsg ' => 'username_unique ' ),
144+ 2 => array ( 'type ' => 'REGEX ' ,
145+ 'regex ' => '/^[\w\.\-\_]{0,50}$/ ' ,
146+ 'errmsg ' => 'username_err ' ),
147+ ),
148+ 'regex ' => '' ,
149+ 'errmsg ' => '' ,
142150 'default ' => '' ,
143151 'value ' => '' ,
144152 'separator ' => '' ,
Original file line number Diff line number Diff line change 11<?php
22$wb["username_txt"] = 'Username';
3- $wb["username_err"] = 'username_err';
3+ $wb["username_err"] = 'The username is too long or contains invalid characters.';
4+ $wb["username_empty"] = 'The username is empty.';
5+ $wb["username_unique"] = 'There is already a user with this username.';
46$wb["passwort_txt"] = 'Password';
57$wb["modules_txt"] = 'Module';
68$wb["startmodule_txt"] = 'Startmodule';
@@ -24,4 +26,5 @@ $wb["default_group_txt"] = 'Default Group';
2426$wb["active_txt"] = 'Active';
2527$wb["btn_save_txt"] = 'Save';
2628$wb["btn_cancel_txt"] = 'Cancel';
29+ $wb["startmodule_err"] = 'Start module is not within modules.';
2730?>
Original file line number Diff line number Diff line change 11< table width ="500 " border ="0 " cellspacing ="0 " cellpadding ="2 ">
22 < tr >
33 < td class ="frmText11 "> {tmpl_var name='username_txt'}:</ td >
4- < td class ="frmText11 "> < input name ="username " type ="text " class ="text " value ="{tmpl_var name='username'} " size ="15 " maxlength ="30 "> </ td >
4+ < td class ="frmText11 "> < input name ="username " type ="text " class ="text " value ="{tmpl_var name='username'} " size ="15 " maxlength ="50 "> </ td >
55 </ tr >
66 < tr >
77 < td class ="frmText11 "> {tmpl_var name='passwort_txt'}:</ td >
4747 < td > < input name ="btn_save " type ="button " class ="button " value ="{tmpl_var name='btn_save_txt'} " onClick ="submitForm('pageForm','admin/users_edit.php'); "> < div class ="buttonEnding "> </ div >
4848 < input name ="btn_cancel " type ="button " class ="button " value ="{tmpl_var name='btn_cancel_txt'} " onClick ="loadContent('admin/users_list.php'); "> < div class ="buttonEnding "> </ div >
4949 </ td >
50- </ tr >
51- </ table >
50+ </ tr >
51+ </ table >
5252< input type ="hidden " name ="id " value ="{tmpl_var name='id'} ">
Original file line number Diff line number Diff line change 11<?php
22/*
3- Copyright (c) 2007 , Till Brehm, projektfarm Gmbh
3+ Copyright (c) 2008 , Till Brehm, projektfarm Gmbh
44All rights reserved.
55
66Redistribution and use in source and binary forms, with or without modification,
4646
4747// Loading classes
4848$ app ->uses ('tpl,tform,tform_actions ' );
49+ $ app ->load ('tform_actions ' );
4950
50- // let tform_actions handle the page
51- $ app ->tform_actions ->onLoad ();
51+ class page_action extends tform_actions {
52+
53+ function onBeforeInsert () {
54+ global $ app , $ conf ;
55+
56+ if (!in_array ($ this ->dataRecord ['startmodule ' ],$ this ->dataRecord ['modules ' ])) {
57+ $ app ->tform ->errorMessage .= $ app ->tform ->wordbook ['startmodule_err ' ];
58+ }
59+ }
60+
61+ }
62+
63+ $ page = new page_action ;
64+ $ page ->onLoad ();
5265
5366?>
Original file line number Diff line number Diff line change 9292 'class ' => 'validate_client ' ,
9393 'function ' => 'username_unique ' ,
9494 'errmsg ' => 'username_error_unique ' ),
95+ 2 => array ( 'type ' => 'REGEX ' ,
96+ 'regex ' => '/^[\w\.\-\_]{0,50}$/ ' ,
97+ 'errmsg ' => 'username_error_regex ' ),
9598 ),
9699 'default ' => '' ,
97100 'value ' => '' ,
Original file line number Diff line number Diff line change @@ -80,4 +80,5 @@ $wb["limit_client_error_notint"] = 'The sub client limit must be a number.';
8080$wb["default_dbserver_txt"] = 'Default Database Server';
8181$wb["limit_database_txt"] = 'Max. number of Databases';
8282$wb["limit_database_error_notint"] = 'The database limit must be a number.';
83+ $wb["username_error_regex"] = 'The Username contains invalid chracaters.';
8384?>
Original file line number Diff line number Diff line change 99 </ tr >
1010 < tr >
1111 < td class ="frmText11 "> {tmpl_var name='username_txt'}:</ td >
12- < td class ="frmText11 "> < input name ="username " type ="text " class ="text " value ="{tmpl_var name='username'} " size ="30 " maxlength ="255 "> </ td >
12+ < td class ="frmText11 "> < input name ="username " type ="text " class ="text " value ="{tmpl_var name='username'} " size ="30 " maxlength ="50 "> </ td >
1313 </ tr >
1414 < tr >
1515 < td class ="frmText11 "> {tmpl_var name='password_txt'}:</ td >
8787 < td > < input name ="btn_save " type ="button " class ="button " value ="{tmpl_var name='btn_save_txt'} " onClick ="submitForm('pageForm','client/client_edit.php'); "> < div class ="buttonEnding "> </ div >
8888 < input name ="btn_cancel " type ="button " class ="button " value ="{tmpl_var name='btn_cancel_txt'} " onClick ="loadContent('client/client_list.php'); "> < div class ="buttonEnding "> </ div >
8989 </ td >
90- </ tr >
91- </ table >
90+ </ tr >
91+ </ table >
9292< input type ="hidden " name ="id " value ="{tmpl_var name='id'} ">
You can’t perform that action at this time.
0 commit comments