Support ⇒ CPG-BB (forum) ⇒ FAO Devs: Can I authenticate an external app to CPG-BB? ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

FAO Devs: Can I authenticate an external app to CPG-BB? Reply to topic


I'm starting to develop a tapatalk (forum viewing app for mobiles) module for DragonflyCMS. If anyone wants to help, that would be nice Laughing

Tapatalk has a particular drawback in it's implementation in that it looks for the required mobiquo.php file in %forumurl%\mobiquo

For a standard forum implementation that is not a problem, but obviously it's a problem for DragonflyCMS because the file will not load directly from the Forum directory, and even worse if you have LEO turned on.

So my plan now is to use their API (which uses xmlrpc) to develop a custom plugin. However, I need to be able to authenticate users against the DragonflyCMS database.

Can I do this outside of the CMS somehow, or am I wasting my time trying to do this? I've created my mobiquo directory in the root of the website so it can call the php file now, but obviously I have no link into the CMS itself yet.
Once I can authenticate to the CMS, I will then work on accessing the forum.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


You do need to process a log in? or check if the user is logged?

BTW: you can include the core functions outside just including
the cmsinit file:


<?php
define('XMLFEED', 1);
require_once('includes/cmsinit.inc');
require_once('includes/classes/security.php');
require_once('includes/classes/session.php');
require_once('includes/classes/cpg_member.php');
$CPG_SESS = array();
$SESS =& new cpg_session();
$CLASS['member'] =& new cpg_member();
$userinfo =& $_SESSION['CPG_USER'];
?>


with that you are able to use the is_user() function and the $userinfo array.
Not sure if this is the best approach.

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


index.php?name=Forums&file=mobiquo.php
will work the same way as
index.php?name=Forums&file=viewtopic.php

In other words try just to drop mobiquo.php inside modules/Forums and calling it with the above URL.

Otherwise what greenday2k is also a good idea.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
none available


greenday2k wrote
You do need to process a log in? or check if the user is logged?

BTW: you can include the core functions outside just including
the cmsinit file:


<?php
define('XMLFEED', 1);
require_once('includes/cmsinit.inc');
require_once('includes/classes/security.php');
require_once('includes/classes/session.php');
require_once('includes/classes/cpg_member.php');
$CPG_SESS = array();
$SESS =& new cpg_session();
$CLASS['member'] =& new cpg_member();
$userinfo =& $_SESSION['CPG_USER'];
?>


with that you are able to use the is_user() function and the $userinfo array.
Not sure if this is the best approach.


Thanks for the response.
The app uses cookies to save the authenticated user, same as a browser, but you do need to process a login initially.
I did try to include the cmsinit.inc by itself, but for some reason it caused the app to stop working.

I should explain the way this app works. It has it's own interface on your phone, and basically queries the mobiquo.php file to view/post/edit forum topics etc. At the moment I have only coded the first function "get_config" which is what they use to test if the app has been installed on a server. Once I included cmsinit.inc, the get_config function no longer worked.

Unfortunately, because it uses it's own app on the phone, I can't call it via index.php. The app will only call mobiquo.php directly, so this is part of the problem I have.
It's actually a very handy app for using a forum on the phone, so I'm sure if I can get this working people will want to use it on their DF sites. It's free for the webmaster, but it's a paid app on the mobile unless you want read-only.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Ok, I previously used include instead of require_once, which may be why it didn't work. Looks like the get_config function is still working with your changes, so that is a start.

I now need to have a look at the login function to see if I can write that to suit DF. In the mobiquo.php I have created, each function calls a php file named the same as the function.

$request_method_name = get_method_name(); if ($request_method_name && isset($server_param[$request_method_name])) { require('./function/'.$request_method_name.'.php'); }


Function: Function Name login Description Server returns cookies in HTTP header. Client should store the cookies and pass it back to server for all subsequence calls to maintain user session. ** DO NOT include HTTP Cookies in the request header **

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Ok, I'm back at work now, so I no longer have the time for this.
I've managed to get it to the point of displaying forums, but no login code has been done yet.

If anyone wants to give me a hand to develop this, I'm willing to pay some money. Surely I can't be the only person that wants a phone app to easily access their forum.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Back to square one... these devs are just not understanding what I need.

Is there any DF devs that want to be paid to write the authentication part of this app? These devs got a login for the app working, but all it does is checks against the username/pass in the database, so none of the $userinfo array is built. Without the $userinfo array, it's next to impossible to do the rest.

I've already paid these guys $500 and got nowhere.

Test Signature

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: