Beispiel #1
0
 static function send_mail($destination, $template, $arr_vars)
 {
     $template_details = simple_select('mail_templates', 'template_name', $template, array('from_addr', 'mail_subject', 'mail_message', 'mail_html', 'mail_footer', 'template_id'), ' AND language = \'' . $_SESSION['misc']['lang'] . '\'');
     $send_text = self::substitute_variables($template_details['mail_message'], $arr_vars);
     $send_html = self::substitute_variables($template_details['mail_html'], $arr_vars);
     $headers = array('From' => $template_details['from_addr'], 'To' => $destination, 'Subject' => $template_details['mail_subject']);
     $mime = new Mail_mime("\n");
     $mime->setTXTBody($send_text);
     $mime->setHTMLBody($send_html);
     $body = $mime->get();
     $hdrs = $mime->headers($headers);
     //echo $body;
     $mail =& Mail::factory('mail');
     if ($mail->send($destination, $hdrs, $body)) {
         self::log_mail_sent($template_details['template_id'], $destination, 'system');
     } else {
         write_log_db('E-MAIL', 'ERROR-SENT', 'Dest: ' . $destination . '; template: ' . $template, 'oops_comm.php; class: mail_templates; method: send_mail');
     }
 }
Beispiel #2
0
';

show_alerts_box();

</script>
			<?php 
            write_log_db('REGISTRATION', 'NEW USER KO', 'User activation code wrong: ' . $_POST['check_code'] . ' mail: ' . decode($_GET['m']), 'check_code.php');
        }
    }
}
# Send e-mail from here
if ($_GET['se']) {
    $mail = decode($_GET['m']);
    $user = new user($mail);
    if ($user->user_id) {
        $arr_code = simple_select('users', 'user_id', $user->user_id, 'control_code');
        $enc_mail = $_GET['m'];
        $arr_vars = array('check_code' => $arr_code['control_code'], 'url' => $conf_main_url . $conf_main_page . '?mod=home&view=check_code&m=' . $enc_mail, 'url_link' => $conf_main_url . $conf_main_page . '?mod=home&view=check_code&m=' . $enc_mail . '&code=' . $arr_code['control_code']);
        if ($_SERVER['SERVER_NAME'] != 'localhost') {
            mail_templates::send_mail($mail, 'check_code', $arr_vars);
        }
    }
}
?>
<div style="padding-left:25px; padding-top:15px;">
  <form name="check_form" id="check_form" method="post" action="">
    <table cellpadding="10" cellspacing="4" border="0" class="default_text" align="center" width="75%">
      <tr>
        <td valign="top"><img src="<?php 
echo $conf_images_path;
?>
Beispiel #3
0
function get_config_value($field)
{
    $arr_ret = simple_select('configuration', 'config_code', $field, 'config_value');
    return $arr_ret['config_value'];
}
Beispiel #4
0
function select_scalar($cmd)
{
    $set = array();
    $set = simple_select($cmd);
    return array_shift($set);
}
Beispiel #5
0
function report_non_existent_fields()
{
    global $dbname;
    $sql_cmd = "\n   SELECT column_name " . "\n\t FROM information_schema.columns " . "\n\t WHERE table_schema = 'public'";
    do_pg_connect();
    $arr = array();
    $arr = simple_select($sql_cmd);
    $arr = array_flip($arr);
    # Iterate through POST, and report names that are not
    # columns in the database
    foreach (array_keys($_POST) as $k) {
        # We only need to check the first numbered field
        if (preg_match("/_(\\d+)\$/", $k, $m)) {
            $n = $m[1];
            if ($n > 1) {
                continue;
            }
        }
        $name = preg_replace('/_\\d+$/', '', $k);
        # Only print this if we are debugging the submit script.
        # The user cannot do anything about this, so why tell then about it.
        if (!array_key_exists($name, $arr) && isset($_POST['debug'])) {
            mtt_notice("{$name} is not in {$dbname} database.");
        }
    }
}