Author Topic: FengOffice 2 + Wordpress + Moodle + ResourceSpace + SMF Forum Integration  (Read 4340 times)

krashnik

  • Freshman
  • *
  • Posts: 25
    • View Profile
    • HardMagic Publishing
Hello,

At HardMagic Publishing, we have had FengOffice 1.7.5 integrated for a few years now.  

As of June 15th, 2013 - we have our first integration of Feng 2.3 integrated with many pieces of software.  They include

Wordpress
ResourceSpace
Moodle
SMF Forum
plus more smaller programs.

We do this by having the user login to Wordpress as the main site.  Then, we have a subdirectory on the site such as example.com/feng

Inside of here, we edited the init.php file to include this:

Code: [Select]
if(isset($_GET['a'])){
if($_GET['a'] == 'login')
{
 //ADD THIRD PARTY SO IT DOES NOT LOAD MOODLE OR WORDPRESS
$third_party = 1;
define('WP_USE_THEMES', false);
require_once(__DIR__.'/../wp-blog-header.php');
if ( is_user_logged_in() ) {
   $current_user = wp_get_current_user();
$_SESSION["id"] = $current_user->ID;
ajx_current("empty");
$user = Contacts::getByUsername($current_user->user_login, owner_company());

try {
CompanyWebsite::instance()->logUserIn($user, 0);
} catch(Exception $e) {
flash_error(lang('invalid login data'));
return;
} // try
} else {

$actual_link = full_url();
    wp_redirect( wp_login_url( $actual_link  )  );
}

}}

We put this on line 162 of the file, which is somewhat important, yet it can be moved around in there.

This essentially checks to see if the user is getting authenticated... once authentication is checked (by having GET['a'] in the url) we hook this operation and tell the program to instead load up the wordpress header file.  

From here, we find the Wordpress user & pass them back as being logged in via the
Code: [Select]
$current_user = wp_get_current_user(); variable.  You can replace this variable with any other system you'd like & it will make your user logged in.  The variable should include the userID needed on the next line & the username on the line thereafter.

I hope this makes sense.  It is a small snippet & we have included this in our open-source software known as Pedadida.  (If given permission, I will post a link to this PHP software.

Pedadida automatically handles all integrations for you and gives you the latest version of all the softwares I mentioned above automatically integrated together.  This is a much larger installation that just FengOffice, itself, though great for Universities or Institutes that use FengOffice as the task management solution while also needing many other amenities on their site.

You may also browse our project on GitHub to see our latest revisions & to see the actual code.  
Owner of HardMagic Publishing

Baveskara

  • Hero Member
  • *****
  • Posts: 648
    • ICQ Messenger - 365673748
    • Yahoo Instant Messenger - cialis and beer
    • View Profile
    • generic cialis 5 mg from india
    • Email
cheap cialis online united states
« Reply #1 on: July 29, 2022, 10:44:45 am »
1 years respectively cialis pills for sale grisactin dydrogesterone in hindi RUBBISH
« Last Edit: December 19, 2022, 04:31:24 pm by Baveskara »