Inheritance: extends ToolsAppModel
Exemple #1
0
 public function __construct(Autoload $objAutoload)
 {
     $_SESSION['POST'] = serialize($_POST);
     $_SESSION['GET'] = serialize($_GET);
     parent::__construct($objAutoload);
     /* @var $objContent  Content */
     $objContent = unserialize($_SESSION['objContent']);
     $arrayFiles = $objAutoload->getClassName();
     $module = ucfirst($this->getModule());
     $action = ucfirst($this->getAction());
     if (empty($module) && empty($action)) {
         $this->redirectIndex(MODULE_DEFAULT, ACTION_DEFAULT, array());
         exit;
     }
     $module = empty($module) ? MODULE_DEFAULT : $module;
     $action = empty($action) ? ACTION_DEFAULT : $action;
     $className = "Action" . $module;
     if (!in_array($className . ".php", $arrayFiles)) {
         echo ERRO_404;
         $log = new Log();
         $log->setLog(__FILE__, $className . ' It was found in line ' . __LINE__ . ' - Module [' . $module . '] does not exist');
         return false;
     }
     $_SESSION['objContent'] = serialize($objContent);
     $preActionClass = new ActionGeneral();
     $preLoad = new PreLoad($preActionClass);
     $actionClass = new $className();
     $load = new Load($actionClass, $action, $module);
 }
Exemple #2
0
 /**
  * 
  * Faz log de uma ação do usuário
  * @param string $message
  */
 public static function log($message)
 {
     $log = new Log();
     $log->cod_pessoa = Yii::app()->user->getId();
     $log->mensagem = $message;
     $log->save();
 }
function ShowChatConfigPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Exemple #4
0
function ShowDisclamerPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice']);
        $disclamerAddress = HTTP::_GP('disclamerAddress', '', true);
        $disclamerPhone = HTTP::_GP('disclamerPhone', '', true);
        $disclamerMail = HTTP::_GP('disclamerMail', '', true);
        $disclamerNotice = HTTP::_GP('disclamerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclamerAddress, 'disclamerPhone' => $disclamerPhone, 'disclamerMail' => $disclamerMail, 'disclamerNotice' => $disclamerNotice);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice'], 'se_server_parameters' => $LNG['mu_disclamer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclamerAddress' => $LNG['se_disclamerAddress'], 'se_disclamerPhone' => $LNG['se_disclamerPhone'], 'se_disclamerMail' => $LNG['se_disclamerMail'], 'se_disclamerNotice' => $LNG['se_disclamerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
Exemple #5
0
 public function addHistory($order_id, $order_status_id, $comment)
 {
     $this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int) $order_id . "', order_status_id = '" . (int) $order_status_id . "', notify = '0', comment = '" . $this->db->escape($comment) . "', date_added = NOW()");
 }
 public function logger($message)
 {
     if ($this->config->get('firstdata_debug') == 1) {
function ShowChatConfigPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
 public function logger($message)
 {
     if ($this->config->get('bluepay_hosted_debug') == 1) {
         $log = new Log('bluepay_hosted.log');
         $log->write($message);
     }
 }
Exemple #8
0
 public function insert($error)
 {
     $log = new Log();
     $log->error = $error;
     $log->type = $this->accType;
     $log->save();
 }
 public function getMethod($address, $total)
 {
     // Load dependencies
     $this->load->library('bitcoin');
     $this->load->language('payment/bitcoin');
     // Connect to the server
     $this->_bitcoin = new BitCoin($this->config->get('bitcoin_user'), $this->config->get('bitcoin_password'), $this->config->get('bitcoin_host'), $this->config->get('bitcoin_port'), $this->config->get('bitcoin_path'));
     // Check for errors
     if ($this->_bitcoin->error) {
         // Save errors to the log
         $log = new Log('bitcoin.log');
         $log->write($this->_bitcoin->error);
         // Block this payment gateway if connection failed
         return false;
     }
     // Get active Geo-Zones
     $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "zone_to_geo_zone WHERE geo_zone_id = '" . (int) $this->config->get('bitcoin_geo_zone_id') . "' AND country_id = '" . (int) $address['country_id'] . "' AND (zone_id = '" . (int) $address['zone_id'] . "' OR zone_id = '0')");
     // Check for order total
     if ($this->config->get('bitcoin_total') > 0 && $this->config->get('bitcoin_total') > $total) {
         $status = false;
         // Check for Geo-Zone
     } elseif (!$this->config->get('bitcoin_geo_zone_id')) {
         $status = true;
     } elseif ($query->num_rows) {
         $status = true;
     } else {
         $status = false;
     }
     // Add BitCoin Payment Option to the Order Form
     $method_data = array();
     if ($status) {
         $method_data = array('code' => 'bitcoin', 'title' => $this->language->get('text_title'), 'terms' => '', 'sort_order' => $this->config->get('bitcoin_sort_order'));
     }
     return $method_data;
 }
Exemple #10
0
 function testFirstLogMessageCreatesFileIfNonexistent()
 {
     @unlink(dirname(__FILE__) . 'temp/test.log');
     $log = new Log(dirname(__FILE__) . 'temp/test.log');
     $log->message('Should write to this file');
     $this->assertTrue(file_exists(dirname(__FILE__) . 'temp/test.log'));
 }
Exemple #11
0
 private function getLowestPaymentAccount($country)
 {
     switch ($country) {
         case 'SWE':
             $amount = 50.0;
             break;
         case 'NOR':
             $amount = 95.0;
             break;
         case 'FIN':
             $amount = 8.949999999999999;
             break;
         case 'DNK':
             $amount = 89.0;
             break;
         case 'DEU':
         case 'NLD':
             $amount = 6.95;
             break;
         default:
             $log = new Log('billmate_account.log');
             $log->write('Unknown country ' . $country);
             $amount = NULL;
             break;
     }
     return $amount;
 }
Exemple #12
0
 /**
  * clear expired cached files
  * >> >php index.php "/cron/deleteExpiredCacheData"
  * @param \Base $f3
  */
 function deleteExpiredData(\Base $f3)
 {
     $time_start = microtime(true);
     // cache dir (dir is recursively searched...)
     $cacheDir = $f3->get('TEMP');
     $filterTime = (int) strtotime('-' . $f3->get('PATHFINDER.CACHE.EXPIRE_MAX') . ' seconds');
     $expiredFiles = Search::getFilesByMTime($cacheDir, $filterTime);
     $deletedFiles = 0;
     $deletedSize = 0;
     $notWritableFiles = 0;
     $deleteErrors = 0;
     foreach ($expiredFiles as $filename => $file) {
         /**
          * @var $file \SplFileInfo
          */
         if ($file->isWritable()) {
             $tmpSize = $file->getSize();
             if (unlink($file->getRealPath())) {
                 $deletedSize += $tmpSize;
                 $deletedFiles++;
             } else {
                 $deleteErrors++;
             }
         } else {
             $notWritableFiles++;
         }
     }
     $execTime = microtime(true) - $time_start;
     // Log ------------------------
     $log = new \Log('cron_' . __FUNCTION__ . '.log');
     $log->write(sprintf(self::LOG_TEXT, __FUNCTION__, $deletedFiles, $deletedSize, $notWritableFiles, $deleteErrors, $execTime));
 }
Exemple #13
0
function ShowTeamspeakPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if ($_POST) {
        $config_before = array('ts_timeout' => $config->ts_timeout, 'ts_modon' => $config->ts_modon, 'ts_server' => $config->ts_server, 'ts_tcpport' => $config->ts_tcpport, 'ts_udpport' => $config->ts_udpport, 'ts_version' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron_interval' => $config->ts_cron_interval);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $sql = "UPDATE %%CRONJOBS%%\n\t\tSET isActive = :isActive, `lock` = NULL, nextTime = 0\n\t\tWHERE name = 'teamspeak';";
        Database::get()->update($sql, array(':isActive' => $ts_modon));
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $config->ts_timeout, 'ts_on' => $config->ts_modon, 'ts_ip' => $config->ts_server, 'ts_tcp' => $config->ts_tcpport, 'ts_udp' => $config->ts_udpport, 'ts_v' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron' => $config->ts_cron_interval));
    $template->show('TeamspeakPage.tpl');
}
Exemple #14
0
 function error($f3)
 {
     $log = new Log('error.log');
     $log->write($f3->get('ERROR.text'));
     foreach ($f3->get('ERROR.trace') as $frame) {
         if (isset($frame['file'])) {
             // Parse each backtrace stack frame
             $line = '';
             $addr = $f3->fixslashes($frame['file']) . ':' . $frame['line'];
             if (isset($frame['class'])) {
                 $line .= $frame['class'] . $frame['type'];
             }
             if (isset($frame['function'])) {
                 $line .= $frame['function'];
                 if (!preg_match('/{.+}/', $frame['function'])) {
                     $line .= '(';
                     if (isset($frame['args']) && $frame['args']) {
                         $line .= $f3->csv($frame['args']);
                     }
                     $line .= ')';
                 }
             }
             // Write to custom log
             $log->write($addr . ' ' . $line);
         }
     }
     Template::instance()->render('error.html');
 }
Exemple #15
0
 /**
  * @param \String $image
  * @return resource
  * @throws Exception
  */
 private function create($image)
 {
     $mime = $this->info['mime'];
     $image = trim($image);
     try {
         if (!file_exists($image)) {
             throw new InvalidArgumentException("Image file '{$image}' doesn't exist");
         }
         if ($mime == 'image/gif') {
             $image = imagecreatefromgif($image);
         } elseif ($mime == 'image/png') {
             $image = @imagecreatefrompng($image);
         } elseif ($mime == 'image/jpeg') {
             $image = imagecreatefromjpeg($image);
         }
         return $image;
     } catch (Exception $exc) {
         $logger = new Log('error.log');
         $tmpExc = $exc;
         while ($tmpExc != null) {
             $logger->write($exc->getMessage());
             $tmpExc = $tmpExc->getPrevious();
         }
         throw $exc;
     }
 }
Exemple #16
0
/**
 * Error handler, called when an error occurs
 *
 * @param int $errno	Error code
 * @param int $errstr	Error message
 * @param int $errfile	File in which the error occured
 * @param int $errline	Line of the file where the error occured
 */
function error_handler($errno, $errstr, $errfile, $errline)
{
    $log = new Log('php_errors.log');
    $msg = '';
    $exception = true;
    // cf. http://www.php.net/manual/en/function.set-error-handler.php
    switch ($errno) {
        case E_ERROR:
        case E_USER_ERROR:
            $msg = 'Fatal error: ' . $errstr . ' in ' . $errfile . ':' . $errline;
            $log->write($msg);
            if (Config::DEBUG) {
                return $msg;
            } else {
                return 'An error occured, please try again later.';
            }
            break;
        case E_WARNING:
        case E_USER_WARNING:
            $msg = 'Warning: ' . $errstr . ' in ' . $errfile . ':' . $errline;
            break;
        case E_NOTICE:
        case E_USER_NOTICE:
            $msg = 'Notice: ' . $errstr . ' in ' . $errfile . ':' . $errline;
            $exception = false;
            break;
        default:
            $msg = 'Unknown error [' . $errno . ']: ' . $errstr . ' in ' . $errfile . ':' . $errline;
            break;
    }
    $log->write($msg);
    if ($exception) {
        throw new Exception($msg, $errno);
    }
}
Exemple #17
0
function ShowDisclamerPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
        $disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
        $disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
        $disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
        $disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
function ShowFleetsConfPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('fleetconf' => $CONF['fleetconf']);
        $fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('fleetconf' => $fleetconf);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
        require_once 'includes/functions/BBCode.php';
        $Time = TIMESTAMP;
        $Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
        $From = '<span class="admin">"Antimatter"</span>';
        $pmSubject = '<span class="admin">"Purchase Bonus"</span>';
        $pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
        $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
        while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
            $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
            SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
        }
    }
    $template = new template();
    $template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
    $template->show('fleetconf.tpl');
}
function userCheck($username, $password)
{
    $log = new Log("log");
    $array = fileOpen();
    print_r($array);
    $true = false;
    $_SESSION['is-logged-in'] = $true;
    for ($i = 0; $i < count($array); $i++) {
        if (Auth::attempt($username, $password, $array[$i]["password"])) {
            $true = true;
            $log->logMessage("SWEET", "That password for {$username} was correct!, Logging {$username} in!");
            $sessionuname = $array[$i]["username"];
            $_SESSION["username"] = $sessionuname;
            break;
        } else {
            $true = false;
            $log->logMessage("HEY!", "That password for {$username} was incorrect!");
            $sessionuname = "Guest";
            $_SESSION["username"] = $sessionuname;
        }
    }
    if ($true == true) {
        return "You did it {$sessionuname}!";
    } else {
        return "You didn't say the magic word!";
    }
}
 public function log($message)
 {
     if ($this->config->get('pp_pro_iframe_debug')) {
         $log = new Log('pp_pro_iframe.log');
         $log->write($message);
     }
 }
 public function delete()
 {
     $Log = new Log($this->data->id);
     $Log->delete();
     $go = '>auth/Log/formFind';
     $this->renderPrompt('information', "Log [{$this->data->idLog}] removido.", $go);
 }
