###END_AUTOCODE
/**
*
- * Build an email to sent do user
*
- * key 'args'
*
- * no_auth => disable authentication check on
- * templateDir => alternative template directory.
- * HTTP_HOST
*
- * expects mail/TMPLATE.txt (if .html exists, it will be the html body version)
- *
- * @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)
{
$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');