File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 5454 check_return_code ($ return_var ,$ output );
5555 unset($ output );
5656 }
57-
57+
58+ // Change domain template
59+ if (($ v_template != $ _POST ['v_template ' ]) && (empty ($ _SESSION ['error_msg ' ]))) {
60+ $ v_template = escapeshellarg ($ _POST ['v_template ' ]);
61+ exec (HESTIA_CMD ."v-change-dns-domain-tpl " .$ user ." " .$ v_domain ." " .$ v_template ." 'no' " , $ output , $ return_var );
62+ check_return_code ($ return_var ,$ output );
63+ unset($ output );
64+ }
5865
5966 // Set expiriation date
6067 if (empty ($ _SESSION ['error_msg ' ])) {
157164 $ v_ip = (empty ($ v_ips [$ ip ]['NAT ' ])?$ ip :$ v_ips [$ ip ]['NAT ' ]);
158165}
159166
167+ // List dns templates
168+ exec (HESTIA_CMD ."v-list-dns-templates json " , $ output , $ return_var );
169+ $ templates = json_decode (implode ('' , $ output ), true );
170+ unset($ output );
171+
172+ exec (HESTIA_CMD ."v-list-user " .$ user ." json " , $ output , $ return_var );
173+ $ user_config = json_decode (implode ('' , $ output ), true );
174+ unset($ output );
175+ $ v_template = $ user_config [$ user ]['DNS_TEMPLATE ' ];
176+
160177if (empty ($ _GET ['domain ' ])) {
161178 // Display body for dns domain
162179
Original file line number Diff line number Diff line change 8888 < tr >
8989 < td class ="vst-text ">
9090 < table style ="display:<?php if (empty($v_adv)) echo 'none';?> ; " id ="advtable ">
91+ < tr >
92+ < td class ="vst-text input-label ">
93+ < ?php print _('Template') . "< span class ='optional '> " . strtoupper($_SESSION['DNS_SYSTEM']) . "</ span > ";?>
94+ </ td >
95+ </ tr >
96+ < tr >
97+ < td >
98+ < select class ="vst-list " name ="v_template ">
99+ < ?php
100+ foreach ($templates as $key => $value) {
101+ echo "\t\t\t\t< option value =\ "".htmlentities($value)."\"";
102+ $svalue = "'".$value."'";
103+ if ((!empty($v_template)) && ( $value == $v_template ) || ($svalue == $v_template)){
104+ echo ' selected' ;
105+ }
106+ echo "> ".htmlentities($value)."</ option > \n";
107+ }
108+ ?>
109+ </ select >
110+ </ td >
111+ </ tr >
91112 < tr >
92113 < td class ="vst-text input-label ">
93114 < ?php print _('Expiration Date');?> < span class ="optional "> (< ?=_('YYYY-MM-DD');?> )</ span >
You can’t perform that action at this time.
0 commit comments