Author Topic: Authorization check  (Read 4944 times)

ssbka

  • Newbie
  • *
  • Posts: 1
    • View Profile
Authorization check
« on: May 26, 2010, 03:09:23 am »
Hi!

I'm implementing various third party plugins in Feng Office (the excellent gantt charts for example found here), but I have a problem that you can access these pages from outside without having to first login to feng office. So how can I determine whatever the user is logged in or not?

For example I have this in layout.js :
Code: [Select]
og.panels.lab = new og.ContentPanel({
title: lang('gantt'),
id: 'labs-panel',
iconCls: 'ico-labs',
refreshOnWorkspaceChange: false,
defaultContent: {
type: 'html',
data: '<iframe id="ganttframe" style="width:100%;height:100%;border:0" src="...index.php"></iframe>'
}
})

Now the gantt charts work in iframe inside feng office which have separate session, how could I share somehow the login information for the plugins which are made "separate" from feng office - any ideas?

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Authorization check
« Reply #1 on: May 31, 2010, 01:01:28 pm »
You should include the Feng Office framework and invoke logged_user() function.

WiZaxx

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: Authorization check
« Reply #2 on: June 04, 2010, 05:48:55 pm »
@ cabeza:
I have the same issue, can you please show us an example?

Thank you,
Wz


cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Authorization check
« Reply #3 on: June 07, 2010, 11:45:27 am »
For a script located in Feng root dir:
Code: [Select]

<?php
chdir
(dirname(__FILE__));
define("CONSOLE_MODE"true);
define('PUBLIC_FOLDER''public');
include 
"init.php";

$user logged_user();
if(
$user){
 echo 
"Logged user id is " $user->getId(); 
}
else{
 echo 
"No logged user";
}

?>


wwwcad

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Authorization check
« Reply #4 on: August 28, 2010, 05:03:45 pm »
Quote
I'm implementing various third party plugins in Feng Office (the excellent gantt charts for example found here),


Great ssbka, what kind of plugins are you working on?