<?php db_include('get_role_by_abbreviation', 'get_officer_info'); $position = get_role_by_abbreviation($_GET['name']); if ($position) { $position_name = $position['name']; $position_description = $position['description_html']; } else { $position_name = 'Officer Not Found'; $position_description = 'Officer position not found!'; } $officers = get_officer_info($position['role']); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - <?php echo $position_name; ?> </title> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> <body> <?php ui_insert('header'); ?> <div class="container">
<?php db_include('get_blog_posts', 'get_max_and_min_blog_post'); $offset = isset($_GET['page']) ? $_GET['page'] : 0; $prev = $offset - 1; $next = $offset + 1; $max_min = get_max_and_min_blog_post(); $all_max = $max_min['max']; $all_min = $max_min['min']; $blog_posts = get_blog_posts(7, $offset); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch</title> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> <body> <?php ui_insert('header'); ?> <div class="container"> <?php ui_insert('sidebar'); ?> <div class="primary">
<?php db_include('get_webpage_access_allowed'); lib_include('ical_lib'); $now = new DateTime(); $end = new DateTime(); $now = $now->sub(new DateInterval('P1D')); $end = $end->add(new DateInterval('P3W')); $icsDates = ics_to_array(URL_ICAL_BOOKING); $events = get_ics_events($icsDates, $now, $end); usort($events, 'compare_ics_events'); ?> <aside> <?php if (get_webpage_access_allowed('ui/sidebar_admin.php')) { include 'sidebar_admin.php'; } ?> <center><b>Upcoming Events</b></center> <?php foreach ($events as $key => $value) { ?> <br /> <?php echo "{$value['Date']} {$value['Time']}"; ?> <br /> <?php
<?php db_include('create_member'); if (!isset($_POST['email']) || !isset($_POST['password'])) { $display_message = 'No email address or password provided!'; $redirect = '/user/accountform.php'; } else { $member_pk = create_member($_POST['email'], $_POST['firstname'], $_POST['lastname'], $_POST['password']); if ($member_pk) { $display_message = 'Successfully created account! You may log in now.'; $redirect = '/index.php'; } else { $display_message = "An account with the specified email - <b>{$_POST['email']}</b> - already exists!"; $redirect = '/user/accountform.php'; } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - Creating Account...</title> <meta http-equiv="refresh" content="3;url=<?php echo $redirect; ?> " /> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> <body>
<?php db_include('get_blog_post'); if (!is_admin()) { header('HTTP/1.0 403 Forbidden'); echo 'Access is forbidden!'; exit; } if (!isset($_GET['id'])) { $message = 'No post ID specified!'; } else { if (isset($_POST['blog_fail_return']) && $_POST['blog_fail_return']) { $title = $_POST['title']; $body = $_POST['body']; } else { $blog_post = get_blog_post($_GET['id']); if (!$blog_post) { $message = 'Invalid post ID specified!'; } else { $title = $blog_post['title']; $body = $blog_post['body']; } } } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - Edit Blog Post</title>
<?php db_include('create_or_update_blog_post'); lib_include('email_lib'); if (!is_admin()) { header('HTTP/1.0 403 Forbidden'); $display_message = 'Access forbidden!'; $redirect = '/index.php'; } else { $params = ['title' => $_POST['title'], 'body' => $_POST['body'], 'author' => SessionLib::get('user_member.member')]; $posted = create_or_update_blog_post($params); if ($posted) { $display_message = 'Wrote post! <br />'; $redirect = "/blog/blog.php?id={$posted}"; if (isset($_POST['sendemail']) && $_POST['sendemail']) { $sent_mail = send_html_email('*****@*****.**', $_POST['title'], $_POST['body']); $display_message .= $sent_email ? 'Sent email!' : 'Failed to send email!'; } } else { $display_message = 'Failed to write post!'; $redirect = '/blog/writeblog.php'; $_POST['blog_fail_return'] = true; } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>Under the Couch - Posting Blog Post...</title>
<?php db_include('get_member_by_login_credentials'); $password = @$_POST['password']; $email = @$_POST['email']; if (!isset($email) || !isset($password)) { $display_message = 'No email address or password provided!'; $redirect = '/login.php'; } else { list($display_message, $redirect) = login($email, $password); } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - Logging In...</title> <meta http-equiv="refresh" content="3;url=<?php echo $redirect; ?> " /> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> <body> <?php ui_insert('header'); ?> <center>
// set up the content-negotiation template paths if (is_dir($app . $env['view_folder'])) { $request->set_template_path($app . $env['view_folder'] . DIRECTORY_SEPARATOR); } else { $request->set_template_path($env['view_folder'] . DIRECTORY_SEPARATOR); } if (is_dir($app . $env['layout_folder'])) { $request->set_layout_path($app . $env['layout_folder'] . DIRECTORY_SEPARATOR); } else { $request->set_layout_path($env['layout_folder'] . DIRECTORY_SEPARATOR); } /** * connect to the database with settings from config.yml */ // load dbscript database support classes db_include(array('database', 'model', 'record', 'recordset', 'resultiterator', $adapter)); if (DB_NAME) { $database = DB_NAME; } if (DB_USER) { $username = DB_USER; } if (DB_PASSWORD) { $password = DB_PASSWORD; } if (DB_HOST) { $host = DB_HOST; } // init the Database ($db) object and connect to the database $db = new $adapter($host, $database, $username, $password); /**
<?php db_include('get_equipment_manager_email'); $email = get_equipment_manager_email(); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - Recording</title> <link rel="stylesheet" type="text/css" href="/styles.css" /> <?php js_include('jquery-2.1.1.min', 'jquery-validation-1.13.0/jquery.validate.min'); ?> </head> <body> <?php ui_insert('header'); ?> <div class="container"> <?php ui_insert('sidebar'); ?> <div class="primary"> <article> Under the Couch has a freshly built studio.
<?php db_include('get_member_session_by_key', 'create_or_update_member_session_by_key', 'delete_member_session_by_key', 'delete_stale_member_sessions'); class GTMNSessionHandler implements SessionHandlerInterface { private $dbHandle; private $cookie; const _SESSION_NAME = 'gtmn'; const _SESSION_TIMEOUT_SECONDS = 3600; const _LIFETIME = 'lifetime'; const _PATH = 'path'; const _DOMAIN = 'domain'; const _SECURE = 'secure'; const _HTTP_ONLY = 'http_only'; public function __construct() { $this->cookie = [self::_LIFETIME => 0, self::_PATH => '/', self::_DOMAIN => $_SERVER['SERVER_NAME'], self::_SECURE => @$_SERVER['HTTPS'] ?: false, self::_HTTP_ONLY => true]; ini_set('session.use_cookies', 1); ini_set('session.use_only_cookies', 1); session_name(self::_SESSION_NAME); session_set_cookie_params($this->cookie[self::_LIFETIME], $this->cookie[self::_PATH], $this->cookie[self::_DOMAIN], $this->cookie[self::_SECURE], $this->cookie[self::_HTTP_ONLY]); } public function open($save_path, $session_name) { error_log("SessionHandler::open() called!"); $this->dbHandle = get_or_connect_to_db(); return $this->dbHandle !== null; } public function close() { error_log("SessionHandler::close() called!");
<?php db_include('delete_blog_post'); if (!is_admin()) { header('HTTP/1.0 403 Forbidden'); $display_message = 'Access forbidden!'; } else { $deleted = delete_blog_post($_GET['id']); $display_message = $deleted ? 'Deleted from table!' : "Could not delete post {$_GET['id']}!"; } ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <title>Under the Couch - Deleting post...</title> <meta http-equiv="refresh" content="3;url=/index.php" /> <link rel="stylesheet" type="text/css" href="/styles.css" /> </head> <body> <?php ui_insert('header'); ?> <article> <?php echo $display_message; ?> </article>