db_query($inn); $inn = "INSERT INTO " . $pre . "szukam(`s_user`)VALUES('" . $user_id . "')"; db_query($inn); $email = $_POST['email']; $smarty->assign("regok", "1"); if ($ust['akt_r'] == 1) { $em = new Smarty(); $em->assign("adres", $ust['adres']); $em->assign("nazwa", $ust['nazwa']); $em->assign("kod", $kod); $em->assign("lang", $lang); $tresc = $em->fetch($ust['templates'] . '/email.aktywacja.tpl'); $head = "From: " . $ust['email'] . " <" . $ust['email'] . ">"; $head .= "\r\n"; $head .= "Content-type: text/html; charset=UTF-8\r\n"; @nw_mail($ust['email'], $email, "Aktywacja konta", $tresc, $head); $smarty->assign("send", "1"); } else { $smarty->assign("send", "2"); } } $smarty->assign("lt", htmlspecialchars($_POST['login'])); $smarty->assign("et", htmlspecialchars($_POST['email'])); $smarty->assign("plec", htmlspecialchars($_POST['plec'])); $smarty->assign("d", htmlspecialchars($_POST['d'])); $smarty->assign("m", htmlspecialchars($_POST['m'])); $smarty->assign("y", htmlspecialchars($_POST['y'])); $smarty->assign("regulamin", htmlspecialchars($_POST['regulamin'])); } $smarty->assign("givereg", $ust['give']); $smarty->assign("tokenr", $ust['token_r']);
include "subheader.php"; if ($_POST[nhzi]) { $Query = 'SELECT * FROM ' . $pre . 'user WHERE user_login="******" and user_akt="1"'; $result = db_query($Query) or die(db_error()); while ($row = db_fetch($result)) { $id = $row['user_id']; $login = $row['user_login']; $email = $row['user_email']; } if ($id != "") { $nhn = rand(11111, 99999999); $nh = md5($nhn); $up = "UPDATE " . $pre . "user SET user_haslo='" . $nh . "' WHERE user_id='" . $id . "'"; db_query($up); $em = new Smarty(); $em->assign("{$adres}", $ust['adres']); $em->assign("{$nazwa}", $ust['nazwa']); $em->assign("haslo", $nhn); $tresc = $em->fetch($ust['templates'] . '/email.zapomniane.haslo.tpl'); $head = "From: " . $ust['email'] . " <" . $ust['email'] . ">"; $head .= "\r\n"; $head .= "Content-type: text/html; charset=UTF-8\r\n"; @nw_mail($ust['email'], $email, "" . $lang['525'] . " " . $ust['nazwa'], $tresc, $head); $smarty->assign("akt", '1'); } else { $smarty->assign("akt", '2'); } } $smarty->assign("title", $lang['478'] . ' - ' . $ust['nazwa']); $smarty->display($ust['templates'] . '/zapomniane.haslo.tpl');
$tresc = str_replace("{imie}", $row['user_nazwak'], $tresc); $tresc = str_replace("{login}", $row['user_login'], $tresc); $tresc = str_replace("{data_r}", $row['user_data_r'], $tresc); $tresc = str_replace("{data_o}", $row['user_data_o'], $tresc); $tytul = str_replace("{imie}", $row['user_nazwak'], $tytul); $tytul = str_replace("{login}", $row['user_login'], $tytul); $tytul = str_replace("{data_r}", $row['user_data_r'], $tytul); $tytul = str_replace("{data_o}", $row['user_data_o'], $tytul); $subject = $tytul; $mail = $row['user_email']; $body = $tresc; $head = "From: " . $ust['email'] . " <" . $ust['email'] . ">"; $head .= "\r\n"; $head .= "Content-type: text/html; charset=UTF-8\r\n"; if ($_POST['typ'] == "1") { @nw_mail($ust['email'], $mail, $subject, $body, $head, "1"); } else { $in = "INSERT INTO " . $pre . "pw(`pw_tytul`, `pw_tresc`, `pw_od`, `pw_do`, `pw_data`, `pw_typ`)VALUE('" . $tytul . "','" . $tresc . "', '" . htmlspecialchars($_SESSION['user_id']) . "', '" . $row['user_id'] . "', NOW(), '1')"; db_query($in); } $ile++; } header("Location: " . $ust['adres'] . "admin/index.php?page=user&e=1000&ile=" . $ile . ""); exit; } else { $send_u_tytul = $_POST['tytul']; $send_u_tresc = $_POST['tresc']; $send_u_typ = $_POST['typ']; $send_u_do = $_POST['do']; $send_u_e = "1"; }
<?php include "subheader.php"; if ($_POST['submit']) { $mail = $_POST['email']; if ($_POST['email'] != "" and $_POST['subject'] != "" and $_POST['text'] != "" and preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $mail) and $_POST['kod'] == $_SESSION['token']) { $subject = "Strona: " . $_POST['subject']; $text = $_POST['text']; $mail = $_POST['email']; $body = "" . $mail . " " . $lang['523'] . " \n\n\r\r " . $text . ""; $head = "From: " . $mail . " <" . $mail . ">"; $head .= "\r\n"; $head .= "Content-type: text/html; charset=UTF-8\r\n"; if (nw_mail($mail, $ust['email'], $subject, $body, $head)) { $smarty->assign("send", "ok"); } else { $smarty->assign("send", "error"); $ttt = htmlspecialchars($_POST['subject']); $eee = htmlspecialchars($_POST['email']); $www = htmlspecialchars($_POST['text']); $smarty->assign("temail", $ttt); $smarty->assign("eemail", $eee); $smarty->assign("wemail", $www); } } else { if (empty($_POST['email'])) { $smarty->assign("error1", "pemail"); } $mail = $_POST['email']; if (!preg_match("/^[-0-9A-Z_\\.]{1,50}@([-0-9A-Z_\\.]+\\.){1,50}([0-9A-Z]){2,4}\$/i", $mail)) { $smarty->assign("error2", "ppemail");