|
16 | 16 | } |
17 | 17 |
|
18 | 18 | // Check empty fields |
19 | | - if (empty($_POST['v_database'])) $errors[] = __('database'); |
20 | | - if (empty($_POST['v_dbuser'])) $errors[] = __('username'); |
21 | | - if (empty($_POST['v_password'])) $errors[] = __('password'); |
22 | | - if (empty($_POST['v_type'])) $errors[] = __('type'); |
23 | | - if (empty($_POST['v_host'])) $errors[] = __('host'); |
24 | | - if (empty($_POST['v_charset'])) $errors[] = __('charset'); |
| 19 | + if (empty($_POST['v_database'])) $errors[] = _('database'); |
| 20 | + if (empty($_POST['v_dbuser'])) $errors[] = _('username'); |
| 21 | + if (empty($_POST['v_password'])) $errors[] = _('password'); |
| 22 | + if (empty($_POST['v_type'])) $errors[] = _('type'); |
| 23 | + if (empty($_POST['v_host'])) $errors[] = _('host'); |
| 24 | + if (empty($_POST['v_charset'])) $errors[] = _('charset'); |
25 | 25 | if (!empty($errors[0])) { |
26 | 26 | foreach ($errors as $i => $error) { |
27 | 27 | if ( $i == 0 ) { |
|
30 | 30 | $error_msg = $error_msg.", ".$error; |
31 | 31 | } |
32 | 32 | } |
33 | | - $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); |
| 33 | + $_SESSION['error_msg'] = _('Field "%s" can not be blank.',$error_msg); |
34 | 34 | } |
35 | 35 |
|
36 | 36 | // Validate email |
37 | 37 | if ((!empty($_POST['v_db_email'])) && (empty($_SESSION['error_msg']))) { |
38 | 38 | if (!filter_var($_POST['v_db_email'], FILTER_VALIDATE_EMAIL)) { |
39 | | - $_SESSION['error_msg'] = __('Please enter valid email address.'); |
| 39 | + $_SESSION['error_msg'] = _('Please enter valid email address.'); |
40 | 40 | } |
41 | | - } |
| 41 | + } |
42 | 42 |
|
43 | 43 | // Check password length |
44 | 44 | if (empty($_SESSION['error_msg'])) { |
45 | | - if (!validate_password($_POST['v_password'])) { $_SESSION['error_msg'] = __('Password does not match the minimum requirements');} |
| 45 | + if (!validate_password($_POST['v_password'])) { $_SESSION['error_msg'] = _('Password does not match the minimum requirements');} |
46 | 46 | } |
47 | 47 |
|
48 | 48 | // Protect input |
|
87 | 87 | // Email login credentials |
88 | 88 | if ((!empty($v_db_email)) && (empty($_SESSION['error_msg']))) { |
89 | 89 | $to = $v_db_email; |
90 | | - $subject = __("Database Credentials"); |
| 90 | + $subject = _("Database Credentials"); |
91 | 91 | $hostname = exec('hostname'); |
92 | | - $from = __('MAIL_FROM',$hostname); |
93 | | - $mailtext = __('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link); |
| 92 | + $from = _('MAIL_FROM',$hostname); |
| 93 | + $mailtext = _('DATABASE_READY',$user."_".$_POST['v_database'],$user."_".$_POST['v_dbuser'],$_POST['v_password'],$db_admin_link); |
94 | 94 | send_email($to, $subject, $mailtext, $from); |
95 | 95 | } |
96 | 96 |
|
97 | 97 | // Flush field values on success |
98 | 98 | if (empty($_SESSION['error_msg'])) { |
99 | | - $_SESSION['ok_msg'] = __('DATABASE_CREATED_OK',htmlentities($user)."_".htmlentities($_POST['v_database']),htmlentities($user)."_".htmlentities($_POST['v_database'])); |
100 | | - $_SESSION['ok_msg'] .= " / <a href=".$db_admin_link." target='_blank'>" . __('open %s',$db_admin) . "</a>"; |
| 99 | + $_SESSION['ok_msg'] = _('DATABASE_CREATED_OK',htmlentities($user)."_".htmlentities($_POST['v_database']),htmlentities($user)."_".htmlentities($_POST['v_database'])); |
| 100 | + $_SESSION['ok_msg'] .= " / <a href=".$db_admin_link." target='_blank'>" . _('open %s',$db_admin) . "</a>"; |
101 | 101 | unset($v_database); |
102 | 102 | unset($v_dbuser); |
103 | 103 | unset($v_password); |
|
0 commit comments