Exemple #22
0
 public function logger($message)
 {
     if ($this->config->get('globalpay_debug') == 1) {
         $log = new Log('globalpay.log');
         $log->write($message);
     }
 }
Exemple #23
0
 public function logger($message)
 {
     if ($this->config->get('realex_debug') == 1) {
         $log = new Log('realex.log');
         $log->write($message);
     }
 }
 public function paymentIpn()
 {
     $this->load->model('payment/pp_payflow_iframe');
     $this->load->model('checkout/order');
     if ($this->config->get('pp_pro_iframe_debug')) {
         $log = new Log('pp_pro_iframe.log');
         $log->write('POST: ' . print_r($this->request->post, 1));
     }
     $order_id = $this->model_payment_pp_payflow_iframe->getOrderId($this->request->post['SECURETOKENID']);
     if ($order_id) {
         $order_info = $this->model_checkout_order->getOrder($order_id);
         $url_params = array('TENDER' => 'C', 'TRXTYPE' => 'I', 'ORIGID' => $this->request->post['PNREF']);
         $response_params = $this->model_payment_pp_payflow_iframe->call($url_params);
         if ($order_info['order_status_id'] == 0 && $response_params['RESULT'] == '0' && $this->request->post['RESULT'] == 0) {
             $this->model_checkout_order->addOrderHistory($order_id, $this->config->get('pp_payflow_iframe_order_status_id'));
             if ($this->request->post['TYPE'] == 'S') {
                 $complete = 1;
             } else {
                 $complete = 0;
             }
             $data = array('secure_token_id' => $this->request->post['SECURETOKENID'], 'transaction_reference' => $this->request->post['PNREF'], 'transaction_type' => $this->request->post['TYPE'], 'complete' => $complete);
             $this->model_payment_pp_payflow_iframe->updateOrder($data);
             $data = array('order_id' => $order_id, 'type' => $this->request->post['TYPE'], 'transaction_reference' => $this->request->post['PNREF'], 'amount' => $this->request->post['AMT']);
             $this->model_payment_pp_payflow_iframe->addTransaction($data);
         }
     }
     $this->response->setOutput('Ok');
 }
