Note that there are some explanatory texts on larger screens.

plurals
  1. POintegration of codeigniter and wordpress authorization
    primarykey
    data
    text
    <p>Is there an easy way to integrate two auth functions between codeigniter and wordpress. I am not sure how to do this, or the best procedure. They are both residing on the same server. I am looking at something maybe similar to the way that youtube and google work together. I am not sure if this is possible. I have managed something with a php application a while ago (not codeigniter), but if I could use that it would be also ideal. It wont implement with codeigniter though. I am not even sure how safe it is but i can paste it below. Codeigniter stores variable in a database on my app as well. I can access them, is there a way I can use these variables??</p> <pre><code>require('../wp-config.php'); auth_redirect(); is_user_logged_in(); wp_get_current_user(); global $current_user; global $mysql, $username; global $auth; $username = $current_user-&gt;user_login; </code></pre> <p>I have just added a script that can access the database session in codeigniter. Dont know if any good, but I dont know how to impliment this or if it is relevant.</p> <pre><code>require_once("config.php"); $cisess_cookie = $_COOKIE['ci_session']; $cisess_cookie = stripslashes($cisess_cookie); $cisess_cookie = unserialize($cisess_cookie); $cisess_session_id = $cisess_cookie['session_id']; $cisess_connect = mysql_connect(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD); if (!$cisess_connect) { die("&lt;div class=\"error\"&gt;" . mysql_error() . "&lt;/div&gt;"); } $cisess_query = "SELECT user_data FROM ci_sessions WHERE session_id = '$cisess_session_id' LIMIT 1"; mysql_select_db(MYSQL_DATABASE, $cisess_connect); $cisess_result = mysql_query($cisess_query, $cisess_connect); if (!$cisess_result) { die("Invalid Query"); } $cisess_row = mysql_fetch_assoc($cisess_result); $cisess_data = unserialize($cisess_row['user_data']); print_r($cisess_data); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload