###END_AUTOCODE
/**
*
- * @param {String} $templateFile (mail/XXXXXXX.txt) exclude the mail and .txt bit.
- * @param {Array|Object} $args data to send out..
- * @return {Array|PEAR_Error} array of $recipents, $header, $body
+ *
+ *
+ *
+ * FIXME !!!! -- USE Pman_Core_Mailer !!!!!
+ *
+ *
+ *
+ *
*/
function buildMail($templateFile, $args)
{
}
$headers['Date'] = date('r');
-
if ($htmlbody !== false) {
+ require_once 'Mail/mime.php';
$mime = new Mail_mime(array('eol' => "\n"));
- $mime->setHeaders($headers);
$mime->setTXTBody($body);
$mime->setHTMLBody($htmlbody);
// I think there might be code in mediaoutreach toEmail somewhere
// h embeds images here..
$body = $mime->get();
- $headers = $mime->headers($hdrs);
+ $headers = $mime->headers($headers);
}
$u = DB_DataObject::factory('Person');
$u->whereAdd(' LENGTH(passwd) > 0');
if (!$u->count()){
+
+ // fake person - open system..
+ $ce = DB_DataObject::factory('core_enum');
+ $ce->initEnums();
+
+
$u = DB_DataObject::factory('Person');
$u->id = -1;
return $u;
}
+
+
function hasPerm($name, $lvl)
{
static $pcache = array();
}
-
if (!empty($q['query']['search'])) {
$s = $this->escape($q['query']['search']);
$this->whereAdd("
$tn_p.name LIKE '%$s%' OR
$tn_p.email LIKE '%$s%' OR
$tn_p.role LIKE '%$s%' OR
+ $tn_p.phone LIKE '%$s%' OR
$tn_p.remarks LIKE '%$s%'
");
}
function onInsert($req, $roo)
{
-
- if ($roo->authUser->id < 0) {
+
+ $p = DB_DataObject::factory('person');
+ if ($roo->authUser->id < 0 && $p->count() == 1) {
+ // this seems a bit risky...
+
$g = DB_DataObject::factory('Groups');
+ $g->initGroups();
+
$g->type = 0;
$g->get('name', 'Administrators');