Plugins

Discussion about plugins and integrations.

408
6
Izzuddin posted Dec 16 '15 at 7:45 pm

Hi, im currently having a problem with logout of codoforum. i am developing a website in wordpress that will integrate this forum with sso-login plugin. i have followed the instruction given and my sso-login is successful.

but, the problem is when i am testing multiple user accounts to use this function (on a single desktop), the sso-login does not log out automatically the previous user (note: this happen when i close tab and not logging out manually)

means that when user2 login to my website and enter codoforum with sso-login, the codoforum still hold the previous user (which is user1).

hope that this will be fixed soon or if you have other possible solution such as "automatically log out user when tabs are closed" or something like that i'll greatly appreciate that.

this is really a great forum btw. thanks

488
1
gmdolfint posted Dec 8 '15 at 11:15 pm

SSO Integration with a WordPress Blog

This is not really a support request but a small guide that someone might find useful in the future. If this should not be here, by all means, feel free to delete it.

Preamble

Codoforum does seem to be a nice alternative to what one is accustom to use, and because of that, one does need to learn the terminology this software uses for certain things (e.g. categories instead of forums); in this regard, IMO, the documentation could be a bit better... but I digress.

Now, IMO, the documentation could be a bit better also on how to integrate SSO with your blog/website... Last night, maybe I was more tired than usual to understand and follow the instructions on how to do it (I found the instructions a bit confusing), but after a while I got it to work as it should.

I'm aware there's a WordPress plugin to integrate SSO with Codoforum, but that didn't work for me, so I just deleted it.

Integrating SSO with WordPress

Note: I set this up locally using MAMP.

My set up is like this:

  • WP Blog URL: http://localhost/codoforum/blog/
  • Codoforum URL: http://localhost/codoforum/forum/

In Codoforum, my SSO settings look like this:

5667599b329ea.png

Note: since it looks truncated, in the SSO Login User Path field I'm redirecting back to the forum. The whole field value looks like this:

http://localhost/codoforum/blog/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2Fcodoforum%2Fforum%2F

My client.php files looks like this:

require 'sso.php';

define('ABSPATH', dirname(__FILE__) . '/');
include_once ABSPATH . '/wp-config.php';

/**
 * 
 * The SSO client id and secret MUST be same as that set in the Codoforum
 * SSO plugin settings
 */

$settings = array(

  "client_id" => 'ssoCodoForum',
  "secret" => 'seKreTkEy',
  "timeout" => 6000  
);

$sso = new codoforum_sso($settings);

$account = array();

/** getting wordpress user info **/
$blog_user = wp_get_current_user();
$blog_username = $blog_user->user_login;
$blog_userID = $blog_user->ID;
$blog_userEmail = $blog_user->user_email;


/*
 * 
 * Here comes your logic to check if the user is logged in or not.
 * A simple example would be using PHP SESSION
 */

if(isset($_COOKIE['PHPSESSID'])) {
    $account['uid'] = $blog_userID; //current logged in user's userid
    $account['name'] = $blog_username; //current logged in user's username
    $account['mail'] = $blog_userEmail; //current logged in user's email id
    //$account['avatar'] = ''; //not used as of now
}


$sso->output_jsonp($account); //output above as JSON back to Codoforum
exit();

Notice that since I need to pull the user's information from WordPress, I added these two lines of code:

define('ABSPATH', dirname(__FILE__) . '/');
include_once ABSPATH . '/wp-config.php';

Obvioulsy, my client.php and sso.php reside in the same directory where my wp-config.php does.

And then I'm assigning the properties of the wp_get_current_user() object to local variables. The rest of the code should be self explanatory.

At the beginning what confused me in the sample code was that the if() statement checking if the user is logged in had USER_IS_LOGGED_IN as its argument, which to me, was a constant, and I spent a bit of time trying to find where that constant was defined... obviously it turned out to be a placeholder... I know the comment above that line reads:

/**
 * 
 * Here comes your logic to check if the user is logged in or not.
 * A simple example would be using PHP SESSION
 */

But since, again, the argument looked like a constant to me, I thought that checking if a PHPSESSION was set was an alternative to using such "constant". Then I realized I was mistaken and changed my code accordingly.

Conclusion

I like the forum so far. I believe it has great potential and I want to learn it more... maybe to the point to develop plugins for it, and, as long time permits, maybe even be more active in the community (hopefully) helping others. We'll see.

Now, after a few more tests, I'm going to deploy my set up to my production server and see how it behaves live.

I hope these small steps can help someone save some time implementing SSO with their WP blog.

Thanks!

887
28
steve posted Nov 30 '15 at 12:01 am

Well first of all i would like to say this is an awesome forum script you have developed here.

Now on to my issue, i have been attempting to merge the logins for my existing site and the forum script using the sso plugin. I followed the directions closely from the install page, and it does link to the login page of my website, but when logging in it doesnt in turn log me into the forum. Hope i am making sense so far.

What is baffling me though, is the logout on my main website will also log me out of the forum once logged in manually using the user/pass i created when installing the forum script.

in the client.php at the bottom

$account['uid'] = [i have actual username here from my website]; //Your logged in user's userid
$account['name'] = [username from website]; //Your logged in user's username
$account['mail'] = [my physical email address]; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now

Not sure where i have gone wrong with this one :/

recent by steve  ·  Dec 10 '15 at 12:53 am
1.4k
6
BAT posted Oct 18 '15 at 11:22 pm

I am trying to integrate corundum into an existing web-application written with Code Igniter.

I believe I have figured out how to integrate the files together. (My controller is importing the sso.php).

When I go to login on Codoforum it takes me to my login (check). I haven't be able to test my logout, but I have not reason not to expect it won't work.

The problem is once I login at my sight it redirects me back to the codoforum as suggested by the directions. However, I am still not logged in.

1) Will codoforum accept user accounts that have already been created?

2) I put the client.php inside a public function for my class controller. I know it is getting invoked because it is set as my SSO Get User Path:

3) I noticed it said email_ID, I only have a plain text email stored in the user table. Is there going to be a problem if send it the actual email in client.php

Here is my client.php (placed inside a function)

    public function CODO_getUser()
    {
        /**
         * 
         * The SSO client id and secret MUST be same as that set in the Codoforum
         * SSO plugin settings
         */
        $settings = array(

          "client_id" => '<SECRET>',
          "secret" => '<SECRET>',
          "timeout" => 6000  
        );

        $sso = new codoforum_sso($settings);

        $account = array();

        /**
         * 
         * Here comes your logic to check if the user is logged in or not.
         * A simple example would be using PHP SESSION
         */
        if ($this->session->userdata("login")) {

            $account['uid'] = <This is the userID from MY WEBSITES DATABASE> //Your logged in user's userid
            $account['name'] = <User Name>//Your logged in user's username
            $account['mail'] = <I have the actual email here NOT the email ID...is that going to be a problem>//Your logged in user's email id
            $account['avatar'] = ''; //not used as of now
        }
        //print_r($account);
        $sso->output_jsonp($account); //output above as JSON back to Codoforum
        exit();


        }

I have gone through the directions stated here: https://codoforum.com/documentation/implementing-codoforum-sso

By the way nice tutorial it was much easier to understand than google's API.

If you see anything I am missing please help.

Thanks for making an awesome forum software.

Sincerely,

BAT

recent by BAT  ·  Nov 2 '15 at 3:05 pm
735
7

Social Logins Not Work.

Im trying to make Functional this but not work...

My error Say: You cannot access this page directly.

I Configured Alll Settings in config.php, and activated all apps in social....dont understand what is the problem:

look: www.venezolanosen.com

http://venezolanosen.com/sys/Ext/hybridauth/?hauth.start=Twitter&hauth.time=1437736733

http://venezolanosen.com/sys/Ext/hybridauth/?hauth.start=Facebook&hauth.time=1437737519

recent by Seanlionel  ·  Oct 4 '15 at 1:47 am
325
2
Jara posted Aug 18 '15 at 11:43 pm

Hi!

I had problem with plugin uni login. After I set everything properly, I still got an fatal error: Class 'Hybrid_Exception' not found...

Problem was caused by notice message in sys/CODOF/Util.php file when method start_sesstion (on line 76) tried to start session again. To disable restarting session you can use condition like

if (session_status() == PHP_SESSION_NONE) {
    session_start();
}

or somethin like

if(session_id() == '') {
    session_start();
}

I hope it some someone helps...

recent by Seanlionel  ·  Oct 4 '15 at 1:45 am
164
1
Annevance posted Aug 24 '15 at 6:30 pm

I just installed the plugin language nl-NL.

Works OK, but I found some grammar errors which I corrected in the file messages.po
I am unfamiliar with this extension, but after saving the corrected file I could not upload in Filezilla.

Status: Invalid character sequence received, disabling UTF-8. Select UTF-8 option in site manager to force UTF-8.
Response: 550 messages.po: Permission non accordée
Error: Critical file transfer error

When I "force" UTF-8 I get same error.

Any advice on how to get it right?

recent by Annevance  ·  Aug 24 '15 at 6:35 pm
232
1
one.relic posted Aug 8 '15 at 8:48 am

With the current list of importers for Codoforum, are there plans for a MyBB importer, or has someone already made one? I'm testing an install of Codoforum right now with the idea of switching my community over from MyBB, but I'd rather not do an entire wipe/reboot of the community if I can avoid it.

673
34

Hi,
I have create a plugin that display a form to be filled by members of my site; i would my form be published as a topic when they press submit button. I would also use this form as one category where there will be nothing else than this form, in others words how use a plugin as own and entire category. THANKS

2k
2
JFlame posted Jul 1 '15 at 6:14 pm

Hi all, I just downloaded and installed Codoforum locally.

I'm wondering, where do I get Plugins and Themes? Is there a respository somewhere? I can't seem to find either here on Codoforum.com.

The default install only had 3 plugins listed, and I don't see any option to install additional through the administration panel.

Thanks!

recent by teddybear  ·  Jul 3 '15 at 4:59 am
108
667
15
Actions
Hide topic messages
Enable infinite scrolling
Previous
Next
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft