Example #1
0
 static function importCollection($url, $calendar)
 {
     ob_start();
     require_once ROOTPATH . '/plugins/davicalCliente/caldav-client-v2.php';
     $cal = new CalDAVClient(Config::service('CalDAV', 'url') . '/', Config::me('uid'), Config::me('password'));
     $events = $cal->GetCollectionETags($url);
     $args = array();
     foreach ($events as $ie => $ve) {
         $cal->DoGETRequest($ie);
         $sync = Controller::parse(array('service' => 'iCal'), $cal->GetResponseBody(), array('calendar' => $calendar, 'owner' => Config::me('uidNumber')));
         if (is_array($sync)) {
             $args = array_merge($args, $sync);
         }
     }
     include ROOTPATH . '/Sync.php';
     ob_end_clean();
 }
Example #2
0
 /**
  * Método que remove do ldap as informações do vacation
  *
  * @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
  * @param      <$uri>
  * @param      <$result>
  * @param      <$criteria>
  * @param      <$original>
  * @return     <void>
  * @access     public
  */
 public function deleteVacationRule(&$uri, &$params, &$criteria, $original)
 {
     if ($original['URI']['id'] === 'vacation') {
         $user = Controller::read(array('concept' => 'user', 'id' => config::me('uidNumber'), 'service' => 'OpenLDAP'));
         $ldapConf = Config::service('OpenLDAP', 'config');
         $con = ldap_connect($ldapConf['host']);
         ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3);
         ldap_bind($con, $ldapConf['user'], $ldapConf['password']);
         $info = array();
         $info['vacationActive'] = 'FALSE';
         $info['vacationInfo'] = "";
         ldap_modify($con, $user['dn'], $info);
         ldap_close($con);
     }
 }