* * @license http://www.gnu.org/copyleft/gpl.html GPL * @author Prognus Software Livre (http://www.prognus.com.br) * @author Cristiano Corrêa Schmidt * @return string * @access prublic */ public function downloadICal() { return $this->ical->returnCalendar(); } /** * Salva o ical em disco * * @license http://www.gnu.org/copyleft/gpl.html GPL * @author Prognus Software Livre (http://www.prognus.com.br) * @author Cristiano Corrêa Schmidt * @param string $directory * @param string $filename * @return string * @access prublic */ public function saveICal($directory, $filename) { $config = array('directory' => $directory, 'filename' => $filename); $this->ical->setConfig($config); $this->ical->saveCalendar(); } } ServiceLocator::register('ical', new ICalService());
* e-mail address prognus@prognus.com.br. * * * @package MemCacheService * @license http://www.gnu.org/copyleft/gpl.html GPL * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) * @author Cristiano Corrêa Schmidt * @sponsor Caixa Econômica Federal * @version 1.0 * @since 2.4.0 */ class MemCacheService extends Memcache { var $expiration = 86400; /** * Adiciona objeto ao cache, com tratamento de erros no compress. * * @license http://www.gnu.org/copyleft/gpl.html GPL * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) * @sponsor Caixa Econômica Federal * @author Cristiano Corrêa Schmidt * @return bool * @access public */ public function set($key, $value, $expiration = false) { return parent::set($key, $value, is_bool($value) || is_int($value) || is_float($value) ? false : MEMCACHE_COMPRESSED, $expiration !== false ? $expiration : $this->expiration); } } ServiceLocator::register('memCache', new MemCacheService());
public function addBcc($email) { $this->mail->addBcc($email); } public function setSubject($subject) { $this->mail->setSubject($subject); } public function setFrom($email) { $this->mail->setFrom($email); } public function setBodyText($data) { $this->mail->setTXTBody($data); } public function setBodyHtml($data) { $this->mail->setHTMLBody($data); } public function getBodyHtml() { return $this->mail->getHTMLBody(); } public function addHeaderField($field, $value) { $this->arrayFields[$field] = $value; } } ServiceLocator::register('mail', new MailService());
break; } } return array_values($all_contacts); } function search_groups($search_for) { $result = array(); $query = 'select' . ' G.oid,' . ' G.id_group,' . ' G.title,' . ' G.short_name'; $query .= ' from' . ' phpgw_cc_groups G'; $query .= ' where ' . ' G.owner=' . $_SESSION['phpgw_info']['expressomail']['user']['account_id'] . ' and lower(translate(G.title, \'АЮБЦДИХЙКМЛОСРТУЖЗЫШЭаюбцдихйкмлосртужзышэГгЯя\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\'))' . ' LIKE lower(translate(\'%' . $search_for . '%\', \'АЮБЦДИХЙКМЛОСРТУЖЗЫШЭаюбцдихйкмлосртужзышэГгЯя\',\'aaaaaeeeeiiiooooouuuuAAAAAEEEEIIIOOOOOUUUUcCnN\'))'; if (!$this->db->query($query)) { return null; } while ($this->db->next_record()) { $result[] = $this->db->row(); } $all_contacts = array(); foreach ($result as $i => $object) { if (!array_key_exists($object['oid'], $all_contacts)) { $all_contacts[$object['oid']] = array('title' => '', 'short_name' => ''); } $all_contacts[$object['oid']]['title'] = $object['title']; $all_contacts[$object['oid']]['short_name'] = $object['short_name']; $all_contacts[$object['oid']]['id'] = $object['id_group']; } return array_values($all_contacts); } } ServiceLocator::register('db', new DBService());
* @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) * @sponsor Caixa Econômica Federal * @author Cristiano Corrêa Schmidt * @param int $pUidNumber uidNumber da conta * @return Array * @access public */ public function getMailAlternateByUidNumber($pUidNumber) { if (!$this->connection) { $this->connect(); } $sr = ldap_search($this->connection, $this->context, '(uidNumber=' . $pUidNumber . ')', array('mailAlternateAddress')); if (!$sr) { return false; } $returnL = ldap_get_entries($this->connection, $sr); $return = array(); if (isset($returnL[0]['mailalternateaddress'])) { foreach ($returnL[0]['mailalternateaddress'] as $i => $v) { if ($i === 'count') { continue; } $return[] = $v; } } return $return; } } ServiceLocator::register('ldap', new LdapService());