File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3636 $ v_lname = escapeshellarg ($ _POST ['v_lname ' ]);
3737 if (empty ($ _POST ['v_notify ' ])) $ v_notify = 'off ' ;
3838
39+ // Validate email
40+ if (!filter_var ($ _POST ['v_email ' ], FILTER_VALIDATE_EMAIL )) {
41+ $ _SESSION ['error_msg ' ] = 'Please enter valid email address. ' ;
42+ }
43+
3944 // Check for errors
4045 if (!empty ($ errors [0 ])) {
4146 foreach ($ errors as $ i => $ error ) {
4651 }
4752 }
4853 $ _SESSION ['error_msg ' ] = "Error: field " .$ error_msg ." can not be blank. " ;
49- } else {
54+ }
55+
56+ if (empty ($ _SESSION ['error_msg ' ])) {
5057 exec (VESTA_CMD ."v_add_user " .$ v_username ." " .$ v_password ." " .$ v_email ." " .$ v_package ." " .$ v_fname ." " .$ v_lname , $ output , $ return_var );
5158 if ($ return_var != 0 ) {
5259 $ error = implode ('<br> ' , $ output );
6774 $ mailtext .= "https:// " .$ _SERVER ['HTTP_HOST ' ]."/login/ \n" ;
6875 $ mailtext .= "username: " .$ _POST ['v_username ' ]."\n" ;
6976 $ mailtext .= "password: " .$ _POST ['v_password ' ]."\n\n" ;
70- $ mailtext .= "Have a nice day, \n The VestaCP Team \n" ;
77+ $ mailtext .= "-- \n Vesta Control Panel \n" ;
7178 send_email ($ to , $ subject , $ mailtext , $ from );
7279 }
7380
You can’t perform that action at this time.
0 commit comments