예제 #1
0
 public function __construct()
 {
     $ec = EventConfig::getInstance();
     $dbConnectionParams = $ec->getDBConnectionParams();
     $dbUser = $ec->getDBUser();
     $dbPass = $ec->getDBPass();
     parent::__construct($dbConnectionParams, $dbUser, $dbPass);
 }
 private function OLD_sendEMail($subject, $body)
 {
     $ec = EventConfig::getInstance();
     $ec->augmentIncludePath();
     include_once 'Mail.php';
     $recipients = $ec->getSMTPRecipient();
     $headers['From'] = $ec->getSMTPSender();
     $headers['To'] = $ec->getSMTPRecipient();
     $headers['Subject'] = $subject;
     $headers['Content-Type'] = 'text/plain; charset=UTF-8';
     $smtpinfo = $ec->getSMTPInfo();
     // Create the mail object using the Mail::factory method
     if (class_exists('Mail')) {
         $m = new Mail();
         $mail_object =& $m->factory('smtp', $smtpinfo);
         return true === $mail_object->send($recipients, $headers, $body);
     } else {
         return false;
     }
 }
 public function dispatchRequest()
 {
     require_once 'EventConfig.php';
     if (!isset($_REQUEST['torch'])) {
         ob_end_clean();
         header('HTTP/1.0 404 Not Found');
         exit;
     }
     try {
         $pdo = new EventPDO();
     } catch (PDOException $e) {
         echo 'Bummer! Our database is currently unavailable. Please try again later.';
         return;
     }
     $ep = EventConfig::getInstance();
     if (isset($_POST['pass']) && isset($_POST['user']) && hash('whirlpool', $ep->getAccessSalt() . $_POST['pass']) === $ep->getAccessPass() && $_POST['user'] === $ep->getAccessUser()) {
         $this->showData($pdo);
         return;
     }
     $this->displayForm($pdo);
 }
예제 #4
0
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 * http://www.gnu.org/copyleft/gpl.html
 *
 */
if (isset($_POST['email']) && strlen($_POST['email']) < 150) {
    require_once 'EventConfig.php';
    $ec = EventConfig::getInstance();
    $ec->augmentIncludePath();
    $body = 'supposed sender: ' . $_POST['name'] . ' <' . $_POST['email'] . ">\n" . $_POST['message'];
    $sender = filter_var($ec->getSMTPSender(), FILTER_VALIDATE_EMAIL);
    mail($ec->getSMTPRecipient(), $_POST['subject'], $body, $sender ? 'From: ' . $sender : '');
    $destination = explode('/', $_SERVER['REQUEST_URI']);
    array_pop($destination);
    $destination = implode('/', $destination);
    if (!$destination) {
        $destination = '/';
    }
    setcookie('halleilujah-mail-success', '1', time() + 5, '/');
    header('Location: ' . $destination, true, 303);
    echo 'Thanks for your message.';
} else {
    setcookie('halleilujah-mail-success', '0', time() + 5, '/');