public function configure() { $this->widgetSchema['allow_registration'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['allow_registration'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('allow_registration', 'Allow registration'); $this->widgetSchema['registration_granted_message'] = new sfWidgetFormTextarea(); $this->validatorSchema['registration_granted_message'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('registration_granted_message', 'Registration granted message'); $this->widgetSchema['subtitle'] = new sfWidgetFormInput(); $this->validatorSchema['subtitle'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('subtitle', 'Subtitle'); $this->widgetSchema['auth_ldap_choice'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['auth_ldap_choice'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('auth_ldap_choice', 'Use LDAP authentication'); $this->widgetSchema['auth_ldap_host'] = new sfWidgetFormInput(); $this->validatorSchema['auth_ldap_host'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('auth_ldap_host', 'LDAP Host'); $this->widgetSchema['auth_ldap_domain'] = new sfWidgetFormInput(); $this->validatorSchema['auth_ldap_domain'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('auth_ldap_domain', 'LDAP Domain name'); // Enabled by default if (!ConfigurationHelper::hasParameter('General', 'allow_registration')) { ConfigurationHelper::setParameter('General', 'allow_registration', true); } // Disabled by default if (!ConfigurationHelper::hasParameter('General', 'auth_ldap_choice')) { ConfigurationHelper::setParameter('General', 'auth_ldap_choice', false); } $this->setDefaults(ConfigurationHelper::getNamespace('General')); $this->widgetSchema->setNameFormat('generalConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
public function configure() { $backup_methods = array('none' => sfContext::getInstance()->getI18N()->__('No backup'), 'ftp' => sfContext::getInstance()->getI18N()->__('FTP')); $this->widgetSchema['backup_method'] = new sfWidgetFormChoice(array('choices' => $backup_methods)); $this->validatorSchema['backup_method'] = new sfValidatorChoice(array('choices' => array_keys($backup_methods), 'required' => true)); $this->widgetSchema->setLabel('backup_method', 'Backup method'); $this->widgetSchema['ftp_host'] = new sfWidgetFormInput(); $this->validatorSchema['ftp_host'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('ftp_host', 'FTP host'); $this->widgetSchema['ftp_service'] = new sfWidgetFormInput(); $this->validatorSchema['ftp_service'] = new sfValidatorInteger(array('min' => 1, 'max' => 65535, 'required' => false)); $this->widgetSchema->setLabel('ftp_service', 'FTP port'); $this->widgetSchema['ftp_username'] = new sfWidgetFormInput(); $this->validatorSchema['ftp_username'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('ftp_username', 'Username'); $this->widgetSchema['ftp_password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['ftp_password'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('ftp_password', 'Password'); if (!ConfigurationHelper::hasParameter('Backup', 'backup_method')) { ConfigurationHelper::setParameter('Backup', 'backup_method', 'none'); } if (!ConfigurationHelper::hasParameter('Backup', 'ftp_host')) { ConfigurationHelper::setParameter('Backup', 'ftp_host', 'ftp'); } if (!ConfigurationHelper::hasParameter('Backup', 'ftp_service')) { ConfigurationHelper::setParameter('Backup', 'ftp_service', '21'); } $this->setDefaults(ConfigurationHelper::getNamespace('Backup')); $this->widgetSchema->setNameFormat('backupConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
protected function writeInterfaces() { $network_interface = sfConfig::get('app_network_interface'); $default_network_interfaces_file = sfConfig::get('app_default_network_interfaces_file', '/etc/network/interfaces'); $values = ConfigurationHelper::getNamespace('Network'); $ipv4_type = $values['ipv4_type']; if (empty($network_interface)) { $this->logSection('tempos', 'No network interface defined in app.yml !', 1024, 'ERROR'); return false; } if (!is_writeable($default_network_interfaces_file)) { $this->logSection('tempos', sprintf('Cannot write to "%s".', $default_network_interfaces_file), 1024, 'ERROR'); return false; } $this->logSection('tempos', sprintf('IPv4 type is: "%s".', $ipv4_type), 1024); if ($ipv4_type == 'system') { $this->logSection('tempos', 'Nothing to do.', 1024); return true; } $template = array(); $template[] = sprintf('iface %s inet %s', $network_interface, $ipv4_type); if ($ipv4_type == 'static') { $ipv4_address = $values['ipv4_address']; $ipv4_netmask = $values['ipv4_netmask']; $ipv4_gateway = $values['ipv4_gateway']; $template[] = sprintf("\taddress %s", $ipv4_address); $template[] = sprintf("\tnetmask %s", $ipv4_netmask); $template[] = sprintf("\tgateway %s", $ipv4_gateway); } $template[] = ""; $template[] = ""; $file = file($default_network_interfaces_file); $newfile = array(); $add_mode = true; foreach ($file as $line) { if ($add_mode) { if (preg_match(sprintf('/^[\\t]*iface[ \\t]+%s/', $network_interface), $line)) { $add_mode = false; $newfile[] = implode("\n", $template); } else { $newfile[] = $line; } } else { if (preg_match('/^[ \\t]*(iface|mapping|auto|allow-)/', $line)) { $add_mode = true; $newfile[] = $line; } } } $fp = fopen($default_network_interfaces_file, 'w'); if ($fp) { fwrite($fp, implode('', $newfile)); fclose($fp); } else { $this->logSection('tempos', sprintf('Cannot open "%s" for writing.', $default_network_interfaces_file), 1024, 'ERROR'); return false; } return true; }
public function configure() { $encryption_methods = array('none' => sfContext::getInstance()->getI18N()->__('No encryption'), 'ssl' => sfContext::getInstance()->getI18N()->__('SSL'), 'tls' => sfContext::getInstance()->getI18N()->__('TLS')); $this->widgetSchema['use_mail'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['use_mail'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('use_mail', 'Use mail'); $this->widgetSchema['smtp_host'] = new sfWidgetFormInput(); $this->validatorSchema['smtp_host'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('smtp_host', 'SMTP host'); $this->widgetSchema['smtp_service'] = new sfWidgetFormInput(); $this->validatorSchema['smtp_service'] = new sfValidatorInteger(array('min' => 1, 'max' => 65535, 'required' => false)); $this->widgetSchema->setLabel('smtp_service', 'SMTP port'); $this->widgetSchema['from'] = new sfWidgetFormInput(); $this->validatorSchema['from'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('from', 'From'); $this->widgetSchema['override_from'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['override_from'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('override_from', 'Always override from ?'); $this->widgetSchema['smtp_encryption_method'] = new sfWidgetFormChoice(array('choices' => $encryption_methods)); $this->validatorSchema['smtp_encryption_method'] = new sfValidatorChoice(array('choices' => array_keys($encryption_methods), 'required' => true)); $this->widgetSchema->setLabel('smtp_encryption_method', 'Encryption method'); $this->widgetSchema['smtp_use_authentication'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['smtp_use_authentication'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('smtp_use_authentication', 'Use authentication'); $this->widgetSchema['smtp_username'] = new sfWidgetFormInput(); $this->validatorSchema['smtp_username'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('smtp_username', 'Username'); $this->widgetSchema['smtp_password'] = new sfWidgetFormInputPassword(); $this->validatorSchema['smtp_password'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('smtp_password', 'Password'); $this->widgetSchema['signature'] = new sfWidgetFormTextarea(); $this->validatorSchema['signature'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('signature', 'Signature'); $this->validatorSchema['from'] = new sfValidatorAnd(array($this->validatorSchema['from'], new sfValidatorEmail())); if (!ConfigurationHelper::hasParameter('Email', 'use_mail')) { ConfigurationHelper::setParameter('Email', 'use_mail', false); } if (!ConfigurationHelper::hasParameter('Email', 'smtp_host')) { ConfigurationHelper::setParameter('Email', 'smtp_host', 'smtp'); } if (!ConfigurationHelper::hasParameter('Email', 'smtp_service')) { ConfigurationHelper::setParameter('Email', 'smtp_service', '25'); } if (!ConfigurationHelper::hasParameter('Email', 'from')) { ConfigurationHelper::setParameter('Email', 'from', '*****@*****.**'); } if (!ConfigurationHelper::hasParameter('Email', 'signature')) { ConfigurationHelper::setParameter('Email', 'signature', "\n\n--------------------\n\nThis message was sent to you from the Tempo's system.\n\nGo to http://tempos.islog-services.eu to get more information."); } $this->setDefaults(ConfigurationHelper::getNamespace('Email')); $this->widgetSchema->setNameFormat('emailConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
public function configure() { $this->widgetSchema['print_reserved_by'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_reserved_by'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_reserved_by', 'Display "Reserved by"'); if (!ConfigurationHelper::hasParameter('Print', 'print_reserved_by')) { ConfigurationHelper::setParameter('Print', 'print_reserved_by', true); } $this->widgetSchema['print_reserved_for'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_reserved_for'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_reserved_for', 'Display "Reserved for"'); if (!ConfigurationHelper::hasParameter('Print', 'print_reserved_for')) { ConfigurationHelper::setParameter('Print', 'print_reserved_for', true); } $this->widgetSchema['print_reason'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_reason'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_reason', 'Display "Reason"'); $this->widgetSchema['print_time'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_time'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_time', 'Display "Time"'); $this->widgetSchema['print_duration'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_duration'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_duration', 'Display "Duration"'); $this->widgetSchema['print_custom_field1'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_custom_field1'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_custom_field1', 'Display "Custom field 1"'); $this->widgetSchema['print_custom_field2'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_custom_field2'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_custom_field2', 'Display "Custom field 2"'); $this->widgetSchema['print_custom_field3'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_custom_field3'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_custom_field3', 'Display "Custom field 3"'); $this->widgetSchema['print_status'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_status'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_status', 'Display "Status"'); $this->widgetSchema['print_profile'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_profile'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_profile', 'Display "Physical access"'); $this->widgetSchema['print_title'] = new sfWidgetFormInputCheckbox(); $this->validatorSchema['print_title'] = new sfValidatorBoolean(array('required' => false)); $this->widgetSchema->setLabel('print_title', 'Display titles'); $this->setDefaults(ConfigurationHelper::getNamespace('Print')); $this->widgetSchema->setNameFormat('printConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
public function configure() { $ipv4_types = array('system' => sfContext::getInstance()->getI18N()->__('System'), 'dhcp' => sfContext::getInstance()->getI18N()->__('DHCP'), 'static' => sfContext::getInstance()->getI18N()->__('Static')); $this->widgetSchema['ipv4_type'] = new sfWidgetFormChoice(array('choices' => $ipv4_types)); $this->validatorSchema['ipv4_type'] = new sfValidatorChoice(array('choices' => array_keys($ipv4_types), 'required' => true)); $this->widgetSchema->setLabel('ipv4_type', 'IPv4 type'); $this->widgetSchema['ipv4_address'] = new sfWidgetFormInput(); $this->validatorSchema['ipv4_address'] = new sfValidatorIPv4Address(array('required' => false)); $this->widgetSchema->setLabel('ipv4_address', 'IPv4 address'); $this->widgetSchema['ipv4_netmask'] = new sfWidgetFormInput(); $this->validatorSchema['ipv4_netmask'] = new sfValidatorIPv4Address(array('required' => false)); $this->widgetSchema->setLabel('ipv4_netmask', 'IPv4 netmask'); $this->widgetSchema['ipv4_gateway'] = new sfWidgetFormInput(); $this->validatorSchema['ipv4_gateway'] = new sfValidatorIPv4Address(array('required' => false)); $this->widgetSchema->setLabel('ipv4_gateway', 'IPv4 gateway'); $this->setDefaults(ConfigurationHelper::getNamespace('Network')); $this->widgetSchema->setNameFormat('networkConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
public function configure() { $this->widgetSchema['activity_module'] = new sfWidgetFormInput(); $this->validatorSchema['activity_module'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('activity_module', 'Activities module'); $this->widgetSchema['activity_label'] = new sfWidgetFormInput(); $this->validatorSchema['activity_label'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('activity_label', 'Activities item'); $this->widgetSchema['reservation_custom_field_1'] = new sfWidgetFormInput(); $this->validatorSchema['reservation_custom_field_1'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('reservation_custom_field_1', 'Free field 1'); $this->widgetSchema['reservation_custom_field_2'] = new sfWidgetFormInput(); $this->validatorSchema['reservation_custom_field_2'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('reservation_custom_field_2', 'Free field 2'); $this->widgetSchema['reservation_custom_field_3'] = new sfWidgetFormInput(); $this->validatorSchema['reservation_custom_field_3'] = new sfValidatorString(array('required' => false)); $this->widgetSchema->setLabel('reservation_custom_field_3', 'Free field 3'); $this->setDefaults(ConfigurationHelper::getNamespace('Rename')); $this->widgetSchema->setNameFormat('renameConfiguration[%s]'); $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema); }
/** * Get the configuration. * * \return The configuration array. */ public function getConfiguration() { $configuration = ConfigurationHelper::getNamespace($this->getName()); return array_merge($this->defaultValues, $configuration); }
protected function execute($arguments = array(), $options = array()) { $this->configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', true); $this->context = sfContext::createInstance($this->configuration); $databaseManager = new sfDatabaseManager($this->configuration); ConfigurationHelper::load(); $nb_controllers = ConfigurationHelper::get('number_of_physical_access'); $reservations = ReservationPeer::doSelectPendingReservations($options['include-inactive'], $delayedTime); if (empty($reservations)) { $this->logSection('tempos', 'check - No reservations pending. Doing nothing.', 1024); } else { $this->logSection('tempos', sprintf('check - %d reservation(s) pending.', count($reservations)), 1024); $i = 0; foreach ($reservations as $reservation) { $roomprofile_id = $reservation->getRoomprofile()->getId(); $roomprofile = RoomprofilePeer::doSelectFromId($roomprofile_id); $rp_controllername = $roomprofile->getConfiguredControllerName(); $pac_infos = BasePhysicalAccessController::findPacFromNameIdentifier($rp_controllername); if (is_null($pac_infos) || empty($pac_infos)) { $this->logSection('tempos', sprintf('check - Can\'t create a physical access controller for this reservation: id(%s)', $reservation->getId()), 1024); continue; } $pac_name = $pac_infos['name']; // print 'pac_name: '; // var_dump($pac_name); $pac_id = $pac_infos['id']; // print 'pac_id: '; // var_dump($pac_id); $pac_selec = ConfigurationHelper::getParameter(null, $pac_name); // print 'pac_selec: '; // var_dump($pac_selec); $pac_conf = ConfigurationHelper::getNamespace($pac_selec . $pac_id); // print 'pac_conf: '; // var_dump($pac_conf); // var_dump($pac_infos); $pac = BasePhysicalAccessController::create($pac_selec, $pac_conf); // var_dump($pac); $delay = $pac->getParameter('delay'); // print 'delay: '; // var_dump($delay); $pac->setVerbose($options['verbose']); $this->logSection('tempos', sprintf('check - Creating a physical access controller: %s', $pac->getName()), 1024); if (is_null($delay) || empty($delay)) { $delay = 0; } $now = time(); $delayedTime = time() + $delay * 60; // Need to add the delay in milliseconds to the time() function $this->logSection('tempos', sprintf('check - Checking reservations at: %s', strftime('%c', $now)), 1024); if ($delay > 0) { $this->logSection('tempos', sprintf('check - There is a starting delay ! Need to start reservation %s minutes before the reservation date !', $delay), 1024); $this->logSection('tempos', sprintf('check - Finally looking reservations at: %s', strftime('%c', $delayedTime)), 1024); } if ($delay > 0) { $this->logSection('tempos', sprintf("check - \t(%d)\tBefore delay: %s", $i, $reservation->__toString()), 1024); $reservation->updateDateWithDelay($delay); $this->logSection('tempos', sprintf("check - \t(%d)\tAfter delay: %s", $i, $reservation->__toString()), 1024); } else { $this->logSection('tempos', sprintf("check - \t(%d)\tReservation: %s", $i, $reservation->__toString()), 1024); } $results = $pac->sendReservation($reservation, $options['update-status']); if (empty($results)) { $this->logSection('tempos', sprintf("check - \t\tSuccess."), 1024); } else { foreach ($results as $result) { $this->logSection('tempos', sprintf("check - \t\t%s: %s", $result['person'], $result['exception']->getMessage()), 1024, 'ERROR'); } } $i++; } } }
private static function findHac($action) { $action_controllername = $action->getConfiguredControllerName(); $hac_infos = BaseHomeAutomationController::findHacFromNameIdentifier($action_controllername); // var_dump($action_controllername); if (is_null($hac_infos)) { return null; } $hac_name = $hac_infos['name']; // print 'hac_name: '; // var_dump($hac_name); $hac_id = $hac_infos['id']; // print 'hac_id: '; // var_dump($hac_id); $hac_selec = ConfigurationHelper::getParameter(null, $hac_name); // print 'hac_selec: '; // var_dump($hac_selec); $hac_conf = ConfigurationHelper::getNamespace($hac_selec . $hac_id); // print 'hac_conf: '; // var_dump($hac_conf); // var_dump($hac_infos); $hac = BaseHomeAutomationController::create($hac_selec, $hac_conf); // var_dump($hac); return $hac; }
protected function execute($arguments = array(), $options = array()) { $this->configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'prod', true); $this->context = sfContext::createInstance($this->configuration); $databaseManager = new sfDatabaseManager($this->configuration); ConfigurationHelper::load(); $nb_controllers = ConfigurationHelper::get('number_of_physical_access'); $now = time(); $startCheckTime = $now + $delay * 60; // Need to add the delay in milliseconds to the time() function $stopCheckTime = $startCheckTime + $options['hours'] * 60 * 60; $this->logSection('tempos', sprintf("check-for-next-hours - Checking reservations started at: %s", strftime('%c', $now)), 1024); $this->logSection('tempos', sprintf("check-for-next-hours - Start delay (%s) minutes --> Start date reservation is: %s", $delay, strftime('%c', $startCheckTime)), 1024); $this->logSection('tempos', sprintf("check-for-next-hours - NB hours to check (%s) --> End date reservation check: %s", $options['hours'], strftime('%c', $stopCheckTime)), 1024); $reservations = ReservationPeer::doSelectPendingReservationsForNextHours($options['include-inactive'], $startCheckTime, $stopCheckTime); if (empty($reservations)) { $this->logSection('tempos', "check-for-next-hours - No reservations pending. Doing nothing.", 1024); } else { $this->logSection('tempos', sprintf("check-for-next-hours - %d reservation(s) pending.", count($reservations)), 1024); $uniquePersonsArray = array(); $i = 0; foreach ($reservations as $reservation) { $roomprofile_id = $reservation->getRoomprofile()->getId(); $roomprofile = RoomprofilePeer::doSelectFromId($roomprofile_id); $rp_controllername = $roomprofile->getConfiguredControllerName(); $pac_infos = BasePhysicalAccessController::findPacFromNameIdentifier($rp_controllername); if (is_null($pac_infos) || empty($pac_infos)) { continue; } $pac_name = $pac_infos['name']; // print 'pac_name'; // var_dump($pac_name); $pac_id = $pac_infos['id']; // print 'pac_id'; // var_dump($pac_id); $pac_selec = ConfigurationHelper::getParameter(null, $pac_name); // print 'pac_selec'; // var_dump($pac_selec); $pac_conf = ConfigurationHelper::getNamespace($pac_selec . $pac_id); // print 'pac_conf'; // var_dump($pac_conf); // var_dump($pac_infos); $pac = BasePhysicalAccessController::create($pac_selec, $pac_conf); // var_dump($pac); $delay = $pac->getParameter('delay'); // print 'delay'; // var_dump($delay); $pac->setVerbose($options['verbose']); if (is_null($delay) || empty($delay)) { $delay = 0; } $this->logSection('tempos', sprintf('check - Creating a physical access controller: %s', $pac->getName()), 1024); $this->logSection('tempos', sprintf("check-for-next-hours - \t(%d)\tProcessing reservation: %s...", $i, $reservation->__toString()), 1024); $persons = $reservation->getAllPersons(); $finalPersons = array(); // Filter the list of persons. We only send the first reservation for each member. // If the user is already in the list, we remove him from the reservation. foreach ($persons as $person) { $this->logSection('tempos', sprintf("check-for-next-hours - \t(%d)\tProcessing user (%s)...", $i, $person), 1024); $uniqueId = $person->getUniqueId(); if (isset($uniquePersonsArray[$uniqueId])) { $this->logSection('tempos', sprintf("check-for-next-hours - \t(%d)\tUser (%s) had already a reservation... Ignoring him...", $i, $person->__toString()), 1024); } else { $uniquePersonsArray[$uniqueId] = 1; $finalPersons[] = $person; } } if (!empty($finalPersons)) { if ($delay > 0) { $this->logSection('tempos', sprintf("check-for-next-hours - \t(%d)\tDelay required ! Before delay: %s", $i, $reservation->getDateString()), 1024); $reservation->updateDateWithDelay($delay); $this->logSection('tempos', sprintf("check-for-next-hours - \t(%d)\tAfter delay: %s", $i, $reservation->getDateString()), 1024); } $results = $pac->sendReservation($reservation, $options['update-status'], $finalPersons); if (empty($results)) { $this->logSection('tempos', sprintf("check-for-next-hours - \t\tSuccess."), 1024); } else { foreach ($results as $result) { $this->logSection('tempos', sprintf("check-for-next-hours - \t\t%s: %s", $result['person'], $result['exception']->getMessage()), 1024, 'ERROR'); } } } else { $this->logSection('tempos', sprintf("check-for-next-hours - \t\tNo more user in the reservation. Doing nothing."), 1024); } $i++; } } }