JOOMLA Intergration

Forum
Last Post
Threads / Messages
The code is working & fully functional on the http://mysticgrove.net site However it was designed to use with that site & it has had MANY mods to the orginal PHPAdoptables sprict. That is probally the reason for the errors you were finding. The script does work & works well but needs to be set for YOUR site.

The reason for my lack of response was NOT because it doesn't work! It was because I recently miscarried twins and have been grieving & healing! RL does happen!!!

Sea
 
My statement was not intended to be an attack at you in any way, and I am well aware of the fact that the script works (and works well) on your site. My question as to if anyone else has managed to get it working was to determine if .... well... anyone other than you has managed to get a functional bridge out of this script. I am pretty sure the answer to that is going to be no.

It appears that you have custom database fields to start with (I have fixed this I think), some custom cookie settings, and possibly even some custom encryption routines. As the user tables for your script, and the user tables that everyone else has do not match this script is all but worthless to the community. However there is some light at the end of the tunnel. The fix I mentioned before will correct the table injection errors. There is still a conflict registered on usersync however, and I am not sure what is causing the new one, as no data on the error is given now.

That being said the users do pass to the adoptables database, but the dual login is not functioning. This could be caused by custom encryption on your script (something that I am not going to be able to fix) or it could be caused by custom cookie setting in your script, if so I have yet to find the right cookie settings.

As for real life, I am truly sorry for your loss.
 
Seapyramid said:
The code is working & fully functional on the http://mysticgrove.net site However it was designed to use with that site & it has had MANY mods to the orginal PHPAdoptables sprict. That is probally the reason for the errors you were finding. The script does work & works well but needs to be set for YOUR site.

The reason for my lack of response was NOT because it doesn't work! It was because I recently miscarried twins and have been grieving & healing! RL does happen!!!

Sea

*hug* My condolences and love go out to help you heal.
 
Thank you :)

Sea

jthm0138 said:
My statement was not intended to be an attack at you in any way, and I am well aware of the fact that the script works (and works well) on your site. My question as to if anyone else has managed to get it working was to determine if .... well... anyone other than you has managed to get a functional bridge out of this script. I am pretty sure the answer to that is going to be no.

It appears that you have custom database fields to start with (I have fixed this I think), some custom cookie settings, and possibly even some custom encryption routines. As the user tables for your script, and the user tables that everyone else has do not match this script is all but worthless to the community. However there is some light at the end of the tunnel. The fix I mentioned before will correct the table injection errors. There is still a conflict registered on usersync however, and I am not sure what is causing the new one, as no data on the error is given now.

That being said the users do pass to the adoptables database, but the dual login is not functioning. This could be caused by custom encryption on your script (something that I am not going to be able to fix) or it could be caused by custom cookie setting in your script, if so I have yet to find the right cookie settings.

As for real life, I am truly sorry for your loss.

Thank you.

As for the cookie settings, I have found them to be very touchy and server specific. I have the Jfusion Bridge installed on 2 different sites for the PHPBB3 Forum and could not use the same cookie settings on both.

The plugin above was working, but the one thing that bothered me on it is that when you tried to use the JFusion module to see how many people were on line & such it would always show the PHPAdoptables as empty because of the session cookies. This was fixed by adding

