<?php include_once '../common.php'; $GLOBALS['p_administrators'] = array('nrporter', 'lrwilcox'); /*******************[End Site Constants]*****************/ /*******************[Authentication Stuff]*****************/ if (!$_GET['hash']) { $_SESSION['username'] = IDMObject::authN(); if (!in_array($_SESSION['username'], $GLOBALS['p_administrators'])) { echo 'You do not have access to use this application'; exit; } //end if } //end if /*******************[End Authentication Stuff]*****************/
<?php require_once 'autoload.php'; PSU::session_start(); // force ssl + start a session $GLOBALS['BASE_URL'] = '/webapp/mobile-notifications'; $GLOBALS['BASE_DIR'] = __DIR__; $GLOBALS['TITLE'] = 'PSU Mobile Notifications'; $GLOBALS['TEMPLATES'] = $GLOBALS['BASE_DIR'] . '/templates'; $GLOBALS['EMERGENCY_GROUP'] = 8306124; require_once 'klein/klein.php'; if (file_exists($GLOBALS['BASE_DIR'] . '/debug.php')) { include $GLOBALS['BASE_DIR'] . '/debug.php'; } IDMObject::authN(); /** * Routing provided by klein.php (https://github.com/chriso/klein.php) * Make some objects available elsewhere. */ respond(function ($request, $response, $app) { // initialize the template $app->tpl = new PSUTemplate(); // get the logged in user $app->user = PSUPerson::get($_SESSION['wp_id']); $app->groups = array(); // assign user to template $app->tpl->assign('user', $app->user); $app->config = new PSU\Config(); $app->config->load(); if ('Registered and confirmed' == $app->user->rave_state) { $rave_user = \PSU\Rave\User::get($app->user->wpid);
<?php PSU::get()->banner = PSU::db('psc1'); respond('/?', function ($request, $response, $app) { $ecommerce_running = shell_exec('ps ef | grep ecommerce_process.php | grep -v grep'); if ($ecommerce_running) { $_SESSION['messages'][] = 'The ECommerce processing script is currently running. Reload to check the status.'; $app->tpl->assign('ecommerce_processing', true); } //end if $app->tpl->assign('ecommerce_pending_files', \PSU\Ecommerce::pending_files()); $app->tpl->assign('ecommerce_pending', \PSU\Ecommerce::pending()); $app->tpl->assign('ecommerce_files', \PSU\Ecommerce::file_info()); $app->tpl->assign('ecommerce_report', \PSU\Ecommerce::report()); $app->tpl->display('ecommerce.tpl'); }); respond('/process', function ($request, $response, $app) { $user = PSU::isDev() ? 'nrporter' : 'webguru'; if (PSU::isDev() && !IDMObject::authN('mis')) { return; } //end if $command = '~' . $user . '/scripts/ecommerce_process.php --instance=' . strtolower(PSU::db('banner')->database) . ' &'; exec($command); $_SESSION['successes'][] = 'The ECommerce processing script has begun. Please check back shortly.'; PSU::redirect($GLOBALS['BASE_URL']); });
// Iterate all valid document roots, looking for this file foreach ($valid_roots as $root) { if ($fullpath = realpath($root . '/' . $path)) { if (substr($fullpath, 0, strlen($root) + 1) === $root . '/') { break; } } $fullpath = false; } // Production currently specifies "RewriteCond %{REQUEST_FILENAME} -f", so // in theory we won't reach this line of code. if (false == $fullpath || !is_file($fullpath)) { header('HTTP/1.1 404 Not Found'); exit('File not found error (' . $path . ')'); } $user = IDMObject::authN(); $fullpath_dir = dirname($fullpath); // Find path to our "secure" directory if ('/secure' === substr($fullpath_dir, -7)) { $secure_dir = $fullpath_dir; } else { $parts = explode('/', $fullpath_dir); while ('secure' !== array_pop($parts)) { if (0 === count($parts)) { break; } } $secure_dir = implode('/', $parts) . '/secure'; } // Examine optional .htrole if (file_exists($htrole = $secure_dir . '/.htrole')) {
/** * displays a ticket's public updates */ public function ticket($ticket) { IDMObject::authN(); $sql = "SELECT *,\n\t\t\t\t\t\t\t\t\t CONCAT(date_assigned, ' ', time_assigned) update_date\n\t\t\t FROM call_history\n\t\t\t\t\t\t WHERE call_id = ?\n AND (updated_by = ?\n\t\t\t\t\t\t OR\n\t\t\t\t\t\t tlc_assigned_to = ?\n\t\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\tupdated_by = ?\n\t\t\t\t\t\t\t\t\t\tOR\n\t\t\t\t\t\t\t\t\t\ttlc_assigned_to = ?\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t ORDER BY date_assigned, time_assigned"; $args = array($ticket, $this->myuser->login_name, $this->myuser->login_name, $this->myuser->wp_id, $this->myuser->wp_id); $details = PSU::db('calllog')->GetAll($sql, $args); foreach ($details as &$detail) { $p = new PSUPerson($detail['updated_by']); $detail['updated_by_name'] = $p->wp_id == $_SESSION['wp_id'] ? 'You' : $p->formatName('f'); $p->destroy(); unset($p); } //end foreach $sql = "SELECT call_status\n\t\t\t FROM call_history\n\t\t\t\t\t\t WHERE call_id = ? AND current = 1"; $args = array($ticket); $this->tpl->assign('call_status', PSU::db('calllog')->GetOne($sql, $args)); $this->tpl->assign('details', $details); $this->tpl->assign('ticket', $ticket); $tpl = new PSUSmarty(); $tpl->assign('hide_checklist', true); $tpl->assign('details_title', 'Update Ticket'); $form = $tpl->fetch(PSU_BASE_DIR . '/webapp/calllog/templates/ticket_form.tpl'); $this->tpl->assign('form', $form); $this->tpl->display('ticket.tpl'); }
<?php require dirname(dirname(__DIR__)) . '/legacy/git-bootstrap.php'; require_once 'autoload.php'; PSU::session_start(); /*******************[Site Constants]*****************/ // Base directory of application $GLOBALS['BASE_DIR'] = dirname(__FILE__); // Base URL $GLOBALS['BASE_URL'] = 'https://' . $_SERVER['HTTP_HOST'] . '/webapp/raintix'; // Local Includes $GLOBALS['LOCAL_INCLUDES'] = $GLOBALS['BASE_DIR'] . '/includes'; // Templates $GLOBALS['TEMPLATES'] = $GLOBALS['BASE_DIR'] . '/templates'; $GLOBALS['TITLE'] = 'Inclement Weather Tickets'; /*******************[End Site Constants]*****************/ /*******************[Authentication Stuff]*****************/ if (!strstr($_SERVER['SCRIPT_FILENAME'], 'search.html')) { $username = IDMObject::authN(); } /*******************[End Authentication Stuff]*****************/ $valid_users = array('mtbatchelder', 'blyndes');