$_Tpl_FRM->setParseValue("FMESSAGE", $MESSAGE);
$_Tpl_FRM->setParseValue("FNAME", $FRM[0]['name']);
$_Tpl_FRM->setParseValue("FDESCR", $FRM[0]['descr']);
$_Tpl_FRM->setParseValue("FEMAIL", display($ADR[0]['email']));
$_Tpl_FRM->setParseValue("FEMAILNAME", $FRM[0]['email']);
$_Tpl_FRM->setParseValue("FGROUP", $FGROUP);
$_Tpl_FRM->setParseValue("F0", display($ADR[0]['f0']));
$_Tpl_FRM->setParseValue("F1", display($ADR[0]['f1']));
$_Tpl_FRM->setParseValue("F2", display($ADR[0]['f2']));
$_Tpl_FRM->setParseValue("F3", display($ADR[0]['f3']));
$_Tpl_FRM->setParseValue("F4", display($ADR[0]['f4']));
$_Tpl_FRM->setParseValue("F5", display($ADR[0]['f5']));
$_Tpl_FRM->setParseValue("F6", display($ADR[0]['f6']));
$_Tpl_FRM->setParseValue("F7", display($ADR[0]['f7']));
$_Tpl_FRM->setParseValue("F8", display($ADR[0]['f8']));
$_Tpl_FRM->setParseValue("F9", display($ADR[0]['f9']));
$_Tpl_FRM->setParseValue("MEMO", display($ADR[0]['memo']));
$_Tpl_FRM->setParseValue("F0NAME", display($FRM[0]['f0']));
$_Tpl_FRM->setParseValue("F1NAME", display($FRM[0]['f1']));
$_Tpl_FRM->setParseValue("F2NAME", display($FRM[0]['f2']));
$_Tpl_FRM->setParseValue("F3NAME", display($FRM[0]['f3']));
$_Tpl_FRM->setParseValue("F4NAME", display($FRM[0]['f4']));
$_Tpl_FRM->setParseValue("F5NAME", display($FRM[0]['f5']));
$_Tpl_FRM->setParseValue("F6NAME", display($FRM[0]['f6']));
$_Tpl_FRM->setParseValue("F7NAME", display($FRM[0]['f7']));
$_Tpl_FRM->setParseValue("F8NAME", display($FRM[0]['f8']));
$_Tpl_FRM->setParseValue("F9NAME", display($FRM[0]['f9']));
if (DEBUG) {
    $MESSAGE .= tm_debugmessage("set OUTPUT and parse from template: {$Form_Success_Filename}");
}
$OUTPUT = $_Tpl_FRM->renderTemplate($Form_Success_Filename);
Ejemplo n.º 2
0
    //found entry?
    if (count($ADR_TMP) > 0) {
        if (DEBUG) {
            $FMESSAGE .= tm_debugmessage("Found entry with id {$a_id}");
        }
        //additionally check code!
        if ($ADR_TMP[0]['code'] == $code) {
            if (DEBUG) {
                $FMESSAGE .= tm_debugmessage("Code OK");
                $FMESSAGE .= tm_debugmessage("email: " . display($ADR_TMP[0]['email']));
            }
            //ok, prefill value with email fetched from db via adr_id
            ${$InputName_Name} = $ADR_TMP[0]['email'];
        } else {
            if (DEBUG) {
                $FMESSAGE .= tm_debugmessage("CODE NOT OK");
            }
        }
    }
}
//check input
$check_mail = checkEmailAdr($email, 1);
if ($set == 'unsubscribe' && !$check_mail[0]) {
    $check = false;
    $FMESSAGE .= "<br>" . ___("Ungültige E-Mail-Adresse") . "<br>";
    #.$check_mail[1];
}
$captcha_code = "";
$captcha_md5 = "";
$FCAPTCHAIMG = "";
if ($C[0]['unsubscribe_use_captcha'] == 1) {
Ejemplo n.º 3
0
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("rcpt-name: " . $RCPT_Name);
    }
    //we have to replace date before parsing {DATE} --> $date_sub
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("parse body");
    }
    $NLSubscribeMail[0]['body'] = str_replace("{DATE}", $date_sub, $NLSubscribeMail[0]['body']);
    $NLSubscribeMail[0]['body_text'] = str_replace("{DATE}", $date_sub, $NLSubscribeMail[0]['body_text']);
    //now parse newsletter:
    if ($NLSubscribeMail[0]['content_type'] == "html" || $NLSubscribeMail[0]['content_type'] == "text/html") {
        $SubscribeMail_HTML = $NEWSLETTER->parseNL(array('nl' => $NLSubscribeMail[0], 'adr' => $ADR[0], 'frm' => array('id' => $frm_id)), "html");
    }
    if ($NLSubscribeMail[0]['content_type'] == "text" || $NLSubscribeMail[0]['content_type'] == "text/html") {
        $SubscribeMail_TEXT = $NEWSLETTER->parseNL(array('nl' => $NLSubscribeMail[0], 'adr' => $ADR[0], 'frm' => array('id' => $frm_id)), "text");
    }
    //2do: create text part from html if nl is html only
    //convert2Text? in ClassNL... test
    //sendmail_smtp[0]=true/false [1]=""/errormessage
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("send mail to " . $ADR[0]['email']);
    }
    @SendMail_smtp($HOST[0]['sender_email'], $HOST[0]['sender_name'], $ADR[0]['email'], $RCPT_Name, $SubscribeMail_Subject, $SubscribeMail_TEXT, $SubscribeMail_HTML, array(), $HOST);
    if ($C[0]['notify_subscribe'] == 1) {
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("send notification mail to admin! " . $C[0]['notify_mail'] . " , " . $HOST[0]['sender_name']);
        }
        @SendMail_smtp($HOST[0]['sender_email'], $HOST[0]['sender_name'], $C[0]['notify_mail'], $HOST[0]['sender_name'], $SubscribeMail_Subject, $SubscribeMail_TEXT, $SubscribeMail_HTML, array(), $HOST);
    }
}
//use nl_doptin
Ejemplo n.º 4
0
    /********************************************************************************/
    //show form
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("show form: subscribe_form_show");
    }
    require_once TM_INCLUDEPATH . "/subscribe_form_show.inc.php";
    /********************************************************************************/
}
if ($use_form && ($doptin_check && $doptin_success || $set == "save" && $check)) {
    /********************************************************************************/
    //ok, parse template, show a "welcome to our newsletter" message
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("parseform show message: subscribe_success");
    }
    require_once TM_INCLUDEPATH . "/subscribe_success.inc.php";
    /********************************************************************************/
}
//output
if ($called_via_url) {
    //wenn direkt aufgerufen, ausgabe
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("called via URL, echo OUTPUT");
    }
    echo $OUTPUT;
} else {
    //wenn included, ausgabe in variable _CONTENT speichern
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("save output to OUTPUT");
    }
    $_CONTENT .= $OUTPUT;
}
Ejemplo n.º 5
0
<?php