PHP:
  include("config.php");
  
  $sess_life = 18000;
  
  
  
  //Connect to the database first
  
  connect();

 // ***********************
 // Connect
 // ***********************
 
 
  
  
  //This function simply connects us to the database and is the session open function
  
  function connect()
  {
      include("config.php");
      
      $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to MySQL');      
      mysql_select_db($dbname) or die('Cannot select database');
      
      return true;
  }
  
  
  
  //This function simply disconnects us from the database and is the session close function
  
  function disconnect()
  {
      include("config.php");
      
      mysql_close();
      
      return true;
  }
  
  
  
  //This function retrieves session values from the database
  
  function sess_read($sessid)
  {
      include("config.php");
      
      
      
      $sql = "SELECT `values` FROM " . $prefix . "sessions WHERE sid = '$sessid' AND expire>=" . time();      
      $query = mysql_query($sql) or die(mysql_error());
      
      if (list($value) = mysql_fetch_row($query)) {
          $expire = time() + $sess_life;
          
          $usql = "UPDATE " . $prefix . "sessions SET expire = $expire WHERE sid = '$sessid'";          
          $uquery = mysql_query($usql) or die(mysql_error());
          
          return $value;
      }
      
      return "";
  }

  
  //This function stores session values into the database
  
  function sess_write($sessid, $values)
  {
      include("config.php");
      
      $expire = time() + $sess_life;     
      $value = addslashes($values);
      
      $uidc = $cprefix . "u";      
      $uid = $_COOKIE[$uidc];
      
      if ($uid) {
          $usql = "SELECT username FROM " . $prefix . "users WHERE uid='$uid'";
          
          $username = mysql_query($usql) or die(mysql_error());
      } else {
          $username = "";
      }
      
      $sql = "INSERT INTO " . $prefix . "sessions VALUES ('$sessid', '$username', $expire, '$value') ON DUPLICATE KEY UPDATE `expire`='$expire', `values`='$value'";     
      $query = mysql_query($sql) or die(mysql_error());
      
      return $qid;
  }
  

  //This function deletes a session from the database
  
  function sess_destroy($sessid)
  {
      include("config.php");
      
      $qry = "DELETE FROM " . $prefix . "sessions WHERE sid = '$sessid'";     
      $qid = mysql_query($qry) or die(mysql_error());
      
      return $qid;
  }

  //This function is session garbage collection
  
  function sess_gc($maxlifetime)
  {
      include("config.php");
      
      $qry = "DELETE FROM " . $prefix . "sessions WHERE expire < " . time();      
      $qid = mysql_query($qry) or die(mysql_error());
      
      return mysql_affected_rows();
  }

  // This registers the above functions as the handlers for the various operations on session data.
  
  session_set_save_handler("connect", "disconnect", "sess_read", "sess_write", "sess_destroy", "sess_gc");

  //As this file is included in all others, begin the session with no caching.
  
  session_cache_limiter('nocache');
  $name = $cprefix . "sid";
  
  session_name($name); 
  session_start();

to the beginning of the functions file & then making these changes
PHP:
     //Function to determine if user is logged in.
   
      //Set up our login info...      
      $username = "";
      
      //$password = "";      
      $cname = $cprefix . "u";
      
      //Check for cookie
      
      if (isset($_COOKIE[$cname])) {
          $userid = $_COOKIE[$cname];
          
          //$username = $_COOKIE['auser'];          
          //$password = $_COOKIE['apass'];

          //$username = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $username);          
          //$username = secure($username);         
          //$password = secure($password);
 
          //Run login operation          
          //$query = "SELECT * FROM ".$prefix."users WHERE username = '$username'";
          
          $query = "SELECT username FROM " . $prefix . "users WHERE uid = '$userid'";          
          $result = mysql_query($query);          
          $num = mysql_numrows($result);

          
          //Loop out code          
          //$i=0;
          //while ($i < 1) {          
          //          
          //$luser=@mysql_result($result,$i,"username");          
          //$lpass=@mysql_result($result,$i,"password");          
          //          
          //$i++;          
          //}
    
          //if($username == $luser and $password == $lpass){
          
          if ($num > 0) {
              $isloggedin = "yes";
              
              $username = mysql_result($result, 0, 0);
          }
          
          else {
              
              
              //if (isset($_COOKIE['auser'])){              
              //$past = time() - 10;               
              //setcookie("auser",$username,$past);              
              //}              
              //              
              //if (isset($_COOKIE['apass'])){              
              //$past = time() - 10; 
              //setcookie("apass",$password,$past);
              
              //}
              
              $isloggedin = "no";
          }
      }
      
      else {
          //User is not logged in
          
          $isloggedin = "no";
      }

      //Return our user data
      
      $userdata[loginstatus] = $isloggedin;      
      $userdata[username] = $username;

      return $userdata;
  }

I hope that helps to lead you in the right direction.

Sea
 
I'm sorry for what happened to you Sea and yes, life's not fair...
I noticed on jfusion forum the time you spent to help us and I really appreciate your efforts.
Now, I am going through the same error when trying to import the users from the master joomla to the slave php adoptables.
I installed phpbb3 as slave for testing purposes and got that working after changing some settings.
Looks like the plugin is in full development so unless someone wants me to try, I won't alter anything. Sea, if you want to take a look at my new installations, let me know. I'll put this project on hold for now, since it's not really working. Even if I get over the initial setup and get the joomla users to log into adoptables, I won't be able to fix the other issues you mentioned as I'm not that good with php scripting. I'm not sure I configured the jfussion grove plugin correctly, especially the curl part of it. If you think you could help, that would be greatly appreciated.

