value="1" />

value="0" />







"; $data = ''; } else { curl_close($ch); } return $data; } function acceptto_login_styles() { wp_enqueue_script('jquery'); ?> ID, 'acceptto_email', true); } if($eml != ''){ $email = $eml; }else{ $email = $_POST['email']; } $url = 'https://mfa.acceptto.com/api/v9/authenticate?message=WordPress+is+wishing+to+authorize&type=Login&email='.$email.'&uid='.get_option('acceptto_uid').'&secret='.get_option('acceptto_secret'); $data = json_decode(get_cUrl($url)); $channel = $data->{'channel'}; if($channel == ''){echo 'Please fill correct email address. url: '.$url;}else{ $_SESSION['channel'] = $channel; $_SESSION['email'] = $email; $new_url = 'https://mfa.acceptto.com/mfa/index?channel='.$channel.'&callback_url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'&autoLlogin'; $data = get_cUrl($new_url); echo ''; echo $data; } }elseif($_SESSION['email'] != '' && $_SESSION['channel'] != ''){ $url = 'https://mfa.acceptto.com/api/v9/check?channel='.$_SESSION['channel'].'&email='.$_SESSION['email']; $data = json_decode(get_cUrl($url)); $status = $data->{'status'}; if($status == 'approved'){ if ( is_user_logged_in() ) { $current_user = wp_get_current_user(); } $user = get_user_by('email', $current_user->user_email); $_SESSION['status'] = $status; $userdidnotexist = false; if ( is_wp_error($user) ) return $user; if (!$user) { $userdidnotexist = true; }else{ wp_set_auth_cookie($user->ID, false, ''); } } if(!$userdidnotexist){ switch($status){ case 'approved': echo 'Successfully loged in.'; wp_redirect( home_url() ); exit; break; case 'rejected': echo '

Sorry Your Milti-Factor authorization request declined.

'; unsetAll(); break; case 'expired': echo '

Sorry Your Milti-Factor authorization request is expired.

'; unsetAll(); break; case '': echo ''; break; } }else{ unset($_SESSION['channel']); unset($_SESSION['email']); unset($_SESSION['status']); echo '

Sorry email dose not exist.

'; } } }elseif(isset($_POST['login_acceptto']) && $_POST['email'] == ''){ ?>
ID, 'acceptto_email', true) == '') :?>

 

ID, 'acceptto_email', true) == '') :?>

 

ID, 'acceptto_email', true) != ''){ include( plugin_dir_path(__FILE__).'/acceptto-auth.php' ); die; } } } } add_action('init', 'myStartSession', 1); function myStartSession() { if(!session_id()) { session_start(); } } add_action( 'show_user_profile', 'acceptto_extra_user_profile_fields' ); add_action( 'edit_user_profile', 'acceptto_extra_user_profile_fields' ); function acceptto_extra_user_profile_fields( $user ) { ?>