From 1f4933c0917263c2814ff7f736b4ae6ef67a863c Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 24 Jul 2022 01:04:50 -0400 Subject: [PATCH] Up to date code --- www/wr_crons/backend.php | 7 +++++-- www/wr_crons/wrb_offer_refund.php | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/www/wr_crons/backend.php b/www/wr_crons/backend.php index b6326f35..0ff1682f 100644 --- a/www/wr_crons/backend.php +++ b/www/wr_crons/backend.php @@ -7,8 +7,11 @@ class backend { var $wrenchboard; function __construct() { - - $this->USER = (array_key_exists('PWD',$_SERVER) && is_dir($_SERVER['PWD'])) ? $_SERVER['PWD'] : $_SERVER['SCRIPT_FILENAME']; + if (array_key_exists('PWD',$_SERVER) && is_dir($_SERVER['PWD'])) { + $this->USER = $_SERVER['PWD']; + } else { + $this->USER = $_SERVER['SCRIPT_FILENAME']; + } $this->USER = str_replace('/home', '', $this->USER); $this->USER = strtok($this->USER, '/'); if ($this->USER == 'opt') { diff --git a/www/wr_crons/wrb_offer_refund.php b/www/wr_crons/wrb_offer_refund.php index a52a7916..fdceac08 100644 --- a/www/wr_crons/wrb_offer_refund.php +++ b/www/wr_crons/wrb_offer_refund.php @@ -7,6 +7,7 @@ $out = array(); $in['action'] = WRB_JOB_CRONJOB; $in['call_action'] = WRB_CRONJOB_OFFER_REFUND_ALERT; $in['one_limit'] = 1; +$out = array(); $wrb->wrenchboard_api($in,$out); print_r($out);