Commit 88388440 authored by bburgaud's avatar bburgaud

improved (I hope :) ) mail-in feature:

- anonymous posts can be discarded
- mail-in accounts can be cheked automatically
parent 0c81ab5f
......@@ -3074,6 +3074,7 @@ tiki/templates/tiki-live_support_client.tpl -text
tiki/templates/tiki-live_support_console.tpl -text
tiki/templates/tiki-live_support_transcripts.tpl -text
tiki/templates/tiki-login.tpl -text
tiki/templates/tiki-mailin.tpl -text
tiki/templates/tiki-minical.tpl -text
tiki/templates/tiki-minical_prefs.tpl -text
tiki/templates/tiki-my_tiki.tpl -text
......@@ -3421,6 +3422,7 @@ tiki/tiki-login.php -text
tiki/tiki-login_scr.php -text
tiki/tiki-login_validate.php -text
tiki/tiki-logout.php -text
tiki/tiki-mailin-code.php -text
tiki/tiki-mailin.php -text
tiki/tiki-map.phtml -text
tiki/tiki-map_download.phtml -text
......
<a href="tiki-admin_mailin.php" class="pagetitle">{tr}WebMail accounts{/tr}</a>
<a href="tiki-admin_mailin.php" class="pagetitle">{tr}Mail-in accounts{/tr}</a>
<!-- the help link info -->
{if $feature_help eq 'y'}
<a href="http://tikiwiki.org/tiki-index.php?page=Webmail" target="tikihelp" class="tikihelp" title="{tr}Tikiwiki.org help{/tr}: {tr}admin Webmail{/tr}">
<img border='0' src='img/icons/help.gif' alt='help' /></a>{/if}
<!-- There are definite disconnects between the tpl and php and what people call this-->
<!-- link to tpl -->
<!-- the help link info --->
{if $feature_help eq 'y'}
<a href="http://tikiwiki.org/tiki-index.php?page=Webmail" target="tikihelp" class="tikihelp" title="{tr}Tikiwiki.org help{/tr}: {tr}admin Webmail{/tr}">
<img border='0' src='img/icons/help.gif' alt='help' /></a>
{/if}
{if $feature_view_tpl eq 'y'}
<a href="tiki-edit_templates.php?template=templates/tiki-admin_mailin.tpl" target="tikihelp" class="tikihelp" title="{tr}View tpl{/tr}: {tr}admin mailin tpl{/tr}">
<img border='0' src='img/icons/info.gif' alt='edit tpl' /></a>{/if}
<!-- link to tpl -->
{if $feature_view_tpl eq 'y'}
<a href="tiki-edit_templates.php?template=templates/tiki-admin_mailin.tpl" target="tikihelp" class="tikihelp" title="{tr}View tpl{/tr}: {tr}admin mailin tpl{/tr}">
<img border='0' src='img/icons/info.gif' alt='edit tpl' /></a>
{/if}
<!-- begin -->
<br /><br />
<table class="normal">
<tr>
<td class="heading">
{tr}Account{/tr}
&nbsp;[<a class="tablename" href="tiki-admin_mailin.php">{tr}add new{/tr}</a>]
</td>
<td class="heading">{tr}type{/tr}</td>
</tr>
{cycle values="odd,even" print=false}
{section name=ix loop=$accounts}
<tr>
<td class="{cycle advance=false}">
<a href="tiki-admin_mailin.php" class="{if $accounts[ix].current eq 'y'}tablename{else}link{/if}">{$accounts[ix].account}</a>
[<a href="tiki-admin_mailin.php?remove={$accounts[ix].accountId}" class="link">x</a>|<a href="tiki-admin_mailin.php?accountId={$accounts[ix].accountId}" class="tablename">edit</a>]
</td>
<td class="{cycle}">{$accounts[ix].type}</td>
</tr>
{/section}
</table>
<br /><br />
<a class="linkbut" href="tiki-mailin.php">Mailin</a>
<!-- What is this link? What does it do? -->
<h3>{tr}Edit{/tr}/{tr}Add new mail account{/tr}</h3>
<form action="tiki-admin_mailin.php" method="post">
<input type="hidden" name="accountId" value="{$accountId|escape}" />
<table class="normal">
<tr>
<td class="formcolor">{tr}Account name{/tr}</td>
<td colspan="3" class="formcolor"><input type="text" name="account" value="{$info.account|escape}" /></td>
</tr>
<tr>
<td class="formcolor">{tr}POP server{/tr}</td>
<td class="formcolor"><input type="text" name="pop" value="{$info.pop|escape}" /></td>
<td class="formcolor">{tr}Port{/tr}</td>
<td class="formcolor"><input type="text" name="port" size="7" value="{$info.port}" /></td>
</tr>
<tr>
<td class="formcolor">{tr}SMTP server{/tr}</td>
<td class="formcolor"><input type="text" name="smtp" value="{$info.smtp|escape}" /></td>
<td class="formcolor">{tr}Port{/tr}</td>
<td class="formcolor"><input type="text" name="smtpPort" size="7" value="{$info.smtpPort}" /></td>
</tr>
<tr>
<td class="formcolor">{tr}SMTP requires authentication{/tr}</td>
<td colspan="3" class="formcolor">
{tr}Yes{/tr}
<input type="radio" name="useAuth" value="y" {if $info.useAuth eq 'y'}checked="checked"{/if} />
{tr}No{/tr}
<input type="radio" name="useAuth" value="n" {if $info.useAuth eq 'n'}checked="checked"{/if} />
</td>
</tr>
<tr>
<td class="formcolor">{tr}Username{/tr}</td>
<td colspan="3" class="formcolor"><input type="text" name="username" value="{$info.username|escape}" /></td>
</tr>
<tr>
<td class="formcolor">{tr}Password{/tr}</td>
<td colspan="3" class="formcolor"><input type="text" name="pass" value="{$info.pass|escape}" /></td>
</tr>
<tr>
<td class="formcolor">{tr}Type{/tr}</td><td colspan="3" class="formcolor">
<select name="type">
<option value="wiki-get" {if $info.type eq 'wiki-get'}selected="selected"{/if}>{tr}wiki-get{/tr}</option>
<option value="wiki-put" {if $info.type eq 'wiki-put'}selected="selected"{/if}>{tr}wiki-put{/tr}</option>
<option value="wiki-append" {if $info.type eq 'wiki-append'}selected="selected"{/if}>{tr}wiki-append{/tr}</option>
<option value="wiki" {if $info.type eq 'wiki'}selected="selected"{/if}>{tr}wiki{/tr}</option>
</select>
</td>
</tr>
<tr>
<td class="formcolor">{tr}Active{/tr}</td>
<td colspan="3" class="formcolor">
{tr}Yes{/tr}
<input type="radio" name="active" {if $info.active eq 'y'}checked="checked"{/if} value="y" />
{tr}No{/tr}
<input type="radio" name="active" {if $info.active eq 'n'}checked="checked"{/if} value="n" />
</td>
</tr>
<tr>
<td class="formcolor">{tr}Allow anonymous acces{/tr}</td>
<td colspan="3" class="formcolor">
{tr}Yes{/tr}
<input type="radio" name="anonymous" {if $info.anonymous eq 'y'}checked="checked"{/if} value="y" />
{tr}No{/tr}
<input type="radio" name="anonymous" {if $info.anonymous eq 'n'}checked="checked"{/if} value="n" />
</td>
</tr>
<tr>
<td class="formcolor">&nbsp;</td>
<td colspan="3" class="formcolor"><input type="submit" name="new_acc" value="{tr}add{/tr}" /></td>
</tr>
</table>
</form>
<br /><br /><br />
<b><a class="readlink" href="tiki-mailin.php">{tr}Check Mail-in accounts{/tr}</a></b>
<br /><br />
<h3>{tr}Add new mail account{/tr}</h3>
<form action="tiki-admin_mailin.php" method="post">
<input type="hidden" name="accountId" value="{$accountId|escape}" />
<table class="normal">
<tr><td class="formcolor">{tr}Account name{/tr}</td><td colspan="3" class="formcolor"><input type="text" name="account" value="{$info.account|escape}" /></td></tr>
<tr><td class="formcolor">{tr}POP server{/tr}</td><td class="formcolor"><input type="text" name="pop" value="{$info.pop|escape}" /></td><td class="formcolor">{tr}Port{/tr}</td><td class="formcolor"><input type="text" name="port" size="7" value="{$info.port}" /></td></tr>
<tr><td class="formcolor">{tr}SMTP server{/tr}</td><td class="formcolor"><input type="text" name="smtp" value="{$info.smtp|escape}" /></td><td class="formcolor">{tr}Port{/tr}</td><td class="formcolor"><input type="text" name="smtpPort" size="7" value="{$info.smtpPort}" /></td></tr>
<tr><td class="formcolor">{tr}SMTP requires authentication{/tr}</td><td colspan="3" class="formcolor">{tr}Yes{/tr}<input type="radio" name="useAuth" value="yes" {if $info.useAuth eq 'y'}checked="checked"{/if} /> {tr}No{/tr}<input type="radio" name="useAuth" value="no" {if $info.useAuth eq 'n'}checked="checked"{/if} /></td></tr>
<tr><td class="formcolor">{tr}Username{/tr}</td><td colspan="3" class="formcolor"><input type="text" name="username" value="{$info.username|escape}" /></td></tr>
<tr><td class="formcolor">{tr}Password{/tr}</td><td colspan="3" class="formcolor"><input type="text" name="pass" value="{$info.pass|escape}" /></td></tr>
<tr><td class="formcolor">{tr}Type{/tr}</td><td colspan="3" class="formcolor">
<select name="type">
<option value="wiki-get" {if $info.type eq 'wiki-get'}selected="selected"{/if}>{tr}wiki-get{/tr}</option>
<option value="wiki-put" {if $info.type eq 'wiki-put'}selected="selected"{/if}>{tr}wiki-put{/tr}</option>
<option value="wiki-append" {if $info.type eq 'wiki-append'}selected="selected"{/if}>{tr}wiki-append{/tr}</option>
<option value="wiki" {if $info.type eq 'wiki'}selected="selected"{/if}>{tr}wiki{/tr}</option>
</select>
</td></tr>
<tr><td class="formcolor">{tr}Active{/tr}</td><td colspan="3" class="formcolor">
{tr}Yes{/tr}<input type="radio" name="active" {if $info.active eq 'y'}checked="checked"{/if} value="y" /> <input type="radio" {if $info.active eq 'n'}checked="checked"{/if} name="active" value="n" />{tr}No{/tr}
</td></tr>
<tr><td class="formcolor">&nbsp;</td><td colspan="3" class="formcolor"><input type="submit" name="new_acc" value="{tr}add{/tr}" /></td></tr>
</table>
<table class="normal">
<tr>
<td class="formcolor">{tr}Check automatically{/tr}</td>
<td class="formcolor">
{tr}Yes{/tr}
<input type="radio" name="mailin_autocheck" {if $mailin_autocheck eq 'y'}checked="checked"{/if} value="y" />
{tr}No{/tr}
<input type="radio" name="mailin_autocheck" {if $mailin_autocheck eq 'n'}checked="checked"{/if} value="n" />
</td>
</tr>
<tr>
<td class="formcolor">{tr}Frequency{/tr}</td>
<td class="formcolor"><input type="text" name="mailin_autocheckFreq" size="6" value="{$mailin_autocheckFreq}" />&nbsp;mn</td>
</tr>
<tr>
<td class="formcolor">&nbsp;</td>
<td class="formcolor"><input type="submit" name="set_auto" value="{tr}set{/tr}" /></td>
</tr>
</table>
</form>
<h3>{tr}User accounts{/tr}</h3>
<table class="normal">
<tr>
<td class="heading">{tr}account{/tr}</td>
<td class="heading">{tr}type{/tr}</td>
</tr>
{cycle values="odd,even" print=false}
{section name=ix loop=$accounts}
<tr><td class="{cycle advance=false}"><a href="tiki-admin_mailin.php" class="{if $accounts[ix].current eq 'y'}tablename{else}link{/if}">{$accounts[ix].account}</a>
[<a href="tiki-admin_mailin.php?remove={$accounts[ix].accountId}" class="link">x</a>|<a href="tiki-admin_mailin.php?accountId={$accounts[ix].accountId}" class="tablename">edit</a>]
</td>
<td class="{cycle}">{$accounts[ix].type}</td>
</tr>
{/section}
</table>
<br /><br />
<a href="tiki-mailin.php" class="pagetitle">{tr}Mail-in feature{/tr}</a>
{$content}
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_mailin.php,v 1.4 2003-11-17 15:44:28 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-admin_mailin.php,v 1.5 2003-12-15 18:19:23 bburgaud Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -11,6 +11,19 @@ require_once ('tiki-setup.php');
include_once ('lib/mailin/mailinlib.php');
//check if feature is on
if($feature_mailin != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_mailin");
$smarty->display("error.tpl");
die;
}
//check permissions
if ($tiki_p_admin_mailin != 'y') {
$smarty->assign('msg', tra("You dont have permission to use this feature"));
$smarty->display("error.tpl");
die;
}
// Add a new mail account for the user here
if (!isset($_REQUEST["accountId"]))
$_REQUEST["accountId"] = 0;
......@@ -20,7 +33,7 @@ $smarty->assign('accountId', $_REQUEST["accountId"]);
if (isset($_REQUEST["new_acc"])) {
$mailinlib->replace_mailin_account($_REQUEST["accountId"], $_REQUEST["account"], $_REQUEST["pop"], $_REQUEST["port"],
$_REQUEST["username"], $_REQUEST["pass"], $_REQUEST["smtp"], $_REQUEST["useAuth"], $_REQUEST["smtpPort"], $_REQUEST["type"],
$_REQUEST["active"]);
$_REQUEST["active"], $_REQUEST["anonymous"]);
$_REQUEST["accountId"] = 0;
}
......@@ -43,6 +56,7 @@ if ($_REQUEST["accountId"]) {
$info["smtpPort"] = 25;
$info["type"] = 'wiki-get';
$info["active"] = 'y';
$info["anonymous"] = 'y';
}
$smarty->assign('info', $info);
......@@ -50,6 +64,21 @@ $smarty->assign('info', $info);
$accounts = $mailinlib->list_mailin_accounts(0, -1, 'account_asc', '');
$smarty->assign('accounts', $accounts["data"]);
if (isset($_REQUEST["mailin_autocheck"]) ) {
if($_REQUEST["mailin_autocheck"]=='y' && !(ereg("[0-9]+",$_REQUEST["mailin_autocheckFreq"]) && $_REQUEST["mailin_autocheckFreq"]>0)) {
$smarty->assign('msg', tra("Frequency should be a positive integer!"));
$smarty->display("error.tpl");
die;
} else {
$tikilib->set_preference("mailin_autocheck", $_REQUEST["mailin_autocheck"]);
$tikilib->set_preference("mailin_autocheckFreq", $_REQUEST["mailin_autocheckFreq"]);
$mailin_autocheck = $_REQUEST["mailin_autocheck"];
$mailin_autocheckFreq = $_REQUEST["mailin_autocheckFreq"];
}
}
$smarty->assign('mailin_autocheck',$mailin_autocheck);
$smarty->assign('mailin_autocheckFreq',$mailin_autocheckFreq);
$smarty->assign('mid', 'tiki-admin_mailin.tpl');
$smarty->display("tiki.tpl");
......
This diff is collapsed.
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-mailin.php,v 1.4 2003-10-19 23:57:25 zaufi Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-mailin.php,v 1.5 2003-12-15 18:19:23 bburgaud Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -9,279 +9,16 @@
// Initialization
require_once ('tiki-setup.php');
include_once ('lib/mailin/mailinlib.php');
require_once ("lib/webmail/pop3.php");
require_once ("lib/webmail/mimeDecode.php");
include_once ("lib/webmail/class.rc4crypt.php");
include_once ("lib/webmail/htmlMimeMail.php");
function parse_output(&$obj, &$parts, $i) {
if (!empty($obj->parts)) {
for ($i = 0; $i < count($obj->parts); $i++)
parse_output($obj->parts[$i], $parts, $i);
} else {
$ctype = $obj->ctype_primary . '/' . $obj->ctype_secondary;
switch ($ctype) {
case 'text/plain':
if (!empty($obj->disposition)AND $obj->disposition == 'attachment') {
$names = split(';', $obj->headers["content-disposition"]);
$names = split('=', $names[1]);
$aux['name'] = $names[1];
$aux['content-type'] = $obj->headers["content-type"];
$aux['part'] = $i;
$parts['attachments'][] = $aux;
} else {
$parts['text'][] = $obj->body;
}
break;
case 'text/html':
if (!empty($obj->disposition)AND $obj->disposition == 'attachment') {
$names = split(';', $obj->headers["content-disposition"]);
$names = split('=', $names[1]);
$aux['name'] = $names[1];
$aux['content-type'] = $obj->headers["content-type"];
$aux['part'] = $i;
$parts['attachments'][] = $aux;
} else {
$parts['html'][] = $obj->body;
}
break;
default:
$names = split(';', $obj->headers["content-disposition"]);
$names = split('=', $names[1]);
$aux['name'] = $names[1];
$aux['content-type'] = $obj->headers["content-type"];
$aux['part'] = $i;
$parts['attachments'][] = $aux;
}
}
//check if feature is on
if($feature_mailin != 'y') {
$smarty->assign('msg', tra("This feature is disabled").": feature_mailin");
$smarty->display("error.tpl");
die;
}
// The mailin script is used to get / set wiki pages using an email account
// Get a list of ACTIVE emails accounts configured for mailin procedures
$accs = $mailinlib->list_active_mailin_accounts(0, -1, 'account_desc', '');
print ('<a href="tiki-admin_mailin.php">Admin</a><br/><br/>');
// foreach account
foreach ($accs['data'] as $acc) {
print ("<b>Processing account</b><br/>");
print ("Account :" . $acc['account'] . "<br/>");
print ("Type :" . $acc['type'] . "<br/>");
print ("--------------------------<br/>");
$pop3 = new POP3($acc["pop"], $acc["username"], $acc["pass"]);
$pop3->Open();
$s = $pop3->Stats();
$mailsum = $s["message"];
for ($i = 1; $i <= $mailsum; $i++) {
$aux = $pop3->ListMessage($i);
$aux["msgid"] = $i;
$aux["realmsgid"] = $pop3->GetMessageID($i);
$message = $pop3->GetMessage($i);
print ("Reading a request. From: " . $aux["sender"]["email"] . "Subject: " . $aux["subject"] . "<br/>");
if (empty($aux["sender"]["name"]))
$aux["sender"]["name"] = $aux["sender"]["email"];
// Now determine account type
if ($acc['type'] == 'wiki-get') {
// A wiki-get account sends a copy of the page to the sender
// and also sends the source of the page
$page = trim($aux['subject']);
$mail = new htmlMimeMail();
$mail->setFrom($acc["account"]);
$mail->setSubject($page);
if ($tikilib->page_exists($page)) {
$info = $tikilib->get_page_info($page);
$data = $tikilib->parse_data($info["data"]);
// Now we should attach the source here
$mail->addAttachment($info['data'], 'source.txt', 'plain/txt');
} else {
$data = 'Page not found';
}
$mail->setSMTPParams($acc["smtp"], $acc["smtpPort"], '', $acc["useAuth"], $acc["username"], $acc["pass"]);
$mail->setHTML($data, strip_tags($data));
$res = $mail->send(array($aux["sender"]["email"]), 'mail');
print ("Response sent<br/>");
// Send the email
}
if ($acc['type'] == 'wiki-put') {
// This is used to UPDATE wiki pages
$page = trim($aux['subject']);
$full = $message["full"];
$params = array(
'input' => $full,
'crlf' => "\r\n",
'include_bodies' => TRUE,
'decode_headers' => TRUE,
'decode_bodies' => TRUE
);
$output = Mail_mimeDecode::decode($params);
parse_output($output, $parts, 0);
if (isset($parts["text"][0]))
$body = $parts["text"][0];
if (isset($body)) {
if (!$tikilib->page_exists($page)) {
print ("Page: $page has been created");
$tikilib->create_page($page,
0, $body, date('U'), "Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
} else {
$tikilib->update_page($page, $body, "Created by email from " . $acc["account"], $aux["sender"]["email"],
'0.0.0.0', '');
print ("Page: $page has been updated");
}
}
}
if ($acc['type'] == 'wiki-append') {
// This is used to UPDATE wiki pages
$page = trim($aux['subject']);
$full = $message["full"];
$params = array(
'input' => $full,
'crlf' => "\r\n",
'include_bodies' => TRUE,
'decode_headers' => TRUE,
'decode_bodies' => TRUE
);
$output = Mail_mimeDecode::decode($params);
parse_output($output, $parts, 0);
if (isset($parts["text"][0]))
$body = $parts["text"][0];
if (isset($body)) {
if (!$tikilib->page_exists($page)) {
print ("Page: $page has been created");
$tikilib->create_page($page,
0, $body, date('U'), "Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
} else {
$info = $tikilib->get_page_info($page);
$tikilib->update_page($page, $info['data'] . $body,
"Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
print ("Page: $page has been updated");
}
}
}
if ($acc['type'] == 'wiki') {
// This is used to GET/SET wiki pages depending on the body
$p_page = trim($aux['subject']);
$parts = explode(':', $p_page);
if (!isset($parts[1])) {
$parts[1] = $parts[0];
$parts[0] = 'GET';
}
$method = $parts[0];
$page = $parts[1];
$full = $message["full"];
$params = array(
'input' => $full,
'crlf' => "\r\n",
'include_bodies' => TRUE,
'decode_headers' => TRUE,
'decode_bodies' => TRUE
);
$output = Mail_mimeDecode::decode($params);
parse_output($output, $parts, 0);
if (isset($parts["text"][0]))
$body = $parts["text"][0];
if ($method == 'PUT') {
if (!$tikilib->page_exists($page)) {
print ("Page: $page has been created");
$tikilib->create_page($page,
0, $body, date('U'), "Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
} else {
$tikilib->update_page($page, $body, "Created by email from " . $acc["account"], $aux["sender"]["email"],
'0.0.0.0', '');
print ("Page: $page has been updated");
}
} elseif ($method == 'GET') {
$mail = new htmlMimeMail();
$mail->setFrom($acc["account"]);
$mail->setSubject($page);
if ($tikilib->page_exists($page)) {
$info = $tikilib->get_page_info($page);
$data = $tikilib->parse_data($info["data"]);
// Now we should attach the source here
$mail->addAttachment($data, $page . '.html', 'plain/html');
$mail->setSMTPParams($acc["smtp"], $acc["smtpPort"], '', $acc["useAuth"], $acc["username"], $acc["pass"]);
$mail->setHTML($info['data'], strip_tags($data));
$res = $mail->send(array($aux["sender"]["email"]), 'mail');
print ("Response sent<br/>");
} else {
$data = 'Page not found';
}
} elseif ($method == 'APPEND' || $method == 'PREPEND') {
if (!$tikilib->page_exists($page)) {
print ("Page: $page has been created");
$tikilib->create_page($page,
0, $body, date('U'), "Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
} else {
$info = $tikilib->get_page_info($page);
$tikilib->update_page($page, ($method=='APPEND' ? $info['data'] . $body : $body . $info['data']),
"Created by email from " . $acc["account"], $aux["sender"]["email"], '0.0.0.0', '');
print ("Page: $page has been updated");
}
} else {
$mail = new htmlMimeMail();
$mail->setFrom($acc["account"]);
$mail->setSubject(tra('Tiki mail-in instructions'));
$mail->setSMTPParams($acc["smtp"], $acc["smtpPort"], '', $acc["useAuth"], $acc["username"], $acc["pass"]);
$mail->setText("Use the subject to indicate the operation to apply:\nGET:WikiName to get a wiki page\nPUT:WikiName to update/create a wiki page (use the body for the page data)\nAPPEND:WikiName to append data to a Wiki page (use the body for the data to add)");
$res = $mail->send(array($aux["sender"]["email"]), 'mail');
}
}
// Remove the email from the pop3 server
$pop3->DeleteMessage($i);
}
$pop3->close();
}
include_once ('tiki-mailin-code.php');
$smarty->assign('content', $content);
$smarty->assign('mid', 'tiki-mailin.tpl');
$smarty->display("tiki.tpl");
?>
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.175 2003-12-14 03:49:07 wolff_borg Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-setup.php,v 1.176 2003-12-15 18:19:23 bburgaud Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -403,6 +403,12 @@ $smarty->assign('wiki_list_links','y');
$smarty->assign('wiki_list_backlinks','y');
$smarty->assign('wiki_list_size','y');
//default wiki mailin feature values
$feature_mailin = 'n';
$mailin_autocheck = 'n';
$mailin_autocheckFreq = '0';
$mailin_autocheckLast = 0;
$feature_wiki_comments = 'n';
$wiki_comments_default_ordering = 'points_desc';
$wiki_comments_per_page = 10;
......@@ -1118,6 +1124,15 @@ foreach ($prefs as $name => $val) {
$smarty->assign("$name", $val);
}
//after prefs update, must check if mailin_autocheck time is elapsed
if($feature_mailin == 'y' && $mailin_autocheck == 'y')
{
if((time() - $mailin_autocheckLast)/60 > $mailin_autocheckFreq){
$tikilib->set_preference("mailin_autocheckLast", time());
include_once("tiki-mailin-code.php");
}
}
$useGroupHome = $tikilib->get_preference("useGroupHome",'n');
if($useGroupHome == 'y' and isset($user)) {
$group = $userlib->get_user_default_group($user);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment