profile_edit.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <script type="text/javascript" language="JavaScript">
  2. function enable_change(enable_over) {
  3. var endis;
  4. endis = !(document.iform.enable.checked || enable_over);
  5. document.iform.range_from.disabled = endis;
  6. document.iform.range_to.disabled = endis;
  7. }
  8. function show_advanced_config() {
  9. $('#show_advanced_box').slideToggle();
  10. $('#show_advanced').slideToggle();
  11. }
  12. </script>
  13. <form method='post' name='ifrm' action=''>
  14. <table width='100%' border='0' cellpadding='0' cellspacing='0'>
  15. <tr>
  16. <td colspan='2'>
  17. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  18. <tr>
  19. <td align='left' width="50%">
  20. <span class='title'>
  21. <?php
  22. if ($action == "update") {
  23. echo $text['header-xmpp-edit'];
  24. }
  25. else if ($action == "add") {
  26. echo $text['header-xmpp-add'];
  27. }
  28. ?>
  29. </span><br>
  30. </td> <td width='50%' align='right'>
  31. <input type='button' class='btn' name='' alt='back' onclick="window.location='xmpp.php'" value='<?php echo $text['button-back']?>'>
  32. <input type='submit' name='submit' class='btn' value='<?php echo $text['button-save']?>'>
  33. </td>
  34. </tr>
  35. <tr>
  36. <td align='left' colspan='2'>
  37. <?php echo $text['description-xmpp-edit-add']?><br />
  38. </td>
  39. </tr>
  40. </table>
  41. <br />
  42. </td>
  43. </tr>
  44. <tr>
  45. <td width="30%" class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  46. <?php echo $text['label-profile_name']?>:
  47. </td>
  48. <td width="70%" class='vtable' align='left'>
  49. <input class='formfld' type='text' name='profile_name' maxlength='255' value="<?php echo escape($profile['profile_name']); ?>" required='required'>
  50. <br />
  51. <?php echo $text['description-profile_name']?>
  52. </td>
  53. </tr>
  54. <tr>
  55. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  56. <?php echo $text['label-username']?>:
  57. </td>
  58. <td class='vtable' align='left'>
  59. <input class='formfld' type='text' name='profile_username' autocomplete='off' maxlength='255' value="<?php echo escape($profile['profile_username']);?>" required='required'>
  60. <br />
  61. <?php echo $text['description-username']?>
  62. </td>
  63. </tr>
  64. <tr>
  65. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  66. <?php echo $text['label-password']?>:
  67. </td>
  68. <td class='vtable' align='left'>
  69. <input class='formfld' type='password' name='profile_password' autocomplete='off' id='profile_password' maxlength='50' onmouseover="this.type='text';" onfocus="this.type='text';" onmouseout="if (!$(this).is(':focus')) { this.type='password'; }" onblur="this.type='password';" value="<?php echo escape($profile['profile_password']);?>" required='required'>
  70. <br />
  71. <?php echo $text['description-password']?>
  72. </td>
  73. </tr>
  74. <tr>
  75. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  76. <?php echo $text['label-auto_login']?>:
  77. </td>
  78. <td class='vtable' align='left'>
  79. <select class='formfld' name='auto_login'>
  80. <option value='true' <?php if($profile['auto_login'] == "true") echo "selected='selected'"; ?>><?php echo $text['label-true']?></option>
  81. <option value='false' <?php if($profile['auto_login'] == "false") echo "selected='selected'"; ?>><?php echo $text['label-false']?></option>
  82. </select>
  83. <br />
  84. <?php echo $text['description-auto_login']?>
  85. </td>
  86. </tr>
  87. <tr>
  88. <td width='30%' class='vncell' valign='top' align='left' nowrap='nowrap'>
  89. <?php echo $text['label-xmpp_server']?>:
  90. </td>
  91. <td width='70%' class='vtable' align='left'>
  92. <input class='formfld' type='text' name='xmpp_server' maxlength='255' value="<?php echo escape($profile['xmpp_server']);?>">
  93. <br />
  94. <?php echo $text['description-xmpp_server']?>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  99. <?php echo $text['label-default_exten']?>:
  100. </td>
  101. <td class='vtable' align='left'>
  102. <input class='formfld' type='text' name='default_exten' maxlength='255' value="<?php echo escape($profile['default_exten']);?>" required='required'>
  103. <br />
  104. <?php echo $text['description-default_exten']?>
  105. </td>
  106. </tr>
  107. <tr>
  108. <td style='padding: 0px;' colspan='2' class='' valign='top' align='left' nowrap='nowrap'>
  109. <div id="show_advanced_box">
  110. <table width="100%" border="0" cellpadding="6" cellspacing="0">
  111. <tr>
  112. <td width="30%" valign="top" class="vncell">&nbsp;</td>
  113. <td width="70%" class="vtable">
  114. <input type="button" class="btn" onClick="show_advanced_config()" value="<?php echo $text['button-advanced']?>"></input>
  115. </td>
  116. </tr>
  117. </table>
  118. </div>
  119. <div id="show_advanced" style="display:none">
  120. <table width="100%" border="0" cellpadding="6" cellspacing="0">
  121. <tr>
  122. <?php if (if_group("superadmin")) { ?>
  123. <td width='30%' class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  124. <?php echo $text['label-context']?>:
  125. </td>
  126. <td width='70%' class='vtable' align='left'>
  127. <input class='formfld' type='text' name='context' maxlength='255' value="<?php echo escape($profile['context']);?>" required='required'>
  128. <br />
  129. <?php echo $text['description-context']?>
  130. </td>
  131. </tr>
  132. <?php } ?>
  133. <tr>
  134. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  135. <?php echo $text['label-rtp_ip']?>:
  136. </td>
  137. <td class='vtable' align='left'>
  138. <input class='formfld' type='text' name='rtp_ip' maxlength='255' value="<?php echo escape($profile['rtp_ip']);?>" required='required'>
  139. <br />
  140. <?php echo $text['description-rtp_ip']?>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  145. <?php echo $text['label-ext_rtp_ip']?>:
  146. </td>
  147. <td class='vtable' align='left'>
  148. <input class='formfld' type='text' name='ext_rtp_ip' maxlength='255' value="<?php echo escape($profile['ext_rtp_ip']);?>" required='required'>
  149. <br />
  150. <?php echo $text['description-ext_rtp_ip']?>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  155. <?php echo $text['label-sasl_type']?>:
  156. </td>
  157. <td class='vtable' align='left'>
  158. <select class='formfld' name='sasl_type'>
  159. <option value='plain' <?php if($profile['sasl_type'] == "plain") echo "selected='selected'"; ?>>Plain</option>
  160. <option value='md5' <?php if($profile['sasl_type'] == "md5") echo "selected='selected'"; ?>>MD5</option>
  161. </select>
  162. <br />
  163. <?php echo $text['description-sasl_type']?>
  164. </td>
  165. </tr>
  166. <tr>
  167. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  168. <?php echo $text['label-tls_enable']?>:
  169. </td>
  170. <td class='vtable' align='left'>
  171. <select class='formfld' name='tls_enable'>
  172. <option value='true' <?php if($profile['tls_enable'] == "true") echo "selected='selected'"; ?>><?php echo $text['label-true']?></option>
  173. <option value='false' <?php if($profile['tls_enable'] == "false") echo "selected='selected'"; ?>><?php echo $text['label-false']?></option>
  174. </select>
  175. <br />
  176. <?php echo $text['description-tls_enable']?>
  177. </td>
  178. </tr>
  179. <tr>
  180. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  181. <?php echo $text['label-use_rtp_timer']?>:
  182. </td>
  183. <td class='vtable' align='left'>
  184. <select class='formfld' name='use_rtp_timer'>
  185. <option value='true' <?php if($profile['use_rtp_timer'] == "true") echo "selected='selected'"; ?>><?php echo $text['label-true']?></option>
  186. <option value='false' <?php if($profile['use_rtp_timer'] == "false") echo "selected='selected'"; ?>><?php echo $text['label-false']?></option>
  187. </select>
  188. <br />
  189. <?php echo $text['description-use_rtp_timer']?>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  194. <?php echo $text['label-vad']?>:
  195. </td>
  196. <td class='vtable' align='left'>
  197. <select class='formfld' name='vad'>
  198. <option value='none' <?php if($profile['vad'] == "none") echo "selected='selected'"; ?>><?php echo $text['option-vad_none']?></option>
  199. <option value='in' <?php if($profile['vad'] == "in") echo "selected='selected'"; ?>><?php echo $text['option-vad_in']?></option>
  200. <option value='out' <?php if($profile['vad'] == "out") echo "selected='selected'"; ?>><?php echo $text['option-vad_out']?></option>
  201. <option value='both' <?php if($profile['vad'] == "both") echo "selected='selected'"; ?>><?php echo $text['option-vad_both']?></option>
  202. </select>
  203. <br />
  204. <?php echo $text['description-vad']?>
  205. </td>
  206. </tr>
  207. <tr>
  208. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  209. <?php echo $text['label-candidate_acl']?>:
  210. </td>
  211. <td class='vtable' align='left'>
  212. <input class='formfld' type='text' name='candidate_acl' maxlength='255' value="<?php echo escape($profile['candidate_acl']);?>">
  213. <br />
  214. <?php echo $text['description-candidate_acl']?>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  219. <?php echo $text['label-local_network_acl']?>:
  220. </td>
  221. <td class='vtable' align='left'>
  222. <input class='formfld' type='text' name='local_network_acl' maxlength='255' value="<?php echo escape($profile['local_network_acl']);?>">
  223. <br />
  224. <?php echo $text['description-local_network_acl']?>
  225. </td>
  226. </tr>
  227. </table>
  228. </div>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td class='vncellreq' valign='top' align='left' nowrap='nowrap'>
  233. <?php echo $text['label-enabled']?>:
  234. </td>
  235. <td class='vtable' align='left'>
  236. <select class='formfld' name='enabled'>
  237. <option value='true' <?php if($profile['enabled'] == "true") echo "selected='selected'"; ?>><?php echo $text['label-true']?></option>
  238. <option value='false' <?php if($profile['enabled'] == "false") echo "selected='selected'"; ?>><?php echo $text['label-false']?></option>
  239. </select>
  240. <br />
  241. <?php echo $text['description-enabled']?>
  242. </td>
  243. </tr>
  244. <tr>
  245. <td class='vncell' valign='top' align='left' nowrap='nowrap'>
  246. <?php echo $text['label-description']?>:
  247. </td>
  248. <td class='vtable' align='left'>
  249. <input class='formfld' type='text' name='description' value='<?php echo escape($profile['description']);?>'>
  250. <br />
  251. <?php echo $text['description-description']?>
  252. </td>
  253. </tr>
  254. <tr>
  255. <td colspan='2' align='right'>
  256. <input type='hidden' name='profile_id' value='<?php echo escape($profile['xmpp_profile_uuid']); ?>'>
  257. <br>
  258. <input type='submit' name='submit' class='btn' value='<?php echo $text['button-save']?>'>
  259. </td>
  260. </tr>
  261. </table>
  262. <br><br>
  263. </form>