Skip to content

Commit d27cfa7

Browse files
committed
Allow spaces in Full Names
1 parent b972002 commit d27cfa7

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

func/main.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,15 @@ validate_format_name() {
605605
fi
606606
}
607607

608+
# Name with space
609+
validate_format_name_s() {
610+
if ! [[ "$1" =~ ^[[:alnum:]][-|\ |\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]]; then
611+
echo "Error: $2 $1 is not valid"
612+
log_event "$E_INVALID" "$EVENT"
613+
exit $E_INVALID
614+
fi
615+
}
616+
608617
# Username
609618
validate_format_username() {
610619
if ! [[ "$1" =~ ^[a-zA-Z0-9][-|\.|_|a-zA-Z0-9]{0,28}[a-zA-Z0-9]$ ]]; then
@@ -795,7 +804,7 @@ validate_format(){
795804
email) validate_format_email "$arg" ;;
796805
exp) validate_format_date "$arg" ;;
797806
extentions) validate_format_common "$arg" 'extentions' ;;
798-
fname) validate_format_name "$arg" "$arg_name" ;;
807+
fname) validate_format_name_s "$arg" "$arg_name" ;;
799808
forward) validate_format_email "$arg" ;;
800809
ftp_password) validate_format_password "$arg" ;;
801810
ftp_user) validate_format_username "$arg" "$arg_name" ;;
@@ -808,7 +817,7 @@ validate_format(){
808817
ip_status) validate_format_ip_status "$arg" ;;
809818
job) validate_format_int "$arg" 'job' ;;
810819
key) validate_format_username "$arg" "$arg_name" ;;
811-
lname) validate_format_name "$arg" "$arg_name" ;;
820+
lname) validate_format_name_s "$arg" "$arg_name" ;;
812821
malias) validate_format_username "$arg" "$arg_name" ;;
813822
mask) validate_format_ip "$arg" ;;
814823
max_db) validate_format_int "$arg" 'max db';;

web/edit/user/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@
120120
exec (VESTA_CMD."v-change-user-name ".$v_username." ".$v_fname." ".$v_lname, $output, $return_var);
121121
check_return_code($return_var,$output);
122122
unset($output);
123+
$v_fname = $_POST['v_fname'];
124+
$v_lname = $_POST['v_lname'];
123125
}
124126

125127
// Change NameServers

web/templates/admin/edit_user.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
</tr>
140140
<tr>
141141
<td>
142-
<input type="text" size="20" class="vst-input" name="v_fname" <?php if (!empty($v_fname)) echo "value=".$v_fname; ?>>
142+
<input type="text" size="20" class="vst-input" name="v_fname" <?php if (!empty($v_fname)) echo "value=\"".$v_fname."\""; ?>>
143143
</td>
144144
</tr>
145145
<tr>
@@ -149,7 +149,7 @@
149149
</tr>
150150
<tr>
151151
<td>
152-
<input type="text" size="20" class="vst-input" name="v_lname" <?php if (!empty($v_lname)) echo "value=".$v_lname; ?>>
152+
<input type="text" size="20" class="vst-input" name="v_lname" <?php if (!empty($v_lname)) echo "value=\"".$v_lname."\""; ?>>
153153
</td>
154154
</tr>
155155
<tr>

0 commit comments

Comments
 (0)