| Server IP : 104.21.13.219 / Your IP : 162.159.115.10 Web Server : nginx/1.26.1 System : Linux HE9229 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/jl3_ph_com/wp-content/plugins/updraftplus/includes/ |
Upload File : |
<?php
if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed.');
if (!class_exists('UpdraftPlus_Login')) require_once('updraftplus-login.php');
class UpdraftPlus_UpdraftCentral_Cloud extends UpdraftPlus_Login {
/**
* Pulls the appropriate message for the given code and translate it before
* returning it to the caller
*
* @internal
* @param string $code The code of the message to pull
* @return string - The translated message
*/
protected function translate_message($code) {
switch ($code) {
case 'generic':
default:
return __('An error has occurred while processing your request.', 'updraftplus').' '.__('The server might be busy or you have lost your connection to the internet at the time of the request.', 'updraftplus').' '.__('Please try again later.', 'updraftplus');
break;
}
}
/**
* Executes login or registration process. Connects and sends request to the UpdraftCentral Cloud
* and returns the response coming from the server
*
* @internal
* @param array $data The submitted form data
* @param boolean $register Indicates whether the current call is for a registration process or not. Defaults to false.
* @return array - The response from the request
*/
protected function login_or_register($data, $register = false) {
global $updraftplus, $updraftcentral_main;
$action = ($register) ? 'updraftcentral_cloud_register' : 'updraftcentral_cloud_login';
if (empty($data['site_url'])) $data['site_url'] = trailingslashit(network_site_url());
$response = $this->send_remote_request($data, $action);
if (is_wp_error($response)) {
$response = array('error' => true, 'code' => $response->get_error_code(), 'message' => $response->get_error_message());
} else {
if (isset($response['status'])) {
if (in_array($response['status'], array('authenticated', 'registered'))) {
$response['redirect_url'] = $updraftplus->get_url('mothership').'/?udm_action=updraftcentral_cloud_redirect';
if (is_a($updraftcentral_main, 'UpdraftCentral_Main')) {
$response['keys_table'] = $updraftcentral_main->get_keys_table();
}
if (!empty($data['addons_options_connect']) && class_exists('UpdraftPlus_Options')) {
UpdraftPlus_Options::update_updraft_option('updraftplus_com_and_udc_connection_success', 1, false);
}
} else {
if ('error' === $response['status']) {
$message = isset($response['message']) ? $response['message'] : $this->translate_message('generic');
if (isset($response['code']) && 'incorrect_password' === $response['code']) {
$message = __("Your email is valid, but your password wasn't recognised.", 'updraftplus').'<br>';
if (time() < strtotime('2026-01-01 00:00:00')) $message .= __('Some users were asked to reset their passwords as part of a recent website migration.', 'updraftplus').'<br>';
// translators: %s: The reset password link
$message .= sprintf(__('Try again, or %s before connecting again.', 'updraftplus'), '<a href="'.$updraftplus->get_url('lost-password').'">'.__('reset your password', 'updraftplus').'</a>');
}
$response = array(
'error' => true,
'code' => isset($response['code']) ? $response['code'] : -1,
'message' => $message,
'response' => $response
);
}
}
} else {
$response = array('error' => true, 'message' => $this->translate_message('generic'));
}
}
return $response;
}
}