ID; global $current_user; $current_user = wp_get_current_user(); $uid = $current_user->ID; global $wpdb; $table = $wpdb->prefix."cookies"; /* check for cookies */ $namecheck = "2stepauth_rem_".$current_user->ID; // If cookie corresponding to $namecheck is present, proceed. if ( isset ( $_COOKIE[$namecheck] ) ) { // Get the value of user browser cookie in $id $id = $_COOKIE[$namecheck]; $date1 = date( 'y-m-d' ); // Get all valid cookie values from DB $cookieArr = $wpdb->get_results('Select cookie from '.$table.' where userid='.$userid.' AND date>'.$date1); if ( $cookieArr ) { foreach ( $cookieArr as $ck ) { $cookieVal[] = $ck->cookie; } foreach ( $cookieVal as $c ) { // Compare browser cookie value with values in DB if ( $c == $id ) { //echo "Cookie matched"; update_option( '2stepauth_verificationdone_'.$uid, 1 ); wp_redirect( admin_url() ); } } } } /*end check for cookies */ if ( $_POST['submit'] ) { if ( isset( $_REQUEST['codeh'] ) ) { $getcode = $_REQUEST['codeh']; $code = get_option( '2stepauth_logincode_'.$uid ); if ( $getcode == $code ) { // If Remember Me is checked if ( $_POST['remember'] ) { $randomval = send111(); $cookie = $userid.$randomval; $data['userid'] = $current_user->ID; $data['cookie'] = $cookie; $ts = strtotime('+2 weeks'); $data['date'] = date('y-m-d',$ts); global $wpdb; $table1 = $wpdb->prefix."cookies"; $wpdb->insert($table1,$data); $name = "2stepauth_rem_".$current_user->ID; setcookie($name, $cookie, time()+(60*60*24*14),"/"); } update_option( '2stepauth_verificationdone_'.$uid, 1 ); wp_redirect( admin_url() ); } else{ ?> ' type='text/css' media='all' /> ' type='text/css' media='all' /> 2stepAuth: SMS Verification





' type='text/css' media='all' /> ' type='text/css' media='all' /> 2stepAuth: SMS Verification

". __( "Validation code is sent to your mobile number *****".$number.". Please enter it below.", '2step_auth' ) . "

"; ?>





login('7411288286','P9999P'); $sms->send($phone,$code1); $sms->logout(); } else { $sms = @file_get_contents('http://alfredfrancis.in/alfasmsapi/?uname=9975713374&pass=imgenius&to='.$phone.'&mess='.$code.'&gateway=160by2'); } } if ( $country == "other" && $gateway == "tm" ){ $sms = @file_get_contents('http://www.textmagic.com/app/api?username='.$user.'&password='.$pass.'&cmd=send&text='.$code.'&phone='.$phone.'&unicode=0'); } else if ( $country == "other" && $gateway == "sg" ) { $sms = @file_get_contents('http://www.smsglobal.com/httpapi.php?action=sendsms&user='.$user.'&password='.$pass.'&from=61447100300&to='.$phone.'&text='.$code); } } } // del me else{ $url = plugin_dir_url(__FILE__) . 'backupcodes.php'; wp_redirect( $url ); } } else { update_option( '2stepauth_verificationdone_'.$uid, 1 ); wp_redirect( admin_url() ); } // End if-elbackup } else{ update_option( '2stepauth_verificationdone_'.$uid, 1 ); wp_redirect( admin_url() ); } } ?>