Exemple #1
0
 function saveFaxData($data, $type = '.ps')
 {
     /* Get the next ID. */
     $fax_id = $this->newFaxId();
     if (is_a($fax_id, 'PEAR_Error')) {
         return $fax_id;
     }
     /* Save data to VFS backend. */
     $path = Hylax::getVFSPath($fax_id);
     $file = $fax_id . $type;
     try {
         $this->_vfs->writeData($path, $file, $data, true);
     } catch (Horde_Vfs_Exception $e) {
         Horde::log('Could not save fax file to VFS: ' . $e->getMessage(), 'ERR');
         throw $e;
     }
     return $fax_id;
 }
Exemple #2
0
 /**
  * Modifies a pine password record for a user.
  *
  * @param string $user         The user whose record we will udpate.
  * @param string $newPassword  The new password value to set.
  *
  * @throws Passwd_Exception
  */
 protected function _modify($user, $newPassword)
 {
     for ($i = 0; $i < sizeof($this->_contents); $i++) {
         if ($this->_contents[$i][1] == $user && ($this->_contents[$i][2] == $this->_params['imaphost'] || !empty($this->_contents[$i][4]) && $this->_contents[$i][4] == $this->_params['imaphost'])) {
             $this->_contents[$i][0] = $newPassword;
         }
     }
     $string = $this->_encode($this->_contents);
     try {
         $this->_ftp->writeData($this->_params['path'], $this->_params['file'], $string);
     } catch (Horde_Vfs_Exception $e) {
         throw new Passwd_Exception($e);
     }
 }