Esempio n. 1
0
function uddeIMprintMenu($myself, $uddeaction, $item_id, $config) {
	$pathtosite = uddeIMgetPath('live_site');
	$my_gid = $config->usergid;

	// write the uddeim title
	if ($config->showtitle)
		echo "<div class='contentheading'>".$config->showtitle."</div>";

	if ($config->showmenuicons==3)
		return;

	// write the uddeim menu
	echo "\n<div id='uddeim-navbar2'><ul>\n";

	if ( $config->enablepostbox ) {
		$cnt = "";
		if ($config->showmenucount)
			$cnt = " (".uddeIMgetInboxCount($myself, 0, true, 0)."/".uddeIMgetInboxCount($myself)."/".uddeIMgetOutboxCount($myself).")";
		if ($uddeaction=="postbox") {
			echo "<li class='uddeim-activemenu'><span>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_inbox.gif' alt='"._UDDEIM_POSTBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_POSTBOX;
			echo $cnt;
			echo "</span></li>\n";
		} else {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=postbox&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_inbox.gif' border='0' alt='"._UDDEIM_POSTBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_POSTBOX;
			echo $cnt;
			echo "</a>";
			echo "</li>\n";
		}
	} else {
		$cnt = "";
		if ($config->showmenucount)
			$cnt = " (".uddeIMgetInboxCount($myself, 0, true, 0)."/".uddeIMgetInboxCount($myself).")";
		if ($uddeaction=="inbox") {
			echo "<li class='uddeim-activemenu'><span>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_inbox.gif' alt='"._UDDEIM_INBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_INBOX;
			echo $cnt;
			echo "</span></li>\n";
		} else {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=inbox&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_inbox.gif' border='0' alt='"._UDDEIM_INBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_INBOX;
			echo $cnt;
			echo "</a>";
			echo "</li>\n";
		}

		$cnt = "";
		if ($config->showmenucount)
			$cnt = " (".uddeIMgetOutboxCount($myself).")";
		if ($uddeaction=="outbox") {
			echo "<li class='uddeim-activemenu'><span>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_outbox.gif' alt='"._UDDEIM_OUTBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_OUTBOX;
			echo $cnt;
			echo "</span></li>\n";
		} else {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=outbox&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_outbox.gif' border='0' alt='"._UDDEIM_OUTBOX."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_OUTBOX;
			echo $cnt;
			echo "</a>";
			echo "</li>\n";
		}
	}

	$cnt = "";
	if ($config->showmenucount) {
		$rightnow=uddetime($config->timezone);
		$offset=((float)$config->TrashLifespan) * 86400;
		$timeframe=$rightnow-$offset;
		$cnt = " (".uddeIMgetTrashcanCount($myself, $timeframe).")";
	}
	if ($uddeaction=="trashcan") {
		echo "<li class='uddeim-activemenu'><span>";
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_trashcan.gif' alt='"._UDDEIM_TRASHCAN."' />";
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_TRASHCAN;
		echo $cnt;
		echo "</span></li>\n";
	} else {
		if( ($config->trashrestriction==0) ||
			($config->trashrestriction==1 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
			($config->trashrestriction==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) ) {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_trashcan.gif' border='0' alt='"._UDDEIM_TRASHCAN."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_TRASHCAN;
			echo $cnt;
			echo "</a>";
			echo "</li>\n";
		}
	}

	$cnt = "";
	if ($config->showmenucount)
		$cnt = " (".uddeIMgetArchiveCount($myself).")";
	if ($uddeaction=="archive") {
		echo "<li class='uddeim-activemenu'><span>";
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_archive.gif' alt='"._UDDEIM_ARCHIVE."' />";
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_ARCHIVE;
		echo $cnt;
		echo "</span></li>\n";
	} else {
		if ($config->allowarchive) {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archive&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_archive.gif' border='0' alt='"._UDDEIM_ARCHIVE."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_ARCHIVE;
			echo $cnt;
			echo "</a>";
			echo "</li>\n";
		}
	}

	if ($uddeaction=="lists") {
		echo "<li class='uddeim-activemenu'><span>";
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_book.gif' alt='"._UDDEIM_LISTS."' />";
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_LISTS;
		echo "</span></li>\n";
	} else {
		if($config->allowmultiplerecipients &&
		   (($config->enablelists==1) ||
			($config->enablelists==2 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
			($config->enablelists==3 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) )
		  ) {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showlists&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_book.gif' border='0' alt='"._UDDEIM_LISTS."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_LISTS;
			echo "</a>";
			echo "</li>\n";
		}
	}

	if ($uddeaction=="settings") {
		if ($config->showsettingslink==1) {
			echo "<li class='uddeim-activemenu'><span>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_settings.gif' alt='"._UDDEIM_SETTINGS."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_SETTINGS;
			echo "</span></li>\n";
		}
	} else {
		$showsettings = 0;
		if ($config->showsettingslink==1) {
			if ($config->pubfrontend || $config->allowpopup || $config->blocksystem || 
				$config->allowemailnotify==1 || 
			   ($config->allowemailnotify==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))) ||
				$config->autoresponder==1 ||
			   ($config->autoresponder==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))) ||
				$config->autoforward==1 ||
			   ($config->autoforward==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) ||
			   ($config->autoforward==3 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) ||
			    $config->enablerss==1 || 
			   ($config->enablerss==2 && (uddeIMisAdmin($my_gid) || uddeIMisAdmin2($my_gid, $config))) )
				$showsettings = 1;
		}
		if ($showsettings) {
			echo "<li>";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=settings&Itemid=".$item_id)."'>";
			if ($config->showmenuicons==1 || $config->showmenuicons==2)
				echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_settings.gif' border='0' alt='"._UDDEIM_SETTINGS."' />";
			if ($config->showmenuicons==0 || $config->showmenuicons==1)
				echo _UDDEIM_SETTINGS;
			echo "</a>";
			echo "</li>\n";
		}
	}

	if ($uddeaction=="new") {
		echo "<li class='uddeim-activemenu'><span>";
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_new.gif' alt='"._UDDEIM_COMPOSE."' />";
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_COMPOSE;
		echo "</span></li>\n";
	} else {
		echo "<li>";
		echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=new&Itemid=".$item_id)."'>";
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/menu_new.gif' border='0' alt='"._UDDEIM_COMPOSE."' />";
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_COMPOSE;
		echo "</a>";
		echo "</li>\n";
	}
	
	// Add menu forum Kunena 
	if (uddeIMcheckKU() && in_array($config->showmenulink, array(5, 9, 11, 12))) {
		$cnt = ""; 
		echo "<li>"; 
		echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_kunena")."'>";
		// echo "<a href='/forum/recent' />"; 
		if ($config->showmenuicons==1 || $config->showmenuicons==2)
			echo "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/icon_next.gif' border='0' alt='"._UDDEIM_KUNENA_LINK."' />"; 
		if ($config->showmenuicons==0 || $config->showmenuicons==1)
			echo _UDDEIM_KUNENA_LINK;
		echo $cnt; 
		echo "</a>"; 
		echo "</li>\n"; 
	}
	// End of add menu forum Kunena

	echo "</ul></div>\n";
}
Esempio n. 2
0
function uddeIMrestoreMessage($myself, $messageid, $limit, $limitstart, $item_id, $config) {
	$my_gid = $config->usergid;

	if( ($config->trashrestriction==0) ||
	    ($config->trashrestriction==1 && (uddeIMisSpecial($my_gid) || uddeIMisSpecial2($my_gid, $config))) || 
	    ($config->trashrestriction==2 && (uddeIMisAdmin($my_gid)   || uddeIMisAdmin2($my_gid, $config))) ) {
		// ok trashcan enabled
	} else {
		$mosmsg=_UDDEADM_NOTRASHACCESS_NOT;
		uddeJSEFredirect("HTTP_REFERER", $mosmsg, "trashcan");
	}

	// to do: show error message when trying to restore message that has been purged or is no longer available
	$exists = uddeIMexistsMessage($messageid);
	if (!$exists) {
		$mosmsg = _UDDEIM_CANTRESTORE;
		uddeJSEFredirect("index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart, $mosmsg);
		return;
	}

	$total = uddeIMgetArchiveCount($myself);
	if ($config->inboxlimit && $config->allowarchive) {		// inbox + archive
		$total = uddeIMgetInboxArchiveCount($myself);
	}
	if ($total >= $config->maxarchive && !uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config)) {
//		echo "<p>"._UDDEIM_ARC_SAVED_1.$total._UDDEIM_ARC_SAVED_2."</p>\n";
//		echo "<p>"._UDDEIM_ARC_SAVED_3."</p>\n";
		$mosmsg = _UDDEIM_LIMITREACHED;
		uddeJSEFredirect("index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart, $mosmsg);
	}

	// WAS: check if the deleted message was in the archive,  but the archive in not longer enabled, so deny access to the message
	// NOW: check if the deleted message was in the archive,  but the archive in not longer enabled, so unarchive message
	$isarchived = uddeIMgetArchivedFromTrashedMessage($myself, $messageid);
	if(!$config->allowarchive && $isarchived) {
		uddeIMupdateArchived($messageid, 0);
	}

	uddeIMrestoreMessageToInboxOutboxArchive($myself, $messageid);
	uddeJSEFredirect("index.php?option=com_uddeim&task=trashcan&Itemid=".$item_id."&limit=".$limit."&limitstart=".$limitstart);
}
Esempio n. 3
0
function uddeIMarchiveMessage ($myself, $item_id, $messageid, $cryptpass, $config) {

	$my_gid = $config->usergid;

	if (!$config->allowarchive) {
		$mosmsg=_UDDEIM_ARCHIVENOTENABLED;
		uddeJSEFredirect("HTTP_REFERER", $mosmsg, "archive");
	}
	
	$exists = uddeIMexistsMessageToUser($myself, $messageid);
	if(!$exists) {
		$mosmsg=_UDDEIM_ARCHIVE_ERROR." (ERR: no message found)"; // debug
		uddeJSEFredirect("HTTP_REFERER", $mosmsg, "archive");
	}
	
	// is the message already saved in archive? 
	$isarchived = uddeIMgetArchived($messageid);
	if($isarchived) {
		$mosmsg=_UDDEIM_MESSAGE_ARCHIVED;
		uddeJSEFredirect("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$messageid, $mosmsg);
	}

	$total = uddeIMgetArchiveCount($myself);
	if ($total>=$config->maxarchive && !uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config)) {
//		echo "<p>"._UDDEIM_ARC_SAVED_1.$total._UDDEIM_ARC_SAVED_2."</p>\n";
//		echo "<p>"._UDDEIM_ARC_SAVED_3."</p>\n";
		$mosmsg = _UDDEIM_ARCHIVEFULL;
//		uddeJSEFredirect("HTTP_REFERER", $mosmsg, "archive");
		uddeJSEFredirect("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$messageid, $mosmsg);
	}

	uddeIMupdateArchivedToid($myself, $messageid, 1);

	// redirect to archived message
	$mosmsg=_UDDEIM_MESSAGE_ARCHIVED;
	uddeJSEFredirect("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$messageid, $mosmsg);
}