<?php
/*
MSN class ver 1.8 by Tommy Wu
License: GPL
You can find MSN protocol from this site: http://msnpiki.msnfanatic.com/index.php/Main_Page
This class support both MSNP15 and MSNP9 for send message. The PHP module needed:
MSNP9: curl pcre
MSNP15: curl pcre mhash mcrypt bcmath
Usually, this class will try to use MSNP15 if your system can support it, if your system can't support it,
it will switch to use MSNP9. But if you use MSNP9, it won't support OIM (Offline Messages).
Sameple Code:
$msn = new MSN;
if (!$msn->connect('YOUR_MSN_ID', 'YOUR_MSN_PASSWORD')) {
echo "Error for connect to MSN network\n";
echo "$msn->error\n";
exit;
}
$msn->sendMessage('Now: '.strftime('%m/%d/%y %H:%M:%S')."\nTesting\nSecond Line\n\n\n\nand Empty Line",
array(
'somebody1@hotmail.com',
'somebody2@hotmail.com'
)
);
echo "Done!\n";
exit;
*/
class MSN
{
var $server = 'messenger.hotmail.com';
var $port = 1863;
var $passport_url = 'https://login.live.com/RST.srf';
var $protocol = 'MSNP15';
var $buildver = '8.1.0178';
var $prod_key = 'PK}_A_0N_K%O?A9S';
var $prod_id = 'PROD0114ES4Z%Q5W';
var $login_method = 'SSO';
var $clientid = '';
var $oim_send_url = 'https://ows.messenger.msn.com/OimWS/oim.asmx';
var $oim_sendsoap = 'http://messenger.live.com/ws/2006/09/oim/Store2';
var $oim_maildata_url = 'https://rsi.hotmail.com/rsi/rsi.asmx';
var $oim_maildata_soap = 'http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMetadata';
var $oim_read_url = 'https://rsi.hotmail.com/rsi/rsi.asmx';
var $oim_read_soap = 'http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage';
var $oim_del_url = 'https://rsi.hotmail.com/rsi/rsi.asmx';
var $oim_del_soap = 'http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages';
var $membership_url = 'https://contacts.msn.com/abservice/SharingService.asmx';
var $membership_soap = 'http://www.msn.com/webservices/AddressBook/FindMembership';
var $addmember_url = 'https://contacts.msn.com/abservice/SharingService.asmx';
var $addmember_soap = 'http://www.msn.com/webservices/AddressBook/AddMember';
var $delmember_url = 'https://contacts.msn.com/abservice/SharingService.asmx';
var $delmember_soap = 'http://www.msn.com/webservices/AddressBook/DeleteMember';
var $id;
var $fp = false;
var $error = '';
var $authed = false;
var $user = '';
var $password = '';
var $passport_policy = '';
var $oim_try = 3;
var $oim_ticket = '';
var $contact_ticket = '';
// FIXME: even we login for following site, but... we don't need that now.
var $web_ticket = '';
var $space_ticket = '';
var $storage_ticket = '';
var $debug = false;
var $log_file = '';
var $timeout = 15;
var $stream_timeout = 2;
var $log_path = false;
var $sb;
var $font_fn = 'Arial';
var $font_co = '333333';
var $font_ef = '';
var $windows = false;
var $kill_me = false;
var $proxy = "";
// the message length (include header) is limited (maybe since WLM 8.5 released)
// for WLM: 1664 bytes
// for YIM: 518 bytes
var $max_msn_message_len = 1664;
var $max_yahoo_message_len = 518;
function MSN($protocol = '', $debug = false, $timeout = 15, $client_id = 0x7000800C)
{
if (is_string($debug) && $debug !== '') {
$this->debug = true;
$this->log_file = $debug;
}
else
$this->debug = $debug;
$this->timeout = $timeout;
// check support
if (!function_exists('curl_init')) die("We need curl module!\n");
if (!function_exists('preg_match')) die("We need pcre module!\n");
if ($protocol != 'MSNP9' && $protocol != 'MSNP15')
$protocol = '';
if ($protocol != 'MSNP9' && !function_exists('mhash')) {
if ($protocol == 'MSNP15') die("We need mhash module for $protocol!\n");
$protocol = 'MSNP9';
}
if ($protocol != 'MSNP9' && !function_exists('mcrypt_cbc')) {
if ($protocol == 'MSNP15') die("We need mcrypt module for $protocol!\n");
$protocol = 'MSNP9';
}
if ($protocol != 'MSNP9' && !function_exists('bcmod')) {
if ($protocol == 'MSNP15') die("We need bcmath module for $protocol!\n");
$protocol = 'MSNP9';
}
if ($protocol == 'MSNP9') {
$this->protocol = 'MSNP9';
$this->passport_url = 'https://nexus.passport.com/rdr/pprdr.asp';
$this->buildver = '6.0.0602';
$this->prod_key = 'Q1P7W2E4J9R8U3S5';
$this->prod_id = 'msmsgs@msnmsgr.com';
$this->login_method = 'TWN';
}
else {
$this->protocol = 'MSNP15';
$this->passport_url = 'https://login.live.com/RST.srf';
$this->buildver = '8.1.0178';
$this->prod_key = 'PK}_A_0N_K%O?A9S';
$this->prod_id = 'PROD0114ES4Z%Q5W';
$this->login_method = 'SSO';
$this->oim_send_url = 'https://ows.messenger.msn.com/OimWS/oim.asmx';
$this->oim_send_soap = 'http://messenger.live.com/ws/2006/09/oim/Store2';
/*
http://msnpiki.msnfanatic.com/index.php/Client_ID
Client ID for MSN:
normal MSN 8.1 clientid is:
01110110 01001100 11000000 00101100
= 0x764CC02C
we just use following:
* 0x04: Your client can send/receive Ink (GIF format)
* 0x08: Your client can send/recieve Ink (ISF format)
* 0x8000: This means you support Winks receiving (If not set the official Client will warn with 'contact has an older client and is not capable of receiving Winks')
* 0x70000000: This is the value for MSNC7 (WL Msgr 8.1)
= 0x7000800C;
*/
$this->clientid = $client_id;
}
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
$this->windows = true;
else
$this->windows = false;
return;
}
function get_passport_ticket($url = '')
{
$user = htmlspecialchars($this->user);
$password = htmlspecialchars($this->password);
if ($url === '')
$passport_url = $this->passport_url;
else
$passport_url = $url;
$XML = '<?xml version="1.0" encoding="UTF-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wssc="http://schemas.xmlsoap.org/ws/2004/04/sc"
xmlns:wst="http://schemas.xmlsoap.org/ws/2004/04/trust">
<Header>
<ps:AuthInfo xmlns:ps="http://schemas.microsoft.com/Passport/SoapServices/PPCRL" Id="PPAuthInfo">
<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>
<ps:BinaryVersion>4</ps:BinaryVersion>
<ps:UIVersion>1</ps:UIVersion>
<ps:Cookies></ps:Cookies>
<ps:RequestParams>AQAAAAIAAABsYwQAAAAxMDMz</ps:RequestParams>
</ps:AuthInfo>
<wsse:Security>
<wsse:UsernameToken Id="user">
<wsse:Username>'.$user.'</wsse:Username>
<wsse:Password>'.$password.'</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</Header>
<Body>
<ps:RequestMultipleSecurityTokens xmlns:ps="http://schemas.microsoft.com/Passport/SoapServices/PPCRL" Id="RSTS">
<wst:RequestSecurityToken Id="RST0">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>
没有合适的资源?快使用搜索试试~ 我知道了~
ThinkSNS1.6源代码
共2392个文件
gif:1032个
php:508个
html:440个
3星 · 超过75%的资源 需积分: 10 16 下载量 141 浏览量
2011-12-27
23:18:07
上传
评论
收藏 7.78MB RAR 举报
温馨提示
ThinkSNS基于许多优秀的开源软件开发,提供全方位的社交网络解决方案ThinkSNS源于办公圈项目,WEB端基于国内技术领先的ThinkPHP框架开发,另外还有IM客户端软件。 ThinkSNS全部基于开源项目,同时也作为开源项目,免费提供给用户使用。项目框架都有完善的文档和实例,非常适合二次开发。能为致力于SNS方向的站长提供帮助,是我们的最大的梦想! 一、运行环境需求:PHP(5.1.2+)+MYSQL(4.1+) 二、安装步骤: 1、使用ftp工具以二进制模式,将该软件包里的 thinksns 目录及其文件上传到您的空间,假设上传后目录仍旧为 thinksns。 2、如果您使用的是Linux 或 Freebsd 服务器,先确认以下目录或文件属性为 (777) 可写模式。 目录: data 目录: runtime 目录: install 文件: config.inc.php 文件: define.inc.php 3、运行 http://yourwebsite/thinksns/install/install.php 安装程序,填入安装相关信息与资料,完成安装! 4、运行 http://yourwebsite/thinksns/index.php 开始体验ThinkSNS1.6!
资源推荐
资源详情
资源评论
收起资源包目录
ThinkSNS1.6源代码 (2392个子文件)
color.bmp 9KB
color.bmp 9KB
base.css 32KB
layout.css 23KB
layout.css 23KB
photo.css 18KB
photo.css 13KB
photo.css 12KB
box.css 10KB
box.css 10KB
group.css 9KB
tinymce.css 9KB
default.css 9KB
public.css 8KB
public.css 8KB
base.css 8KB
im_bak.css 6KB
im_bak.css 6KB
index.css 6KB
poster.css 6KB
admin.css 6KB
style.css 6KB
layout.css 5KB
event.css 5KB
jquery.cluetip.css 5KB
space.css 5KB
ui.friendsuggest.css 4KB
poll.css 4KB
mood.css 4KB
ui.friendsuggest.css 4KB
im.css 4KB
im.css 4KB
bug.css 4KB
blog.css 3KB
friend.css 3KB
ymPrompt.css 3KB
share.css 3KB
reg.css 3KB
ymPrompt.css 2KB
ymPrompt.css 2KB
pop.css 2KB
ymPrompt.css 2KB
ymPrompt.css 2KB
mark_photo.css 2KB
privacy.css 2KB
ymPrompt.css 2KB
style.css 2KB
pagination.css 2KB
facebox.css 2KB
notify.css 2KB
gift.css 2KB
ymPrompt.css 2KB
us_info.css 2KB
us_info.css 2KB
main.css 1KB
basic.css 1KB
default.css 1KB
default.css 1KB
default.css 1KB
default.css 1KB
style.css 820B
style.css 727B
app_list.css 709B
editor.css 605B
accounts.css 488B
type.css 298B
index.css 154B
Thumbs.db 215KB
Thumbs.db 158KB
Thumbs.db 85KB
Thumbs.db 35KB
Thumbs.db 35KB
Thumbs.db 35KB
Thumbs.db 33KB
Thumbs.db 29KB
Thumbs.db 22KB
Thumbs.db 19KB
Thumbs.db 11KB
Thumbs.db 9KB
Thumbs.db 8KB
Thumbs.db 8KB
Thumbs.db 7KB
Thumbs.db 7KB
Thumbs.db 7KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 6KB
Thumbs.db 5KB
Thumbs.db 5KB
4abb328cb5b7b.gif 112KB
4abb2d260c24a.gif 112KB
4abb3c39804a9.gif 112KB
4abb397543a5d.gif 112KB
4abb2e9020621.gif 112KB
photo_pic_01.gif 33KB
ad01.gif 29KB
ad01.gif 29KB
table_hb.gif 13KB
共 2392 条
- 1
- 2
- 3
- 4
- 5
- 6
- 24
资源评论
- fefen02015-06-03好久没更新了TP。还是等官网吧
whisper002
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功