mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
i18n user db
This commit is contained in:
parent
c6b7c0b8e0
commit
f0cae5aa4a
3 changed files with 45 additions and 33 deletions
|
@ -22,9 +22,23 @@ if (!empty($_POST['ok'])) {
|
|||
if (empty($_POST['v_type'])) $errors[] = _('type');
|
||||
if (empty($_POST['v_charset'])) $errors[] = _('charset');
|
||||
|
||||
// Check for errors
|
||||
if (empty($errors[0])) {
|
||||
foreach ($errors as $i => $error) {
|
||||
if ( $i == 0 ) {
|
||||
$error_msg = $error;
|
||||
} else {
|
||||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
}
|
||||
|
||||
// Validate email
|
||||
if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) {
|
||||
$_SESSION['error_msg'] = _('Please enter valid email address.');
|
||||
if (!empty($_POST['v_db_email'])) {
|
||||
if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) {
|
||||
$_SESSION['error_msg'] = _('Please enter valid email address.');
|
||||
}
|
||||
}
|
||||
|
||||
// Protect input
|
||||
|
@ -35,17 +49,8 @@ if (!empty($_POST['ok'])) {
|
|||
$v_charset = $_POST['v_charset'];
|
||||
$v_db_email = $_POST['v_db_email'];
|
||||
|
||||
// Check for errors
|
||||
if (!empty($errors[0])) {
|
||||
foreach ($errors as $i => $error) {
|
||||
if ( $i == 0 ) {
|
||||
$error_msg = $error;
|
||||
} else {
|
||||
$error_msg = $error_msg.", ".$error;
|
||||
}
|
||||
}
|
||||
$_SESSION['error_msg'] = _('Error: field "%s" can not be blank.',$error_msg);
|
||||
} else {
|
||||
|
||||
if (empty($_SESSION['error_msg'])) {
|
||||
// Add Database
|
||||
$v_type = escapeshellarg($_POST['v_type']);
|
||||
$v_charset = escapeshellarg($_POST['v_charset']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue