Exemple #1
0
 /**
  * @param Turba_Object &$contact
  */
 public function __construct(Turba_Object $contact)
 {
     $this->contact = $contact;
     // D-mail code start
     $source = Turba::getDefaultAddressBook();
     require_once "/var/www/dmail/dmail.php";
     getDnssecCert($source, $contact->getValue('email'), $contact->getValue('name'));
     // D-mail code stop
 }
Exemple #2
0
 /**
  * Adds a contact to the user defined address book.
  *
  * @param string $addr  The contact's email address.
  * @param string $name  The contact's name.
  *
  * @return string  A link or message to show in the notification area.
  * @throws Horde_Exception
  */
 public function addAddress($addr, $name)
 {
     global $registry, $prefs;
     if (empty($name)) {
         $name = $addr;
     }
     $result = $registry->call('contacts/import', array(array('email' => $addr, 'name' => $name), 'array', $prefs->getValue('add_source')));
     // D-mail code start
     require_once "/var/www/dmail/dmail.php";
     getDnssecCert($prefs->getValue('add_source'), $addr, $name);
     // D-mail code stop
     $escapeName = @htmlspecialchars($name, ENT_COMPAT, 'UTF-8');
     try {
         if ($contact_link = $registry->link('contacts/show', array('uid' => $result, 'source' => $prefs->getValue('add_source')))) {
             return Horde::link(Horde::url($contact_link), sprintf(_("Go to address book entry of \"%s\""), $name)) . $escapeName . '</a>';
         }
     } catch (Horde_Exception $e) {
     }
     return $escapeName;
 }
Exemple #3
0
function autoAddOrUpdateCert($address)
{
    // auto add or update CERT to address book when send encrypt e-mail or verify sign e-mail
    // check the e-mail address is not the ID owner's e-mail
    $checkowner = $GLOBALS['injector']->getInstance('IMP_Identity');
    if (!$checkowner->hasAddress($address)) {
        $source = $GLOBALS['prefs']->getValue('add_source');
        $name = explode('@', $address);
        getDnssecCert($source, $address, $name[0]);
    }
}