function __construct() { parent::__construct(); $this->sms_param = $GLOBALS['phpgw_info']['sms_config']['bergen_kommune']; }
function __construct() { parent::__construct(); $this->gnokii_param['path'] = $GLOBALS['phpgw_info']['sms_config']['gnokii']['gnokii_cfg']; }
function check_for_new_mail() { if (!isset($this->carrot_param['email_user']) || !$this->carrot_param['email_user']) { throw new Exception('Email user not defined'); } $account_id = $GLOBALS['phpgw']->accounts->name2id($this->carrot_param['email_user']); $GLOBALS['phpgw_info']['user']['account_id'] = $account_id; $GLOBALS['phpgw']->preferences->account_id = $account_id; $pref = $GLOBALS['phpgw']->preferences->read(); $GLOBALS['phpgw_info']['user']['preferences']['felamimail'] = isset($pref['felamimail']) ? $pref['felamimail'] : ''; $boPreferences = CreateObject('felamimail.bopreferences'); $boPreferences->setProfileActive(true, 2); //2 for selected user $bofelamimail = CreateObject('felamimail.bofelamimail'); $connectionStatus = $bofelamimail->openConnection(); $headers = $bofelamimail->getHeaders('INBOX', 1, $maxMessages = 15, $sort = 0, $_reverse = 1, $_filter = array('string' => '', 'type' => 'quick', 'status' => 'unseen')); $sms = array(); $j = 0; if (isset($headers['header']) && is_array($headers['header'])) { foreach ($headers['header'] as $header) { if (!$header['seen']) { $sms[$j]['uid'] = $header['uid']; $sms[$j]['message'] = utf8_encode($header['subject']); $bodyParts = $bofelamimail->getMessageBody($header['uid']); $sms[$j]['message'] .= "\n"; for ($i = 0; $i < count($bodyParts); $i++) { $sms[$j]['message'] .= utf8_encode($bodyParts[$i]['body']) . "\n"; } $sms[$j]['message'] = substr($sms[$j]['message'], 0, 160); $j++; } } } foreach ($sms as $entry) { $sms_datetime = $entry['']; $sms_sender = $entry['']; $target_code = $entry['']; $message = $entry['message']; if (!parent::setsmsincomingaction($sms_datetime, $sms_sender, $target_code, $message)) { $bofelamimail->flagMessages($_flag = 'unread', array($entry['uid'])); } } if ($connectionStatus == 'true') { $bofelamimail->closeConnection(); } }
function __construct() { parent::__construct(); $this->pswin_param = $GLOBALS['phpgw_info']['sms_config']['pswin']; }
function __construct() { parent::__construct(); $this->carrot_param = $GLOBALS['phpgw_info']['sms_config']['carrot']; }