edituser.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511
  1. <?php
  2. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/auth.php");
  3. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/languages/" . HTML_LANG . ".php");
  4. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/idfilter.php");
  5. $default_sort = 'ip_int';
  6. require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/sortfilter.php");
  7. $msg_error = "";
  8. $sSQL = "SELECT * FROM user_list WHERE id = ?";
  9. $user_info = get_record_sql($db_link, $sSQL, [$id]);
  10. if (empty($user_info)) {
  11. header("Location: /admin/");
  12. exit;
  13. }
  14. // === РЕДАКТИРОВАНИЕ ПОЛЬЗОВАТЕЛЯ ===============================================
  15. if (getPOST("edituser") !== null) {
  16. $new = [];
  17. $f_ou = (int)getPOST("f_ou", null, 0);
  18. if ($f_ou > 0) {
  19. $new["ou_id"] = $f_ou;
  20. }
  21. $new["filter_group_id"] = (int)getPOST("f_filter", null, 0);
  22. $new["queue_id"] = (int)getPOST("f_queue", null, 0);
  23. $user_name = trim(getPOST("f_login", null, $user_info['login']));
  24. if ($user_name !== '') {
  25. $new["login"] = $user_name;
  26. }
  27. $new["description"] = trim(getPOST("f_description", null, ''));
  28. // Настройки по OU
  29. if (get_const('default_user_ou_id') == ($new["ou_id"] ?? 0) ||
  30. get_const('default_hotspot_ou_id') == ($new["ou_id"] ?? 0)) {
  31. $new["enabled"] = 0;
  32. $new["blocked"] = 0;
  33. $new["day_quota"] = 0;
  34. $new["month_quota"] = 0;
  35. $new["permanent"] = 0;
  36. } else {
  37. $new["enabled"] = (int)getPOST("f_enabled", null, 0);
  38. $new["blocked"] = (int)getPOST("f_blocked", null, 0);
  39. $new["day_quota"] = (int)trim(getPOST("f_perday", null, 0));
  40. $new["month_quota"] = (int)trim(getPOST("f_permonth", null, 0));
  41. $new["permanent"] = (int)getPOST("f_permanent", null, 0);
  42. }
  43. update_record($db_link, "user_list", "id = ?", $new, [$id]);
  44. // Отключаем авторизацию, если пользователь выключен
  45. if (!$new["enabled"]) {
  46. update_records($db_link, 'user_auth', 'user_id = ?', ['enabled' => 0, 'changed' => 1], [$id]);
  47. }
  48. // Обновляем описание в user_auth
  49. if (!empty($new["description"])) {
  50. update_records($db_link, 'user_auth',
  51. "user_id = ? AND deleted = 0 AND (description IS NULL OR description = '' OR description = ?)",
  52. ['description' => $new["description"]],
  53. [$id, $user_info["description"]]
  54. );
  55. }
  56. // Обновление ou_id в user_auth
  57. update_records($db_link, 'user_auth', 'user_id = ? AND deleted = 0', ['ou_id' => $new["ou_id"]], [$id]);
  58. // Обновление device_name в devices
  59. update_record($db_link, 'devices', 'user_id = ?', ['device_name' => $new["login"]], [$id]);
  60. header("Location: " . $_SERVER["REQUEST_URI"]);
  61. exit;
  62. }
  63. // === АВТОПРАВИЛА ПО MAC =========================================================
  64. if (getPOST("addMacRule") !== null) {
  65. $first_auth = get_records_sql($db_link,
  66. "SELECT mac FROM user_auth WHERE user_id = ? AND deleted = 0 AND LENGTH(mac) > 0 ORDER BY id",
  67. [$id]
  68. );
  69. foreach ($first_auth as $row) {
  70. if (!empty($row['mac'])) {
  71. add_auth_rule($db_link, $row['mac'], 2, $id);
  72. }
  73. }
  74. header("Location: " . $_SERVER["REQUEST_URI"]);
  75. exit;
  76. }
  77. if (getPOST("delMacRule") !== null) {
  78. delete_records($db_link, "auth_rules", "user_id = ? AND rule_type = 2", [$id]);
  79. header("Location: " . $_SERVER["REQUEST_URI"]);
  80. exit;
  81. }
  82. // === АВТОПРАВИЛА ПО IP ==========================================================
  83. if (getPOST("addIPRule") !== null) {
  84. $first_auth = get_records_sql($db_link,
  85. "SELECT ip FROM user_auth WHERE user_id = ? AND deleted = 0 AND ip IS NOT NULL ORDER BY id",
  86. [$id]
  87. );
  88. foreach ($first_auth as $row) {
  89. if (!empty($row['ip'])) {
  90. add_auth_rule($db_link, $row['ip'], 1, $id);
  91. }
  92. }
  93. header("Location: " . $_SERVER["REQUEST_URI"]);
  94. exit;
  95. }
  96. if (getPOST("delIPRule") !== null) {
  97. delete_records($db_link, "auth_rules", "user_id = ? AND rule_type = 1", [$id]);
  98. header("Location: " . $_SERVER["REQUEST_URI"]);
  99. exit;
  100. }
  101. // === СОЗДАНИЕ УСТРОЙСТВА ========================================================
  102. if (getPOST("showDevice") !== null) {
  103. $device = get_record_sql($db_link, "SELECT * FROM devices WHERE user_id = ?", [$id]);
  104. $auth = get_record_sql($db_link, "SELECT * FROM user_auth WHERE user_id = ?", [$id]);
  105. if (empty($device) && !empty($auth)) {
  106. $new = [
  107. 'user_id' => $id,
  108. 'device_name' => $user_info['login'],
  109. 'device_type' => 5,
  110. 'ip' => $auth['ip'],
  111. 'ip_int' => $auth['ip_int'],
  112. 'community' => get_const('snmp_default_community'),
  113. 'snmp_version' => get_const('snmp_default_version'),
  114. 'login' => get_option($db_link, 28),
  115. 'password' => get_option($db_link, 29),
  116. 'protocol' => 0,
  117. 'control_port' => get_option($db_link, 30)
  118. ];
  119. $new_id = insert_record($db_link, "devices", $new);
  120. if (!empty($new_id)) {
  121. header("Location: /admin/devices/editdevice.php?id={$new_id}");
  122. exit;
  123. }
  124. }
  125. if (!empty($device['id'])) {
  126. header("Location: /admin/devices/editdevice.php?id=" . $device['id']);
  127. } else {
  128. header("Location: " . $_SERVER["REQUEST_URI"]);
  129. }
  130. exit;
  131. }
  132. // === ДОБАВЛЕНИЕ ЗАПИСИ АВТОРИЗАЦИИ ==============================================
  133. if (getPOST("addauth") !== null) {
  134. $fip = normalizeIpAddress(substr(trim(getPOST("newip", null, '')), 0, 18));
  135. $fdescription = null;
  136. $fmac = trim(getPOST("newmac", null, ''));
  137. if (!empty($fmac)) {
  138. if (!checkValidMac($fmac)) {
  139. $fdescription = $fmac;
  140. $fmac = null;
  141. } else {
  142. $fmac = mac_dotted($fmac);
  143. }
  144. }
  145. if (!empty($fip)) {
  146. $ip_aton = ip2long($fip);
  147. $f_dhcp = 1;
  148. // Проверка MAC
  149. if (!empty($fmac)) {
  150. $mac_exists = find_mac_in_subnet($db_link, $fip, $fmac);
  151. if (!empty($mac_exists) && ($mac_exists['count'] ?? 0) >= 1 && !in_array($id, $mac_exists['users_id'] ?? [])) {
  152. $dup_info = get_record_sql($db_link, "SELECT * FROM user_list WHERE id = ?", [$mac_exists['users_id'][0] ?? 0]);
  153. $msg_error = "Mac already exists at another user in this subnet! Skip creating $fip [$fmac].<br>Old user id: " . ($dup_info['id'] ?? '') . " login: " . ($dup_info['login'] ?? '');
  154. $_SESSION[$page_url]['msg'] = $msg_error;
  155. LOG_ERROR($db_link, $msg_error);
  156. header("Location: " . $_SERVER["REQUEST_URI"]);
  157. exit;
  158. }
  159. // DHCP для вторичного IP
  160. if (!empty($mac_exists) && in_array($id, $mac_exists['users_id'] ?? [])) {
  161. $f_dhcp = 0;
  162. }
  163. }
  164. // Проверка дубликата IP
  165. $dup_ip_record = get_record_sql($db_link, "SELECT * FROM user_auth WHERE ip_int = ? AND user_id <> ? AND deleted = 0", [$ip_aton, $id]);
  166. if (!empty($dup_ip_record)) {
  167. $dup_info = get_record_sql($db_link, "SELECT * FROM user_list WHERE id = ?", [$dup_ip_record['user_id']]);
  168. $msg_error = "$fip already exists. Skip creating $fip [$fmac].<br>Old user id: " . $dup_info['id'] . " login: " . $dup_info['login'];
  169. $_SESSION[$page_url]['msg'] = $msg_error;
  170. LOG_ERROR($db_link, $msg_error);
  171. header("Location: " . $_SERVER["REQUEST_URI"]);
  172. exit;
  173. }
  174. $fid = new_auth($db_link, $fip, $fmac, $id);
  175. if (!empty($fid)) {
  176. $new_auth = ['dhcp' => $f_dhcp, 'created_by' => 'manual'];
  177. if (!empty($fdescription)) {
  178. $new_auth['description'] = $fdescription;
  179. }
  180. update_record($db_link, "user_auth", "id = ?", $new_auth, [$fid]);
  181. header("Location: /admin/users/editauth.php?id=" . $fid);
  182. exit;
  183. }
  184. } else {
  185. $msg_error = "IP-address format error!";
  186. $_SESSION[$page_url]['msg'] = $msg_error;
  187. }
  188. header("Location: " . $_SERVER["REQUEST_URI"]);
  189. exit;
  190. }
  191. // === УДАЛЕНИЕ ЗАПИСЕЙ АВТОРИЗАЦИИ ==============================================
  192. if (getPOST("removeauth") !== null) {
  193. $auth_id = getPOST("f_auth_id", null, []);
  194. if (!empty($auth_id) && is_array($auth_id)) {
  195. foreach ($auth_id as $val) {
  196. $val = trim($val);
  197. if ($val !== '') {
  198. delete_user_auth($db_link, (int)$val);
  199. }
  200. }
  201. }
  202. header("Location: " . $_SERVER["REQUEST_URI"]);
  203. exit;
  204. }
  205. // === СОЗДАНИЕ НОВОГО ПОЛЬЗОВАТЕЛЯ ИЗ ЗАПИСИ АВТОРИЗАЦИИ =========================
  206. if (getPOST("new_user") !== null) {
  207. $auth_id = getPOST("f_auth_id", null, []);
  208. $save_traf = (int)get_option($db_link, 23);
  209. if (!empty($auth_id) && is_array($auth_id)) {
  210. foreach ($auth_id as $val) {
  211. $val = (int)$val;
  212. if ($val <= 0) continue;
  213. $auth_info = get_record_sql($db_link, "SELECT * FROM user_auth WHERE id = ?", [$val]);
  214. if (empty($auth_info)) continue;
  215. $ou_id = $user_info["ou_id"];
  216. $login = null;
  217. if (!empty($auth_info["dns_name"])) {
  218. $login = $auth_info["dns_name"];
  219. } elseif (!empty($auth_info["description"])) {
  220. $login = transliterate($auth_info["description"]);
  221. } elseif (!empty($auth_info["dhcp_hostname"])) {
  222. $login = $auth_info["dhcp_hostname"];
  223. } elseif (!empty($auth_info["mac"])) {
  224. $login = $auth_info["mac"];
  225. } else {
  226. $login = $auth_info["ip"];
  227. }
  228. $new_user = get_record_sql($db_link, "SELECT * FROM user_list WHERE LOWER(login) = LOWER(?) AND deleted = 0", [$login]);
  229. if (!empty($new_user)) {
  230. // Перенос записи авторизации
  231. $auth_update = [
  232. 'user_id' => $new_user["id"],
  233. 'ou_id' => $new_user["ou_id"],
  234. 'save_traf' => $save_traf
  235. ];
  236. $auth_update = apply_auth_rule($db_link, $auth_update, $new_user["id"]);
  237. update_record($db_link, "user_auth", "id = ?", $auth_update, [$val]);
  238. } else {
  239. $new_user_data = [
  240. 'login' => $login,
  241. 'ou_id' => $ou_id
  242. ];
  243. if (!empty($auth_info["description"])) {
  244. $new_user_data["description"] = $auth_info["description"];
  245. } elseif (!empty($auth_info["dns_name"])) {
  246. $new_user_data["description"] = $auth_info["dns_name"];
  247. } elseif (!empty($auth_info["dhcp_hostname"])) {
  248. $new_user_data["description"] = $auth_info["dhcp_hostname"];
  249. }
  250. $new_user_data["enabled"] = $auth_info["enabled"];
  251. $l_id = insert_record($db_link, "user_list", $new_user_data);
  252. if (!empty($l_id)) {
  253. $auth_update = ['user_id' => $l_id, 'save_traf' => $save_traf];
  254. update_record($db_link, "user_auth", "id = ?", $auth_update, [$val]);
  255. }
  256. }
  257. }
  258. }
  259. header("Location: " . $_SERVER["REQUEST_URI"]);
  260. exit;
  261. }
  262. unset($_POST);
  263. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/header.php");
  264. ?>
  265. <div id="cont">
  266. <?php
  267. if (!empty($_SESSION[$page_url]['msg'])) {
  268. print '<div id="msg">' . $_SESSION[$page_url]['msg'] . '</div>';
  269. unset($_SESSION[$page_url]['msg']);
  270. }
  271. ?>
  272. <form name="def" action="edituser.php?id=<?php echo $id; ?>" method="post">
  273. <input type="hidden" name="id" value=<?php echo $id; ?>>
  274. <table class="data">
  275. <tr>
  276. <td colspan=2><?php print WEB_cell_login; ?></td>
  277. <td colspan=2><?php print WEB_cell_description; ?></td>
  278. <td colspan=2><?php print WEB_cell_ou; ?></td>
  279. <td ><?php print WEB_user_permanent; ?></td>
  280. </tr>
  281. <tr>
  282. <td colspan=2><input type="text" name="f_login" value="<?php print $user_info["login"]; ?>" size=25></td>
  283. <td colspan=2><input type="text" name="f_description" value="<?php print $user_info["description"]; ?>" size=25></td>
  284. <td colspan=2><?php print_ou_set($db_link, 'f_ou', $user_info["ou_id"]); ?></td>
  285. <td><?php print_qa_select('f_permanent', $user_info["permanent"]); ?></td>
  286. </tr>
  287. <tr>
  288. <td colspan=2><?php print WEB_cell_perday; ?></td>
  289. <td colspan=2><?php print WEB_cell_permonth; ?></td>
  290. <td><?php print WEB_cell_blocked; ?></td>
  291. <td></td>
  292. <td><?php print WEB_cell_enabled; ?></td>
  293. </tr>
  294. <tr>
  295. <td colspan=2><input type="text" name="f_perday" value="<?php echo $user_info["day_quota"]; ?>" size=5></td>
  296. <td colspan=2><input type="text" name="f_permonth" value="<?php echo $user_info["month_quota"]; ?>" size=5></td>
  297. <td><?php print_qa_select('f_blocked', $user_info["blocked"]); ?></td>
  298. <td></td>
  299. <td><?php print_qa_select('f_enabled', $user_info["enabled"]); ?></td>
  300. </tr>
  301. <tr>
  302. <td class=data colspan=7><?php echo WEB_user_rules_for_autoassign; ?>:</td>
  303. </tr>
  304. <tr>
  305. <td colspan=2><?php print WEB_cell_filter; ?></td>
  306. <td colspan=2><?php print WEB_cell_shaper; ?></td>
  307. <td colspan=3></td>
  308. </tr>
  309. <tr>
  310. <td colspan=2><?php print_filter_group_select($db_link, 'f_filter', $user_info["filter_group_id"]); ?></td>
  311. <td colspan=2><?php print_queue_select($db_link, 'f_queue', $user_info["queue_id"]); ?></td>
  312. <td colspan=3></td>
  313. </tr>
  314. <tr>
  315. <?php
  316. print "<td>";
  317. print_url(WEB_user_rule_list, "/admin/users/edit_rules.php?id=$id");
  318. print "</td>";
  319. $rule_count = get_count_records($db_link, "auth_rules", "user_id=?", [ $id ]);
  320. print "<td > Count: " . $rule_count . "</td>";
  321. $first_auth = get_record_sql($db_link, "SELECT id FROM user_auth WHERE user_id=? AND deleted=0 ORDER BY id", [ $id ]);
  322. if (!empty($first_auth)) {
  323. //mac
  324. $mac_rule_count = get_count_records($db_link, "auth_rules", "user_id=? AND rule_type=2", [ $id ]);
  325. if (!empty($mac_rule_count)) {
  326. print "<td><input type=\"submit\" name=\"delMacRule\" value=" . WEB_btn_mac_del . " ></td>";
  327. } else {
  328. print "<td><input type=\"submit\" name=\"addMacRule\" value=" . WEB_btn_mac_add . " ></td>";
  329. }
  330. //ip
  331. $ip_rule_count = get_count_records($db_link, "auth_rules", "user_id=? AND rule_type=1", [ $id ]);
  332. if (!empty($ip_rule_count)) {
  333. print "<td><input type=\"submit\" name=\"delIPRule\" value=" . WEB_btn_ip_del . " ></td>";
  334. } else {
  335. print "<td><input type=\"submit\" name=\"addIPRule\" value=" . WEB_btn_ip_add . " ></td>";
  336. }
  337. } else {
  338. print "<td colspan=2></td>";
  339. }
  340. ?>
  341. <td colspan=3 align=right><?php print WEB_cell_created . ":&nbsp";
  342. print $user_info["ts"]; ?></td>
  343. </tr>
  344. <tr>
  345. <?php print "<td colspan=2>";
  346. print_url(WEB_report_by_day, "/admin/reports/userday.php?id=$id"); ?></td>
  347. <td></td>
  348. <td><input type="submit" name="showDevice" value=<?php print WEB_btn_device; ?>></td>
  349. <td colspan=2></td>
  350. <td align=right><input type="submit" name="edituser" value=<?php print WEB_btn_save; ?>></td>
  351. </tr>
  352. </table>
  353. <?php
  354. if ($msg_error) {
  355. print "<div id='msg'><b>$msg_error</b></div><br>\n";
  356. }
  357. $sort_table = 'user_auth';
  358. $sort_url = "<a href=edituser.php?id=" . $id;
  359. ?>
  360. <br><b><?php echo WEB_user_ip_list; ?></b><br>
  361. <table class="data">
  362. <tr>
  363. <td class="data"><?php echo WEB_user_add_ip; ?>:&nbsp<input type=text name=newip value=""></td>
  364. <td class="data"><?php echo WEB_user_add_mac; ?>:&nbsp<input type=text name=newmac value=""></td>
  365. <td class="data"><input type="submit" name="addauth" value="<?php echo WEB_btn_add; ?>"></td>
  366. <td class="data" align=right><input type="submit" name="new_user" value="<?php echo WEB_btn_transfom; ?>"></td>
  367. </tr>
  368. </table>
  369. <table class="data" width=120%>
  370. <tr align=center>
  371. <td class="data"><input type="checkbox" onClick="checkAll(this.checked);"></td>
  372. <td class="data"><?php print $sort_url . "&sort=ip_int&order=$new_order>" . WEB_cell_ip . "</a>"; ?></td>
  373. <td class="data"><?php print $sort_url . "&sort=mac&order=$new_order>" . WEB_cell_mac . "</a>"; ?></td>
  374. <td class="data"><?php print WEB_cell_description; ?></td>
  375. <td class="data"><?php print $sort_url . "&sort=dns_name&order=$new_order>" . WEB_cell_dns_name . "</a>"; ?></td>
  376. <td class="data"><?php print WEB_cell_enabled; ?></td>
  377. <td class="data"><?php print WEB_cell_dhcp; ?></td>
  378. <td class="data"><?php print WEB_cell_filter; ?></td>
  379. <td class="data"><?php print WEB_cell_shaper; ?></td>
  380. <td class="data"><?php print WEB_cell_perday . "/<br>" . WEB_cell_permonth . ", Mb"; ?></td>
  381. <td class="data"><?php print WEB_cell_temporary; ?></td>
  382. <td class="data"><?php print "<input type=\"submit\" onclick=\"return confirm('" . WEB_msg_apply_selected . "?')\" name=\"removeauth\" value=" . WEB_btn_remove . ">"; ?></td>
  383. </tr>
  384. <?php
  385. $flist = get_records($db_link, 'user_auth', "user_id=? and deleted=0 ORDER BY $sort_table.$sort_field $order", [ $id ]);
  386. if (!empty($flist)) {
  387. foreach ($flist as $row) {
  388. $dhcp_str = '';
  389. if (!is_empty_datetime($row["dhcp_time"])) {
  390. if (!empty($row["dhcp_action"])) { $dhcp_str = FormatDateStr('Y.m.d H:m', $row["dhcp_time"]) . " (" . $row["dhcp_action"] . ")"; }
  391. }
  392. if (is_empty_datetime($row["last_found"])) {
  393. $row["last_found"] = '';
  394. }
  395. if (is_empty_datetime($row["mac_found"])) {
  396. $row["mac_found"] = '';
  397. }
  398. if (is_empty_datetime($row["arp_found"])) {
  399. $row["arp_found"] = '';
  400. }
  401. print "<tr align=center>";
  402. print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_auth_id[] value=" . $row["id"] . " ></td>";
  403. print "<td class=\"data\" align=left><a href=editauth.php?id=" . $row["id"] . ">" . $row["ip"] . "</a>";
  404. if (!empty($row["arp_found"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["arp_found"])."</p>"; }
  405. print "</td>";
  406. print "<td class=\"data\" >" . expand_mac($db_link, $row["mac"]);
  407. if (!empty($row["mac_found"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["mac_found"])."</p>"; }
  408. print "</td>";
  409. if (isset($row["dhcp_hostname"]) and strlen($row["dhcp_hostname"]) > 0) {
  410. print "<td class=\"data\" >" . $row["description"] . " [" . $row["dhcp_hostname"] . "]</td>";
  411. } else {
  412. print "<td class=\"data\" >" . $row["description"] . "</td>";
  413. }
  414. $f_dns_type = 'A';
  415. if ($row["dns_ptr_only"]) { $f_dns_type = 'ptr'; }
  416. $f_dns_row = '';
  417. if (!empty($row["dns_name"])) { $f_dns_row = $row["dns_name"]."<hr>".$f_dns_type; }
  418. print "<td class=\"data\" >" . $f_dns_row . "</td>";
  419. $ip_status = 1;
  420. if ($row["blocked"] or !$row["enabled"]) {
  421. $ip_status = 0;
  422. }
  423. print_td_qa($ip_status);
  424. $cl = "data_green";
  425. if (!$row["dhcp"]) { $cl = "data_red"; }
  426. print "<td class=\"$cl\" >" . get_qa($row["dhcp"]);
  427. if (!empty($row["dhcp_acl"]) or !empty($row["dhcp_option_set"])) {
  428. print "<p class='ts'>";
  429. if (!empty($row["dhcp_acl"])) { print $row["dhcp_acl"]; }
  430. if (!empty($row["dhcp_acl"]) and !empty($row["dhcp_option_set"])) { print "&nbsp/&nbsp"; }
  431. if (!empty($row["dhcp_option_set"])) { print $row["dhcp_option_set"]; }
  432. print "</p>";
  433. }
  434. if (!empty($dhcp_str)) { print "<p class='ts'>".$dhcp_str. "</p>"; }
  435. print "</td>";
  436. print "<td class=\"data\" >" . get_group($db_link, $row["filter_group_id"]) . "</td>";
  437. print "<td class=\"data\" >" . get_queue($db_link, $row["queue_id"]) . "</td>";
  438. print "<td class=\"data\" >" . $row["day_quota"] . "/" . $row["month_quota"] . "</td>";
  439. if ($row['dynamic']) { $cl = "data_red"; } else { $cl = "data_green"; }
  440. print "<td class=\"$cl\" >". get_qa($row['dynamic']);
  441. if ($row['dynamic'] and !empty($row["end_life"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["end_life"])."</p>"; } else { print "&nbsp"; }
  442. print "</td>";
  443. print "<td class=\"data\" >";
  444. if (!empty($row["created_by"])) { print $row["created_by"]; } else { print "&nbsp"; }
  445. print "</td>";
  446. print "</tr>";
  447. }
  448. }
  449. ?>
  450. </table>
  451. </form>
  452. <?php
  453. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/footer.php");
  454. ?>