My joomla, adoptables, forum
Code:
Detailed JFusion Error Report
User from Plugin  
joomla_int  


User Info from Usersync List 
username ikonyk 
email my@email.com


User Info from getUser() function 
userid 66 
activation "" 
username ikonyk 
name ikonyk 
password f169f2af41ec9......db9d6102af 
email my@email.com 
block 0 
group_name Registered 
group_id 18 
params " " 
password_salt ITNE............y1MMDN 
language en-GB 



User target Plugin  
grove  



Error Info from updateUser() function 
0 Error while creating the userDB function failed with error number 1136<br /><font color="red">Column count doesn't match value count at row 1 SQL=INSERT INTO adopts_users VALUES ('', 'ikonyk', 'f169f2a.........d46db9d6102af','my@email.com','3','1', '2009-09-21', '0','','','','','','0','0')</font> 



Debug Info from updateUser() function 
0 No user with that identifier has been found. Creating a new user. 



User Info from updateUser() function  
null
 
That error is generated due to two extra fields in sea's database.
A fix for that issue is a few posts back.
Right now its the cookie that is causing issues, and I am totally lost at the moment, more information as soon as I have it.
 
Ok.. I have been playing around with this more, and have gone over every line of code in the grove bridge. Now I have a few correction, and a few questions.

The questions first....
As there are no descriptions defined in the Admin Panel, The XML for the admin panel, nor the code itself, there are a few fields that I am unsure of. The first being "Over Ride" -> "login[indirect]=no" the next being "Leave Alone" -> "GROVEID_=>" and the last being "Integration Type" -> "1". Anyone have any idea what these fields do (or could you spread some light for us Sea? pretty please :) )

On to the code :) in public.php
Code:
<?php

/**
* @package JFusion_Moodle
* @author JFusion development team
* @copyright Copyright (C) 2008 JFusion. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC' ) or die('Restricted access' );
/**
 * JFusion Public Class for Moodle 1.8+
 * For detailed descriptions on these functions please check the model.abstractpublic.php
 * @package JFusion_Moodle
 */
class JFusionPublic_grove extends JFusionPublic{
    function getJname(){
        return 'grove';
    }
    function getRegistrationURL(){
        return 'grove/register.php';
    }
    function getLostPasswordURL(){
        return 'grove/account.php?act=changepass';
    }
    function getLostUsernameURL(){
        return 'grove/account.php?act=changepass';
    }
}

?>

Unless you happened to install the PHP Adoptables Script into a sub-directory named "grove" this code will not work correctly and will return some errors. I am sure there is a way to change that to a variable, but I have been awake for about 4 days trying to get my site finished, and I am not processing information correctly anymore. The simple fix for now is to manually redirect those returns to the proper sub-directory until I can remember the correct variable syntax, or someone else posts it.
 
3 people and 20 hours later we have rewritten the plugin from the ground up and it now works.
However due to the nature of the bridge it will have to be custom tailored to every install. I am willing to do this for $50 USD. If anyone would like this done send me an email at contact at trinityintrigue.com
 
I'd love to get this to work for Joomla -- I've used that before and just love it, but after reading all this I am totally lost as to whether to even try it or not. I don't want to mess up what I have, but integration with Joomla would be wonderful!!

I just have Joomla installed on a sub directory called Base, and the Adoptables is on the root --- maybe I can try to get this to work, could we possibly have that Grove file re- uploaded again?

Thanks!
 
Joomla has to be installed at the root.. adoptables would be a slave. JFusion is needed. I will zip the files & reupload them but I offer NO assistance. After you have the files you will need to go to Joomla & JFusion for techs. I will re-upload tomarrow sometime.

Sea
 
great!!

thanks a lot, I have used Joomla in the past and I am fairly good with it. I should be able to do this, and thanks for all your help! :)
 
I'll be using my other name here for most things from now on, Redheadturkey was the donator name, and I use this one for the site I am getting going! So I really want to be known under this, I think, since it's my main name for stuff related to all this.

Anyways, something I wanted to mention too about the whole bridging thing, in case others here want to try this when it is re posted, once you have it set up, you really have to be careful if you ever undo it -- or at least it was that way with my Joomla/Coppermine hybrid!

Just be sure you DO want to bridge.

For me, it was a great way to go, and I think this might work well with the Fusion to have the adopts, and possibly my SMF Forum as slaves to the Joomla base!
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top