\MainWP\ChildMainWP_Connect

Class MainWP_Connect

Manage connection between MainWP Dashboard and the child site.

Summary

Methods
Properties
Constants
get_class_name()
instance()
register_site()
parse_init_auth()
auth()
parse_login_required()
parse_query()
check_login()
check_login_as()
login()
check_other_auth()
is_valid_auth()
get_max_history()
$instance
No constants found
No protected methods found
No protected properties found
N/A
get_request_files()
check_redirects()
open_location_redirect()
where_redirect()
$maxHistory
N/A

Properties

$instance

$instance : mixed

Public static variable to hold the single instance of the class.

Type

mixed — Default null

$maxHistory

$maxHistory : integer

Private variable to hold the max history value.

Type

integer — Max history.

Methods

get_class_name()

get_class_name() : string

Method get_class_name()

Get class name.

Returns

string —

CLASS Class name.

instance()

instance() : mixed

Method instance()

Create a public static instance.

Returns

mixed —

Class instance.

parse_init_auth()

parse_init_auth(boolean  $auth = false) : boolean

Method parse_init_auth()

Parse inistial authentication.

Parameters

boolean $auth

True is authenticated, false if not.

Returns

boolean —

ture|false.

auth()

auth(string  $signature, string  $func, string  $nonce, integer  $nossl) : integer|boolean

Method auth()

Connection authentication handler. Verifies that the signature is correct for the specified data using the public key associated with pub_key_id. This must be the public key corresponding to the private key used for signing.

Parameters

string $signature

MainWP Dashboard signature.

string $func

Function to run.

string $nonce

Security nonce.

integer $nossl

OpenSSL not availalbe. NoSSL connection required.

Returns

integer|boolean —

$auth Returns 1 if authenticated, false if authentication fails.

parse_login_required()

parse_login_required() : boolean

Method parse_login_required()

Check if the login process is required.

Returns

boolean —

Return true on success, false on failure.

parse_query()

parse_query(string  $var) : array

Method parse_query()

Parse query

Parameters

string $var

Contains the parameter to prase.

Returns

array —

$arr Array containing parsed arguments.

check_login()

check_login() : boolean

Method check_login()

Auto-login user to the child site when the Open WP Admin feature from the MainWP Dashboard is used.

Returns

boolean —

Return false if $_POST['mainwpsignature'] is not set.

check_login_as()

check_login_as(string  $alter_login) : boolean

Method check_login_as()

Auto-login alternative user to the child site when the Open WP Admin feature from the MainWP Dashboard is used.

Parameters

string $alter_login

Alternative user account to log into.

Returns

boolean —

Return false will log in as default admin user. Return true will try to login as alternative user.

login()

login(string  $username, boolean  $doAction = false) : boolean

Method login()

The login process handler.

Parameters

string $username

Contains the account username.

boolean $doAction

If true, run 'wp_login' action aftr the login.

Returns

boolean —

true|false

check_other_auth()

check_other_auth() 

Method check_other_auth()

Check other authentication methods.

is_valid_auth()

is_valid_auth(string  $key) : boolean

Method is_valid_auth()

Check if authentication is valid.

Parameters

string $key

Contains the authentication key to check.

Returns

boolean —

true|false If valid authentication, return true, if not, return false.

get_max_history()

get_max_history() : integer

Method get_max_history()

Returns

integer —

The max history value.

get_request_files()

get_request_files() : resource

Method get_request_files()

Parse HTTP request to get files.

Returns

resource —

Requested file.

check_redirects()

check_redirects() : boolean

Method check_redirects()

Handle redirects.

Returns

boolean —

Returns false if $_REQUEST['fdl'] is set.

open_location_redirect()

open_location_redirect(string  $open_location) 

Method open_location_redirect()

Jump to the wanted location (child site WP Admin page).

Parameters

string $open_location

Desired location relative path.

where_redirect()

where_redirect() 

Method where_redirect()

Safe redirect to wanted location.