Example #1
0
<?php

require 'servicemain.php';
//Include xhelp Related Includes
require_once XHELP_INCLUDE_PATH . '/events.php';
require XHELP_CLASS_PATH . '/mailboxPOP3.php';
require XHELP_CLASS_PATH . '/msgParser.php';
require XHELP_CLASS_PATH . '/msgStore.php';
require XHELP_CLASS_PATH . '/validator.php';
//Initialize xhelp objects
$msgParser = new xhelpEmailParser();
$msgStore = new xhelpEmailStore();
$hDeptBoxes =& xhelpGetHandler('departmentMailBox');
$hMailEvent =& xhelpGetHandler('mailEvent');
$hTicket =& xhelpGetHandler('ticket');
$_eventsrv->advise('new_user_by_email', xhelpNotificationService::singleton(), 'new_user_activation' . $xoopsConfigUser['activation_type']);
//Get All Department Mailboxes
$deptmboxes =& $hDeptBoxes->getActiveMailboxes();
//Loop Through All Department Mailboxes
foreach ($deptmboxes as $mbox) {
    $deptid = $mbox->getVar('departmentid');
    //Connect to the mailbox
    if ($mbox->connect()) {
        //Check for new messages
        if ($mbox->hasMessages()) {
            //Retrieve / Store each message
            while ($msg =& $mbox->getMessage()) {
                $msg_logs = array();
                $skip_msg = false;
                //Check if there are any errors parsing msg
                if ($parsed =& $msgParser->parseMessage($msg)) {
Example #2
0
 /**
  * creates new staff member
  *
  * @access public
  */
 function addStaff($uid, $email)
 {
     $notify = new xhelpNotificationService();
     $staff =& $this->create();
     $staff->setVar('uid', $uid);
     $staff->setVar('email', $email);
     $numNotify = $notify->getNumDeptNotifications();
     $staff->setVar('notify', pow(2, $numNotify) - 1);
     $staff->setVar('permTimestamp', time());
     return $this->insert($staff);
 }
Example #3
0
<?php

//$Id: events.php,v 1.2 2005/12/02 23:16:09 ackbarr Exp $
if (!defined('XHELP_CLASS_PATH')) {
    exit;
}
//Include the Event Subsystem classes
require_once XHELP_CLASS_PATH . '/eventService.php';
require_once XHELP_CLASS_PATH . '/xhelpService.php';
require_once XHELP_CLASS_PATH . '/cacheService.php';
require_once XHELP_CLASS_PATH . '/logService.php';
require_once XHELP_CLASS_PATH . '/notificationService.php';
require_once XHELP_CLASS_PATH . '/staffService.php';
require_once XHELP_CLASS_PATH . '/firnService.php';
//Create an instance of each event class
$xhelpEventSrv =& xhelpNewEventService();
$var = xhelpCacheService::singleton();
$var = xhelpLogService::singleton();
$var = xhelpNotificationService::singleton();
$var = xhelpStaffService::singleton();
$var = xhelpFirnService::singleton();
unset($var);
// @todo - update every reference to $_eventsrv to use the new $xhelpEventSrv object
$_eventsrv =& $xhelpEventSrv;