Exemplo n.º 1
0
function uddeIMpublicFrontendPlugin($versionstring, $pathtouser, $pathtosite, $config) {
	// not required since I do this in uddeim.php now
	//	session_start();

	$Itemid 	= uddeIMmosGetParam( $_REQUEST, 'Itemid');
	if (!$Itemid || !isset($Itemid) || empty( $Itemid )) {
		$Itemid = uddeIMgetItemid($config);
	} else if ($config->overwriteitemid) {
		$Itemid = (int)$config->useitemid;
	}

	$item_id	= (int) $Itemid;
	$task		= uddeIMmosGetParam( $_REQUEST, 'task', 'inbox');	// task is publicnew or publicsave

	$recip		= (int) uddeIMmosGetParam ( $_REQUEST, 'recip');				// für blocking nach ID and new message
	$runame		= uddeIMmosGetParam ( $_REQUEST, 'runame');	// für blocking nach NAME and new message

	$to_id		= (int) uddeIMmosGetParam ($_POST, 'to_id');
	$to_name	= uddeIMmosGetParam ($_POST, 'to_name');
	$fromname	= uddeIMmosGetParam ($_POST, 'from_name');
	$fromemail	= uddeIMmosGetParam ($_POST, 'from_email');
	$pmessage	= strip_tags(uddeIMmosGetParam($_POST, 'pmessage', '', _MOS_ALLOWHTML));
	$spamtrap	= uddeIMmosGetParam ($_POST, 'city');
	if ($spamtrap)
		$task = "spamtrap";

	$sendeform_showallusers = uddeIMmosGetParam ($_POST, 'sendeform_showallusers', '');
	$backto			= uddeIMmosGetParam ($_POST, 'backto');

	// load template css file
	if(!$config->templatedir) {
		$config->templatedir="default";
	}
	// browser switch
	$used_browser = uddeIMmosGetParam($_SERVER, 'HTTP_USER_AGENT', null);
	$css_appendix="";
	$css_alternative="";
	if (stristr($used_browser, "Opera")) {
		$css_appendix="-opera";
	} elseif (stristr($used_browser, "MSIE 4")) {
		$css_appendix="-ie4";
		$css_alternative="-ie";
	} elseif (stristr($used_browser, "MSIE 6") || stristr($used_browser, "MSIE/6")) {
		$css_appendix="-ie6";
		$css_alternative="-ie";
	} elseif (stristr($used_browser, "MSIE 7") || stristr($used_browser, "MSIE/7")) {
		$css_appendix="-ie7";
		$css_alternative="-ie";
	} elseif (((stristr($used_browser, "MSIE 5") || stristr($used_browser, "MSIE/5"))) && stristr($used_browser, "Win")) {
		$css_appendix="-ie5win";
		$css_alternative="-ie";
	} elseif (stristr($used_browser, "MSIE 5") && stristr($used_browser, "Mac")) {
		$css_appendix="-ie5mac";
		$css_alternative="-ie";
	} elseif (stristr($used_browser, "Safari")) {
		$css_appendix="-safari";
	} elseif (stristr($used_browser, "Safari/100")) {
		$css_appendix="-safari100";
		$css_alternative="-safari";
	} elseif (stristr($used_browser, "Safari/85")) {
		$css_appendix="-safari85";
		$css_alternative="-safari";
	} elseif (stristr($used_browser, "Konqueror")) {
		$css_appendix="-konq";
	} elseif (stristr($used_browser, "Konqueror/2")) {
		$css_appendix="-konq2";
		$css_alternative="-konq";
	} elseif (stristr($used_browser, "Konqueror/3")) {
		$css_appendix="-konq3";
		$css_alternative="-konq";
	}

	$omitDefaultOutput = false;
	if (class_exists('JRequest')) {
		if (JRequest::getVar('no_html', false))
			$omitDefaultOutput = true;
	} else {
		if (uddeIMmosGetParam( $_REQUEST, 'no_html', false ))
			$omitDefaultOutput = true;
	}
	// now start the output
	if (!$omitDefaultOutput){
		echo "\n<!-- ".$versionstring." output below -->\n";

		// load the css file
		$css = "";
		if(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/uddeim'.$css_appendix.'.css')) {
			$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/uddeim".$css_appendix.".css";
		} elseif(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/uddeim'.$css_alternative.'.css')) {
			$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/uddeim".$css_alternative.".css";
		} elseif(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/uddeim.css')) {
			$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/uddeim.css";
		} else {
			// template css doesn't exist, now we try to load the default css file
			if(file_exists($pathtouser.'/templates/default/css/uddeim.css'))
				$css = $pathtosite."/components/com_uddeim/templates/default/css/uddeim.css";
		}
		uddeIMaddCSS($css);

		if ($config->pubuseautocomplete) {
			$css = "";
			if(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/autocompleter'.$css_appendix.'.css')) {
				$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/autocompleter".$css_appendix.".css";
			} elseif(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/autocompleter'.$css_alternative.'.css')) {
				$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/autocompleter".$css_alternative.".css";
			} elseif(file_exists($pathtouser.'/templates/'.$config->templatedir.'/css/autocompleter.css')) {
				$css = $pathtosite."/components/com_uddeim/templates/".$config->templatedir."/css/autocompleter.css";
			} else {
				// template css doesn't exist, now we try to load the default css file
				if(file_exists($pathtouser.'/templates/default/css/autocompleter.css'))
					$css = $pathtosite."/components/com_uddeim/templates/default/css/autocompleter.css";
			}
			uddeIMaddCSS($css);
		}
		echo "<div id='uddeim'><div id='uddeim-topborder'></div>\n";
	}
	// fork according to task
	switch ($task) {
		case 'completeUserName':
			uddeIMcompleteUserName(0, $config);
			break;
		case "spamtrap":
			uddeIMprintPublicMenu($item_id, $config);
			echo "<div id='uddeim-m'>\n<div id='uddeim-bottomlines'>\n";
			echo "<p><b>"._UDDEIM_PUBLICSENT."</b></p>";
			echo "</div>\n</div>\n<div id='uddeim-bottomborder'></div>\n";
			break;
		case "publicsent":
			uddeIMprintPublicMenu($item_id, $config);
			echo "<div id='uddeim-m'>\n<div id='uddeim-bottomlines'>\n";
			echo "<p><b>"._UDDEIM_PUBLICSENT."</b></p>";
			echo "</div>\n</div>\n<div id='uddeim-bottomborder'></div>\n";
			break;
		case "publicsave":
			uddeIMpublicSaveMessage($fromname, $fromemail, $to_name, $to_id, $pmessage, $item_id, $sendeform_showallusers, $backto, $config);
			break;
		case "publicnew":
		default:
			uddeIMpublicNewMessage($item_id, $to_id, $recip, $runame, $pmessage, $config);
			break;
	}

	if (!$omitDefaultOutput){
		echo "</div>\n";		// </div id='uddeim'>
		echo "<!-- ".$versionstring." output above -->\n";
	}
}
Exemplo n.º 2
0
	case "saveresponderemn":
		uddeIMsaveAutoresponderEMN($userid, $item_id, $autorespondertext, $autorespondercheck, $config);
		break;

	case "saveforwardemn":
		uddeIMsaveAutoforwardEMN($userid, $item_id, $autoforwardid, $autoforwardcheck, $config);
		break;

	case "saveuseremn":
		uddeIMsaveUserEMN($userid, $item_id, $popupcheck, $publiccheck, $config);
		break;

	// 2007-11-21 zenny: added this to route onto autocomplete ajax return
	case 'completeUserName':
		uddeIMcompleteUserName($userid, $config);
		break;

	case 'ajaxGetNewMessages':
		uddeIMajaxGetNewMessages($userid, $config);
		break;

	default:
		if( $config->enablepostbox ) {
			uddeIMemit("onPostbox", Array( "userid" => $userid ) );
			uddeIMshowPostbox($userid, $item_id, $limit, $limitstart, $cryptpass, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode);
			break;
		}
		require_once($pathtouser.'/inbox.php');
		uddeIMemit("onInbox", Array( "userid" => $userid ) );
		uddeIMshowInbox($userid, $item_id, $limit, $limitstart, $cryptpass, $config, $filter_user, $filter_unread, $filter_flagged, $sort_mode, $sort_mode);