Exemple #1
0
if (!isset($_SESSION)) {
    session_start();
}
$email = new Emailer();
$user = strtolower($_POST['user']);
$password = $_POST['password'];
$arrContextOptions = array("ssl" => array("verify_peer" => false, "verify_peer_name" => false, 'http' => array('header' => "User-Agent:SASSCAL Weather/1.0\r\n")));
//$link = 'https://'.$user.':'.$password.'@afrihost.sasscal.org/api/users/';
$link = 'https://erik@sas.co.na:qwe123@afrihost.sasscal.org/api/users';
$contents = file_get_html($link, false, stream_context_create($arrContextOptions));
if (strpos($contents, $user) !== false) {
    /***********************************************
      *if entered email adress is found do the following:
      *-save user id in session
      -save email in session                              
      ***************************************************/
    $doc = new DOMDocument();
    $doc->loadHTML($contents);
    $as = $doc->getElementsByTagName('a');
    foreach ($as as $a) {
        if ($a->nodeValue === $user) {
            $id = substr(strrchr($a->getAttribute('href'), '/'), 1);
        }
    }
}
$hashString = strtolower($user);
$hashString .= $password;
$hashkey = md5($hashString);
//echo $contents;
echo $email->sendEmail($hashkey, $id, $user);
Exemple #2
0
                                            <p class = "addressInfo" style = " position: relative;
                                                                            display: block;
                                                                            color: black;
                                                                            font-size: 16px;
                                                                            font-weight: 300;
                                                                            margin: 0 !important;
                                                                            padding: 0 !important;
                                                                            top: 10px;
                                                                            left: 50%;
                                                                            transform:  translateX(-50%);
                                                                            -webkit-transform: translateX(-50%);
                                                                            -ms-transform: translateX(-50%);
                                                                            text-align: center;
                                                                            @media only screen
                                                                              and (min-device-width: 320px)
                                                                              and (max-device-width: 480px)
                                                                              and (-webkit-min-device-pixel-ratio: 2) {
                                                                                   font-size: 10px;
                                                                            }">

                                            710 94th Ave N, Suite 302 <br> St. Petersburg, FL, 33702 <br> (727) 403-3154
                                            </p>
                                        </div>
                                    </div>
                                    </html>';
    $mail = new PHPMailer();
    $Emailer = new Emailer($mail, $connection, $object);
    $Emailer->sendEmail();
    echo json_encode(array('success' => 'success'));
} else {
}