0
votes

Hi guys I was asked to add a wordpress blog to a website, I was wondering if there was a way to let the existing website admin area use the same login as wordpress admin!

P.S: I know that I can make a wordpress plugin to control the existing website from inside wp-admin, but I don't want to do this. So is there a way to include some wordpress page or function in the header of the existing admin panel?

[edit] as the website prevented me from answering the question: Your answers gave me some brain storming and Voila! I read this article: http://www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts and then used the plugin: http://wordpress.org/extend/plugins/root-cookie/ Through it I could move the cookies place, and added the following piece of code to the existing CMS header:

<?php
define('WP_USE_THEMES', false);
require('../portal/wp-load.php');

require_once('../portal/wp-config.php');
if (!is_user_logged_in()){auth_redirect();}?>

I wish my solution will be useful!

3
Are you asking if you can use the same auth session from the old CMS on your new Wordpress installation? Do you want to be able to skip the login to Wordpress if you're already logged in on the old system?o01
No my friend I want the opposite, I want to cancel the old CMS session and use wordpress session on old CMShousamz

3 Answers

0
votes

Not being a user of wordpress I don't know the exact variables, but I would guess WP sets a session variable so that it knows you are logged in. I can't see why you couldn't just set that variable in your own script.

Of course it is not always that simple, but that's where I would start looking.

[EDIT] seeing your comment response, it is essentially the same thing, but backwards. Find the session that is set in your old CMS and eidt wordpress so that it gets set as well when you log in.

0
votes

Store your wordpress session in a database or a cookie. Then write a script in your old CMS that checks that storage.

0
votes

Your answers gave me some brain storming and Voila! I read this article: http://www.linickx.com/1016/root-cookie-tutorial-1-accessing-wordpress-cookies-from-custom-scripts and then used the plugin: http://wordpress.org/extend/plugins/root-cookie/ Through it I could move the cookies place, and added the following piece of code to the existing CMS header:

<?php
define('WP_USE_THEMES', false);
require('../portal/wp-load.php');

require_once('../portal/wp-config.php');
if (!is_user_logged_in()){auth_redirect();}?>

I wish my solution will be useful!