HEX
Server: Apache/2.4.25
System: Linux ion14 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64
User: (10087)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,system, exec, shell_exec, passthru, popen, proc_open
Upload Files
File: /home/www/web115/wordpress/wp-content/plugins/digimember/system/model/logic/network_config.php
<?php

$load->model( 'logic/blog_config' );

class ncore_NetworkConfigLogic extends ncore_BlogConfigLogic
{
    public function getNetworkNonce( $get_previous=false ) {

        $ttl = 45000;

        $model = ncore_api()->load->model( 'logic/network_config' );

        $this->model()->pushNetworkMode();

        if ($get_previous)
        {
            $nonce = $model->get( 'network_nonce_previous' );
        }
        else
        {
            $nonce   = $model->get( 'network_nonce_value'   );
            $created = $model->get( 'network_nonce_created' );

            $invalid = !$nonce || $created + $ttl < time();

            if ($invalid)
            {
                $model->set( 'network_nonce_previous', $nonce );

                $this->api->load->helper( 'string' );
                $nonce = ncore_randomString( 'alnum', 32 );

                $model->set( 'network_nonce_value',   $nonce );
                $model->set( 'network_nonce_created', time() );
            }
        }

        $this->model()->popNetworkMode();

        return $nonce;
    }

    public function validateNetworkNonce( $nonce ) {

        $nonce = trim( $nonce );

        if (!$nonce) {
            return false;
        }

        $model = ncore_api()->load->model( 'logic/network_config' );


        if ($nonce == $model->getNetworkNonce())
        {
            return true;
        }

        if ($nonce == $model->getNetworkNonce( $get_previous=true ))
        {
            return true;
        }

        return false;

    }

    //
    // protected
    //

    protected function defaultValues()
    {
        return array();
    }

    protected function namePrefix() {
        return 'net_';
    }

    protected function loadSettings()
    {
        $this->model()->pushNetworkMode();
        parent::loadSettings();
        $this->model()->popNetworkMode();
    }

}