403Webshell
Server IP : 104.26.2.156  /  Your IP : 216.73.216.185
Web Server : nginx/1.27.1
System : Linux us-1 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User : vinodai ( 3134)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /storage/v1396/woofsite3/public_html/wp-content/plugins/nextend-facebook-connect/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /storage/v1396/woofsite3/public_html/wp-content/plugins/nextend-facebook-connect/class-settings.php
<?php

class NextendSocialLoginSettings {

    protected $optionKey;

    protected $settings = array(
        'default' => array(),
        'stored'  => array(),
        'final'   => array()
    );

    /**
     * NextendSocialLoginSettings constructor.
     *
     * @param $optionKey             string
     * @param $defaultSettings       array
     */
    public function __construct($optionKey, $defaultSettings) {
        $this->optionKey = $optionKey;

        $this->settings['default'] = $defaultSettings;


        $storedSettings = get_option($this->optionKey);
        if ($storedSettings !== false) {
            $storedSettings = (array)maybe_unserialize($storedSettings);
        } else {
            $storedSettings = array();
        }

        $this->settings['stored'] = array_merge($this->settings['default'], $storedSettings);

        $this->settings['final'] = apply_filters('nsl_finalize_settings_' . $optionKey, $this->settings['stored']);
    }

    public function get($key, $storage = 'final') {
        if (!isset($this->settings[$storage][$key])) {
            return false;
        }

        return $this->settings[$storage][$key];
    }

    public function set($key, $value) {
        $this->settings['stored'][$key] = $value;
        $this->storeSettings();
    }

    public function getAll($storage = 'final') {
        return $this->settings[$storage];
    }

    /**
     * @param array $postedData
     *
     * @return bool
     */
    public function update($postedData) {
        if (is_array($postedData)) {
            $newData = array();
            $newData = apply_filters('nsl_update_settings_validate_' . $this->optionKey, $newData, $postedData);

            if (count($newData)) {

                $isChanged = false;
                foreach ($newData AS $key => $value) {
                    if ($this->settings['stored'][$key] != $value) {
                        $this->settings['stored'][$key] = $value;
                        $isChanged                      = true;
                    }
                }

                if ($isChanged) {
                    $allowedKeys              = array_keys($this->settings['default']);
                    $this->settings['stored'] = array_intersect_key($this->settings['stored'], array_flip($allowedKeys));

                    $this->storeSettings();

                    return true;
                }
            }
        }

        return false;
    }

    protected function storeSettings() {
        update_option($this->optionKey, maybe_serialize($this->settings['stored']));

        $this->settings['final'] = apply_filters('nsl_finalize_settings_' . $this->optionKey, $this->settings['stored']);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit