File tree Expand file tree Collapse file tree 3 files changed +32
-10
lines changed
Expand file tree Collapse file tree 3 files changed +32
-10
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,11 @@ user=$1
1414domain=$2
1515domain_idn=$2
1616id=$3
17- dvalue=$( idn -t --quiet -u " $4 " )
18- priority=$5
19- restart=$6
17+ record=$4
18+ type=$5
19+ dvalue=$( idn -t --quiet -u " $6 " )
20+ priority=$7
21+ restart=$8
2022
2123# Includes
2224source $HESTIA /func/main.sh
@@ -33,8 +35,8 @@ format_domain_idn
3335# Verifications #
3436# ----------------------------------------------------------#
3537
36- check_args ' 4 ' " $# " ' USER DOMAIN ID VALUE [PRIORITY] [RESTART]'
37- is_format_valid ' user' ' domain' ' id' ' dvalue'
38+ check_args ' 6 ' " $# " ' USER DOMAIN ID RECORD TYPE VALUE [PRIORITY] [RESTART]'
39+ is_format_valid ' user' ' domain' ' id' ' record ' ' type ' ' dvalue'
3840is_system_enabled " $DNS_SYSTEM " ' DNS_SYSTEM'
3941is_object_valid ' user' ' USER' " $user "
4042is_object_unsuspended ' user' ' USER' " $user "
@@ -77,7 +79,7 @@ time=$(echo "$time_n_date" |cut -f 1 -d \ )
7779date=$( echo " $time_n_date " | cut -f 2 -d \ )
7880
7981# Adding record
80- dns_rec=" ID='$id ' RECORD='$RECORD ' TYPE='$TYPE ' PRIORITY='$priority '"
82+ dns_rec=" ID='$id ' RECORD='$record ' TYPE='$type ' PRIORITY='$priority '"
8183dns_rec=" $dns_rec VALUE='$dvalue ' SUSPENDED='no' TIME='$time ' DATE='$date '"
8284echo " $dns_rec " >> $USER_DATA /dns/$domain .conf
8385
Original file line number Diff line number Diff line change 156156 $ v_record_id = escapeshellarg ($ _POST ['v_record_id ' ]);
157157
158158 // Change dns record
159- if (($ v_val != $ _POST ['v_val ' ]) || ($ v_priority != $ _POST ['v_priority ' ]) && (empty ($ _SESSION ['error_msg ' ]))) {
159+ if (($ v_rec != $ _POST ['v_rec ' ]) || ($ v_type != $ _POST ['v_type ' ]) || ($ v_val != $ _POST ['v_val ' ]) || ($ v_priority != $ _POST ['v_priority ' ]) && (empty ($ _SESSION ['error_msg ' ]))) {
160+ $ v_rec = escapeshellarg ($ _POST ['v_rec ' ]);
161+ $ v_type = escapeshellarg ($ _POST ['v_type ' ]);
160162 $ v_val = escapeshellarg ($ _POST ['v_val ' ]);
161163 $ v_priority = escapeshellarg ($ _POST ['v_priority ' ]);
162- exec (HESTIA_CMD ."v-change-dns-record " .$ v_username ." " .$ v_domain ." " .$ v_record_id ." " .$ v_val ." " .$ v_priority , $ output , $ return_var );
164+ exec (HESTIA_CMD ."v-change-dns-record " .$ v_username ." " .$ v_domain ." " .$ v_record_id ." " .$ v_rec . " " . $ v_type . " " . $ v_val ." " .$ v_priority , $ output , $ return_var );
163165 check_return_code ($ return_var ,$ output );
166+ $ v_rec = $ _POST ['v_rec ' ];
167+ $ v_type = $ _POST ['v_type ' ];
164168 $ v_val = $ _POST ['v_val ' ];
165169 unset($ output );
166170 $ restart_dns = 'yes ' ;
167171 }
168172
173+
169174 // Change dns record id
170175 if (($ _GET ['record_id ' ] != $ _POST ['v_record_id ' ]) && (empty ($ _SESSION ['error_msg ' ]))) {
171176 $ v_old_record_id = escapeshellarg ($ _GET ['record_id ' ]);
Original file line number Diff line number Diff line change 6868 </ tr >
6969 < tr >
7070 < td >
71- < input type ="text " size ="20 " class ="vst-input " name ="v_rec " value ="<?=htmlentities(trim($v_rec, "'"))?> " disabled >
71+ < input type ="text " size ="20 " class ="vst-input " name ="v_rec " value ="<?=htmlentities(trim($v_rec, "'"))?> ">
7272 < input type ="hidden " name ="v_record_id " value ="<?=htmlentities($v_record_id)?> ">
7373 </ td >
7474 </ tr >
7979 </ tr >
8080 < tr >
8181 < td >
82- < input type ="text " size ="20 " class ="vst-input " name ="v_type " value ="<?=htmlentities(trim($v_type, "'"))?> " disabled>
82+ < select class ="vst-list " name ="v_type ">
83+ < option value ="A " < ?php if ($v_type == 'A') echo selected; ?> > A</ option >
84+ < option value ="AAAA " < ?php if ($v_type == 'AAAA') echo selected; ?> > AAAA</ option >
85+ < option value ="NS " < ?php if ($v_type == 'NS') echo selected; ?> > NS</ option >
86+ < option value ="CNAME " < ?php if ($v_type == 'CNAME') echo selected; ?> > CNAME</ option >
87+ < option value ="MX " < ?php if ($v_type == 'MX') echo selected; ?> > MX</ option >
88+ < option value ="TXT " < ?php if ($v_type == 'TXT') echo selected; ?> > TXT</ option >
89+ < option value ="SRV " < ?php if ($v_type == 'SRV') echo selected; ?> > SRV</ option >
90+ < option value ="DNSKEY " < ?php if ($v_type == 'DNSKEY') echo selected; ?> > DNSKEY</ option >
91+ < option value ="KEY " < ?php if ($v_type == 'KEY') echo selected; ?> > KEY</ option >
92+ < option value ="IPSECKEY " < ?php if ($v_type == 'IPSECKEY') echo selected; ?> > IPSECKEY</ option >
93+ < option value ="PTR " < ?php if ($v_type == 'PTR') echo selected; ?> > PTR</ option >
94+ < option value ="SPF " < ?php if ($v_type == 'SPF') echo selected; ?> > SPF</ option >
95+ < option value ="TLSA " < ?php if ($v_type == 'TLSA') echo selected; ?> > TLSA</ option >
96+ < option value ="CAA " < ?php if ($v_type == 'CAA') echo selected; ?> > CAA</ option >
97+ </ select >
8398 </ td >
8499 </ tr >
85100 < tr >
You can’t perform that action at this time.
0 commit comments