/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/10 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: info@tellmatic.org                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/*******************************************************************************/
if (DEBUG) {
    $MESSAGE .= tm_debugmessage("create new adr record");
}
srand((double) microtime() * 1000000);
$code = rand(111111, 999999);
//wenn adresse noch nicht existiert , neu anlegen
$newADRID = $ADDRESS->addAdr(array("email" => $email, "aktiv" => $FRM[0]['subscribe_aktiv'], "created" => $created, "status" => $status, "code" => $code, "author" => $author, "source" => "subscribe", "source_id" => $FRM[0]['id'], "source_extern_id" => 0, "f0" => $f0, "f1" => $f1, "f2" => $f2, "f3" => $f3, "f4" => $f4, "f5" => $f5, "f6" => $f6, "f7" => $f7, "f8" => $f8, "f9" => $f9, "memo" => "subscribe new, memo:\n " . $memo), $new_adr_grp);
if (DEBUG) {
    $MESSAGE .= tm_debugmessage("new adrid is " . $newADRID . " code: " . $code);
}
Ejemplo n.º 6
0
function checkEmailList($eMailList, $debug = 0, $level = 2)
{
    //3 parameters: list of comma-separated emails, $debug?, e mail check level
    if (!empty($eMailList)) {
        $Return = true;
        //zerlege string fwd in bestandteile durch komma getrennt
        $eMailListArray = explode(",", $eMailList);
        $Count = count($eMailListArray);
        $Message = "";
        $Message .= "<br>" . sprintf(___("Prüfe Adressen: (%s)"), $Count) . "<br>";
        for ($Counter = 0; $Counter < $Count; $Counter++) {
            //pruefe einzelne adresse
            $Message .= $Counter . ".:" . $eMailListArray[$Counter];
            //wird einmal falsches ergebnis ausgegeben, false setzen
            $check_mail = checkEmailAdr($eMailListArray[$Counter], $level);
            if (!$check_mail[0]) {
                $Return = false;
                $Message .= "...........<b>" . ___("Fehler") . " " . $check_mail[1] . "</b>";
            } else {
                $Message .= "..........." . ___("OK");
            }
            $Message .= "<br>";
        }
        if ($debug == 1) {
            echo tm_debugmessage($Message);
        }
    } else {
        //wenn leer ok
        $Return = true;
    }
    //!empty
    return $Return;
}
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("updating groups, merge with old");
        }
        $old_adr_grp = $ADDRESS->getGroupID(0, $ADR[0]['id'], 0);
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("old groups: " . implode(",", $old_adr_grp));
        }
        $tmp_adr_grp = array_merge($old_adr_grp, $new_adr_grp);
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("merge old and new: " . implode(",", $tmp_adr_grp));
        }
        $new_adr_grp = array_unique($tmp_adr_grp);
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("merge old and new, unique: " . implode(",", $new_adr_grp));
        }
    } else {
        //overwrite pubgroups
        //ueberschreiben mit neuen gruppen refs:
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("overwrite groups, save only default and new selected.");
        }
    }
    //overwrite pubgroups
} else {
    //adr exists
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("email not yet exists, save new entry");
    }
}
//re-index, important!
$new_adr_grp = array_values($new_adr_grp);
Ejemplo n.º 8
0
 //expertmode, hilfe ausblenden
 if ($user_is_expert) {
     $_MAIN_OUTPUT .= "\n\t<script type=\"text/javascript\">\n\t\t//switchSection('main_help');\n\t\ttoggleSlide('toggle_help','main_help',1);\n\t</script>";
 }
 if (!$user_is_expert) {
     $_MAIN_OUTPUT .= "\n\t<script type=\"text/javascript\">\n\t\ttoggleSlide('toggle_help','main_help',0);\n\t</script>";
 }
 //PHP Fehler
 if (!empty($_ERROR['html'])) {
     $_MAIN_MESSAGE .= "<hr noshade><br>" . $_ERROR['html'] . "<br><hr noshade><br>";
 }
 if (DEBUG) {
     $_MAIN_MESSAGE .= tm_debugmessage("available_mem={$available_mem} Byte");
 }
 if (DEBUG) {
     $_MAIN_MESSAGE .= tm_debugmessage("adr_row_limit={$adr_row_limit}");
 }
 $pwchanged = getVar("pwchanged");
 $usr_message = getVar("usr_message", 1, "");
 $_MAIN_MESSAGE .= $usr_message;
 if ($pwchanged == 1) {
     #$cryptpw=getVar("cryptpw");
     $check = getVar("check");
     if ($check == 1) {
         $_MAIN_MESSAGE .= "<br>" . ___("Passwort wurde gespeichert und ist ab sofort gültig.");
     }
     //check
 }
 //pwchanged
 //wichtig, triggerfunction f. menu: id ist "me_0_1"
 //only if logged in, else it throws a $trigger has no property js error because there is no menu!
