} else {
         $template = new template("formbuilder", "_custom_report");
         $template->assign("template", $rpt->text);
     }
     $template->assign("fields", $fields);
     $template->assign("captions", $captions);
     $template->assign("is_email", 1);
     $emailHtml = $template->render();
     if (count($emaillist)) {
         //This is an easy way to remove duplicates
         $emaillist = array_flip(array_flip($emaillist));
         if (!defined("SYS_SMTP")) {
             require_once BASE . "subsystems/smtp.php";
         }
         $headers = array("MIME-Version" => "1.0", "Content-type" => "text/html; charset=iso-8859-1");
         if (pathos_smtp_mail($emaillist, "", $f->subject, $emailHtml, $headers) == false) {
             pathos_lang_loadDictionary('modules', 'formbuilder');
             echo TR_FORMBUILDER_ERR_SMTP;
         }
     }
 }
 //If is a new post show response, otherwise redirect to the flow.
 if (!isset($_POST['data_id'])) {
     $template = new template("formbuilder", "_view_response");
     global $SYS_FLOW_REDIRECTIONPATH;
     $SYS_FLOW_REDIRECTIONPATH = "editfallback";
     $template->assign("backlink", pathos_flow_get());
     $SYS_FLOW_REDIRECTIONPATH = "pathos_default";
     $template->assign("response_html", $f->response);
     $template->output();
 } else {
Пример #2
0
         $emails = array();
         if (!defined("SYS_USERS")) {
             require_once BASE . "subsystems/users.php";
         }
         foreach ($notifs as $n) {
             if ($n->user_id != $user->id) {
                 $u = pathos_users_getUserById($n->user_id);
                 if ($u->email != "") {
                     $emails[] = $u->email;
                 }
             }
         }
         if (!defined("SYS_SMTP")) {
             require BASE . "subsystems/smtp.php";
         }
         pathos_smtp_mail($emails, $from_addr, $title, $msg, $headers);
     }
     // Save new monitors
     $thread_id = $parent ? $parent->id : $post->id;
     if (isset($_POST['monitor'])) {
         if (!$db->selectObject("bb_threadmonitor", "thread_id=" . $parent . " AND user_id=" . $user->id)) {
             $mon = null;
             $mon->thread_id = $thread_id;
             $mon->user_id = $user->id;
             $db->insertObject($mon, "bb_threadmonitor");
         }
     } else {
         $db->delete("bb_threadmonitor", "thread_id=" . $thread_id . " AND user_id=" . $user->id);
     }
     pathos_flow_redirect();
 } else {
            $message .= "----------------------------------\n";
            $message .= "Name:  " . $_POST['name'] . "\n";
            $message .= "Email: " . $_POST['email'] . "\n";
            $message .= "----------------------------------\n";
            $message .= "Reasons for Volunteering:\n";
            $message .= wordwrap($_POST['reasons']) . "\n";
            $message .= "----------------------------------\n";
            $message .= "How they feel they can help:\n";
            $message .= wordwrap($_POST['howhelp']) . "\n";
            $message .= "----------------------------------\n";
            $message .= "Past experience and qualifications:\n";
            $message .= wordwrap($_POST['experience']) . "\n";
            $subject = "Software Roadmap : Volunteer for " . $milestone->name . ":" . $stepstone->name;
        } else {
            echo SITE_404_HTML;
            return;
            // exit this page
        }
    }
    if (!defined("SYS_SMTP")) {
        require_once BASE . "subsystems/smtp.php";
    }
    if (pathos_smtp_mail($stepstone->contact, $from, $subject, $message, $headers)) {
        echo "Message successfully sent.";
    } else {
        echo "There was a problem sending the message.  Please contact the system administrator.";
    }
    echo "<br /><br /><a href='" . pathos_flow_get() . "' class='mngmntlink codemap_mngmntlink'>Back</a>";
} else {
    echo SITE_404_HTML;
}
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: send_feedback.php,v 1.5 2005/04/18 15:22:16 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if (!defined('SYS_SMTP')) {
    require_once BASE . 'subsystems/smtp.php';
}
//filter the message thru the form template for formatting
$msgtemplate = new formtemplate('email', '_' . $_POST['formname']);
$msgtemplate->assign('post', $_POST);
$msg = $msgtemplate->render();
$ret = false;
//make sure we this is from a valid event and that the email addresses are listed, then mail
if (isset($_POST['id'])) {
    $event = $db->selectObject('calendar', 'id=' . $_POST['id']);
    $email_addrs = array();
    if ($event->feedback_email != '') {
        $email_addrs = split(',', $event->feedback_email);
        $email_addrs = array_map('trim', $email_addrs);
        $ret = pathos_smtp_mail($email_addrs, 'website@' . HOSTNAME, $_POST['subject'], $msg);
    }
}
$template = new template('calendarmodule', '_feedback_submitted');
$template->assign('success', $ret ? 1 : 0);
$template->output();
Пример #5
0
    $newpass = '';
    for ($i = 0; $i < rand(12, 20); $i++) {
        $num = rand(48, 122);
        if ($num > 97 && $num < 122 || $num > 65 && $num < 90 || $num > 48 && $num < 57) {
            $newpass .= chr($num);
        } else {
            $i--;
        }
    }
    // Send message
    if (!defined('SYS_SMTP')) {
        require_once BASE . 'subsystems/smtp.php';
    }
    $e_template = new template('loginmodule', '_email_resetdone', $loc);
    $e_template->assign('newpass', $newpass);
    $msg = $e_template->render();
    if (!defined('SYS_USERS')) {
        require_once BASE . 'subsystems/users.php';
    }
    $u = pathos_users_getUserById($tok->uid);
    if (!pathos_smtp_mail($u->email, 'Password Manager <passwords@pathos>', 'Your New Password', $msg)) {
        $template->assign('state', 'smtp_error');
    } else {
        // Save new password
        $u->password = md5($newpass);
        pathos_users_saveUser($u);
        $db->delete('passreset_token', 'uid=' . $tok->uid);
        $template->assign('state', 'sent');
    }
}
$template->output();
Пример #6
0
if (!defined('PATHOS')) {
    exit('');
}
pathos_lang_loadDictionary('modules', 'loginmodule');
if (!defined('SYS_USERS')) {
    require_once BASE . 'subsystems/users.php';
}
$u = pathos_users_getUserByName($_POST['username']);
$template = new template('loginmodule', '_resetsend');
if ($u != null && $u->is_acting_admin == 0 && $u->is_admin == 0 && $u->email != '') {
    if (!defined('SYS_SMTP')) {
        require_once BASE . 'subsystems/smtp.php';
    }
    $tok = null;
    $tok->uid = $u->id;
    $tok->expires = time() + 2 * 3600;
    $tok->token = md5(time()) . uniqid('');
    $e_template = new template('loginmodule', '_email_resetconfirm', $loc);
    $e_template->assign('token', $tok);
    $msg = $e_template->render();
    // FIXME: smtp call prototype / usage has changed.
    if (!pathos_smtp_mail($u->email, 'Password Manager <password@' . HOSTNAME . '>', 'Password Reset Confirmation', $msg)) {
        $template->assign('state', 'smtp_error');
    } else {
        $db->insertObject($tok, 'passreset_token');
        $template->assign('state', 'sent');
    }
} else {
    $template->assign('state', 'unable');
}
$template->output();
Пример #7
0
                $ban = $db->selectObject("inbox_contactbanned", "user_id=" . $user->id . " AND owner=" . $id);
                if (!$ban) {
                    $ban = $db->selectObject("inbox_contactbanned", "user_id=" . $id . " AND owner=" . $user->id);
                }
                if ($ban) {
                    $failed->body = sprintf(INBOXMODULE_FAILED_MSG, $message->body);
                    $db->insertObject($failed, "privatemessage");
                } else {
                    $message->recipient = $id;
                    $inbox_userconfig = $db->selectObject("inbox_userconfig", "id=" . $id);
                    if (!$inbox_userconfig) {
                        $inbox_userconfig->forward = 1;
                    }
                    if ($inbox_userconfig->forward == 1 && $u->email != "") {
                        // Forward the message to their email account
                        $emails[] = $u->email;
                    }
                    $db->insertObject($message, "privatemessage");
                }
            }
        }
    }
    if (count($emails)) {
        $body = $message->body;
        $headers = array("MIME-Version" => "1.0", "Content-type" => "text/html; charset=iso-8859-1", 'Reply-to' => $reply_to, 'From' => $reply_to);
        if (pathos_smtp_mail($emails, "", $message->subject, '<html><body>' . $message->body . '</body></html>', $headers) == false) {
            echo TR_INBOXMODULE_ERR_SMTP;
        }
    }
    pathos_flow_redirect();
}
Пример #8
0
}
$headers = array();
$headers["From"] = $config->from_name . " <" . $config->from_address . ">";
if ($config->replyto_address != "") {
    $headers["Reply-to"] = $config->replyto_address;
}
if (!defined("SYS_USERS")) {
    require_once BASE . "subsystems/users.php";
}
$emails = array();
foreach ($db->selectObjects("contact_contact", "location_data='" . serialize($loc) . "'") as $c) {
    if ($c->user_id != 0) {
        $u = pathos_users_getUserById($c->user_id);
        $emails[] = $u->email;
    } else {
        if ($c->email != "") {
            $emails[] = $c->email;
        }
    }
}
if (!defined("SYS_SMTP")) {
    require_once BASE . "subsystems/smtp.php";
}
if (pathos_smtp_mail($emails, $config->from_address, $config->subject, $msg, $headers)) {
    $template = new template('contactmodule', '_final_message');
    $template->assign('message', $config->final_message);
    $template->output();
} else {
    pathos_lang_loadDictionary('modules', 'contactmodule');
    echo TR_CONTACTMODULE_SMTPERROR;
}