Esempio n. 1
0
            $var['icon'] = "plain.gif";
        }
        $var['AttachNames'] .= "{$var['filename']}; ";
        // Build the HTML table that lists the attachments
        $var['attachments'] .= $atmail->parse("html/{$atmail->Language}/{$atmail->LoginType}/attachfilemodal.html", $var);
        // Increment the counter ( for the Javascript id field )
        $var['id']++;
    }
    $var['AttachNames'] = preg_replace('/; $/', '', $var['AttachNames']);
    print $atmail->parse("html/{$atmail->Language}/{$atmail->LoginType}/attachmentmodallist.html", $var);
} elseif ($var['func'] == "attachment") {
    $icon = $atmail->icon_hash();
    $var['delete'] = $_REQUEST['delete'];
    $var['unique'] = $atmail->param_escape('unique');
    $var['unique'] = basename($var['unique']);
    $sendmsg = new SendMsg(array('Account' => "{$atmail->username}@{$atmail->pop3host}"));
    // Delete the selected attachment
    if (isset($var['delete'])) {
        $var['status'] = $sendmsg->delete_attachment($var['delete'], $var['unique']);
    } elseif (isset($_FILES['fileupload'])) {
        $var['status'] = $sendmsg->add_attachment($var['unique']);
        if ($var['status'] === false) {
            print $atmail->parse("html/{$atmail->Language}/msg/attachtoolarge.html");
        }
    } elseif (isset($_GET['sending_attachment'])) {
        // Probably exceeded post_max_size if we get here
        print $atmail->parse("html/{$atmail->Language}/msg/attachtoolarge.html");
    }
    // List the number of attachments . Based on the unique compose
    // window and our logged in account
    $h = $sendmsg->list_attachments($var['unique']);
Esempio n. 2
0
if (!$var['Charset']) {
    $var['Charset'] = $atmail->EmailEncoding;
}
// Make a new UIDL if one does not exist
if (!$var['UIDL']) {
    $var['UIDL'] = time() . getmypid() . rand(0, 9000) . $atmail->genkey();
    $var['UIDL'] = preg_replace('/\\..*/', '', $var['UIDL']);
}
// Find which EmailBox to save into
if ($_REQUEST['Draft']) {
    $var['msgbox'] = 'Drafts';
} else {
    $var['msgbox'] = 'Sent';
}
// Build the message to send . Add the headers, message body and UIDL
$sendmsg = new SendMsg(array('Account' => "{$atmail->username}@{$atmail->pop3host}", 'EmailTo' => $var['emailto'], 'EmailFrom' => $var['emailfrom'], 'EmailCC' => $var['emailcc'], 'EmailBCC' => $var['emailbcc'], 'EmailSubject' => $var['emailsubject'], 'EmailPriority' => $var['emailpriority'], 'ContentType' => $var['contype'], 'XMailer' => "AtMail {$pref['version']}", 'EmailBox' => $var['msgbox'], 'EmailUIDL' => $var['UIDL'], 'Unique' => $var['unique'], 'X-Origin' => $_SERVER['REMOTE_ADDR'], 'EmailMessage' => $_REQUEST['emailmessage'], 'SessionID' => $auth->SessionID, 'PGPappend' => $atmail->PGPappend, 'PGPsign' => $atmail->PGPsign, 'SMIMEencrypt' => $var['SMIMEencrypt'], 'SMIMEsign' => $var['SMIMEsign'], 'Charset' => $var['Charset'], 'ReadReceipt' => $var['ReadReceipt'], 'ReplyFwd' => $var['type'], 'VideoStream' => $var['VideoStream']));
// Save the message into the Sent users folder
// Create a new mail object
$mail = new GetMail(array('Username' => $atmail->username, 'Pop3host' => $atmail->pop3host, 'Password' => $auth->password, 'Type' => $atmail->MailType, 'Mode' => $atmail->Mode));
$mail->login();
// Build the email message to send
$sendmsg->buildmsg();
// Exit if no message defined
if (!$sendmsg->mime) {
    $atmail->end();
}
// If the user chooses to save the message
if ($sendmsg->EmailBox == 'Drafts') {
    // Print the draft save message
    $var['msg'] = $atmail->parse("html/{$atmail->Language}/msg/savedraft.html");
} else {
 public function check_phone()
 {
     //获取验证码
     import('Class.SendMsg', APP_PATH);
     // $phonenum="13017148493";
     // $phonecode="{\"param1\":\"1000\"}";
     if (!IS_AJAX) {
         halt('页面不存在!');
     }
     //电话号码
     $phonenum = I('phone_num', '', 'htmlspecialchars');
     $dm_phone["repay_id"] = I("fund_repay_id");
     //项目id
     $dm_phone["phone_number"] = $phonenum;
     if ($phone = M("dm_phone")->where($dm_phone)->find()) {
         //该号码已经支持过该项目
         $this->ajaxReturn(array('Code' => 2));
         return 0;
     }
     M("dm_phone")->add($dm_phone);
     $count = M("dm_phone")->where('repay_id=' . I("fund_repay_id"))->count();
     //这个项目的基金支持数
     $limits = M("dm_repay")->where("id=" . I("fund_repay_id"))->getField("limits");
     //回报的限定人数
     if ($count > $limits && $limits != 0) {
         //删除
         M("dm_phone")->where($dm_phone)->delete();
         $this->ajaxReturn(array('Code' => 3));
         return 0;
     }
     M("dm_phone")->where($dm_phone)->delete();
     // 	$phonenum=I('phone_num','','htmlspecialchars');	//电话号码
     //    $dm_phone["repay_id"]=I("fund_repay_id");//项目id
     //    session('fund_phone',I('phone_num','','htmlspecialchars'));
     // //设置验证码session
     // 	$_SESSION["code_time"]=time();//验证码过期时间
     // 	session('send_phone_code',1);//验证码
     // 	$this->ajaxReturn(array(
     // 	'Code'=>1,
     // 	'dm_phone'=>$dm_phone,
     // 	));
     // 	return 0;
     $this->security_code = rand(10000, 99999);
     $phonecode = "{\"param1\":\"{$this->security_code}\"}";
     $msg = new SendMsg($phonenum, $phonecode);
     $msg->init();
     // $this->security_code=10000;
     // $code=session('security_code');
     //设置手机号码session
     session('fund_phone', I('phone_num', '', 'htmlspecialchars'));
     //设置验证码session
     $_SESSION["code_time"] = time();
     //验证码过期时间
     session('send_phone_code', $this->security_code);
     //验证码
     $this->ajaxReturn(array('Code' => 1));
     return 0;
 }
Esempio n. 4
0
<?php

/**
 * 微信扩展接口测试
 */
include "sendmsg.class.php";
function logdebug($text)
{
    file_put_contents('data/log.txt', $text . "\n", FILE_APPEND);
}
$options = array('appid' => 'wx7876787c21486f55', 'appsecret' => 'aeaedf03b50a9adccdd2f28014a340cf');
$sendmsg = new SendMsg($options);
$content = $_GET['content'];
$openid = $_GET['id'];
if ($sendmsg->checkAppidAndAppsecret()) {
    //get token
    if ($sendmsg->sendMsgByOpenid($openid, $content)) {
        echo "send msg success";
    } else {
        echo "send msg faile";
    }
} else {
    echo "appid or appsecret error";
}
 public function phonenum()
 {
     import('Class.SendMsg', APP_PATH);
     // $phonenum="13017148493";
     // $phonecode="{\"param1\":\"1000\"}";
     if (!IS_POST) {
         halt('页面不存在!');
     }
     $phonenum = I('post.phone_num', '', 'htmlspecialchars');
     $this->security_code = rand(10000, 99999);
     $phonecode = "{\"param1\":\"{$this->security_code}\"}";
     $msg = new SendMsg($phonenum, $phonecode);
     $msg->init();
     // $this->security_code=10000;
     $code = session('security_code');
     if (isset($code)) {
         session('security_code', null);
     }
     session('security_code', $this->security_code);
     $data = 1;
     $this->ajaxReturn($data);
 }