Ejemplo n.º 9
0
if (DEBUG) {
    if (isset($_COOKIE[session_name()])) {
        $_MAIN_MESSAGE .= tm_debugmessage("cookie: " . $_COOKIE[session_name()]);
    } else {
        $_MAIN_MESSAGE .= tm_debugmessage("_COOKIE[sessionname], sessionname: " . session_name() . " not set yet");
    }
}
if (DEBUG) {
    $_MAIN_MESSAGE .= tm_debugmessage("old session id: " . session_id());
}
/***********************************************************/
//neue sessionid
/***********************************************************/
session_regenerate_id();
if (DEBUG) {
    $_MAIN_MESSAGE .= tm_debugmessage("new session id: " . session_id());
}
/***********************************************************/
//set cookie
/***********************************************************/
setcookie(session_name(), session_id(), time() + TM_SESSION_TIMEOUT * 10, TM_DIR . "/admin", str_replace("https://", "", str_replace("http://", "", TM_DOMAIN)));
/***********************************************************/
//expert & admin
/***********************************************************/
if ($logged_in) {
    if ($LOGIN->USER['expert'] == 1) {
        $user_is_expert = TRUE;
    }
    if ($LOGIN->USER['admin'] == 1) {
        $user_is_admin = TRUE;
    }
        $MESSAGE .= tm_debugmessage("invalid email!");
    }
    if ($use_form) {
        $OUTPUT .= $FRM[0]['email_errmsg'] . "<br>";
    } else {
        $OUTPUT .= "ERR 3<br>";
    }
}
if ($doptin_check && $check_mail[0]) {
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("validating email");
    }
    //adresse pruefen:
    //double optin bestaetigung:
    //adr suchen, code vergleichen, wenn ok, weiter, sonst ...... leere seite! -?
    $search['email'] = $email;
    $search['code'] = $code;
    $search['email_exact_match'] = true;
    //harte pruefung, nur wenn noch nicht bestaetigt:	$search['status']=5; oder touch
    //limit=1: adr holen
    $ADR = $ADDRESS->getAdr(0, 0, 1, 0, $search);
    if (isset($ADR[0]) && check_dbid($ADR[0]['id']) && $ADR[0]['code'] == $code) {
        //ja, code muesste man nicht nochmal pruefen, wird ja in search bereits in der db gesucht....
        //setstatus adr_id = 3
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("email found, now setting status to 3: confirmed");
        }
        $ADDRESS->setStatus($ADR[0]['id'], 3);
        $doptin_success = true;
    }
}
    }
    $MESSAGE .= "<br>" . $FRM[0]['email_errmsg'];
}
//eingaben pruefen
//"simplified":
for ($fc = 0; $fc <= 9; $fc++) {
    $field = "f" . $fc;
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("checking " . $field);
    }
    if (!empty($FRM[0]['f' . $fc . '_expr']) && !ereg($FRM[0]['f' . $fc . '_expr'], ${$field}) || $FRM[0]['f' . $fc . '_required'] == 1 && empty(${$field})) {
        $check = false;
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage($field . " failed!");
        }
        $MESSAGE .= "<br>" . $FRM[0]['f' . $fc . '_errmsg'];
    }
}
//check for public groups, force user to select at least one public group
if ($FRM[0]['force_pubgroup'] == 1) {
    if (DEBUG) {
        $MESSAGE .= tm_debugmessage("checking force public group");
    }
    if (!isset($adr_grp_pub[0])) {
        $check = false;
        if (DEBUG) {
            $MESSAGE .= tm_debugmessage("no group selected");
        }
        $MESSAGE .= "<br>" . $FRM[0]['pubgroup_errmsg'];
    }
}