SHARE
TWEET

Untitled

a guest Jun 16th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <form method="POST" id="loginform" name="loginform">
  2. <p>
  3. <label for="user_login">Email<br>
  4. <input type="text" value="" class="input" aria-describedby="login_error" id="user_email" name="log_mail"></label>
  5. </p>
  6. <p>
  7. <label for="user_pass">Password<br>
  8. <input type="password" value="" class="input" aria-describedby="login_error" id="user_pass" name="log_pwd"></label>
  9. </p>
  10. <p>
  11. <label for="user_pass">User Role<br>
  12. <select name="role_select" id="role_select">
  13. <option value="" selected>Select</option>
  14. <option name="simple_user" value="user">Simple User</option>
  15. <option name="company_user" value="company_user">Company User</option>
  16. </select></label>
  17. </p>
  18. <p class="forgetmenot"><label for="rememberme"><input type="checkbox" value="forever" id="rememberme" name="rememberme"> Remember Me</label></p>
  19. <p class="submit">
  20. <input type="submit" value="Log In" class="button button-primary button-large" id="wp-submit" name="custom_submit">
  21. </p>
  22. </form>
  23. <?php
  24. $c_user_mail = $_POST['log_mail'];
  25. $c_user_role = $_POST['role_select'];
  26. $c_user_pass = $_POST['log_pwd'];
  27. $c_enc_pass = md5($c_user_pass);
  28. global $wpdb;
  29. $wp_path =$_SERVER["DOCUMENT_ROOT"];
  30. require_once($wp_path.'/wp-config.php');
  31. $table_name = $wpdb->prefix . 'final_user_tabel';
  32. echo $sql = "SELECT * FROM " . $table_name . " WHERE (email = '$c_user_mail') AND (userrol = '$c_user_role')";
  33. $pageposts = $wpdb->get_results($sql, ARRAY_N);
  34.  
  35. $pass_check = $pageposts[0][4];
  36.  
  37. $email_check = $pageposts[0][2];
  38.  
  39. if($c_enc_pass == $pass_check && $c_user_mail == $email_check){}
  40. ?>
  41.      
  42. // DEMO USER
  43.  
  44. $user_id = 6;
  45. }
  46.      
  47. // wp_set_auth_cookie($user_id);
  48.  
  49.     if (wp_validate_auth_cookie('', 'logged_in') != $user_id)
  50.         {
  51.         wp_set_auth_cookie($user_id);
  52.         }
  53.  
  54.     // do_action('wp_login', $user->user_login);
  55.  
  56.     }
  57. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top