function printBody() { require_once dirname(__FILE__) . '/system_controller.class.php'; $GLOBALS['system'] = $GLOBALS['system'] = System_Controller::get(); set_error_handler(array($GLOBALS['system'], '_handleError')); if ($this->readyToInstall() && $this->initInitialEntities()) { $GLOBALS['JETHRO_INSTALLING'] = 1; $this->initDB(); $this->createInitialEntities(); unset($GLOBALS['JETHRO_INSTALLING']); $this->printConfirmation(); } else { $this->printForm(); } }
define('TEMPLATE_DIR', JETHRO_ROOT . '/templates/'); // Load configuration if (!is_readable(JETHRO_ROOT . '/conf.php')) { trigger_error('Jethro configuration file not found. You need to copy conf.php.sample to conf.php and edit it before Jethro can run', E_USER_ERROR); exit; } require_once JETHRO_ROOT . '/conf.php'; // Initialise system if (!defined('DSN')) { define('DSN', constant('PRIVATE_DSN')); } require_once JETHRO_ROOT . '/include/init.php'; // Set up the user system require_once JETHRO_ROOT . '/include/user_system.class.php'; require_once JETHRO_ROOT . '/include/system_controller.class.php'; $GLOBALS['user_system'] = new User_System(); if ($GLOBALS['user_system']->getCurrentUser() == NULL) { System_Controller::checkConfigHealth(); // Nobody is logged in, so show login screen or installer if (!$GLOBALS['user_system']->hasUsers()) { require_once JETHRO_ROOT . '/include/installer.class.php'; $installer = new Installer(); $installer->run(); } else { $GLOBALS['user_system']->printLogin(); } } else { // We have a user, so run the system $GLOBALS['system'] = System_Controller::get(); System_Controller::get()->run(); }
/** * Find all services after a particular date. * * If the congregationid is specified, then only services for this congregation are returned. * @param string $date * @param int $congregationid * @return mixed Returns an array of service objects. */ public static function findAllAfterDate($date, $congregationid = null) { $db =& $GLOBALS['db']; $sql = ''; if ($congregationid == null) { $sql = 'SELECT id FROM service where date >= ' . $db->quote($date); } else { $sql = 'SELECT id FROM service where date >= ' . $db->quote($date) . ' and congregationid = ' . $db->quote($congregationid); } $res = $db->queryAll($sql); check_db_result($res); $services = array(); foreach ($res as $row) { $service = System_Controller::get()->getDBObject('service', $row['id']); $services[] = $service; } return $services; }
define('JETHRO_ROOT', dirname(dirname(__FILE__))); set_include_path(get_include_path() . PATH_SEPARATOR . JETHRO_ROOT); if (!is_readable(JETHRO_ROOT . '/conf.php')) { trigger_error('Jethro configuration file not found. You need to copy conf.php.sample to conf.php and edit it before Jethro can run', E_USER_ERROR); exit; } require_once JETHRO_ROOT . '/conf.php'; if (!defined('DSN')) { define('DSN', constant('PRIVATE_DSN')); } require_once JETHRO_ROOT . '/include/init.php'; require_once JETHRO_ROOT . '/include/user_system.class.php'; $GLOBALS['user_system'] = new User_System(); $GLOBALS['user_system']->setPublic(); require_once JETHRO_ROOT . '/include/system_controller.class.php'; $GLOBALS['system'] = System_Controller::get(); if (empty($api_key)) { trigger_error("API key not specified", E_USER_ERROR); } $api = new MCAPI($api_key); // Check for / look for a list ID if (empty($list_id)) { $lists = $api->lists(); if (!empty($api->errorMessage)) { trigger_error("Mailchimp API Error calling lists(): " . $api->errorMessage, E_USER_ERROR); } if (count($lists['data']) == 1) { $list_id = $lists['data'][0]['id']; } if (empty($list_id)) { trigger_error("Looked for a single List ID in Mailchimp but couldn't find one", E_USER_NOTICE);
<?php /** @var services **/ ?> BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Jethro/Jethro//NONSGML v1.0//EN X-WR-CALNAME:<?php echo SYSTEM_NAME; ?> Services <?php foreach ($services as $service) { $uid = 'service_' . $service->id . '_' . $service->values['date']; $congregation = System_Controller::get()->getDBObject('congregation', $service->getValue('congregationid')); $starttime = Service::getMeetingDateTime(strtotime($service->getValue('date')), $congregation->getValue('meeting_time')); // Guess end date as $date + 1 hour (3600 seconds) $endtime = $starttime + 3600; ?> BEGIN:VEVENT UID:<?php echo $uid; ?> @jethro_service <?php if (defined('MEMBER_REGO_EMAIL_FROM_NAME') && strlen(MEMBER_REGO_EMAIL_FROM_NAME)) { $fromName = MEMBER_REGO_EMAIL_FROM_NAME; } else { $fromName = 'Jethro Admin'; } if (defined('MEMBER_REGO_EMAIL_FROM_ADDRESS') && strlen(MEMBER_REGO_EMAIL_FROM_ADDRESS)) {
* Jethro PMM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jethro PMM. If not, see <http://www.gnu.org/licenses/>. * * index.php - first stop for every request * * @author Tom Barrett <*****@*****.**> * @version $Id: index.php,v 1.3 2013/03/20 11:03:53 tbar0970 Exp $ * @package jethro-pmm */ define('THIS_DIR', str_replace('\\', '/', dirname(__FILE__))); define('JETHRO_ROOT', preg_replace('#/public$#', '', THIS_DIR)); define('TEMPLATE_DIR', THIS_DIR . '/templates/'); set_include_path(get_include_path() . PATH_SEPARATOR . dirname(THIS_DIR)); // Load configuration require_once dirname(THIS_DIR) . '/conf.php'; define('DSN', PUBLIC_DSN); define('IS_PUBLIC', true); // Initialise system require_once JETHRO_ROOT . '/include/init.php'; // Init user system but don't try to auth anyone require_once JETHRO_ROOT . '/include/user_system.class.php'; $GLOBALS['user_system'] = new User_System(); $GLOBALS['user_system']->setPublic(); require_once 'include/system_controller.class.php'; $GLOBALS['system'] = System_Controller::get(THIS_DIR); $GLOBALS['system']->run();