HEX
Server: Apache
System: Linux sxb1plzcpnl440011.prod.sxb1.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: xfp2mtarcm67 (7705020)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: //proc/self/cwd/wp-content/plugins/fin-accounting-for-woocommerce/classes/settings.class.php
<?php
/**
 * Class for Settings management
 *
 *
 * @link              https://finpose.com
 * @since             2.1.0
 * @package           Finpose
 * @author            [email protected]
 */
if ( !class_exists( 'fin_settings' ) ) {
  class fin_settings extends fin_app {

    public $table = 'fin_settings';
    public $v = 'pageSettings';
    public $p = '';

    public $selyear;
    public $selmonth;
    public $selcat = '';
    public $selpage;

    public $success = false;
    public $message = '';
    public $payload = array();
    public $callback = '';

      /**
     * Constructor
     */
    public function __construct($v = 'pageSettings') {
      parent::__construct();

			// POST verification, before processing
      if($this->post) {
				$verified = wp_verify_nonce( $this->post['nonce'], 'finpost' );
				$can = current_user_can( 'view_woocommerce_reports' );
				if($verified && $can) {

					if(isset($this->post['process'])) {
						$p = $this->post['process'];

						unset(
							$this->post['process'],
							$this->post['handler'],
							$this->post['action'],
							$this->post['nonce'],
							$this->post['_wp_http_referer']
						);

						$this->$p();
					}
				}
      }
      if($v != 'ajax') { $this->$v(); }
      if($this->ask->errmsg) { $this->view['errmsg'] = $this->ask->errmsg; }
		}

		public function pageSettings() {
      $this->view['logs'] = get_option('finpose_errors');
		}

    public function getSettings() {
      $sett = get_option('finpose_settings');
      $this->payload['settings'] = $sett ? $sett : array('fiscal'=>'standard', 'dateformat'=>'usa');
      $this->payload['timezones'] = $this->presets->timezones;
      $this->payload['wc_timezone'] = get_option('timezone_string');
      $this->payload['server_timezone'] = date_default_timezone_get();
    }

    public function saveSettings() {
      $this->payload['settings'] = $this->post;
      update_option( 'finpose_settings', $this->post );
    }
  }
}