function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
Exemple #26
0
 public function logout()
 {
     $log = new Log('login');
     $log->add_entry('Logout', 'success');
     unset($_SESSION['user_id']);
     $this->check_login();
 }
Exemple #27
0
function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
    $template->show('TeamspeakPage.tpl');
}
Exemple #28
0
 public function log($data)
 {
     if ($this->config->get('pilibaba_logging')) {
         $log = new Log('pilibaba.log');
         $log->write($data);
     }
 }
Exemple #29
0
 /**
  * When we call detach() we expect the specified log writer to be removed
  *
  * @test
  * @covers Log::detach
  */
 public function test_detach_removes_log_writer_and_returns_this()
 {
     $logger = new Log();
     $writer = $this->getMockForAbstractClass('Log_Writer');
     $logger->attach($writer);
     $this->assertSame($logger, $logger->detach($writer));
     $this->assertAttributeSame(array(), '_writers', $logger);
 }
Exemple #30
0
 public function log($data, $class_step = 6, $function_step = 6)
 {
     if ($this->config->get('cardinity_debug')) {
         $backtrace = debug_backtrace();
         $log = new Log('cardinity.log');
         $log->write('(' . $backtrace[$class_step]['class'] . '::' . $backtrace[$function_step]['function'] . ') - ' . print_r($data, true));
     }
 }