$val) { if ($val) { unset($auth); unset($user); if (isset($_POST["e_enabled"])) { $auth['enabled'] = $a_enabled; $user['enabled'] = $a_enabled; } if (isset($_POST["e_group_id"])) { $auth['filter_group_id'] = $a_group; } if (isset($_POST["e_queue_id"])) { $auth['queue_id'] = $a_queue; } if (isset($_POST["e_dhcp"])) { $auth['dhcp'] = $a_dhcp; } if (isset($_POST["e_dhcp_acl"])) { $auth['dhcp_acl'] = $a_dhcp_acl; } if (isset($_POST["e_traf"])) { $auth['save_traf'] = $a_traf; } if (isset($_POST["e_day_q"])) { $user['day_quota'] = $a_day; } if (isset($_POST["e_month_q"])) { $user['month_quota'] = $a_month; } if (isset($_POST["e_new_ou"])) { $user['ou_id'] = $a_ou_id; $auth['ou_id'] = $a_ou_id; } $login = get_record($db_link, "User_list", "id='$val'"); $msg .= " For all ip user id: " . $val . " login: " . $login['login'] . " set: "; $msg .= get_diff_rec($db_link, "User_list", "id='$val'", $user, 1); $ret = update_record($db_link, "User_list", "id='" . $val . "'", $user); if (!$ret) { $all_ok = 0; } $auth_list = get_records_sql($db_link, "SELECT id FROM User_auth WHERE deleted=0 AND user_id=" . $val); if (!empty($auth)) { foreach ($auth_list as $row) { if (empty($row)) { continue; } $ret = update_record($db_link, "User_auth", "id='" . $row["id"] . "'", $auth); if (!$ret) { $all_ok = 0; } } } } } if ($all_ok) { print "Success!"; } else { print "Fail!"; } }