function load() { global $db, $scache, $config, $bbcode; if ($this->exists() == true) { $this->import(); } else { $categories_obj = $scache->load('categories'); $cat_cache = $categories_obj->get(); $result = $db->query("\n\t\t\tSELECT id, name, parent, position, description, topics, replies, opt, optvalue, forumzahl, topiczahl, prefix, invisible, readonly, auto_status, active_topic, count_posts, reply_notification, topic_notification, message_active, message_title, message_text\n\t\t\tFROM {$db->pre}forums\n\t\t\t", __LINE__, __FILE__); $this->data = array(); while ($row = $db->fetch_assoc($result)) { $row['bid'] = $cat_cache[$row['parent']]['parent']; $emails = preg_split('/[\\r\\n]+/', $row['topic_notification'], -1, PREG_SPLIT_NO_EMPTY); $row['topic_notification'] = array(); foreach ($emails as $email) { if (check_mail($email)) { $row['topic_notification'][] = $email; } } $emails = preg_split('/[\\r\\n]+/', $row['reply_notification'], -1, PREG_SPLIT_NO_EMPTY); $row['reply_notification'] = array(); foreach ($emails as $email) { if (check_mail($email)) { $row['reply_notification'][] = $email; } } BBProfile($bbcode); $bbcode->setReplace($config['wordstatus']); $row['message_text'] = $bbcode->parse($row['message_text']); $this->data[$row['id']] = $row; } $this->export(); } }
function print_mail($content) { $new_messages = check_mail(); print "\n\t\n<table border=\"0\" class=\"mail\">\n\t<tr><td><a href=\"messages.php?compose\" title=\"compose a message\">compose</a>\n\t<br /><a href=\"messages.php?read\" title=\"read messages\">inbox</a>({$new_messages})\n\t<br /><a href=\"messages.php?outbox\" title=\"read sent messages\">outbox</a>\n\t<br /><a href=\"messages.php?trash\" title=\"read deleted messages\">trash</a></td>\n\t<td rowspan=\"2\" colspan=\"4\" class=\"mail_content_holder\">"; print $content; print "</td></tr></table>"; }
public function Execute(Template $template, Session $session, $request) { $this->dba = DBA::Open(); /* Create the ancestors bar (if we run into any trouble */ $template = CreateAncestors($template, $template['L_INFORMATION']); if ($session['user'] instanceof Guest) { $email = htmlspecialchars($request['email']); if ($email == check_mail($email)) { if ($this->dba->Query("SELECT * FROM " . USERS . " WHERE email = '{$email}'")->NumRows() > 0) { $new_pw = $this->GetRandom(); $forum = $this->dba->GetValue("SELECT name FROM " . FORUMS . " WHERE row_left = 1"); $username = $this->dba->GetValue("SELECT name FROM " . USERS . " WHERE email = '{$email}'"); if (mail($email, sprintf($template['L_PWSENTSUBJECT'], $forum), sprintf($template['L_PWSENTMESSAGE'], $forum, $username, $new_pw, $forum), "From: \"Password Reset - k4 Bulletin Board Mailer\" <noreply@" . $_SERVER['HTTP_HOST'] . ">")) { $this->dba->Query("UPDATE " . USERS . " SET pass = '******' WHERE email = '{$email}'"); return new Error($template['L_PASSWORDSENT'] . '<meta http-equiv="refresh" content="2; url=index.php">', $template); } else { return new Error($template['L_ERRORRESETPW'], $template); } } else { return new Error($template['L_INVALIDEMAIL'], $template); } } else { return new Error($template['L_INVALIDEMAIL'], $template); } } else { return new Error($template['L_CANTBELOGGEDIN'], $template); } }
static function checkMail($mail, $userid = 0) { if (!check_mail($mail)) { return '¬ведите правильный e-mail'; } elseif ($userid !== null) { $rs = DB::select("SELECT * FROM sc_users WHERE (mail=:mail OR login=:mail) AND u_id!=:u_id LIMIT 1", array('mail' => $mail, 'login' => $mail, 'u_id' => $userid)); if ($rs->next()) { return 'e-mail уже зарегистрирован'; } } return ''; }
function checkMail($mail) { global $ST; if (!check_mail($mail)) { return 'Введите правильный e-mail'; } else { $rs = $ST->select("SELECT * FROM sc_users WHERE mail='" . SQL::slashes($mail) . "' AND u_id!=" . $this->getUserId() . " LIMIT 1"); if ($rs->next()) { return 'e-mail уже зарегистрирован'; } } }
/** * Form data need to be valid * @return $monit */ function valid_data() { global $i18n; if (strlen($this->coreuser) < 4) { $this->monit[] = $i18n['main_content'][0]; } if (!check_mail($this->coremail)) { $this->monit[] = $i18n['main_content'][1]; } if (strlen($this->corepass_1) < 6) { $this->monit[] = $i18n['main_content'][2]; } if ($this->corepass_1 != $this->corepass_2) { $this->monit[] = $i18n['main_content'][3]; } if (empty($this->monit)) { $this->do_install(); } else { $this->failed_install(); } }
public function Execute(Template $template, Session $session, $request) { $this->dba = DBA::Open(); $template = CreateAncestors($template, $template['L_ADMINPANEL']); if ($session['user'] instanceof Member && $session['user']['perms'] & ADMIN) { foreach ($request as $key => $val) { $request[$key] = $this->dba->Quote($val); } /* Check if that is a valid email */ if (!check_mail($request['email'])) { return new Error($template['L_INVALIDEMAIL'], $template); } $id = intval($request['id']); if ($this->dba->Query("SELECT * FROM " . USERS . " WHERE id = {$id}")->NumRows() == 1) { if ($this->dba->Query("UPDATE " . USERS . " SET name = '" . $request['name'] . "', email = '" . $request['email'] . "', posts = " . intval($request['posts']) . ", rank = '" . $request['rank'] . "' WHERE id = " . $id)) { echo '<meta http-equiv="refresh" content="2; url=member.php?id=' . $id . '">'; return new Error($template['L_USERUPDATED'], $template); } } else { return new Error($template['L_USERDOESNTEXIST'], $template); } } return TRUE; }
$human = null; if (!$my->vlogin) { if ($config['botgfxtest_posts'] == 1) { include "classes/graphic/class.veriword.php"; $vword = new VeriWord(); if ($_POST['letter']) { if ($vword->check_session($_POST['captcha'], $_POST['letter']) == FALSE) { $error[] = $lang->phrase('veriword_mistake'); } else { $human = array('captcha' => $_POST['captcha'], 'letter' => $_POST['letter']); } } else { $error[] = $lang->phrase('veriword_failed'); } } if (!check_mail($_POST['email']) && ($config['guest_email_optional'] == 0 || !empty($_POST['email']))) { $error[] = $lang->phrase('illegal_mail'); } if (double_udata('name', $_POST['name']) == false) { $error[] = $lang->phrase('username_registered'); } if (is_id($_POST['name'])) { $error[] = $lang->phrase('username_registered'); } if (strxlen($_POST['name']) > $config['maxnamelength']) { $error[] = $lang->phrase('name_too_long'); } if (strxlen($_POST['name']) < $config['minnamelength']) { $error[] = $lang->phrase('name_too_short'); } if (strxlen($_POST['email']) > 200) {
for ($loop = 0; $loop < count($tab_group['moy_manquante']); $loop++) { if ($loop > 0) { $message .= ", "; } //$message.=$tab_group['moy_manquante'][$loop]; $message .= $tab_alerte_prof[$login_prof]['groupe'][$group_id]['moy_manquante'][$loop]; } $message .= ".\n"; } } $message .= "\nLorsqu'un élève n'a pas de note, veuillez saisir un tiret '-' pour signaler qu'il n'y a pas d'oubli de saisie de votre part.\nEn revanche, s'il s'agit d'une erreur d'affectation, vous disposez, en mode Visualisation d'un carnet de notes, d'un lien 'Signaler des erreurs d affectation' pour alerter l'administrateur Gepi sur un problème d'affectation d'élèves.\n"; $message .= "\nJe vous serais reconnaissant(e) de bien vouloir les remplir rapidement.\n\nD'avance merci.\n-- \n" . civ_nom_prenom($_SESSION['login']); echo "<tr class='lig{$alt}'>\n"; echo "<td>\n"; if ($tab_alerte_prof[$login_prof]['email'] != "") { if (check_mail($tab_alerte_prof[$login_prof]['email'])) { $tab_num_mail[] = $num; $sujet_mail = "[Gepi]: Appreciations et/ou moyennes manquantes"; echo "<a href='mailto:" . $tab_alerte_prof[$login_prof]['email'] . "?subject={$sujet_mail}&body=" . rawurlencode($message) . "'>" . $info_prof . "</a>"; echo "<input type='hidden' name='sujet_{$num}' id='sujet_{$num}' value=\"{$sujet_mail}\" />\n"; echo "<input type='hidden' name='mail_{$num}' id='mail_{$num}' value=\"" . $tab_alerte_prof[$login_prof]['email'] . "\" />\n"; } } else { echo $info_prof; } //echo "<br />"; echo "</td>\n"; echo "<td rowspan='2'>\n"; //echo "<textarea id='message_$num' cols='50' rows='5'>$message</textarea>\n"; echo "<textarea name='message_{$num}' id='message_{$num}' cols='50' rows='5'>{$message}</textarea>\n"; //echo "<input type='hidden' name='message_$num' id='message_$num' value=\"".rawurlencode($message)."\" />\n";
<?php require_once 'functions.php'; require_once 'functions.mail.php'; require_once 'openid.php'; $expiration = (int) $_GET['expiration']; $get_hash = $_GET['hash']; if ($_POST) { $_POST['email'] = trim($_POST['email']); if (check_mail($_POST['email'])) { $tomorrow = date("M d, Y", strtotime(date("Y-m-d") . " +1day")); $expiration = strtotime($tomorrow); $hash = encrypt($expiration); $link = URL . "register.php?expiration={$expiration}&hash={$hash}"; $text = _('You have been invited to access the following site: ' . SITENAME . '. '); $text .= _('In order to access this website, you need to register your account. '); $text .= _('This can be done by clicking the link below and following the instructions. '); $text .= _('This link will be valid until ' . $tomorrow . ". "); $html = $text; $text .= "\n" . _('Link: ') . $link; $html .= "<br /><br />" . _('Link: <a href=' . $link . '>' . _('Register your account')); pearMail($_POST['email'], _('Register your account for ') . SITENAME, $html, $text); $print = _("Email was sent"); } else { $print = _("Mail address not valid"); } } ?> <!doctype html> <html> <head>
?> </td> <td><span class="label label-info"><?php echo $item['alarm_value']; ?> </span></td> <td><?php echo $item['create_time']; ?> </td> <td><?php echo check_mail($item['send_mail']); ?> </td> <td><?php echo check_mail($item['send_mail_status']); ?> </td> </tr> <?php } } else { ?> <tr> <td colspan="12"> <font color="red"><?php echo $this->lang->line('no_record'); ?> </font> </td>
<td class="ubox" colspan="2" align="center"><input type="submit" name="Submit" value="<?php echo $lang->phrase('admin_form_submit'); ?> "></td> </tr> </table> </form> <?php echo foot(); } elseif ($job == 'register2') { echo head(); $register_notification = $gpc->get('register_notification', none); $emails = preg_split('/[\\r\\n]+/', $register_notification, -1, PREG_SPLIT_NO_EMPTY); $register_notification = array(); foreach ($emails as $email) { if (check_mail($email, true)) { $register_notification[] = $email; } } $register_notification = implode("\n", $register_notification); $c->getdata(); $c->updateconfig('confirm_registration', str); $c->updateconfig('register_notification', str, $register_notification); $c->updateconfig('disableregistration', int); $c->updateconfig('acceptrules', int); $c->savedata(); ok('admin.php?action=settings&job=settings'); } elseif ($job == 'db') { $config = $gpc->prepare($config); echo head(); ?>
function xmail($to, $from = array(), $topic, $comment, $type = 'plain', $attachment = array()) { global $config, $my, $lang, $bbcode; require_once "classes/mail/class.phpmailer.php"; require_once 'classes/mail/extended.phpmailer.php'; $mail = new PHPMailer(); $mail->CharSet = $lang->phrase('charset'); // Added Check_mail for better security // Now it is not possible to add various headers to the mail if (!isset($from['mail']) || !check_mail($from['mail'])) { $mail->From = $config['forenmail']; } else { $mail->From = $from['mail']; } if (!isset($from['name'])) { $mail->FromName = $config['fname']; } else { $mail->FromName = $from['name']; } if ($config['smtp'] == 1) { $mail->Mailer = "smtp"; $mail->IsSMTP(); $mail->Host = $config['smtp_host']; if ($config['smtp_auth'] == 1) { $mail->SMTPAuth = TRUE; $mail->Username = $config['smtp_username']; $mail->Password = $config['smtp_password']; } } elseif ($config['sendmail'] == 1) { $mail->IsSendmail(); $mail->Mailer = "sendmail"; $mail->Sendmail = $config['sendmail_host']; } else { $mail->IsMail(); } $mail->Subject = $topic; if (!is_array($to)) { $to = array('0' => array('mail' => $to)); } $i = 0; foreach ($to as $email) { if ($type == 'bb') { BBProfile($bbcode); $bbcode->setSmileys(0); $bbcode->setReplace($config['wordstatus']); $row->comment = $row->comment; $mail->IsHTML(TRUE); $mail->Body = $bbcode->parse($comment); $mail->AltBody = $bbcode->parse($comment, 'plain'); } elseif ($type == 'html') { $mail->IsHTML(TRUE); $mail->Body = $comment; $mail->AltBody = html_entity_decode(strip_tags($comment)); } else { $mail->Body = html_entity_decode($comment); } if (isset($email['name'])) { $mail->AddAddress($email['mail'], $email['name']); } else { $mail->AddAddress($email['mail']); } foreach ($attachment as $file) { if ($file['type'] == 'string') { $mail->AddStringAttachment($file['file'], $file['name']); } else { $mail->AddAttachment($file['file'], $file['name']); } } if ($mail->Send()) { $i++; } $mail->ClearAddresses(); $mail->ClearAttachments(); } return $i; }
} else { $query['name'] = $name; } $query['pw'] = $gpc->get('pw_'.$random, str); $query['hp'] = trim($query['hp']); if (strtolower(substr($query['hp'], 0, 4)) == 'www.') { $query['hp'] = "http://{$query['hp']}"; } $error = array(); if (strxlen($query['comment']) > $config['maxaboutlength']) { $error[] = $lang->phrase('admin_member_about_too_many_chars'); } if (check_mail($query['email']) == false) { $error[] = $lang->phrase('admin_member_no_valid_mail'); } if (strxlen($query['name']) > $config['maxnamelength']) { $error[] = $lang->phrase('admin_member_name_too_many_chars'); } if (strxlen($query['name']) < $config['minnamelength']) { $error[] = $lang->phrase('admin_member_too_less_chars'); } if (strlen($query['email']) > 200) { $error[] = $lang->phrase('admin_member_email_too_many_chars'); } if ($user['mail'] != $_POST['email'] && double_udata('mail', $_POST['email']) == false) { $error[] = $lang->phrase('email_already_used'); } if (strxlen($query['signature']) > $config['maxsiglength']) {
$monit = array(); // tablica przechowuj±ca b³êdy $dbname = $_POST['dbname']; $dbhost = $_POST['dbhost']; $dbuser = $_POST['dbuser']; $dbpass = $_POST['dbpass']; $lang = $_POST['lang']; $dbprefix = $_POST['dbprefix']; $coreuser = $_POST['coreuser']; $coremail = $_POST['coremail']; $corepass_1 = $_POST['corepass_1']; $corepass_2 = $_POST['corepass_2']; if (strlen($coreuser) < 4) { $monit[] = $i18n['main_content'][0]; } if (!check_mail($coremail)) { $monit[] = $i18n['main_content'][1]; } if (strlen($corepass_1) < 6) { $monit[] = $i18n['main_content'][2]; } if ($corepass_1 != $corepass_2) { $monit[] = $i18n['main_content'][3]; } $rdbms = empty($_POST['rdbms']) ? '' : $_POST['rdbms']; switch ($rdbms) { case 'mysql4': $db_schema = SQL_SCHEMA . '/core-mysql40_install.sql'; break; case 'mysql41': $db_schema = SQL_SCHEMA . '/core-mysql41_install.sql';
<?php include "./modele/modele_connexion_bdd.php"; include "./modele/modele_fonction.php"; if (isset($_POST["valider"])) { $pseudo = htmlspecialchars($_POST["pseudo"]); $mdp = htmlspecialchars($_POST["mdp"]); $mail = $_POST["mail"]; if (preg_match("`^[a-z]+[[:alnum:]]+\$`", $pseudo)) { if (filter_var($mail, FILTER_VALIDATE_EMAIL)) { $verif_pseudo = compte($pseudo); $check_mail = check_mail($mail); if ($verif_pseudo != 0) { $alerte = "Ce compte exite déjà"; include "./vue/vue_inscription.php"; } else { if ($check_mail != 0) { $alerte = "Cette adresse mail exite déjà"; include "./vue/vue_inscription.php"; } else { $mdp1 = hash_mdp($mdp); inscription($pseudo, $mdp1, $mail); $_SESSION["pseudo"] = $pseudo; $_SESSION["mdp"] = $mdp; $id = id($pseudo); $_SESSION["id"] = $id; $results = liste_relais($id); foreach ($results as $cle => $result) { $results[$cle]["nom_domain"] = nl2br(htmlspecialchars($result["nom_domain"])); $results[$cle]["ip"] = nl2br(htmlspecialchars($result["ip"])); }
$nick = $_REQUEST['nick']; $new_pass = trim($_REQUEST['passor']); $new_email = trim($_REQUEST['email']); if (check_name($nick)) { $player = new Player(); $account = new Account(); $player->find($nick); if ($player->isLoaded()) { $account = $player->getAccount(); } if ($account->isLoaded()) { $account_key = $account->getCustomField('key'); if (!empty($account_key)) { if ($account_key == $rec_key) { if (check_password($new_pass)) { if (check_mail($new_email)) { $account->setEMail($new_email); $account->setPassword($new_pass); $account->save(); $main_content .= 'Your account name, new password and new e-mail.<BR> <FORM ACTION="?subtopic=accountmanagement" onsubmit="return validate_form(this)" METHOD=post> <INPUT TYPE=hidden NAME="character" VALUE=""> <TABLE CELLSPACING=1 CELLPADDING=4 BORDER=0 WIDTH=100%> <TR><TD BGCOLOR="' . $config['site']['vdarkborder'] . '" CLASS=white><B>Your account name, new password and new e-mail</B></TD></TR> <TR><TD BGCOLOR="' . $config['site']['darkborder'] . '"> Account name: <b>' . htmlspecialchars($account->getName()) . '</b><BR> New password: <b>' . htmlspecialchars($new_pass) . '</b><BR> New e-mail address: <b>' . htmlspecialchars($new_email) . '</b><BR>'; if ($account->getCustomField('next_email') < time()) { $mailBody = '<html> <body>
if (empty($name)) { $query['name'] = $user['name']; } else { $query['name'] = $name; } $name = $gpc->get('pw_' . $random, str); if (empty($name)) { $query['pw'] = $user['pw']; } else { $query['pw'] = $name; } $error = array(); if (strxlen($query['comment']) > $config['maxaboutlength']) { $error[] = $lang->phrase('about_too_long'); } if (check_mail($query['email']) == FALSE) { $error[] = $lang->phrase('illegal_mail'); } if (strxlen($query['name']) > $config['maxnamelength']) { $error[] = $lang->phrase('name_too_long'); } if (strxlen($query['name']) < $config['minnamelength']) { $error[] = $lang->phrase('name_too_short'); } if (strxlen($query['email']) > 200) { $error[] = $lang->phrase('email_too_long'); } if (strxlen($query['signature']) > $config['maxsiglength']) { $error[] = $lang->phrase('editprofile_signature_too_long'); } if (strxlen($query['hp']) > 254) {
} } //############# CHANGE E-MAIL ################### if ($action == "changeemail") { $account_email_new_time = $account_logged->getCustomField("email_new_time"); if ($account_email_new_time > 10) { $account_email_new = $account_logged->getCustomField("email_new"); } if ($account_email_new_time < 10) { if ($_POST['changeemailsave'] == 1) { $account_email_new = trim($_POST['new_email']); $post_password = trim($_POST['password']); if (empty($account_email_new)) { $change_email_errors[] = "Please enter your new email address."; } else { if (!check_mail($account_email_new)) { $change_email_errors[] = "E-mail address is not correct."; } } if (empty($post_password)) { $change_email_errors[] = "Please enter password to your account."; } else { if (!$account_logged->isValidPassword($post_password)) { $change_email_errors[] = "Wrong password to account."; } } if (empty($change_email_errors)) { $account_email_new_time = time() + $config['site']['email_days_to_change'] * 24 * 3600; $account_logged->set("email_new", $account_email_new); $account_logged->set("email_new_time", $account_email_new_time); $account_logged->save();
function actSave() { global $ST, $get, $post; $id = $post->getInt('id'); $data = array('content' => $post->get('content'), 'description' => $post->get('description'), 'title' => $post->get('title'), 'author' => $post->get('author'), 'date' => dte($post->get('date'), 'Y-m-d'), 'state' => $post->get('state'), 'category' => $post->getInt('category'), 'position' => $post->getInt('position'), 'gallery' => $post->getInt('gallery'), 'type' => $this->getType()); $img_out = ""; if (!empty($_FILES['upload']['name']) && isImg($_FILES['upload']['name'])) { $img = $this->cfg('NEWS_IMAGE_PATH') . '/' . md5($_FILES['upload']['tmp_name']) . "." . file_ext($_FILES['upload']['name']); move_uploaded_file($_FILES['upload']['tmp_name'], ROOT . $img); $data['img'] = $img; $img_out = scaleImg($img, 'w200'); } if ($post->getInt('clear')) { $data['img'] = ''; } if ($id) { $ST->update('sc_news', $data, "id=" . $id); } else { $id = $ST->insert('sc_news', $data); } $ST->delete('sc_relation', "parent={$id} AND type='public'"); foreach ($post->getArray('public_rel') as $v) { $ST->insert('sc_relation', array('parent' => $id, 'type' => 'public', 'child' => $v)); } $msg = "Сохранено"; if (true) { $content = ''; $content .= '<small>' . date('d.m.Y') . '</small> '; $content .= '<strong>' . $post->getHtml('title') . '</strong><br />'; $content .= '<span>' . $post->getHtml('description') . '</span><br />'; $content .= '<a href="http://' . $this->cfg('SITE') . '/' . $post->get('type') . '/' . $id . '/">подробнее...</a>'; if ($post->exists('save_and_send')) { $mail = new Mail(); $mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail'))); $key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($this->getUser('mail') . $this->getType() . 'unsubscribe') . '&type=' . $this->getType() . '&mail=' . $this->getUser('mail'); $key = '<a href="' . $key . '">' . $key . '</a>'; $mail->setTemplate('letter_' . $this->getType(), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'), 'TITLE' => $post->get('title'))); $mail->xsend($this->getUser('mail'), array('UNSUBSCRIBE' => $key)); } elseif ($post->exists('save_and_send_all')) { $q = "SELECT distinct mail,id FROM sc_subscribe WHERE type LIKE '%" . $this->getType() . "%' \r\n\t\t\t\tAND NOT EXISTS(SELECT mailid FROM sc_news_sendlog WHERE id=mailid AND newsid={$id}){$this->getMailFilter()}"; if ($post->getInt('pack')) { $q .= " LIMIT {$post->getInt('pack')}"; } $rs = $ST->select($q); $mail = new Mail(); // $mail->setFromMail($this->getConfig('mail')); $mail->setFromMail(array($this->cfg('SITE'), $this->cfg('mail'))); $mail->setTemplate('letter_' . $this->getType(), array('FROM_SITE' => $this->cfg('SITE'), 'CONTENT' => $content, 'BODY' => $post->get('content'), 'TITLE' => $post->get('title'))); $n = 0; while ($rs->next()) { if (check_mail($m = trim($rs->get('mail')))) { $key = 'http://' . $this->cfg('SITE') . '/cabinet/unsubscribe/?key=' . md5($rs->get('mail') . $this->getType() . 'unsubscribe') . '&type=' . $this->getType() . '&mail=' . $rs->get('mail'); $key = '<a href="' . $key . '">' . $key . '</a>'; $mail->xsend($m, array('UNSUBSCRIBE' => $key)); $ST->insert('sc_news_sendlog', array('mailid' => $rs->get('id'), 'newsid' => $id)); $n++; } else { $ST->delete('sc_subscribe', "mail='" . SQL::slashes($rs->get('mail')) . "'"); } } $msg .= " отправлено {$n}"; } } echo printJSONP(array('msg' => $msg, 'id' => $id, 'img' => $img_out)); exit; }
$size .= $lang->phrase('editprofile_pic_w2'); } if ($config['avheight'] > 0) { $size .= $lang->phrase('editprofile_pic_h1'); } else { $size .= $lang->phrase('editprofile_pic_h2'); } $mymodules->load('editprofile_pic_top'); echo $tpl->parse("editprofile/pic"); } elseif ($_GET['action'] == "profile2") { $_POST['hp'] = trim($_POST['hp']); if (strtolower(substr($_POST['hp'], 0, 4)) == 'www.') { $_POST['hp'] = "http://" . $_POST['hp']; } $error = array(); if (check_mail($_POST['email']) == FALSE) { $error[] = $lang->phrase('illegal_mail'); } if (strxlen($_POST['name']) > $config['maxnamelength'] && $config['changename_allowed'] == 1) { $error[] = $lang->phrase('name_too_long'); } if (strxlen($_POST['name']) < $config['minnamelength'] && $config['changename_allowed'] == 1) { $error[] = $lang->phrase('name_too_short'); } if (strxlen($_POST['email']) > 200) { $error[] = $lang->phrase('email_too_long'); } if (strxlen($_POST['signature']) > $config['maxsiglength']) { $error[] = $lang->phrase('editprofile_signature_too_long'); } if (strxlen($_POST['hp']) > 254) {
if($lig->description=="") { $texte.="Aucun détail n'a été saisi."; if($lig->nature=='') { if((!in_array($lig->declarant, array_keys($tab_individu)))||(!isset($tab_individu[$lig->declarant]['email']))) { $sql="SELECT email,civilite,nom,prenom FROM utilisateurs WHERE login='******' AND email!='';"; $res_mail=mysqli_query($GLOBALS["mysqli"], $sql); if(mysqli_num_rows($res_mail)>0) { $lig_mail=mysqli_fetch_object($res_mail); $tab_individu[$lig->declarant]['designation']=$lig_mail->civilite." ".casse_mot($lig_mail->nom, 'maj')." ".casse_mot($lig_mail->prenom, 'majf2'); $tab_individu[$lig->declarant]['email']=$lig_mail->email; } } if((isset($tab_individu[$lig->declarant]['email']))&&(check_mail($tab_individu[$lig->declarant]['email']))) { $texte="<a href=\"mailto:".$tab_individu[$lig->declarant]['email']."?subject=".getSettingValue('gepiPrefixeSujetMail')." ".ucfirst($mod_disc_terme_incident)." sans détails"; if($email_visiteur!='') { $texte.="&bcc=".$email_visiteur; } $texte.="&body=Bonjour%20".preg_replace("/ /","%20",$tab_individu[$lig->declarant]['designation']).",%0A%0a"."Vous avez déclaré un ".$mod_disc_terme_incident." (numéro $lig->id_incident) sans en préciser la nature, les détails."."%0A%0a"."L'".$mod_disc_terme_incident." a eu lieu le ".formate_date($lig->date)." en $lig->heure avec pour protagonistes: $liste_protagonistes"."%0A%0a"."Pourriez-vous préciser?"."%0A%0a"."Merci."."\">"; $texte.="Aucun détail n'a été saisi."; $texte.="</a>"; } else { $texte="Aucun détail n'a été saisi."; } } } else {
$texte_mail .= "\nPrendre en compte la proposition : " . getSettingValue('url_racine_gepi') . "/groupes/edit_eleves.php?id_groupe=" . $current_group["id"] . " \n(vous devez être connecté(e) dans GEPI avant de cliquer sur ce lien).\n"; } // On utilise un témoin if (isset($nom_eleve) && $nom_eleve != "" && getSettingValue("gepiAdminAdress") != '') { $gepiPrefixeSujetMail = getSettingValue("gepiPrefixeSujetMail") ? getSettingValue("gepiPrefixeSujetMail") : ""; if ($gepiPrefixeSujetMail != '') { $gepiPrefixeSujetMail .= " "; } $ajout_header = ""; if ($email_declarant != "") { $ajout_header .= "Cc: {$nom_declarant} <" . $email_declarant . ">\r\n"; $tab_param_mail['cc'][] = $email_declarant; $tab_param_mail['cc_name'][] = $nom_declarant; } $destinataire_mail = getSettingValue("gepiAdminAdress"); if (check_mail($destinataire_mail)) { $tab_param_mail['destinataire'][] = $destinataire_mail; } if (getSettingValue('email_dest_info_erreur_affect_grp') != "" && getSettingValue('email_dest_info_erreur_affect_grp') != getSettingValue("gepiAdminAdress")) { $destinataire_mail .= "," . getSettingValue("email_dest_info_erreur_affect_grp"); $tab_param_mail['destinataire'][] = getSettingValue("email_dest_info_erreur_affect_grp"); } $envoi = envoi_mail($sujet_mail, $texte_mail, $destinataire_mail, $ajout_header, "plain", $tab_param_mail); } } // On utilise un témoin if (isset($nom_eleve) && $nom_eleve != "" && $msg == "") { $msg = "Enregistrement effectué."; } } }
} } } //echo "\$texte_mail=$texte_mail<br />"; if (count($tab_alerte_classe) > 0) { $tab_param_mail = array(); $destinataires = get_destinataires_mail_alerte_discipline($tab_alerte_classe, $nature); // La liste des destinataires, admin inclus doivent être définis dans "Définition des destinataires d'alertes" //if($destinataires=="") { // $destinataires=getSettingValue("gepiAdminAdress"); //} if ($destinataires != "") { $texte_mail = $texte_mail . "\n\n" . "Message: " . preg_replace('#<br />#', "\n", $msg); $subject = "[GEPI][" . ucfirst($mod_disc_terme_incident) . " n°{$id_incident}]" . $info_classe_prot . $liste_protagonistes_responsables; $headers = ""; if (isset($_SESSION['email']) && check_mail($_SESSION['email'])) { $headers .= "Reply-to:" . $_SESSION['email'] . "\r\n"; $tab_param_mail['replyto'] = $_SESSION['email']; } if (isset($message_id)) { $headers .= "Message-id: {$message_id}\r\n"; } if (isset($references_mail)) { $headers .= "References: {$references_mail}\r\n"; } // On envoie le mail $envoi = envoi_mail($subject, $texte_mail, $destinataires, $headers, "plain", $tab_param_mail); } } } }
} if ($forumzahl < 0) { $forumzahl * -1; } $emails = preg_split('/[\\r\\n]+/', $reply_notification, -1, PREG_SPLIT_NO_EMPTY); $reply_notification = array(); foreach ($emails as $email) { if (check_mail($email)) { $reply_notification[] = $email; } } $reply_notification = implode("\n", $reply_notification); $emails = preg_split('/[\\r\\n]+/', $topic_notification, -1, PREG_SPLIT_NO_EMPTY); $topic_notification = array(); foreach ($emails as $email) { if (check_mail($email)) { $topic_notification[] = $email; } } $topic_notification = implode("\n", $topic_notification); $position = null; $positions = array(); $result = $db->query("SELECT id, position FROM {$db->pre}forums WHERE parent = '{$parent}' ORDER BY position"); while ($pos = $db->fetch_assoc($result)) { if ($pos['id'] == $sort) { $position = $pos['position'] + $sortx; } else { $positions[$pos['id']] = $pos['position']; } } if ($position == null) {
} $my->icq = iif(empty($my->icq), '', $my->icq); $year = gmdate('Y'); $maxy = $year - 6; $miny = $year - 100; $customfields = editprofile_customfields(1, $my->id); ($code = $plugins->load('editprofile_profile_prepared')) ? eval($code) : null; echo $tpl->parse("editprofile/profile"); ($code = $plugins->load('editprofile_profile_end')) ? eval($code) : null; } elseif ($_GET['action'] == "profile2") { $_POST['hp'] = trim($_POST['hp']); if (strtolower(substr($_POST['hp'], 0, 4)) == 'www.') { $_POST['hp'] = "http://{$_POST['hp']}"; } $error = array(); if (check_mail($_POST['email']) == false) { $error[] = $lang->phrase('illegal_mail'); } if ($my->mail != $_POST['email'] && double_udata('mail', $_POST['email']) == false) { $error[] = $lang->phrase('email_already_used'); } if ($config['changename_allowed'] == 1 && strxlen($_POST['name']) > $config['maxnamelength']) { $error[] = $lang->phrase('name_too_long'); } if ($config['changename_allowed'] == 1 && strxlen($_POST['name']) < $config['minnamelength']) { $error[] = $lang->phrase('name_too_short'); } if ($config['changename_allowed'] == 1 && strtolower($my->name) != strtolower($_POST['name']) && double_udata('name', $_POST['name']) == false) { $error[] = $lang->phrase('username_registered'); } if (strlen($_POST['email']) > 200) {
// $Id: comments_add.php 1132 2005-08-03 23:42:40Z lark $ // dekalracja zmiennej $page_string $page_string = empty($page_string) ? '' : $page_string; $comment_author = empty($_COOKIE['devlog_comment_user']) ? '' : $_COOKIE['devlog_comment_user']; // deklaracja zmiennej $action::form $action = empty($_GET['action']) ? '' : $_GET['action']; switch ($action) { case 'add': $monit = array(); // Obs³uga formularza, jesli go zatwierdzono if (!eregi('^([^0-9]+){2,}$', $_POST['author'])) { $monit[] = $i18n['comments_add'][0]; } // Sprawdzenie poprawnosci adresu e-mail if (!empty($_POST['email']) && !check_mail($_POST['email'])) { $monit[] = $i18n['comments_add'][1]; } // Je¿eli dane spe³niaja wszystkie kryteria dodanie nowego komentarza if (empty($monit)) { $text = str_nl2br($_POST['text']); // [b] i [/b] dla tekstu pogrubionego. $text = preg_replace('/\\[b\\]([^\\"]+)\\[\\/b\\]/', '<b>\\1</b>', $text); // [i] i [/i] dla tekstu pochylonego. $text = preg_replace('/\\[i\\]([^\\"]+)\\[\\/i\\]/', '<i>\\1</i>', $text); // [u] i [/u] dla tekstu podkre¶lonego. $text = preg_replace('/\\[u\\]([^\\"]+)\\[\\/u\\]/', '<u>\\1</u>', $text); // [abbr] i [/abbr] dla akronimów. $text = preg_replace('/\\[abbr=([^\\"]+)\\]([^\\"]+)\\[\\/abbr\\]/', '<abbr title="\\1">\\2</abbr>', $text); // [link] i [/link] dla odsy³aczy. $text = preg_replace('/\\[link\\]([^\\"]+)\\[\\/link\\]/', '<a href="\\1" target="_blank">\\1</a>', $text);
<?php require_once '../kernel/begin.php'; define('TITLE', $LANG['title_register']); require_once '../kernel/header.php'; $Cache->load('member'); if (!$CONFIG_USER['activ_register']) { redirect(get_start_page()); } $user_mail = strtolower(retrieve(POST, 'mail', '')); $valid = retrieve(POST, 'valid', false); if ($valid && !empty($user_mail) && check_mail($user_mail)) { $login = !empty($_POST['log']) ? strprotect(substr($_POST['log'], 0, 25)) : ''; $password = retrieve(POST, 'pass', '', TSTRING_UNCHANGE); $password_hash = strhash($password); $password_bis = retrieve(POST, 'pass_bis', '', TSTRING_UNCHANGE); $password_bis_hash = strhash($password_bis); $user_show_mail = retrieve(POST, 'user_show_mail', 0) ? 1 : 0; $user_lang = retrieve(POST, 'user_lang', ''); $user_theme = retrieve(POST, 'user_theme', ''); $user_editor = retrieve(POST, 'user_editor', ''); $user_timezone = retrieve(POST, 'user_timezone', 0); $user_avatar = retrieve(POST, 'user_avatar', ''); $user_local = retrieve(POST, 'user_local', ''); $user_occupation = retrieve(POST, 'user_occupation', ''); $user_hobbies = retrieve(POST, 'user_hobbies', ''); $user_desc = retrieve(POST, 'user_desc', '', TSTRING_PARSE); $user_sex = retrieve(POST, 'user_sex', 0); $user_sign = retrieve(POST, 'user_sign', '', TSTRING_PARSE); $user_msn = retrieve(POST, 'user_msn', ''); $user_yahoo = retrieve(POST, 'user_yahoo', '');
function xmail($to, $from = array(), $topic, $comment) { global $config, $gpc; require_once "classes/mail/class.phpmailer.php"; $mail = new PHPMailer(); $mail->CharSet = 'UTF-8'; // Added Check_mail for better security // Now it is not possible to add various headers to the mail if (!isset($from['mail']) || !check_mail($from['mail'])) { $mail->From = $config['forenmail']; } else { $mail->From = $gpc->plain_str($from['mail']); } if (!isset($from['name'])) { $mail->FromName = $gpc->plain_str($config['fname']); } else { $mail->FromName = $gpc->plain_str($from['name']); } if ($config['smtp'] == 1) { $mail->Mailer = "smtp"; $mail->IsSMTP(); $mail->Host = $config['smtp_host']; if ($config['smtp_auth'] == 1) { $mail->SMTPAuth = TRUE; $mail->Username = $config['smtp_username']; $mail->Password = $config['smtp_password']; } } elseif ($config['sendmail'] == 1) { $mail->IsSendmail(); $mail->Mailer = "sendmail"; $mail->Sendmail = $config['sendmail_host']; } else { $mail->IsMail(); } $mail->Subject = $gpc->plain_str($topic); if (!is_array($to)) { $to = array('0' => array('mail' => $to)); } $i = 0; foreach ($to as $email) { $mail->IsHTML(false); $mail->Body = $gpc->plain_str($comment); if (isset($email['name'])) { $mail->AddAddress($gpc->plain_str($email['mail']), $gpc->plain_str($email['name'])); } else { $mail->AddAddress($gpc->plain_str($email['mail'])); } if ($config['local_mode'] == 0) { if ($mail->Send()) { $i++; } } $mail->ClearAddresses(); $mail->ClearAttachments(); } return $i; }
<?php include dirname(__FILE__) . '/../vues/inscription/inscription.php'; include dirname(__FILE__) . '/../modeles/inscription/enregistrement_membre.php'; include dirname(__FILE__) . '/../modeles/inscription/check_bdd.php'; if (isset($_POST['inscription'])) { // On rend inoffensif les données de l'utilisateur $_POST['nom'] = htmlspecialchars($_POST['nom']); $_POST['prenom'] = htmlspecialchars($_POST['prenom']); $_POST['email'] = htmlspecialchars($_POST['email']); $_POST['verif_email'] = htmlspecialchars($_POST['verif_email']); $_POST['pass'] = htmlspecialchars($_POST['pass']); $_POST['verif_pass'] = htmlspecialchars($_POST['verif_pass']); // Verification de l'existance du pseudo dans la BDD $nb_mail = check_mail($_POST['email']); // Regex pour vérifier l'email //if(preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $_POST['pass'])) //{ // $email_valide = true; //} function verif_pass($password) { } if ($_POST['email'] != $_POST['verif_email']) { echo 'Les deux adresses mails ne sont pas identiques, veuillez les saisir à nouveau'; } elseif (!isset($_POST['email']) or empty($_POST['email']) or $nb_mail > 0) { echo 'Veuillez saisir une nouvelle addresse mail, elle est soit vide soit déja éxistante.'; } elseif (!isset($_POST['pass']) or !isset($_POST['verif_pass']) or empty($_POST['pass']) or $_POST['pass'] != $_POST['verif_pass']) { echo 'Les deux mots de passes ne sont pas identiques, veuillez les saisir à nouveau'; } else { // Hachage du mot de passe