Example #1
0
function uddeIMreplySuggestion($decryptedmessage, $displaymessage, $fromname, $toname, $isforward, $box, $config) {
	$replysuggest = stripslashes($decryptedmessage);
	// if allowed to contain bbcodes they should be stripped for the reply quote
	if ($displaymessage->systemflag || $config->allowbb)
		$replysuggest = uddeIMbbcode_strip($replysuggest);

	if ($box=="outbox") {
		if ($isforward && $config->allowforwards) {
			$fromname = uddeIMgetNameFromID($displaymessage->fromid, $config);
			if ($config->allowbb)
				$replysuggest="[i]"._UDDEIM_FWDFROM." ".$fromname." "._UDDEIM_FWDTO." ".$toname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):[/i]\n\n".$replysuggest;
			else
				$replysuggest=""._UDDEIM_FWDFROM." ".$fromname." "._UDDEIM_FWDTO." ".$toname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):\n\n".$replysuggest;
		}
	} else {
		if ($isforward && $config->allowforwards) {
			if ($displaymessage->toid!=$displaymessage->fromid) { 		// not a copy to myself
				$toname = uddeIMgetNameFromID($displaymessage->toid, $config);
				if ($config->allowbb)
					$replysuggest="[i]"._UDDEIM_FWDFROM." ".$fromname." "._UDDEIM_FWDTO." ".$toname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):[/i]\n\n".$replysuggest;
				else
					$replysuggest=""._UDDEIM_FWDFROM." ".$fromname." "._UDDEIM_FWDTO." ".$toname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):\n\n".$replysuggest;
			} else {	// its a copy2me
				$toname = uddeIMgetNameFromID($displaymessage->toid, $config);
				if ($config->allowbb)
					$replysuggest="[i]"._UDDEIM_FWDFROM." ".$toname." ".$fromname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):[/i]\n\n".$replysuggest;
				else
					$replysuggest=""._UDDEIM_FWDFROM." ".$toname." ".$fromname." (".uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ())."):\n\n".$replysuggest;
			}
		}
	}
	$replytomessage = "\n\n\n\n".$config->quotedivider."\n".$replysuggest;

	if ($config->maxlength) {
		if (uddeIM_utf8_strlen($config->languagecharset, $replytomessage)+3>=$config->maxlength) {
			$mlength = $config->maxlength * 2 / 3;
			$replytomessage = uddeIM_utf8_substr($config->languagecharset, $replytomessage,0,$mlength)."...";
		}
	}
	return $replytomessage;
}
Example #2
0
function uddeIMarchiveDownload($myself, $item_id, $arcmes, $limit, $limitstart, $cryptpass, $config) {
	$mosConfig_sitename = uddeIMgetSitename();
	
	// if e-mail traffic stopped, don't send.
	if (!$config->emailtrafficenabled) {
		$mosmsg = _UDDEIM_STOPPEDEMAIL;
		uddeJSEFredirect("index.php?option=com_uddeim&task=archive&Itemid=".$item_id, $mosmsg);
	}
	
	if (!$config->allowarchive || !$config->enabledownload) {
		$mosmsg = _UDDEIM_ARCHIVENOTENABLED;
		uddeJSEFredirect("HTTP_REFERER", $mosmsg, "archive");
	}

	$n = count($arcmes);
	if(!$n) {
		echo _UDDEIM_NOMSGSELECTED."<br /><a href='javascript:history.go(-1)'>"._UDDEIM_BACK."</a>";
		return;
	}

	$clrf=chr(10);
	$rightnow=uddetime($config->timezone);
	
	$htmlstring="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>";
	$htmlstring.=$mosConfig_sitename." "._UDDEIM_MESSAGEDOWNLOAD;
	$htmlstring.="</title></head><body><h2>";
	$htmlstring.=_UDDEIM_MESSAGEDOWNLOAD." - ".$mosConfig_sitename;
	$htmlstring.="</h2><h4>".uddeLdate($rightnow, $config, uddeIMgetUserTZ())."</h4><!-- generated by uddeIM messaging component --><table cellspacing=0 cellpadding=4 border=0>";
	
	$exportstring=_UDDEIM_MESSAGEDOWNLOAD." - ".$mosConfig_sitename.$clrf;
	$exportstring.=uddeLdate($rightnow, $config, uddeIMgetUserTZ());
	$exportstring.=$clrf.$clrf.$clrf;
	
	$maindivider="================================================================================".$clrf;
	
	$exportstring.=$maindivider;
	
	for($i = 0; $i <= ($n-1); $i++)	{

		$trashs = uddeIMselectArchiveMessage($myself, $arcmes[$i], $config);
		foreach($trashs as $trash) {

			$fromname = uddeIMevaluateUsername($trash->fromname, $trash->fromid, $trash->publicname);
			if($trash->systemflag)
				$fromname = $trash->systemmessage;

			// $headstring.=" (".uddeLdate($trash->datum, $config, uddeIMgetUserTZ()).")";
			// $headdivider=str_repeat("=", strlen($headstring));
			// $exportstring.="     ".$headstring.$clrf."     ".$headdivider.$clrf.$clrf;
			$cm = uddeIMgetMessage($trash->message, $cryptpass, $trash->cryptmode, $trash->crypthash, $config->cryptkey);
	
			$dlmsg = stripslashes($cm);
			$dlmsg = uddeIMbbcode_strip($dlmsg);
			// $exportstring.=stripslashes($dlmsg);
			// $exportstring.=$clrf.$clrf.$clrf.$clrf;
			// $exportstring.=$maindivider;
			$exportstring.=_UDDEIM_EXPORT_FORMAT;
			$exportstring=str_replace("%user%", $fromname, $exportstring);
			$exportstring=str_replace("%msgdate%", uddeLdate($trash->datum, $config, uddeIMgetUserTZ()), $exportstring);
			$exportstring=str_replace("%msgbody%", $dlmsg, $exportstring);				
		
			$htmlstring.="\n\t<tr bgcolor=#cccccc><td><strong>".$fromname."</strong></td><td align=right>".uddeLdate($trash->datum, $config, uddeIMgetUserTZ())."</td></tr><tr><td>&nbsp;</td><td>";
			$htmlstring.=nl2br(stripslashes($dlmsg));
			$htmlstring.="</td></tr>";
		}
	}
	$htmlstring.="\n</table>\n</body>\n</html>\n";
	
	// we now have $exportstring and $htmlstring (text and html respecitvely) as files with all checked messages (in arcmes[])
//	$ret = uddeIMgetNameEmailFromID($myself, $var_toname, $var_tomail, $config);
	$var_toname = uddeIMgetNameFromID($myself, $config);
	$var_tomail = uddeIMgetEMailFromID($myself, $config);

	if (!$var_tomail) {
		$mosmsg = _UDDEIM_EXPORT_COULDNOTSEND;
		uddeJSEFredirect("index.php?option=com_uddeim&task=archive&Itemid=".$item_id, $mosmsg);
	}
	if (!$var_toname)
		$var_toname = "Anonymous";

	$subject = $mosConfig_sitename." "._UDDEIM_MESSAGEDOWNLOAD;
	$var_fromname = $config->emn_sendername;
	$var_frommail = $config->emn_sendermail;

	if(uddeIMsendmail($var_fromname, $var_frommail, $var_toname, $var_tomail, $subject, $exportstring, "", "", "", $config)) {
		$mosmsg = _UDDEIM_EXPORT_MAILED;
	} else {
		$mosmsg = _UDDEIM_EXPORT_COULDNOTSEND;
	}
	uddeJSEFredirect("index.php?option=com_uddeim&task=archive&Itemid=".$item_id, $mosmsg);
}
Example #3
0
function uddeIMshowOutmessage($myself, $item_id, $messageid, $isforward, $cryptpass, $config) {
	global $uddeicons_onlinepic, $uddeicons_offlinepic, $uddeicons_readpic, $uddeicons_unreadpic;

	$my_gid = $config->usergid;

	$displaymessages = uddeIMselectOutboxMessage($myself, $messageid, $config, 0);

	if(count($displaymessages)<1) {
		echo _UDDEIM_MESSAGENOACCESS;
		return;
	}

	// write the uddeim menu
	uddeIMprintMenu($myself, 'showOutmessage', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	foreach($displaymessages as $displaymessage) {

		$msgread=$displaymessage->toread;

		$toname = uddeIMevaluateUsername($displaymessage->toname, $displaymessage->toid, $displaymessage->publicname);

		// CRYPT
		$cm = uddeIMgetMessage($displaymessage->message, $cryptpass, $displaymessage->cryptmode, $displaymessage->crypthash, $config->cryptkey);

		// echo str_replace("&amp;#", "&#", nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset)));
		$dmessage = nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset));
		$dmessage = str_replace("&amp;#", "&#", $dmessage); // unicode workaround
		$dmessage = str_replace("&amp;&lt;/br&gt;", "</br>", $dmessage);

		// if system message or bbcodes allowed, call parser
		if ($displaymessage->systemflag || $config->allowbb)
			$dmessage=uddeIMbbcode_replace($dmessage, $config);
		if ($config->allowsmile)
			$dmessage=uddeIMsmile_replace($dmessage, $config);
		$bodystring=$dmessage;
		
		$replytomessage = uddeIMreplySuggestion($cm, $displaymessage, "", $toname, $isforward, "outbox", $config);
		// We used an placeholder above to insert the "reply suggestion" for the "mailto:" link
		$urlbody = rawurlencode($replytomessage);

		// display the message
		$headerstring="<table class='innermost'><tr>";

		// does CB have a thumbnail image of the receiver?
		if ($config->showcbpic && $displaymessage->toname || $config->gravatar) {
			$topic = uddeIMgetPicOnly($displaymessage->toid, $config);
			if ($topic)
				$headerstring.="<td valign='top' rowspan='2'>".$topic."</td>\n";
		}

		$headerstring.="<td valign='top' width='99%'><div class='uddeim-messagefrom'>";
		$headerstring.=_UDDEIM_MESSAGETO;

		// show links ???
		$temp = $toname;
		if ($config->showcblink && $displaymessage->toname) {
			$temp = uddeIMgetLinkOnly($displaymessage->toid, $toname, $config);
		}
		// display email address
		if ($displaymessage->toname==NULL && !$displaymessage->toid && $displaymessage->publicemail!=NULL)
			$temp .= " &lt;<a href='mailto:".$displaymessage->publicemail."?body=".$urlbody."'>".$displaymessage->publicemail."</a>&gt;";
		$headerstring.=$temp;

		// is this user currently online?
		if ($config->showonline && $displaymessage->toname) {
			$isonline = uddeIMisOnline($displaymessage->toid);
			if($isonline)
				$headerstring.="&nbsp;".$uddeicons_onlinepic;
			else
				$headerstring.="&nbsp;".$uddeicons_offlinepic;
		}

		$headerstring.="<br />";
		$headerstring.=uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ());
		$headerstring.="</div></td><td valign='top' rowspan='2'><span class='uddeim-clear'>&nbsp;</span><ul>";

		// show delete links
		if ($config->allowforwards) {
			if ($displaymessage->cryptmode==2 || $displaymessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
			   $headerstring.="<li class='uddeim-messageactionlink-forward'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutboxpass&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_FORWARDLINK."</a></li>\n";
			} else {	// normal message
			   $headerstring.="<li class='uddeim-messageactionlink-forward'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardoutbox&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_FORWARDLINK."</a></li>\n";
			}
		}
		if (!$displaymessage->totrashoutbox) { // but only if not already moved to trash
			$headerstring.="<li class='uddeim-messageactionlink-delete'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=deletefromoutbox&Itemid=".$item_id."&ret=top&messageid=".$displaymessage->id)."'>"._UDDEIM_DELETELINK."</a></li>\n";
		}
		if (!$displaymessage->toread) {	// if not read then a recall is possible
			if ($displaymessage->cryptmode==2 || $displaymessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
			    $headerstring.="<li class='uddeim-messageactionlink-recall'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recallpass&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_RECALL."</a></li>\n";
			} else {	// normal message
			    $headerstring.="<li class='uddeim-messageactionlink-recall'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recall&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_RECALL."</a></li>\n";
			}
		}

		$headerstring.="</ul></td>";
		$headerstring.="</tr>";
		$msgnavigation = "&nbsp;";

		if ($config->enablereply) {
			$msgnavigation = "";
			$pathtosite = uddeIMgetPath('live_site');
			$pic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/envelope.gif' alt='"._UDDEIM_PMNAV_EXISTS."' title='"._UDDEIM_PMNAV_EXISTS."' />";
			$picdel = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/envelope_deleted.gif' alt='"._UDDEIM_PMNAV_DELETED."' title='"._UDDEIM_PMNAV_DELETED."' />";

			$replyid = $displaymessage->replyid;
			if ($replyid) {
				$msgnavigation .= _UDDEIM_PMNAV_THISISARESPONSE;

				$orig = uddeIMselectInboxMessage($myself, $replyid, $config, 0);
				$temp = Array();
				foreach($orig as $or)
					$temp = $or;
				$orig = $temp;

				if (count($orig)>0) {		// the message should be stored in the outbox
					if ($orig->cryptmode==2 || $orig->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showpass&Itemid=".$item_id."&messageid=".$replyid)."'>".$pic."</a>";
					} else {					// normal message
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$replyid)."'>".$pic."</a>";
					}
				} else {
					$msgnavigation .= " ".$picdel;
				}
			}

			$repls = uddeIMselectMessageReplies($displaymessage->id, 'inbox', $myself);
			if (count($repls)>0) {
				$msgnavigation .= "<br />";
				$msgnavigation .= _UDDEIM_PMNAV_THEREARERESPONSES;
				foreach($repls as $repl) {
					if ($repl->cryptmode==2 || $repl->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=showpass&Itemid=".$item_id."&messageid=".$repl->id)."'>".$pic."</a>";
					} else {					// normal message
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=show&Itemid=".$item_id."&messageid=".$repl->id)."'>".$pic."</a>";
					}
					$msgnavigation .= " ";
				}
			}
		}

		$headerstring.="<tr><td valign='bottom'><div class='uddeim-messagefrom'>".trim($msgnavigation)."</div></td></tr>";
		$headerstring.="</table>";

		if (!$isforward) {
			echo "<div class='uddeim-messageheader'>".$headerstring."</div>";
			echo "<div class='uddeim-messagebody'>".uddeIMreplyquoteMarkup($bodystring,$config->quotedivider)."</div>";

			// UDDEIMFILE
			if( $config->enableattachment )	// Always show attachments when attachments are enabled
				uddeIMshowAttachments("outbox", $item_id, $displaymessage->id, $config);
		}
	
		$trashmessage = $displaymessage->totrashoutbox;
	}
	
	if ($config->inboxlimit) {				// there is a limit for inbox + archive
		if ($config->allowarchive) {		// have an archive and an "archive and inbox" limit, so get number of messages in inbox and archive
			$universeflag = _UDDEIM_ARC_UNIVERSE_BOTH;	// inbox and archive
			$total = uddeIMgetInboxArchiveCount($myself);
		} else {							// user has switched off archive but there is an limit for "inbox", so count inbox messages only
			$universeflag = _UDDEIM_ARC_UNIVERSE_INBOX;	// inbox
			$total = uddeIMgetInboxCount($myself);
		}
	
		// "You have XX messages in your inbox/inbox+archive."
		$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
		$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
		$limitreached.= $universeflag;

		if (!uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config) && ($isforward && $config->allowforwards)) {		// so the warning is only displayed when a forward is possible
			// "The allowed maximum is XX."
			// $limitreached.= _UDDEIM_INBOX_LIMIT_3." ".$config->maxarchive.". ";
			$limitreached.= " "._UDDEIM_SHOWINBOXLIMIT_2." ".$config->maxarchive.").";	// (of max. )

			if ($total > $config->maxarchive) {
				// "You have XX messages in your inbox/inbox+archive."
				$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
				$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
				$limitreached.= $universeflag;
				// You can still receive and read messages but you will not be able to reply or to compose new ones until you delete messages.
				$limitwarning = _UDDEIM_INBOX_LIMIT_4;

				$showinboxlimit_borderbottom = "<span class='uddeim-warning'>";
				$showinboxlimit_borderbottom.= $limitreached." ";
				$showinboxlimit_borderbottom.= $limitwarning;
				$showinboxlimit_borderbottom.= "</span>";
				echo "<div id='uddeim-bottomlines'>".$showinboxlimit_borderbottom."</div>";
				// close main container
				echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $limitreached, $config)."</div>\n";
				return;
			}
		}
	}

	

	if ($isforward && $config->allowforwards) {	// it is a forward 
		// show reply form
		if(!$trashmessage) { // but only if not already moved to trash
			$tbackto = uddeIMmosGetParam($_SERVER, 'HTTP_REFERER', null);
			if(stristr($tbackto, "com_uddeim")) {
				$tbackto="";
			}
			uddeIMdrawWriteform($myself, $my_gid, $item_id, $tbackto, "", $replytomessage, 0, 0, 0, 0, $config);
		} else {
			// offer recycle link
			echo "<div id='uddeim-bottomlines'>"._UDDEIM_YOUMOVEDTOTRASH;
			echo "<br />";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=restore&Itemid=".$item_id."&messageid=".$replytoid)."'>"._UDDEIM_RESTORE."</a></div>\n";
		}
	}
	
	// recall link if unread
	if (!$msgread) {
		echo "<div id='uddeim-bottomlines'>";
		if ($displaymessage->cryptmode==2 || $displaymessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recallpass&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_RECALLTHISMESSAGE."</a>";
		} else {								// normal message
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=recall&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_RECALLTHISMESSAGE."</a>";
		}
		echo "</div>\n";
	}
	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
}
Example #4
0
function uddeIMshowMessage($myself, $item_id, $messageid, $isforward, $cryptpass, $config) {
	global $uddeicons_onlinepic, $uddeicons_offlinepic, $uddeicons_readpic, $uddeicons_unreadpic;

	$my_gid = $config->usergid;

	$displaymessages = uddeIMselectInboxMessage($myself, $messageid, $config, 0);

	if (count($displaymessages)<1) {
		echo _UDDEIM_MESSAGENOACCESS;
		return;
	}

	// write the uddeim menu
	uddeIMprintMenu($myself, 'showMessage', $item_id, $config);
	echo "<div id='uddeim-m'>\n";

	foreach($displaymessages as $displaymessage) {

		$is_spam = 0;
		if ($config->reportspam)		// save one database query if possible
			$is_spam = uddeIMgetSpamStatus($messageid);

		$fromname = uddeIMevaluateUsername($displaymessage->fromname, $displaymessage->fromid, $displaymessage->publicname);
		if ($displaymessage->systemflag)
			$fromname = $displaymessage->systemmessage;

		$personalsys = 0;
		if ($displaymessage->systemflag && $displaymessage->systemmessage==$displaymessage->fromname)
			$personalsys = 1;

		// CRYPT
		$cm = uddeIMgetMessage($displaymessage->message, $cryptpass, $displaymessage->cryptmode, $displaymessage->crypthash, $config->cryptkey);

		// echo str_replace("&amp;#", "&#", nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset)));
		$dmessage = nl2br(htmlspecialchars(stripslashes($cm), ENT_QUOTES, $config->charset));
		$dmessage = str_replace("&amp;#", "&#", $dmessage);		// unicode workaround
		$dmessage = str_replace("&amp;&lt;/br&gt;", "</br>", $dmessage);
		
		// if system message or bbcodes allowed, call parser
		if ($displaymessage->systemflag || $config->allowbb)
			$dmessage = uddeIMbbcode_replace($dmessage, $config);
		if ($config->allowsmile)
			$dmessage = uddeIMsmile_replace($dmessage, $config);
		$bodystring = $dmessage;			// converted message for email body

		$replytomessage = "";
		if ($config->replytext)
			$replytomessage = uddeIMreplySuggestion($cm, $displaymessage, $fromname, "", $isforward, "inbox", $config);
		// We used an placeholder above to insert the "reply suggestion" for the "mailto:" link
		$urlbody = rawurlencode($replytomessage);

		// display the message
		$headerstring="<table class='innermost'><tr>";

		// does CB have a thumbnail image of the sender?
		if ($config->showcbpic && $displaymessage->fromname || $config->gravatar) {
			$frompic = uddeIMgetPicOnly($displaymessage->fromid, $config);
			if ($frompic && ($personalsys || !$displaymessage->systemflag))
				$headerstring.="<td valign='top' rowspan='2'>".$frompic."</td>\n";
		}

		$headerstring.="<td valign='top' width='99%'><div class='uddeim-messagefrom'>";
		if ($displaymessage->toid!=$displaymessage->fromid) { // not a copy to myself
			$headerstring.=_UDDEIM_MESSAGEFROM;
		} else {
			// $headerstring.=_UDDEIM_MESSAGE." ";			// BUGBUG: "Message admin"   -   sollte besser "Copy to yourself" sein
			if ( 0 == strncasecmp($displaymessage->systemmessage, _UDDEIM_TO_SMALL." ", strlen(_UDDEIM_TO_SMALL)+1 ) )
				$headerstring.=_UDDEIM_MESSAGE." ";			// systemmsg is "to XXX", so suppress the from (copy2me)
			else
				$headerstring.=_UDDEIM_MESSAGEFROM." ";		// systemmsg is a name
		}

		// show links ???
		$temp = $fromname;
		if ($config->showcblink && $displaymessage->fromname) {
			if (!$displaymessage->systemflag || $personalsys) {
				$temp = uddeIMgetLinkOnly($displaymessage->fromid, $fromname, $config);
			}
		}
		// display email address
		if ($displaymessage->fromname==NULL && !$displaymessage->fromid && $displaymessage->publicemail!=NULL)
			$temp .= " &lt;<a href='mailto:".$displaymessage->publicemail."?body=".$urlbody."'>".$displaymessage->publicemail."</a>&gt;";
		$headerstring.=$temp;

		// is this user currently online?
		if ($config->showonline && $displaymessage->fromname) {
			if (!$displaymessage->systemflag || $personalsys) {
				$isonline = uddeIMisOnline($displaymessage->fromid);
				if ($isonline)
					$headerstring.="&nbsp;".$uddeicons_onlinepic;
				else
					$headerstring.="&nbsp;".$uddeicons_offlinepic;
			}
		}

		$headerstring.="<br />";
		$headerstring.=uddeLdate($displaymessage->datum, $config, uddeIMgetUserTZ());
		$headerstring.="</div></td><td valign='top'><span class='uddeim-clear'>&nbsp;</span><ul>";

		// show delete & block links
		if ($config->allowforwards) {
			if ($displaymessage->cryptmode==2 || $displaymessage->cryptmode==4) {	// Message is encrypted, so go to enter password page
			   $headerstring.="<li class='uddeim-messageactionlink-forward'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forwardpass&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_FORWARDLINK."</a></li>\n";
			} else {	// normal message
			   $headerstring.="<li class='uddeim-messageactionlink-forward'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=forward&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_FORWARDLINK."</a></li>\n";
			}
		}
		if (!$displaymessage->archived && $config->allowarchive)
			$headerstring.="<li class='uddeim-messageactionlink-archive'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=archivemessage&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_STORE."</a></li>\n";
		if ( $displaymessage->archived && $config->allowarchive)
			$headerstring.="<li class='uddeim-messageactionlink-archive'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unarchive&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_UNARCHIVE."</a></li>\n";
		if (!$displaymessage->totrash) { // but only if not already moved to trash
			$headerstring.="<li class='uddeim-messageactionlink-delete'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=delete&Itemid=".$item_id."&ret=top&messageid=".$displaymessage->id)."'>"._UDDEIM_DELETELINK."</a></li>\n";
			if ($config->blocksystem && !$displaymessage->systemflag && $displaymessage->fromid) {
				$headerstring.="<li class='uddeim-messageactionlink-block'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=blockuser&Itemid=".$item_id."&recip=".$displaymessage->fromid)."'>"._UDDEIM_BLOCKNOW."</a></li>\n";
			}
		}

		if ($config->reportspam) {		// uddeIMcheckPlugin('spamcontrol') &&  not required since uddeIMcheckConfig sets this 0 if plugin is missing
			if ($is_spam)
				$headerstring.="<br /><li class='uddeim-messageactionlink-spam'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=unreportspam&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_SPAMCONTROL_UNREPORT."</a></li>";
			else
				$headerstring.="<br /><li class='uddeim-messageactionlink-spam'><a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=reportspam&Itemid=".$item_id."&messageid=".$displaymessage->id)."'>"._UDDEIM_SPAMCONTROL_REPORT."</a></li>";
		}

		$headerstring.="</ul>";
		$headerstring.="</td>";
		$headerstring.="</tr>";

		$msgnavigation = "&nbsp;";
		if ($config->enablereply) {
			$msgnavigation = "";
			$pathtosite = uddeIMgetPath('live_site');
			$pic = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/envelope.gif' alt='"._UDDEIM_PMNAV_EXISTS."' title='"._UDDEIM_PMNAV_EXISTS."' />";
			$picdel = "<img src='".$pathtosite."/components/com_uddeim/templates/".$config->templatedir."/images/envelope_deleted.gif' alt='"._UDDEIM_PMNAV_DELETED."' title='"._UDDEIM_PMNAV_DELETED."' />";

			$replyid = $displaymessage->replyid;
			if ($replyid) {
				$msgnavigation .= _UDDEIM_PMNAV_THISISARESPONSE;
				$copy2me = ($displaymessage->toid==$displaymessage->fromid && $displaymessage->fromid==$myself);

				if ($copy2me) // this is a copy2me message, so the original is also stored in inbox
					$orig = uddeIMselectInboxMessage($myself, $replyid, $config, 0);
				else
					$orig = uddeIMselectOutboxMessage($myself, $replyid, $config, 0);
				$temp = Array();
				foreach($orig as $or)
					$temp = $or;
				$orig = $temp;

				if (count($orig)>0) {		// the message should be stored in the outbox
					$goto = "showout";
					$c2me = "";
					if ($copy2me) // this is a copy2me message, so the original is also stored in inbox
						$goto = "show";
					if ($orig->cryptmode==2 || $orig->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=".$goto."pass&Itemid=".$item_id."&messageid=".$replyid)."'>".$pic."</a>";
					} else {					// normal message
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=".$goto."&Itemid=".$item_id."&messageid=".$replyid)."'>".$pic."</a>";
					}
				} else {
					$msgnavigation .= " ".$picdel;
				}
			}

			$repls = uddeIMselectMessageReplies($displaymessage->id, 'outbox', $myself);
			if (count($repls)>0) {
				$msgnavigation .= "<br />";
				$msgnavigation .= _UDDEIM_PMNAV_THEREARERESPONSES;
				foreach($repls as $repl) {
					$goto = "showout";
					$c2me = "";
					if ($repl->toid==$repl->fromid)	{	// copy2me are stored in the inbox
						$goto = "show";
						$c2me = " "._UDDEIM_PMNAV_COPY2ME;		// BUGBUG
					}
					if ($repl->cryptmode==2 || $repl->cryptmode==4) {	// Message is encrypted, so go to enter password page
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=".$goto."pass&Itemid=".$item_id."&messageid=".$repl->id)."'>".$pic."</a>".$c2me;
					} else {					// normal message
						$msgnavigation .= " <a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=".$goto."&Itemid=".$item_id."&messageid=".$repl->id)."'>".$pic."</a>".$c2me;
					}
					$msgnavigation .= " ";
				}
			}
		}

		$headerstring.="<tr>";
		$headerstring.="<td valign='bottom'><div class='uddeim-messagefrom'>".trim($msgnavigation)."</div></td>";

		$headerstring.="<td valign='bottom'>";
		if ($config->reportspam) {		// uddeIMcheckPlugin('spamcontrol') &&  not required since uddeIMcheckConfig sets this 0 if plugin is missing
			if ($is_spam)
				$headerstring.="<div class='uddeim-messagefrom-spam'>"._UDDEIM_SPAMCONTROL_MARKED."</div>";
		}
		$headerstring.="</td>";

		$headerstring.="</tr>";
		$headerstring.="</table>";

		// output the message

		if (!$isforward) {
			echo "<div class='uddeim-messageheader'>".$headerstring."</div>";
			echo "<div class='uddeim-messagebody'>".uddeIMreplyquoteMarkup($bodystring,$config->quotedivider)."</div>";
			// UDDEIMFILE
			if( $config->enableattachment )	// Always show attachments when attachments are enabled
				uddeIMshowAttachments("inbox", $item_id, $displaymessage->id, $config);
		}

		$trashmessage = $displaymessage->totrash;
		$to_id 		  = $displaymessage->fromid;
		$replytoid 	  = $displaymessage->id;
		$disablereply = $displaymessage->disablereply;
		
		// now check, if we can send a reply
		if (!$config->pubreplies) {				// we do not allow replies to public users, so check if it is a public user
			if ( uddeIMisPublicUser($displaymessage->fromname,$displaymessage->fromid) )	// it is $displaymessage->fromname which specifies if it is a public user or not
				$disablereply = 1;
		} else {								// we allow replies to public users, so check if it is a public user...
			if ( uddeIMisPublicUser($displaymessage->fromname,$displaymessage->fromid) && 
							(!$displaymessage->publicemail || $displaymessage->publicemail==NULL))
				$disablereply = 1;				// ..its a public user and there is no email address given, we could send a reply to
		}
		if ( uddeIMisDeletedUser($displaymessage->fromname,$displaymessage->fromid) )
			$disablereply = 1;					// ..its a deleted user so disable replies
		if ($displaymessage->archived)
			$disablereply = 1;					// ..no reply to archived messages

		if ($displaymessage->fromid==$myself &&
		    $displaymessage->fromid==$displaymessage->toid)
			$disablereply = 1;					// ...no reply to copy2me messages
	}

	// read flag set to true, but only when its a forward
	if (!$isforward)
		uddeIMupdateToread($myself, $displaymessage->id, 1);

	if ($config->inboxlimit) {				// there is a limit for inbox + archive
		if ($config->allowarchive) {		// have an archive and an "archive and inbox" limit, so get number of messages in inbox and archive
			$universeflag = _UDDEIM_ARC_UNIVERSE_BOTH;	// inbox and archive
			$total = uddeIMgetInboxArchiveCount($myself);
		} else {							// user has switched of archive but there is an limit for "inbox and archive", so count inbox messages only
			$universeflag = _UDDEIM_ARC_UNIVERSE_INBOX;	// inbox
			$total = uddeIMgetInboxCount($myself);
		}
	
		// "You have XX messages in your inbox/inbox+archive."
		$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
		$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
		$limitreached.= $universeflag;

		if (!uddeIMisAdmin($my_gid) && !uddeIMisAdmin2($my_gid, $config) && (!$disablereply || ($isforward && $config->allowforwards))) {		// so the warning is only displayed when a forward or reply is possible
			// "The allowed maximum is XX."
			// $limitreached.= _UDDEIM_INBOX_LIMIT_3." ".$config->maxarchive.". ";
			$limitreached.= " "._UDDEIM_SHOWINBOXLIMIT_2." ".$config->maxarchive.").";	// (of max. )

			if ($total > $config->maxarchive) {
				// "You have XX messages in your inbox/inbox+archive."
				$limitreached = _UDDEIM_INBOX_LIMIT_1." ".$total;
				$limitreached.= " ".($total==1 ? _UDDEIM_INBOX_LIMIT_2_SINGULAR : _UDDEIM_INBOX_LIMIT_2)." ";
				$limitreached.= $universeflag;
				// You can still receive and read messages but you will not be able to reply or to compose new ones until you delete messages.
				$limitwarning = _UDDEIM_INBOX_LIMIT_4;

				$showinboxlimit_borderbottom = "<span class='uddeim-warning'>";
				$showinboxlimit_borderbottom.= $limitreached." ";
				$showinboxlimit_borderbottom.= $limitwarning;
				$showinboxlimit_borderbottom.= "</span>";
				echo "<div id='uddeim-bottomlines'>".$showinboxlimit_borderbottom."</div>";
				// close main container
				echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', $limitreached, $config)."</div>\n";
				return;
			}
		}
	}

	

	if (($isforward && $config->allowforwards) || !$disablereply) {	// it is a forward or you can reply to the message
		// show reply form
		if(!$trashmessage) { // but only if not already moved to trash
			// echo "<div id='uddeim-writeform'><b>"._UDDEIM_REPLY."</b><br />";
			// which page did refer to this "show Message" page? we want to send back the user where he came from
			$tbackto = uddeIMmosGetParam($_SERVER, 'HTTP_REFERER', null);
			if(stristr($tbackto, "com_uddeim")) {
				$tbackto="";
			}
			if ($isforward && $config->allowforwards) {		// it is a forward, so allow selecting a recipient
				uddeIMdrawWriteform($myself, $my_gid, $item_id, $tbackto, "", $replytomessage, 0, 0, 0, 0, $config);
			} else {										// it is a reply, so reply to $to_id {
				uddeIMdrawWriteform($myself, $my_gid, $item_id, $tbackto, $to_id, $replytomessage, $replytoid, 1, 0, 0, $config); // isreply, errorcode, sysmsg
			}
		} else {
			// offer restore link
			echo "<div id='uddeim-bottomlines'>"._UDDEIM_YOUMOVEDTOTRASH;
			echo "<br />";
			echo "<a href='".uddeIMsefRelToAbs("index.php?option=com_uddeim&task=restore&Itemid=".$item_id."&messageid=".$replytoid)."'>"._UDDEIM_RESTORE."</a></div>\n";
		}
	} else {
		// don't allow replies ($disablereply)
		if ($displaymessage->archived)
			echo "<div id='uddeim-bottomlines'>"._UDDEIM_CANTREPLYARCHIVE."</div>\n";
		else
			echo "<div id='uddeim-bottomlines'>"._UDDEIM_CANTREPLY."</div>\n";
	}
	// close container
	echo "</div>\n<div id='uddeim-bottomborder'>".uddeIMcontentBottomborder($myself, $item_id, 'standard', 'none', $config)."</div>\n";
}
Example #5
0
function uddeIMbackupRestoreConfig($option, $task, $act, $pathtoadmin, $config) {
	$database = uddeIMgetDatabase();
	if ($act=="backup") {
		$backup = array();
		$backup['_backupdate']					= uddeLdate(uddetime($config->timezone), $config, uddeIMgetUserTZ());
		$backup['version'] 						= $config->version;
		$backup['cryptkey'] 					= $config->cryptkey;
		$backup['datumsformat'] 				= $config->datumsformat;
		$backup['ldatumsformat'] 				= $config->ldatumsformat;
		$backup['emn_sendermail'] 				= $config->emn_sendermail;
		$backup['emn_sendername'] 				= $config->emn_sendername;
		$backup['sysm_username'] 				= $config->sysm_username;
		$backup['charset'] 						= $config->charset;
		$backup['mailcharset'] 					= $config->mailcharset;
		$backup['emn_body_nomessage'] 			= $config->emn_body_nomessage;
		$backup['emn_body_withmessage'] 		= $config->emn_body_withmessage;
		$backup['emn_forgetmenot'] 				= $config->emn_forgetmenot;
		$backup['export_format'] 				= $config->export_format;
		$backup['showtitle'] 					= $config->showtitle;
		$backup['templatedir'] 					= $config->templatedir;
		$backup['quotedivider'] 				= $config->quotedivider;
		$backup['blockgroups'] 					= $config->blockgroups;
		$backup['pubblockgroups'] 				= $config->pubblockgroups;
		$backup['hideusers'] 					= $config->hideusers;
		$backup['pubhideusers'] 				= $config->pubhideusers;
		$backup['attachmentgroups'] 			= $config->attachmentgroups;
		$backup['recaptchaprv'] 				= $config->recaptchaprv;
		$backup['recaptchapub'] 				= $config->recaptchapub;
		$backup['allowedextensions'] 			= $config->allowedextensions;
		$backup['badwords'] 					= $config->badwords;
		$backup['gravatard'] 					= $config->gravatard;
		$backup['gravatarr'] 					= $config->gravatarr;
		$backup['groupsadmin'] 					= $config->groupsadmin;
		$backup['groupsspecial'] 				= $config->groupsspecial;

		$backup['ReadMessagesLifespan']			= $config->ReadMessagesLifespan;
		$backup['UnreadMessagesLifespan']		= $config->UnreadMessagesLifespan;
		$backup['SentMessagesLifespan'] 		= $config->SentMessagesLifespan;
		$backup['TrashLifespan'] 				= $config->TrashLifespan;
		$backup['ReadMessagesLifespanNote'] 	= $config->ReadMessagesLifespanNote;
		$backup['UnreadMessagesLifespanNote'] 	= $config->UnreadMessagesLifespanNote;
		$backup['SentMessagesLifespanNote'] 	= $config->SentMessagesLifespanNote;
		$backup['TrashLifespanNote'] 			= $config->TrashLifespanNote;
		$backup['adminignitiononly'] 			= $config->adminignitiononly;
		$backup['pmsimportdone'] 				= $config->pmsimportdone;
		$backup['blockalert'] 					= $config->blockalert;
		$backup['blocksystem'] 					= $config->blocksystem;
		$backup['allowemailnotify'] 			= $config->allowemailnotify;
		$backup['notifydefault'] 				= $config->notifydefault;
		$backup['popupdefault'] 				= $config->popupdefault;
		$backup['allowsysgm'] 					= $config->allowsysgm;
		$backup['emailwithmessage'] 			= $config->emailwithmessage;
		$backup['firstwordsinbox'] 				= $config->firstwordsinbox;
		$backup['longwaitingdays'] 				= $config->longwaitingdays;
		$backup['longwaitingemail'] 			= $config->longwaitingemail;
		$backup['maxlength'] 					= $config->maxlength;
		$backup['showcblink'] 					= $config->showcblink;
		$backup['showmenulink'] 				= $config->showmenulink;
		$backup['showcbpic'] 					= $config->showcbpic;
		$backup['showonline'] 					= $config->showonline;
		$backup['allowarchive']					= $config->allowarchive;
		$backup['maxarchive'] 					= $config->maxarchive;
		$backup['allowcopytome'] 				= $config->allowcopytome;
		$backup['trashoriginal'] 				= $config->trashoriginal;
		$backup['perpage'] 						= $config->perpage;
		$backup['enabledownload'] 				= $config->enabledownload;
		$backup['inboxlimit'] 					= $config->inboxlimit;
		$backup['showinboxlimit'] 				= $config->showinboxlimit;
		$backup['allowpopup'] 					= $config->allowpopup;
		$backup['allowbb'] 						= $config->allowbb;
		$backup['allowsmile'] 					= $config->allowsmile;
		$backup['animated'] 					= $config->animated;
		$backup['animatedex'] 					= $config->animatedex;
		$backup['showmenuicons'] 				= $config->showmenuicons;
		$backup['bottomlineicons'] 				= $config->bottomlineicons;
		$backup['actionicons'] 					= $config->actionicons;
		$backup['showconnex'] 					= $config->showconnex;
		$backup['showsettingslink'] 			= $config->showsettingslink;
		$backup['showabout'] 					= $config->showabout;
		$backup['emailtrafficenabled'] 			= $config->emailtrafficenabled;
		$backup['getpiclink'] 					= $config->getpiclink;
		$backup['connex_listbox'] 				= $config->connex_listbox;
		$backup['forgetmenotstart'] 			= $config->forgetmenotstart;
		$backup['realnames'] 					= $config->realnames;
		$backup['cryptmode'] 					= $config->cryptmode;
		$backup['modeshowallusers'] 			= $config->modeshowallusers;
		$backup['useautocomplete'] 				= $config->useautocomplete;
		$backup['allowmultipleuser'] 			= $config->allowmultipleuser;
		$backup['connexallowmultipleuser'] 		= $config->connexallowmultipleuser;
		$backup['allowmultiplerecipients'] 		= $config->allowmultiplerecipients;
		$backup['showtextcounter'] 				= $config->showtextcounter;
		$backup['allowforwards'] 				= $config->allowforwards;
		$backup['showgroups'] 					= $config->showgroups;
		$backup['mailsystem'] 					= $config->mailsystem;
		$backup['searchinstring'] 				= $config->searchinstring;
		$backup['maxrecipients'] 				= $config->maxrecipients;
		$backup['languagecharset'] 				= $config->languagecharset;
		$backup['usecaptcha'] 					= $config->usecaptcha;
		$backup['captchalen'] 					= $config->captchalen;
		$backup['pubfrontend'] 					= $config->pubfrontend;
		$backup['pubfrontenddefault'] 			= $config->pubfrontenddefault;
		$backup['pubmodeshowallusers'] 			= $config->pubmodeshowallusers;
		$backup['hideallusers'] 				= $config->hideallusers;
		$backup['pubhideallusers'] 				= $config->pubhideallusers;
		$backup['unblockCBconnections'] 		= $config->unblockCBconnections;
		$backup['CBgallery'] 					= $config->CBgallery;
		$backup['enablelists'] 					= $config->enablelists;
		$backup['maxonlists'] 					= $config->maxonlists;
		$backup['timedelay'] 					= $config->timedelay;
		$backup['pubrealnames'] 				= $config->pubrealnames;
		$backup['pubreplies'] 					= $config->pubreplies;
		$backup['pubemail'] 					= $config->pubemail;
		$backup['csrfprotection'] 				= $config->csrfprotection;
		$backup['trashrestriction'] 			= $config->trashrestriction;
		$backup['replytruncate'] 				= $config->replytruncate;
		$backup['allowflagged'] 				= $config->allowflagged;
		$backup['overwriteitemid'] 				= $config->overwriteitemid;
		$backup['useitemid'] 					= $config->useitemid;
		$backup['timezone'] 					= $config->timezone;
		$backup['pubuseautocomplete'] 			= $config->pubuseautocomplete;
		$backup['pubsearchinstring'] 			= $config->pubsearchinstring;
		$backup['mootools'] 					= $config->mootools;
		$backup['autoresponder'] 				= $config->autoresponder;
		$backup['autoforward'] 					= $config->autoforward;
		$backup['rows'] 						= $config->rows;
		$backup['cols'] 						= $config->cols;
		$backup['width'] 						= $config->width;
		$backup['enablefilter'] 				= $config->enablefilter;
		$backup['enablereply'] 					= $config->enablereply;
		$backup['enablerss'] 					= $config->enablerss;
		$backup['showigoogle'] 					= $config->showigoogle;
		$backup['showhelp'] 					= $config->showhelp;
		$backup['separator'] 					= $config->separator;
		$backup['rsslimit'] 					= $config->rsslimit;
		$backup['restrictallusers'] 			= $config->restrictallusers;
		$backup['trashoriginalsent'] 			= $config->trashoriginalsent;
		$backup['reportspam'] 					= $config->reportspam;
		$backup['checkbanned'] 					= $config->checkbanned;
		$backup['enableattachment']				= $config->enableattachment;
		$backup['maxsizeattachment']			= $config->maxsizeattachment;
		$backup['maxattachments']				= $config->maxattachments;
		$backup['fileadminignitiononly'] 		= $config->fileadminignitiononly;
		$backup['showlistattachment'] 			= $config->showlistattachment;
		$backup['showmenucount'] 				= $config->showmenucount;
		$backup['encodeheader'] 				= $config->encodeheader;
		$backup['enablesort'] 					= $config->enablesort;
		$backup['captchatype'] 					= $config->captchatype;
		$backup['unprotectdownloads'] 			= $config->unprotectdownloads;
		$backup['waitdays'] 					= $config->waitdays;
		$backup['avatarw'] 						= $config->avatarw;
		$backup['avatarh'] 						= $config->avatarh;
		$backup['gravatar'] 					= $config->gravatar;
		$backup['addccline'] 					= $config->addccline;
		$backup['modnewusers'] 					= $config->modnewusers;
		$backup['modpubusers'] 					= $config->modpubusers;
		$backup['restrictcon'] 					= $config->restrictcon;
		$backup['restrictrem'] 					= $config->restrictrem;
		$backup['stime'] 						= $config->stime;
		$backup['dontsefmsglink'] 				= $config->dontsefmsglink;
		$backup['enablepostbox']				= $config->enablepostbox;
		$backup['postboxfull']					= $config->postboxfull;
		$backup['postboxavatars']				= $config->postboxavatars;
		$backup['replytext']					= $config->replytext;

		$query = 'TRUNCATE TABLE #__uddeim_config';
		$database->setQuery($query);
		if (!$database->query())
			echo("SQL error: ".$database->stderr(true));
		foreach ($backup as $key => $value) {
			$query = 'INSERT INTO #__uddeim_config ( varname, value ) VALUES ( '.$database->Quote($key).', '.$database->Quote($value).' )';
			$database->setQuery($query);
			if (!$database->query())
				echo("SQL error: ".$database->stderr(true));
		}
		echo "<div style='text-align:left'>";
		echo "<p><b>"._UDDEADM_BACKUP_DONE."</b></p>";
		echo "<p><b><a href=".uddeIMredirectIndex()."?option=com_uddeim>"._UDDEADM_CONTINUE."</a></b></p></div>";
	}
	elseif ($act=="restore") {
		$query = "SELECT varname, value FROM #__uddeim_config";
        $database->setQuery($query);
        $results = $database->loadObjectList();
		if (!$database->query())
			echo("SQL error: ".$database->stderr(true));
        foreach ($results as $result) {
			if (substr($result->varname,0,1)!='_')
				$config->{$result->varname} = $result->value;
		}
		uddeIMsaveConfig($pathtoadmin, $config);
		echo "<div style='text-align:left'>";
		echo "<p><b>"._UDDEADM_RESTORE_DONE."</b></p>";
		echo "<p><b><a href=".uddeIMredirectIndex()."?option=com_uddeim>"._UDDEADM_CONTINUE."</a></b></p></div>";
	}
}