function app_get_emails($email, $psw, $type) { $temp = explode('@', $email); $name = array_shift($temp); $domain = array_shift($temp); if ($type == 'email') { include_once dirname(__FILE__) . '/lib/mailfactory.php'; switch (strtolower($domain)) { case "126.com": $contact = new MailFactory(M126); break; case "sina.com": $contact = new MailFactory(MSINA); break; case "tom.com": $contact = new MailFactory(MTOM); break; case "gmail.com": $contact = new MailFactory(MGOOGLE); break; case "163.com": $contact = new MailFactory(M163); break; case "sohu.com": $name = $email; $contact = new MailFactory(MSOHU); break; case "vip.sohu.com": $name = $email; $contact = new MailFactory(MSOHU_VIP); break; case "yahoo.cn": case "yahoo.com": case "yahoo.com.cn": $name = $email; $contact = new MailFactory(MYAHOO); break; default: die("error"); } return $contact->getContactList($name, $psw); } elseif (strtolower($type) == 'msn') { include_once dirname(__FILE__) . '/lib/msn.class.php'; $return = array(); $msn2 = new msn(); $return_emails = $msn2->qGrab($email, $psw); if ($return_emails && is_array($return_emails)) { foreach ($return_emails as $v) { $return[] = $v[0]; } } return $return; } }
public function getEmailList() { set_time_limit(0); if (empty($_POST['account']) || empty($_POST['password'])) { $this->error('账号或者密码不能为空'); } vendor('Sync.mailfactory'); switch ($_POST['email_type']) { case "126.com": $contact = new MailFactory(M126); break; case "sina.com": $contact = new MailFactory(MSINA); break; case "tom.com": $contact = new MailFactory(MTOM); break; case "gmail.com": $contact = new MailFactory(MGOOGLE); break; case "163.com": $contact = new MailFactory(M163); break; case "sohu.com": $_POST['account'] = $_POST['account'] . "@" . $_POST['email_type']; $contact = new MailFactory(MSOHU); break; case "vip.sohu.com": $_POST['account'] = $_POST['account'] . "@" . $_POST['email_type']; $contact = new MailFactory(MSOHU_VIP); break; case "yahoo.cn": case "yahoo.com": case "yahoo.com.cn": $_POST['account'] = $_POST['account'] . "@" . $_POST['email_type']; $contact = new MailFactory(MYAHOO); break; default: die("error"); } $contacts = $contact->getcontactlist($_POST['account'], $_POST['password']); if (empty($contacts)) { $this->error('对不起,没有找到你的联系人'); } else { $emailArr = D('Invite')->filterEmail($contacts, $this->mid); //获取朋友类型 $map = "uid = 0 or uid = " . $this->mid; $groups = D("FriendGroup")->where($map)->order("id asc")->findAll(); $this->assign("groups", $groups); $this->assign('emailArr', $emailArr); $this->display('doMsnInvite'); } }
/** * This method reads the configuration options (using the getConfig method) * and initializes the database connections. * */ function configure() { $connections = $this->getConfig(); if ($connections) { foreach ($connections as $name => $params) { self::$connections[$name] = MailFactory::getConnection($params, $name); } } }
case "163.com": $contact = new MailFactory(M163); break; case "sohu.com": $_POST['account'] = $_POST['account'] . "@" . $_POST['postoffice']; $contact = new MailFactory(MSOHU); break; case "vip.sohu.com": $_POST['account'] = $_POST['account'] . "@" . $_POST['postoffice']; $contact = new MailFactory(MSOHU_VIP); break; case "yahoo.cn": case "yahoo.com": case "yahoo.com.cn": $_POST['account'] = $_POST['account'] . "@" . $_POST['postoffice']; $contact = new MailFactory(MYAHOO); break; default: die("error"); } $contacts = $contact->getContactList($_POST['account'], $_POST['passwd']); if ($contacts == 0) { die('error'); } 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));
header("Location: " . orongoURL("orongo-register.php?msg=3")); exit; } $name = Security::escape($_POST['username']); $email = Security::escape($_POST['email']); $password = Security::hash($_POST['password']); if (User::usernameExists($name) == false) { $user = null; try { $user = User::registerUser($name, $email, $password, RANK_USER); } catch (Exception $e) { header("Location: " . orongoURL("orongo-login.php?msg=3")); exit; } $activationLink = User::generateActivationURL($user->getID()); $mail = MailFactory::generateActivationEmail($user->getName(), $activationLink); $sendEmail = mail($user->getEmail(), $mail['subject'], $mail['message'], $mail['headers']); if (!$sendEmail) { header("Location: " . orongoURL("orongo-login.php?msg=3")); exit; } header("Location: " . orongoURL("orongo-login.php?msg=2")); exit; } else { echo $name; header("Location:" . orongoURL("orongo-login.php?msg=1")); exit; } } else { header("Location: " . orongoURL("orongo-register.php?msg=3")); exit;