function stream_do_action_toevoegen($account, $admin = 2) { global $lang; global $stream_bitrates; global $stream_host_poorten; global $mysqli; if (!isset($mysqli) || empty($mysqli)) { create_db_connection('mysqli', 'central'); } global $mysqli; $bitrate = FALSE; $host = FALSE; $poort = FALSE; $admin_user = FALSE; $admin_pass = FALSE; $name = FALSE; $max_listeners = FALSE; foreach ($stream_bitrates as $type) { if (get_value_post('bitrate') == $type) { $bitrate = $type; } } $post_port = get_value_post('poort'); if ($post_port !== FALSE) { $post_port2 = explode(':', $post_port); foreach ($stream_host_poorten as $hostname => $ports) { if ($post_port2[0] == $hostname) { foreach ($ports as $port) { if ($post_port2[1] == $port) { $sql = 'SELECT * FROM `stream_streams` WHERE `host` LIKE "' . $mysqli->real_escape_string($hostname) . '" AND `poort` LIKE "' . $mysqli->real_escape_string($port) . '" LIMIT 1'; $query = $mysqli->query($sql); if (!isset($query) || empty($query) || $query->num_rows == "0") { $poort = $port; $host = $hostname; } } } } } } $admin_user = get_value_post('admin_user'); $admin_pass = get_value_post('admin_pass'); $name = get_value_post('name'); $max_listeners = get_value_post('max_listeners'); $genre = get_value_post('genre'); $description = get_value_post('description'); $url = get_value_post('url'); $source_pass = get_value_post('source_pass'); $relay_pass = get_value_post('relay_pass'); $mountpoint = get_value_post('mountpoint'); $master_server = get_value_post('master_server'); $master_port = get_value_post('master_port'); $master_user = get_value_post('master_user'); $master_pass = get_value_post('master_pass'); $ftp_pass = get_value_post('ftp_pass'); $streamtype = get_value_post('streamtype'); $shoutcastkey = get_value_post('shoutcastkey'); if ($bitrate === FALSE || $host === FALSE || $poort === FALSE || $admin_user === FALSE || $admin_pass === FALSE || $name === FALSE || $max_listeners === FALSE) { $html = '<br /><br />' . $lang->translate(929) . '<br /><br />'; } else { $availablelisteners = pakketten_get_value_size_stream(get_value_session('from_db', 'id'), 'listeners') - pakketten_get_value_used_stream(get_value_session('from_db', 'id'), 'listeners'); if ($max_listeners < $availablelisteners) { $sql2 = 'INSERT INTO `stream_streams` (`poort`,`admin_user`,`admin_pass`,`max_listeners`,`bitrate`,`account`,`name`,`host`,`genre`,`description`,`url`,`source_pass`,`relay_pass`,`mountpoint`,`master_server`,`master_port`,`master_user`,`master_pass`,`changed2`,`changed`,`type`,`shoutcastkey`) VALUES ("' . $mysqli->real_escape_string($poort) . '","' . $mysqli->real_escape_string($admin_user) . '","' . $mysqli->real_escape_string($admin_pass) . '","' . $mysqli->real_escape_string($max_listeners) . '","' . $mysqli->real_escape_string($bitrate) . '","' . $mysqli->real_escape_string($account) . '","' . $mysqli->real_escape_string($name) . '","' . $mysqli->real_escape_string($host) . '","' . $mysqli->real_escape_string($genre) . '","' . $mysqli->real_escape_string($description) . '","' . $mysqli->real_escape_string($url) . '","' . $mysqli->real_escape_string($source_pass) . '","' . $mysqli->real_escape_string($relay_pass) . '","' . $mysqli->real_escape_string($mountpoint) . '","' . $mysqli->real_escape_string($master_server) . '","' . $mysqli->real_escape_string($master_port) . '","' . $mysqli->real_escape_string($master_user) . '","' . $mysqli->real_escape_string($master_pass) . '","1","1","' . $mysqli->real_escape_string($streamtype) . '","' . $mysqli->real_escape_string($shoutcastkey) . '")'; $mysqli->query($sql2); $id = $mysqli->insert_id; if (get_value_post('ftp_pass') != FALSE && get_value_post('ftp_pass') != '') { $sql = 'INSERT INTO `stream_ftpuser` (`userid`,`passwd`,`homedir`) VALUES ("stream' . $id . '","' . $mysqli->real_escape_string(get_value_post('ftp_pass')) . '","/home/icecast/stream' . $id . '")'; $mysqli->query($sql); $sql = 'INSERT INTO `stream_ftpquotalimits` (`name`,`limit_type`) VALUES ("stream' . $id . '","hard")'; $mysqli->query($sql); } $html = '<br /><br />' . $lang->translate(930) . '<br /><br />'; } else { $html = '<br /><br />' . $lang->translate(931) . '<br /><br />'; } } return $html; }
// Insert record $sql = "INSERT INTO users(name, email, date_of_birth, sex) VALUES ('" . $name . "', '" . $email . "', '" . $year . "-" . $month . "-" . $day . "', '" . $sex . "')"; if ($mysqli->query($sql) !== true) { die("MySQL error"); } // Disconnect $mysqli->close(); } // read in form values $name = get_value_post("name"); $email = get_value_post("email"); $year = get_value_post("year"); $month = get_value_post("month"); $day = get_value_post("day"); $sex = get_value_post("sex"); $terms = get_value_post("terms"); // check if the form has been submitted -- any of the input values is set $submitted = isset($_POST['name']); if ($submitted) { // check for errors $errors = input_check($name, $email, $year, $month, $day, $sex, $terms); if (count($errors) > 0) { display_form($name, $email, $year, $month, $day, $sex, $terms, $errors); } else { confirm($name, $email, $year, $month, $day, $sex); save_to_mysql($name, $email, $year, $month, $day, $sex); } } else { // display form for the first time display_form(); }
} } } $html = '<div class="paginatitel">' . $lang->translate(30) . '</div><div class="content"><p><br />' . $melding . '<br /></p></div>'; $html .= '<DIV class="formtable"><table><tr><td colspan="2"><b>' . $lang->translate(221) . '</b><br></td>'; $html .= '<tr><td width="200px"><form name="form1" method="post" action="">' . $lang->translate(102) . '</td><td><input type="password" id="curr_password" name="curr_password"></td></tr>'; $html .= '<tr><td>' . $lang->translate(103) . '</td><td><input type="password" id="password" name="password"></td></tr>'; $html .= '<tr><td>' . $lang->translate(104) . '</td><td><input type="password" id="password2" name="password2"></td></tr></table></div>'; $html .= '<div class="content"><p><input type="submit" value="' . $lang->translate(105) . '" id="submit" name="submit" class="button"></p></div></form><br /><br />'; } elseif (get_value_get('type') == 'feedback') { $melding = ''; if (get_value_post('submit') != FALSE) { $melding = '<br /><br />' . $lang->translate(150) . '<br /><br />'; $message = "Via het contact formulier op dnsshop heeft " . get_value_post('naam') . " (" . get_value_post('mail234') . ") onderstaande feedback gegevens: \r\n\r\n " . get_value_post('inhoud') . "\r\n Het IP adres van " . get_value_post('naam') . " is " . $_SERVER["REMOTE_ADDR"] . " en de login is " . get_value_session('from_db', 'username') . "."; $subject = "Feedback via contactformulier op dnsshop: " . get_value_post('onderwerp'); $headers = "MIME-Version: 1.0\r\n" . "Content-type: multipart/alternative\r\n" . " \tboundary=\"----=_NextPart_000_002A_01C5CD23.F7D29650\"\r\n" . "X-Priority: 3\r\n" . "X-MSMail-Priority: Normal\r\n" . "X-Mailer: Microsoft Outlook Express 6.00.2900.2670\r\n" . "X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670\r\n" . "From: " . get_value_post('mail234') . " (" . get_value_post('naam') . " )\r\n" . "Subject: " . $subject . ""; mail("*****@*****.**", $subject, $message, $header); } $html = '<div class="paginatitel">' . $lang->translate(33) . '</div><div class="content"><p><br />' . $melding . '<br /></p></div>'; $html .= '<form name="form1" method="post" action=""><div class="formtable"><table><tr><td colspan="2"><b>' . $lang->translate(33) . '</b><br></td>'; $html .= '<tr><td width="200px">' . $lang->translate(151) . '</td><td><input type="text" id="naam" name="naam" value="' . get_value_session('from_db', 'username') . '"></td></tr>'; $html .= '<tr><td>' . $lang->translate(152) . '</td><td><input type="text" id="mail1234" name="mail1234" value="' . get_value_session('from_db', 'email') . '"></td></tr>'; $html .= '<tr><td>' . $lang->translate(153) . '</td><td><input type="text" id="onderwerp" name="onderwerp"></td></tr>'; $html .= '<tr><td>' . $lang->translate(154) . '</td><td><textarea name="inhoud" rows="10" cols="42"></textarea></td></tr></table></div>'; $html .= '<div class="content"><p><input type="submit" value="' . $lang->translate(155) . '" id="submit" name="submit" class="button"></p></div></form><br /><br />'; } else { $html = '<div class="paginatitel">' . $lang->translate(30) . '</div>'; $html .= '<br><br><div class="tablehome"><table>'; $html .= '<tr>'; //$html .= '<td><a href="?page=gegevens&type=overzicht"><img src="'.$template_dir.'/desktop_mijngegevens.png" border="0"></a></td>'; $html .= '<td><a href="?page=gegevens&type=email"><img src="' . $template_dir . '/desktop_email.png" border="0"></a></td>';
function dns_do_action_superbewerken($id, $account, $admin = 2) { global $lang; $data = dns_get_value_super($id); if (pakketten_check_is_allowed($data['account'], 'DNS', $admin)) { global $mysqli_dns; if (!isset($mysqli_dns) || empty($mysqli_dns)) { create_db_connection('mysqli_dns', 'dns'); } global $mysqli_dns; if (get_value_post('ip') == FALSE) { $html = '<br /><br /><p>' . $lang->translate(777) . '</p><br /><br />'; } elseif (get_value_post('name') == FALSE) { $html = '<br /><br /><p>' . $lang->translate(777) . '</p><br /><br />'; } else { $sql = 'UPDATE `supermasters` SET `ip` = "' . $mysqli_dns->real_escape_string(get_value_post('ip')) . '", `nameserver` = "' . $mysqli_dns->real_escape_string(get_value_post('name')) . '", `account` = "' . $mysqli_dns->real_escape_string($account) . '" WHERE `id` = "' . $mysqli_dns->real_escape_string($id) . '"'; $mysqli_dns->query($sql); $html = '<br /><br />' . $lang->translate(794) . '<br /><br />'; } } else { $html = '<br /><br />'; $html .= $lang->translate(792) . '<br /><br />'; } return $html; }
$html .= '<br /><p>' . $lang->translate(658) . '</p><br />'; } } else { $html .= '<br /><p>' . $lang->translate(658) . '</p><br />'; } } elseif (get_value_post('category') == "2") { if (get_value_session('from_db', 'is_admin') == '1') { $pakketten = pakketten_get_value_overview('%', 'stream', get_value_session('from_db', 'is_admin')); } else { $pakketten = pakketten_get_value_overview(get_value_session('from_db', 'id'), 'stream', get_value_session('from_db', 'is_admin')); } if ($pakketten !== FALSE) { foreach ($pakketten as $pakket) { $html .= '<br /><br />'; if (check_user_right(get_value_session('from_db', 'id'), 'streamzoeken', get_value_session('from_db', 'is_admin')) !== FALSE) { $html .= stream_do_action_search($pakket['pakket_id'], get_value_post('search'), get_value_session('from_db', 'is_admin')); } } if (check_user_right(get_value_session('from_db', 'id'), 'dnsdomzoeken', get_value_session('from_db', 'is_admin')) === FALSE && check_user_right(get_value_session('from_db', 'id'), 'dnstemzoeken', get_value_session('from_db', 'is_admin')) === FALSE) { $html .= '<br /><p>' . $lang->translate(658) . '</p><br />'; } } else { $html .= '<br /><p>' . $lang->translate(658) . '</p><br />'; } } else { $html .= '<br /><p>' . $lang->translate(658) . '</p><br />'; } } else { //$type = $lang->translate(631); // dns //$type = $lang->translate(632); // vps if (get_value_session('from_db', 'is_admin') == '1') {
function pakketten_do_action_create_stream() { global $mysqli; if (!isset($mysqli) || empty($mysqli)) { create_db_connection('mysqli', 'central'); } global $mysqli; $temp = 1; if (get_value_session('from_db', 'is_admin') == 1) { $sql = 'INSERT INTO `pakketten_stream` (`max_listeners`) VALUES ("' . $mysqli->real_escape_string(get_value_post('listeners')) . '")'; $mysqli->query($sql); $id = $mysqli->insert_id; if ($id != 0) { $sql = 'INSERT INTO `pakketten` (`type`,`user_id`,`pakket_id`) VALUES ("stream","' . $mysqli->real_escape_string(get_value_post('klant')) . '","' . $mysqli->real_escape_string($id) . '")'; $mysqli->query($sql); $id2 = $mysqli->insert_id; if ($id2 != 0) { return TRUE; } else { return FALSE; } } else { return FALSE; } } else { if (check_user_subuser(get_value_session('from_db', 'id'), get_value_post('klant'))) { $availablelisteners = pakketten_get_value_size_stream(get_value_session('from_db', 'id'), 'listeners') - pakketten_get_value_used_stream(get_value_session('from_db', 'id'), 'listeners'); if (get_value_post('listeners') < $availablelisteners) { $sql = 'INSERT INTO `pakketten_stream` (`max_listeners`) VALUES ("' . $mysqli->real_escape_string(get_value_post('listeners')) . '")'; $mysqli->query($sql); $id = $mysqli->insert_id; if ($id != 0) { $sql = 'INSERT INTO `pakketten` (`type`,`user_id`,`pakket_id`) VALUES ("stream","' . $mysqli->real_escape_string(get_value_post('klant')) . '","' . $mysqli->real_escape_string($id) . '")'; $mysqli->query($sql); $id2 = $mysqli->insert_id; if ($id2 != 0) { return TRUE; } else { return FALSE; } } else { return FALSE; } } else { return FALSE; } } else { return FALSE; } } }
} else { $html .= $search; } } else { $html .= stream_create_html_search(); } } elseif (get_value_get('type') == 'streamtoevoegen' && check_user_right(get_value_session('from_db', 'id'), 'streamtoevoegen', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { if (get_value_post('submit') != FALSE) { $html .= stream_do_action_toevoegen(get_value_get('id'), get_value_session('from_db', 'is_admin')); } else { $html .= stream_create_html_toevoegen(get_value_get('id'), get_value_session('from_db', 'is_admin')); } } elseif (get_value_get('type') == 'streambekijken' && check_user_right(get_value_session('from_db', 'id'), 'streambekijken', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { $html .= stream_create_html_streamdetails(get_value_get('id'), get_value_get('streamid'), 'bekijk', get_value_session('from_db', 'is_admin')); } elseif (get_value_get('type') == 'streambewerken' && check_user_right(get_value_session('from_db', 'id'), 'streambewerken', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { if (get_value_post('submit')) { $replace = stream_do_action_replace_streamdetails(get_value_get('id'), get_value_get('streamid'), get_value_session('from_db', 'is_admin')); if ($replace === FALSE) { $html .= '<br /><br />' . $lang->translate(934) . '<br />'; } else { $html .= '<br /><br />' . $lang->translate(935) . '<br />'; } } $html .= stream_create_html_streamdetails(get_value_get('id'), get_value_get('streamid'), 'bewerk', get_value_session('from_db', 'is_admin')); } elseif (get_value_get('type') == 'streamverwijderen' && check_user_right(get_value_session('from_db', 'id'), 'streamverwijderen', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { $html .= stream_do_action_delete(get_value_get('streamid'), get_value_get('id'), get_value_session('from_db', 'is_admin')); } elseif (get_value_get('type') == 'streamstart' && check_user_right(get_value_session('from_db', 'id'), 'stream', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE && get_value_get('streamid') !== FALSE) { $html .= stream_create_html_action(get_value_get('id'), get_value_get('streamid'), get_value_get('type')); $html .= '<br /><br />' . $lang->translate(603) . ''; $html .= stream_create_html_overview(get_value_get('id')); } elseif (get_value_get('type') == 'streamstop' && check_user_right(get_value_session('from_db', 'id'), 'stream', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE && get_value_get('streamid') !== FALSE) {
} elseif ($rights[$row['id']] == 3) { $user_right[$row['user']][$row['right']]['user'] = 1; $user_right[$row['user']][$row['right']]['subuser'] = 1; } elseif ($rights[$row['id']] == 4) { $user_right[$row['user']][$row['right']]['user'] = 1; $user_right[$row['user']][$row['right']]['subuser'] = 2; } $user_right[$row['user']][$row['right']]['lang'] = $row['subuser']; $user_right[$row['user']][$row['right']]['right'] = $row['right']; $user_right[$row['user']][$row['right']]['id'] = $row['id']; $user_right[$row['user']][$row['right']]['group'] = $row['user']; $user_rights++; } } } else { $rights = get_value_post('right'); if (isset($rights[$row['id']]) && !empty($rights[$row['id']])) { if ($rights[$row['id']] == 1) { $user_right[$row['user']][$row['right']]['user'] = 0; $user_right[$row['user']][$row['right']]['subuser'] = 0; } elseif ($rights[$row['id']] == 2) { $user_right[$row['user']][$row['right']]['user'] = 1; $user_right[$row['user']][$row['right']]['subuser'] = 0; } elseif ($rights[$row['id']] == 3) { $user_right[$row['user']][$row['right']]['user'] = 1; $user_right[$row['user']][$row['right']]['subuser'] = 1; } elseif ($rights[$row['id']] == 4) { $user_right[$row['user']][$row['right']]['user'] = 1; $user_right[$row['user']][$row['right']]['subuser'] = 2; } $user_right[$row['user']][$row['right']]['lang'] = $row['subuser'];
} else { $html .= $search; } } else { $html .= dns_create_html_search('super'); } } elseif (get_value_get('type') == 'superoverzicht' && check_user_right(get_value_session('from_db', 'id'), 'dnssmoverzicht', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { $html .= dns_create_html_superoverzicht(get_value_get('id')); } elseif (get_value_get('type') == 'supertoevoegen' && check_user_right(get_value_session('from_db', 'id'), 'dnssmtoevoegen', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { if (get_value_post('submit') != FALSE) { $html .= dns_do_action_supertoevoegen(get_value_get('id')); } else { $html .= dns_create_html_supertoevoegen(get_value_get('id')); } } elseif (get_value_get('type') == 'superbewerken' && check_user_right(get_value_session('from_db', 'id'), 'dnssmbewerken', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { if (get_value_post('submit') != FALSE) { $html .= dns_do_action_superbewerken(get_value_get('id'), get_value_get('superid'), get_value_session('from_db', 'admin')); } else { $html .= dns_create_html_superbewerken(get_value_get('id'), get_value_get('superid'), get_value_session('from_db', 'admin')); } } elseif (get_value_get('type') == 'superverwijderen' && check_user_right(get_value_session('from_db', 'id'), 'dnssmverwijderen', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { $html .= dns_do_action_delete(get_value_get('superid'), get_value_get('id'), 'super', get_value_session('from_db', 'is_admin')); $html .= dns_create_html_superoverzicht(get_value_get('id')); } elseif (get_value_get('type') == 'domsuperontkoppelen' && check_user_right(get_value_session('from_db', 'id'), 'dnssmdomontkop', get_value_session('from_db', 'is_admin')) !== FALSE && get_value_get('id') !== FALSE) { $html .= dns_do_action_superontkoppelen(get_value_get('domid'), get_value_get('id'), get_value_session('from_db', 'is_admin')); } else { //$html .= '<br /><br />'.$lang->translate(603).''; $html .= dns_create_html_overview(get_value_get('id'), 'domain'); } } else { $html .= '<br /><br />' . $lang->translate(601) . '<br /><br />';