• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

How to call for connections data

Status
Not open for further replies.

jfquestiaux

Well-Known Member
I'm writing a Fabrik plugin for JSitemap Pro, to create XML sitemaps with records in Fabrik lists.

It's working fine for the default connection, but I need to add a feature to accomodate the case where the records come from another database than the default J! one. Getting these data is not a problem, except that the password is encrypted!

So I tried to use Fabrik itself to provide the data: I tried this:

include_once(JPATH_SITE . '/components/com_fabrik/models/connection.php');
$fabrikDb = new FabrikFEModelConnection;
$fabrikDb->getConnection($id);

but it crashes the system! Huge memory leak. So I'm stuck and don't know what else to try. Any idea?
 
You could just decrypt the passwords yourself. In 3.x we use the (deprecated) SimpleCrypt, with the site secret as the salt, so something like ...

Code:
// assumes encrypted password is in $password
jimport('joomla.crypt.crypt');
jimport('joomla.crypt.key');
$config = JFactory::getConfig();
$secret = $config->get('secret', '');
$key = new JCryptKey('simple', $secret, $secret);
$crypt = new JCrypt(new JCryptCipherSimple, $key);
$cleartext = $crypt->decrypt($password);

-- hugh
 
Thanks. I was wondering how you were doing the encryption.
"Deprecated" means that for J! 4, it will need to use namespaces, right?
 
Nope, it means the JCryptCipherSimple is insecure (easily decrypted without a key), was deprecated years ago, and has been removed from J! entirely in 4.0. In 4.0 I'm using a different cipher method. I've just never bothered changing it in 3.x because of the operation issues of switching a cipher method, which would of course invalidate all existing connections .... and because if someone has your #__connections table, you've got big problems with your database security anyway.

But as 4.0 looks like being a "breaking" install anyway (requiring some migration rather than just a simple update), and I don't have any choice ... connection passwords will need to be reset.

-- hugh
 
k.
I have another problem now:
I need to get data from another database than the default J! one.
In a Fabrik context, I would use $dbItem = FabrikWorker::getDbo(false, 2);, but this gives me an 500 error.
I guess it's because I need to import or use something, but I don't know what (or how).
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top