Exemplo n.º 1
0
    }
    if (empty($contacts)) {
        die('empty');
    }
    if ($_POST['postoffice'] == "sina.com" || $_POST['postoffice'] == "sohu.com" || $_POST['postoffice'] == "vip.sohu.com") {
        echo diff_contacts($contacts);
    } else {
        echo diff_contacts(array_flip($contacts));
    }
    exit;
} elseif ($act == "m") {
    if (!$_POST['account'] || !$_POST['passwd']) {
        die('error');
    }
    include 'msn.class.php';
    $msn2 = new hotmail();
    $returned_emails = $msn2->qGrab($_POST['account'], $_POST['passwd']);
    die(print_r($returned_emails));
    diff_contacts($returned_emails);
    exit;
} elseif ($act == "u") {
    if (empty($_FILES['cardfile']) || $_FILES['cardfile']['size'] <= 0) {
        $ret = 'error';
    } else {
        $content = file_get_contents($_FILES['cardfile']['tmp_name']);
        preg_match_all("/[a-z0-9_\\.\\-]+@[a-z0-9\\-]+\\.[a-z]{2,6}/i", $content, $matches);
        if (($emails = array_unique($matches[0])) != false) {
            $ret = diff_contacts(array_flip($emails));
        } else {
            $ret = "empty";
        }
 function doMsnInvite()
 {
     set_time_limit(120);
     if (empty($_POST['account']) || empty($_POST['password'])) {
         $this->error('账号或者密码不能为空');
     }
     $account = t($_POST['account']);
     $password = $_POST['password'];
     vendor('Loginer.msn_loginer');
     $msnFriends = get_msn_friends($account, $password);
     if (!$msnFriends) {
         vendor('Sync.msn#class');
         $msn2 = new hotmail();
         $msnFriends = $msn2->qGrab($account, $password);
     }
     if (!$msnFriends) {
         $this->error('没有找到好友');
     }
     $emails = array();
     foreach ($msnFriends as $k => $v) {
         $emails[] = $k;
     }
     $emailArr = D('Invite')->filterEmail($emails, $this->mid);
     //print_r($emailArr);
     //好友分类
     $map = "uid = 0 or uid = " . $this->mid;
     $groups = D("FriendGroup")->where($map)->order("id asc")->findAll();
     //$emailArr = array('sendInviteFriend'=>array('*****@*****.**','*****@*****.**','*****@*****.**'),'sendInviteReg'=>array('*****@*****.**'));
     $this->assign("groups", $groups);
     $this->assign('emailArr', $emailArr);
     $this->display('doMsnInvite');
 }