options=$options; } $this->add_remote=false; } public function pre_add_remote($remote,$id) { if($remote['type']==WPVIVID_REMOTE_ONEDRIVE) { $remote['id']=$id; } return $remote; } public function handle_auth_actions() { if (isset($_GET['action']) && isset($_GET['page'])) { if($_GET['page'] === 'WPvivid') { if($_GET['action']=='wpvivid_one_drive_auth') { try { $auth_id = uniqid('wpvivid-auth-'); $remote_options['auth_id']=$auth_id; update_option('wpvivid_tmp_remote_options',$remote_options); $url = 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' . '?client_id=' . urlencode('37668be9-b55f-458f-b6a3-97e6f8aa10c9') . '&scope=' . urlencode('offline_access files.readwrite') . '&response_type=code' . '&redirect_uri=' . urlencode('https://auth.wpvivid.com/onedrive_v2/') . '&state=' . urlencode(admin_url() . 'admin.php?page=WPvivid' . '&action=wpvivid_one_drive_finish_auth&main_tab=storage&sub_tab=one_drive&sub_page=storage_account_one_drive&auth_id='.$auth_id) . '&display=popup' . '&locale=en'; header('Location: ' . esc_url_raw($url)); } catch (Exception $e){ echo '
'.$e->getMessage().'
You have authenticated the Microsoft OneDrive account as your remote storage.
'.$e->getMessage().'
'.$e->getMessage().'
'.__('You have authenticated the Microsoft OneDrive account as your remote storage.', 'wpvivid-backuprestore').'
'.esc_html($_GET['resp_msg']).'