Can I Log Logged in WordPress users in Apache without a WordPress plugin?

Although a little clunky I’ve found a passable solution to this problem using mod_security. To implement this, enable modsecurity in Apache (presumably with a2enmod security). Then edit the config file. On my Ubuntu based systems this is at /etc/modsecurity/modsecurity.conf and as follows: Ensure SecRequestBodyAccess is On (and I assume SecRuleEngine to DetectionOnly). You may also … Read more

wp_signon by user’s login by their particular role

/* Add code below wp_set_auth_cookie( $user->ID, true, false ); */ $current_user = wp_get_current_user(); if($current_user->roles[0]==’personal_account’){ wp_redirect(site_url(‘/profile’)); }else if($current_user->roles[0]==’corporate_user’){ wp_redirect(site_url(‘/corporate-profile’)); }

Adding a “Sign In/My Account” link to an external app

You can read cookies both on the front- and back-end sides. For the front-end, you have to provide both links, and show only the desired one with javascript. Use document.cookie.indexOf(‘cookie_name’) to check the cookie presence. For the back-end, you can read the special $_COOKIE variable to check the cookie presence in you template and change … Read more

How to add additional factor to wordpress authentication

I don’t know that I would use cookies for this as the user could just modify their cookie to match their current IP. You could store the user’s IP as user meta at signup and then compare that to their IP during subsequent logins via the wp_authenticate_user filter. Sample code (untested): add_action( ‘user_register’, ‘wpse157630_add_user_ip’, 10, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)