function display($file, $wrap = true, $cache_id = null, $compile_id = null) { if ($wrap && !$this->is_channel) { $this->assign('webapp_page_title', $this->page_title); $this->assign('webapp_app_title', $this->app_title); $this->assign('webapp_content_classes', implode(' ', $this->content_classes)); if (isset($this->body_style_classes)) { if (is_array($this->body_style_classes)) { $this->assign('body_style_classes', implode(' ', $this->body_style_classes)); } else { $this->assign('body_style_classes', $this->body_style_classes); } } else { $this->assign('body_style_classes', basename($file, '.tpl')); } if (isset($this->body_id)) { $this->assign('body_id', $this->body_id); } $this->addCSS('/app/core/css/all960.css'); if ($this->fluid) { $this->addCSS('/app/core/css/fluid960.css'); } //end if $this->addCSS('/app/core/css/style.css?v=1.2'); if (\PSU::isDev() && $_SESSION['username'] == 'mtbatchelder') { $this->addCSS('/app/core/css/mtbatchelder.css'); } //end if if ($GLOBALS['BASE_URL'] == 'http://' . $_SERVER['HTTP_HOST'] . '/webapp/style') { if ($_GET['old']) { $this->addCSS('/app/core/css/old_webapp_style.css'); } //end if } else { } //end if if ($GLOBALS['channel_styles']) { $this->addCSS('/webapp/my/templates/override.css'); $this->addCSS('/webapp/my/templates/channels.css'); } //end if $this->addJS('http' . ($_SERVER['HTTPS'] ? 's' : '') . '://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.js', array('head' => true)); // psu-standard scripts if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) { $this->addJS('/app/core/js/amplify.js'); $this->addJS('/app/core/js/jquery-plugins/jquery.multi-ddm.min.js'); $this->addJS('/app/core/js/behavior.js'); $this->addJS('/app/core/js/jquery-plugins/jquery.ba-dotimeout.js'); $this->addJS('/app/core/js/jquery-plugins/waypoints.js'); } else { $this->addJS('/app/core/js/standard/psu-standard.min.js'); } $this->addJS('/app/core/js/bootstrap/bootstrap.min.js'); if ($this->channel_container) { $this->addJS('/js/jquery-plugins/shadowbox/shadowbox.js'); $this->addCSS('/js/jquery-plugins/shadowbox/shadowbox.css'); $this->addJS('/webapp/my/js/combined.js?v=1'); $this->addJS('/webapp/portal/myjs/index.php?v=1.6'); $this->addJS('/webapp/my/js/loaded.js?v=1'); } //end if $this->webapp_content('css'); $this->webapp_content('host_js'); $this->webapp_content('pre_js'); $this->webapp_content('js'); $this->webapp_content('head'); $this->webapp_content('nav'); $this->webapp_content('avant_body'); $this->webapp_content('body', $this->fetch($file, $cache_id, $compile_id, false)); $this->webapp_content('apres_body'); $this->webapp_content('foot'); $this->webapp_content('apres_foot', $this->fetch(PSU_BASE_DIR . '/app/core/templates/apres_foot.tpl', $cache_id, $compile_id, false)); $this->webapp_content('apres_foot_center'); if (!$GLOBALS['suppress_theme']) { $this->addCSS('/webapp/themes/my/my.php'); $this->addJS('/webapp/themes/my/js.php'); } //end if $this->fetch(PSU_BASE_DIR . '/app/core/templates/main.tpl', $cache_id, $compile_id, true); } else { $this->fetch($file, $cache_id, $compile_id, true); } //end else if ($this->is_channel) { $params = array('callback' => $this->channel_callback ? $this->channel_callback : '$.my.channelLoad', 'channel_id' => $this->channel_id ? $this->channel_id : $_GET['channel_id']); if ($this->channel_js_callback) { $params['js_callback'] = $this->channel_js_callback; } //end if if ($this->state) { $params['state'] = $this->state; } //end if if ($this->title) { $params['title'] = $this->title; } //end if $this->addJS('http' . ($_SERVER['HTTPS'] ? 's' : '') . '://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', array('head' => true)); $this->addJS('/webapp/portal/myjs/index.php'); $this->addJS('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js'); $this->addJS('/includes/js/jquery-plugins/jquery.multi-ddm.min.js'); $this->addJS('/webapp/my/js/combined.js'); $this->addJS('/app/core/js/behavior.js'); $this->addJS('/webapp/my/js/behavior.js'); $this->assign('js_init', $params['js_callback']); $params['template_vars'] = $this->get_template_vars(); if ($_GET['output_method'] == 'js' || $_GET['output'] == 'js') { \Channel::out('callback', $params); } else { \Channel::out('html', $params); } } //end if }
<?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']); });
/** * generates a Guzzle client **/ protected function init_client($config) { $default = array('base_url' => '{{scheme}}://api.{{domain}}/{{version}}/?appid={{appid}}&appkey={{appkey}}', 'scheme' => 'https', 'version' => '0.1', 'domain' => \PSU::isDev() ? 'dev.plymouth.edu' : 'plymouth.edu'); $required = array('appid', 'appkey', 'base_url'); $config = \Guzzle\Common\Inspector::prepareConfig($config, $default, $required); $client = new \Guzzle\Service\Client($config->get('base_url'), $config); $client->setConfig($config); return $client; }
/** * Get the courses a user can see from Moodle * $moodle_path is the location of the moodle application starting from the PSU base url */ public static function getMoodleCourses($username, $moodle_path = 'webapp/courses/course/report/portal/index.php') { $moodle_curl_url = 'http://www' . (\PSU::isDev() ? '.dev' : '') . '.plymouth.edu/' . $moodle_path; $today = mktime(); $get_data = '?username='******'&time=' . $today . '&hash=' . md5($username . $today . 'monkeyballz'); $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_URL, $moodle_curl_url . $get_data); curl_setopt($ch, CURLOPT_COOKIE, $_SERVER['HTTP_COOKIE']); $moodle_json = curl_exec($ch); curl_close($ch); return json_decode($moodle_json, true); }
}); respond('/?', function ($request, $response, $app) { $contracts = new PSU\AR\PaymentPlan\Feed\Contracts(10); $disbursements = new PSU\AR\PaymentPlan\Feed\Disbursements(4); $app->tpl->assign('date_format', '%b %e @ %l:%M %P'); $app->tpl->assign('contracts', $contracts); $app->tpl->assign('disbursements', $disbursements); $app->tpl->display('payment-plans.tpl'); }); respond('/process/[contract|disbursement:script]', function ($request, $response, $app) { $script = $request->script; if ($app->running[$script]) { PSU::redirect($GLOBALS['BASE_URL'] . '/payment-plans'); } //end if $user = PSU::isDev() ? 'nrporter' : 'webguru'; if (PSU::isDev() && !IDMObject::authZ('permission', 'mis')) { $_SESSION['errors'][] = 'Only MIS can run this script in development'; PSU::redirect($GLOBALS['BASE_URL'] . '/payment-plans'); } //end if if ('contract' == $script) { $command = '/usr/local/bin/php ~' . $user . '/scripts/payment_plan_' . $script . '.php -i ' . strtolower(PSU::db('banner')->database) . ' &'; } else { $command = '/usr/local/bin/php ~' . $user . '/scripts/payment_plan_' . $script . '.php --instance=' . strtolower(PSU::db('banner')->database) . ' &'; } //end else exec($command); $_SESSION['successes'][] = 'The Payment Plan ' . ucwords($script) . ' processing script has begun. Please check back shortly.'; PSU::redirect($GLOBALS['BASE_URL'] . '/payment-plans'); });
public function process() { if ($this->psu_status == 'eod') { \PSU::db('banner')->StartTrans(); if ($this->status_flag == 'success') { if ($this->transactiontype == 1) { $this->detail_code = 'IQEW'; $this->detail_desc = 'Credit-Card-Payment-Thank You'; $this->multiplier = -1; // send notification to bursar if an unknown creditcard payment has been received if ($this->transactionstatus == 4) { $message = 'There was a "Transaction Status = 4" payment paid via Commerce Manager. Here is the debug information:' . "\n\n"; $message .= print_r($this, true); \PSU::mail('bursar@plymouth.edu,mtbatchelder@plymouth.edu', 'Alert: Unknown Credit Card Payment via Nelnet', $message); } //end if } elseif ($this->transactiontype == 2) { $this->detail_code = 'IREW'; $this->detail_desc = 'Credit-Card-Refund'; $this->multiplier = 1; // send notification to bursar if an unknown creditcard refund has been received if ($this->transactionstatus == 4) { $message = 'There was a "Transaction Status = 4" credit card refund fed by via Commerce Manager. Here is the debug information:' . "\n\n"; $message .= print_r($this, true); $email = array('*****@*****.**'); if (!\PSU::isDev()) { $email[] = '*****@*****.**'; } //end if \PSU::mail($email, 'Alert: Unknown Credit Card Refund via Nelnet', $message); } //end if } elseif ($this->transactiontype == 3) { $this->detail_code = 'IQEC'; $this->detail_desc = 'E-Check-Payment-Thank You'; $this->multiplier = -1; } //end else $this->transaction = new \PSU\AR\Transaction\Receivable($this->ordernumber, $this->totalamount / 100, $this->multiplier); $this->bursar_term = $this->transaction->term_code; $receivable_template = $this->init_template(); $this->transaction->split($receivable_template); if (\PSU::has_filter('etrans_post_split')) { \PSU::apply_filters('etrans_post_split', $this); } //end if $this->transaction->save(); if (\PSU::has_filter('etrans_post_save')) { \PSU::apply_filters('etrans_post_save', $this); } //end if $this->psu_status = 'loaded'; $this->save(); $amount = !PSU::db('banner')->HasFailedTrans() ? $this->totalamount / 100 : false; } else { $this->psu_status = 'no_load'; $this->save(); $amount = 0; } //end else PSU::db('banner')->CompleteTrans(); return $amount; } //end if PSU::db('banner')->CompleteTrans(false); return false; }
/** * return the current server's facebook credentials */ public static function fbAPI() { include 'other/facebook' . (PSU::isDev() ? '_dev' : '') . '.php'; return $_FB['facebook']; }
/** * workflow * * constructor initializes SOAP connection to the workflow wsdl * * @access public * @since version 0.1.0 */ function __construct($in = null) { if (is_null($in)) { if (PSU::isDev()) { $which = 'test'; $domain = 'https://www.dev.plymouth.edu/'; } else { $which = 'psc1'; $domain = 'https://www.plymouth.edu/'; } } else { $which = $in; } $this->_instance = $which; try { //$wsdl_url = "https://draco.plymouth.edu/wf".$this->_instance."/ws/services/WorkflowWS/v1_1?WSDL"; $wsdl_url = $domain . "webapp/workflow/" . $this->_instance . ".wsdl.xml"; if (PSU::curl($wsdl_url, PSU::FILE_GET_CONTENTS)) { $this->_client = new SoapClient($wsdl_url, array('trace' => 1, 'connection_timeout' => 5, 'cache_wsdl' => WSDL_CACHE_MEMORY)); } else { return false; } } catch (Exception $e) { return false; } $this->_num_soap_calls++; include 'oracle/' . $this->_instance . '_wf_webservice.php'; $this->_authentication = array('principal' => $_DB['oracle'][$this->_instance . '_wf_webservice']['username'], 'credential' => PSUSecurity::password_decode($_DB['oracle'][$this->_instance . '_wf_webservice']['password'])); // auth string for lookup }
require dirname(dirname(dirname(__DIR__))) . '/legacy/git-bootstrap.php'; require_once 'autoload.php'; PSU::session_start(); $config = \PSU\Config\Factory::get_config(); /*******************[Site Constants]*****************/ // Base directory of application $GLOBALS['BASE_DIR'] = dirname(__FILE__); // Base URL: whatever the URL is $GLOBALS['BASE_URL'] = $config->get('systems-workorder', 'base_url'); // Local Includes $GLOBALS['INCLUDES'] = $GLOBALS['BASE_DIR'] . '/includes'; // Templates $GLOBALS['TEMPLATES'] = $GLOBALS['BASE_DIR'] . '/templates'; /*******************[End Site Constants]*****************/ $GLOBALS['NUM_ITEMS'] = 7; if (PSU::isDev()) { $GLOBALS['ORDER_USERNAME'] = "******"; } else { $GLOBALS['ORDER_USERNAME'] = "******"; } //end else $GLOBALS['PARTS_MARKUP'] = $config->get('systems-workorder', 'parts_markup'); $GLOBALS['PARTS_MARKUP_MAX'] = $config->get('systems-workorder', 'parts_markup_max'); $GLOBALS['SHOP_EMAIL'] = "*****@*****.**"; $GLOBALS['IP'] = explode(".", $_SERVER['REMOTE_ADDR']); $sql = "SELECT ip FROM shop_authorized_ips"; $GLOBALS['HD_IPS'] = \PSU::db('systems')->GetCol($sql); $GLOBALS['IS_HD'] = in_array($_SERVER['REMOTE_ADDR'], $GLOBALS['HD_IPS']); /*******************[Includes]**********************/ require_once 'xtemplate.php'; //XTemplates
/** * returns a payment plan link */ public function paymentPlanURL($type = 'enr', $force_prod = false) { $query_string = array('S_Id' => '04007', 'SA_Id' => '01', 'a' => $this->person->id, 'b' => $this->person->formatName('f'), 'c' => $this->person->formatName('i'), 'd' => $this->person->formatName('l'), 'e' => '', 'f' => '', 'g' => '', 'h' => $this->person->address['MA'][0] ? $this->person->address['MA'][0]->street_line1 : '', 'i' => $this->person->address['MA'][0] ? $this->person->address['MA'][0]->street_line2 : '', 'j' => $this->person->address['MA'][0] ? $this->person->address['MA'][0]->city : '', 'k' => $this->person->address['MA'][0] ? $this->person->address['MA'][0]->stat_code : '', 'l' => $this->person->address['MA'][0] ? $this->person->address['MA'][0]->zip : '', 'm' => '0.00', 'n' => $this->person->phone['MA'][0] ? $this->person->phone['MA'][0]->phone_area . $this->person->phone['MA'][0]->phone_number : '', 'o' => $this->person->email['CA'][0] ? $this->person->email['CA'][0]->email_address : '', 'p' => $type, 'c1' => $this->term_code, 'c2' => '', 'c3' => '', 'c4' => '', 'c5' => '', 'c6' => '', 'c7' => '', 'c8' => ''); $query_string = http_build_query($query_string); $url = 'https://' . (\PSU::isDev() && !$force_prod ? 'demo' : 'www') . '.afford.com/IntelliLinks/IntelliLinks.aspx?' . $query_string; return $url; }
/** * returns the email addresses for list contributors * * @param $people array collection of PSUPerson objects */ public static function contributor_email($people) { $emails = array(); foreach ((array) $people as $person) { $emails[] = $person->wp_email; } //end foreach if (PSU::isDev()) { $emails = array('*****@*****.**'); if ($_SESSION['username']) { $emails[] = $_SESSION['username'] . '@plymouth.edu'; } //end if } //end if $emails = array_unique($emails); return $emails; }