Tag Info

New answers tagged

0

I have found another solution here that uses a better approach (at least in my opinion...). No need to set any cookie, it uses the Wordpress API: /** * Programmatically logs a user in * * @param string $username * @return bool True if the login was successful; false if it wasn't */ function programmatic_login( $username ) { if ( ...


0

As @MarkKaplun suggested, the problem was indeed XML-RPC. I contacted the hosting company and asked for a readout of the logs. xmlrpc.php had been hit over 3500 times in less than 24 hours (and this is a small site where nobody would have any reason to hit anything that many times!). Edit Here's what I suspect was happening. From Antti Vilpponen's blog on ...


2

The answer is most likely XML-RPC which is used to communicate with the mobile wordpress apps and is always on in newer versions. If you don't use mobile apps to admin your WP you can use my plugin - http://wordpress.org/plugins/control-xml-rpc-publishing/ to disable it.


0

You can try using wp_redirect(); and the hook after_setup_theme (shouldn't be any output at this point). Create more manageable conditionals with early bail outs. Here's my take on it I guess... if(!function_exists('mbe_redirect_restricted_areas')){ function mbe_redirect_restricted_areas(){ // Determine login page status. global ...


1

You need to exit() after you set the header (and I'd recommend using wp_redirect()). Untested, but the following should work. If it's really the case that current_user_can() isn't working, I'd first disable any other plug-ins to rule out a conflict, and then check that user really does have the permissions you think they should have. function ...


1

Do not set header in a template file. Those are part of the HTTP request itself. About your problem: Add a template (whatever file you need - see "Template Hierarchy"). On top of it you include the default stuff like get_header(); and so on. For the restricted part, you use the following: if ( current_user_can( 'view_players_area' ) ) { // Code that ...


1

Put this on the top of the file with your code: global $current_user; if ( !$current_user->ID ) { get_currentuserinfo(); }


0

I have a really simple script that is linked What do I need to do to fully integrate a custom session login into WP?. Basically I am assuming that your SSO is secure, that you have the users in your database, and that you don't need to keep the session alive except for authentication. From my standpoint I just want to pass the user onto WP and let the WP ...



Top 50 recent answers are included