Example #1
0
    function EmailBlast(&$rows, &$a_skeys, $EmailColumn, $aDispCols)
    {
        $subject = trim(CleanGet('txt_subject'));
        $email_text = trim(CleanGet('txt_email'));
        ?>
		<h2>Email Transmit Report</h2>
		<p>Recipients are listed below. If a recipient
	    	has a missing or invalid email, the administrator
			will get a "bounce" message, which you can use to
			correct the recipient's email address.
		</p>
		<?php 
        foreach ($a_skeys as $skey) {
            if (CleanGet('embox' . $skey, '', false) == '') {
                continue;
            }
            $namepart = '';
            foreach ($aDispCols as $col) {
                $namepart .= trim($rows[$skey][$col]) . '  ';
            }
            $recipient = $namepart . '<' . $rows[$skey][$EmailColumn] . '>';
            EmailSend($recipient, $subject, $email_text);
            echo $namepart . '  ' . $rows[$skey][$EmailColumn] . '<br>';
        }
    }
Example #2
0
 function PW_ForgotPage1()
 {
     // KFD 11/13/06.  Heavily modified for new system, threw out
     //   the older code entirely, now that all apps have a users
     //   table built into them.
     $eml = trim(gp('txt_email'));
     $seml = SQLFC(strtolower($eml));
     $heml = hx($eml);
     $ueml = urlencode($eml);
     //$leml= MakeUserId(strtolower($eml));
     $db2 = scDBConn_Push('usermaint');
     $sq = "Select skey,user_id,member_password,email FROM users " . " where LOWER(email)={$seml}";
     $member = SQL_AllRows($sq);
     // Nothing of any kind is a bummer, we can't do anything
     if (count($member) == 0) {
         ErrorAdd('There are no active accounts with that email address');
     } else {
         $leml = MakeUserID($eml);
         $member = $member[0];
         // If we know who they are, send a password and allow them to change it
         $user_pwkey = md5($member['member_password'] . $leml . time());
         //$ref=$_SERVER['HTTP_REFERER'];
         $http = httpWebSite() . "/";
         $row = array('skey' => $member['skey'], 'user_pwkey' => $user_pwkey);
         $UID = $member['user_id'];
         $PWD = $member['member_password'];
         // KFD 12/21/06.  Done for medinfo originally.  If UID looks like
         //  the email, send the email instead
         $emailUID = $member['email'];
         $table_dd = DD_Tableref('users');
         SQLX_Update($table_dd, $row);
         $emailuser_id = OptionGet('EMAIL_USERID', 'N') == 'Y' ? $emailUID : $leml;
         $text_email = "\nYour username and password are: {$emailuser_id} and {$PWD}.\n   \nIf you would like to change your password, click here:\n<{$http}?gp_page=x_password&gpp=2&eml={$ueml}&hash={$user_pwkey}>\n";
         scDBConn_Pop();
         //echo $text_email;
         EmailSend($eml, 'System Access Request', $text_email);
         ?>
         <b>Email Has Been Sent</b>.  An email has been sent to you with information
         needed to access the system.
         <?php 
         gpSet('gpp', 'X');
     }
 }