<?php
# [External Protocols Support (via IM_PROXY)] #
$IM_PROXY_HOST = "localhost";
$IM_PROXY_PORT = 10001;
function getTranslatedOptValue($sOption) {
global $EXT_OPTIONS_VALUE_STR;
if(isset($EXT_OPTIONS_VALUE_STR[$sOption])) {
return $EXT_OPTIONS_VALUE_STR[$sOption];
}
else {
return $sOption;
}
}
$hProtocol = array (
"MSN"=> array(
"NAME" =>"MSN Messenger",
"CHAT_OFFLINE" => 0, // MSN doesn't support offline messages
"FC" => "#000000", // font color
"BC" => "#ffcc99", // background color
"ERROR_LIST_URL" => "http://www.hypothetic.org/docs/msn/reference/error_list.php",
),
"ICQ"=>array(
"NAME"=>"ICQ",
"CHAT_OFFLINE" => 1, // ICQ supports offline messages (sent via server )
"FC" => "#000000", // font color
"BC" => "#33cc00", // background color
"USER_INFO_URL" => "http://wwp.icq.com/",
"USER_IMG_URL" => "http://www.icq.com/dmedia/show_photo.jpg?uin=%s",
'PER_MSG_ENC' => 1, // Allow changes of message encoding per user
),
"YIM"=> array(
"NAME"=>"Yahoo Instant Messenger",
"CHAT_OFFLINE" => 1, // Not sure about the offline messages in YIM
"FC" => "#ffffff", // font color
"BC" => "#3366ff", // background color
"USER_INFO_URL" => 'http://profiles.yahoo.com/'
),
"AIM"=>array(
"NAME"=>"AOL Instant Messenger",
"CHAT_OFFLINE" => 1, // OSCAR protocol can handle offline messages
# "CHAT_OFFLINE" => 0, // TOC protocol is not sending offline messeges
"FC" => "red", // font color
"BC" => "yellow"// background color
),
/* Not Quite supported at the moment
"NVL"=>array(
"NAME"=>"Novell GroupWise Messenger",
"CHAT_OFFLINE" => 0, // TOC protocol is not sending offline messeges
"FC" => "red", // font color
"BC" => "white"// background color
),
"LIM"=>array(
"NAME"=>"LAFFER Instant Messenger",
"CHAT_OFFLINE" => 0, // LIM protocol is not sending offline messeges
"FC" => "yellow", // font color
"BC" => "#996633"// background color
),
*/
"JAB"=>array(
"NAME"=>"Jabber Instant Messenger",
"CHAT_OFFLINE" => 0, // LIM protocol is not sending offline messeges
"FC" => "#813838", // font color
"BC" => "#ffbe25"// background color
),
/* Google Changed for Nth time their web
"GIM"=>array(
"NAME"=>"Google Fake Instant Messenger",
"CHAT_OFFLINE" => 1,
"FC" => "#000000", // font color
"BC" => "#8bc2ff"// background color
),
*/
);
# Define Advanced/Additional Options for external protocols
$hProtocolOptions = array (
"AIM"=>array(
"MSG_ENC" =>array (
"TYPE" =>"select",
"OPTIONS"=>array(
"C"=>"C",
"utf8" => "utf-8",
)
),
),
"NVL" =>array(
"SERVER"=>array(
"DEFAULT"=>"",
"TYPE" =>"text",
"SIZE" => 30,
), # Option Name => default value
"PORT" =>array(
"DEFAULT"=>"",
"TYPE" =>"text",
"SIZE" => 10,
),
),
"ICQ" =>array(
"USER_AGENT" =>array (
"TYPE" =>"select",
"OPTIONS"=>array(
"MIRANDA"=>"Miranda IM",
"GAIM" => "GAIM",
"MICQ" => "mICQ",
"TRILLIAN"=>"Trillian IM",
"SIM" => "SIM",
)
),
"MSG_ENC" =>array (
"TYPE" =>"select",
"OPTIONS"=>array(
"C" =>"C",
"UCS-2BE" => "utf-8",
)
),
),
"YIM" =>array(
"MSG_ENC" =>array (
"TYPE" =>"select",
"OPTIONS"=>array(
"utf8" => "utf-8",
"C"=>"C",
)
),
),
"JAB" =>array(
"SERVER"=>array(
"DEFAULT"=>"jabber.org",
"TYPE" =>"text",
"SIZE" => 30,
), # Option Name => default value
"PORT" =>array(
"DEFAULT"=>"5222",
"TYPE" =>"text",
"SIZE" => 10,
),
),
);
/* All Capabities for the moment are
Users: 'ADD_USER'-> add user to contact list
'MOVE_USER'-> move user to group
'DEL_USER'-> delete from contact list or only from group
'REN_USER'-> rename user
'BLOCK_USER' -> stop messages from this user and presence information
'SET_USER_STAT' -> send your presence status only to this user (you can make yourself hidden only for this user)
'FIND_USER' -> search for user from a catalog
'AUTH_USER' -> authorize user
'REQ_AUTH' -> request authorization
Groups: 'ADD_GROUP'-> add group to contact list
'REN_GROUP'-> rename group
'DEL_GROUP'-> delete group from contact list
*/
$hDefaultCapabilities = array('ADD_USER'=>1,'MOVE_USER'=>1,'DEL_USER'=>1, 'REN_USER' =>1,
'ADD_GROUP'=>1,'REN_GROUP'=>1,'DEL_GROUP'=>1
);
$hProtocolCaps = array( // protocol capabilities
'ICQ'=> array_merge($hDefaultCapabilities,
array('SET_USER_STAT'=>1,'FIND_USER'=>1, 'AUTH_USER'=>1)
),
'MSN'=> array_merge($hDefaultCapabilities,
array('BLOCK_USER'=>1)
),
'YIM'=> array('ADD_USER'=>1,'MOVE_USER'=>1,'DEL_USER'=>1,'BLOCK_USER'=>1,
'ADD_GROUP'=>1,'REN_GROUP'=>1,'DEL_GROUP'=>1
),
'JAB'=> array_merge($hDefaultCapabilities,array('FIND_USER'=>1)), // may be even more
'AIM'=> $hDefaultCapabilities, // needs research
// "NVL"=> $hDefaultCapabilities, // needs research
// "LIM"=> $hDefaultCapabilities,
// "GIM"=> array('ADD_USER'=>1,'DEL_USER'=>1, 'REN_USER' =>1),
);
function getProtocolIDs() {
global $hProtocol;
$sResult = "";
foreach($hProtocol as $sID=>$hValue) {
$sResult.="'$sID',";
}
$sResult = substr($sResult,0,-1);
return $sResult;
}
function getProtocolsForCap($sCapability) {
global $hProtocolCaps;
$sResult = "";
foreach($hProtocolCaps as $sProtocol=>$hCapabilities) {
if(is_array($hCapabilities)) {
if(isset($hCapabilities[$sCapability])) {
$sResult.="'$sProtocol',";
}
}
}
$sResult = substr($sResult,0,-1);
return $sResult;
}
$EXT_OPTIONS_STR = array();
$EXT_OPTIONS_VALUE_STR = array();
require_once("$LANG_PATH/$LANG/ext_protocols");
?>