Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Single Sign On for NOCC

2011-05-20
2013-05-01
  • Bogi Aditya
    Bogi Aditya
    2011-05-20

    Dear fellows,

    I have a problem in integrating NOCC and Joomla. We want to create a single sign on between both application, so when user has log in to the Joomla, they will have a member's only menu like "Mail", and when they click this menu they will go directly to their Inbox using NOCC, without the need to login again in NOCC.

    Currently our web site is using Joomla and it  store the session in database.

    I'm not a programmer, and surely I'm quite afraid to modify the php script in NOCC without any guidance from the expert.
    What should I do to integrate both application?
    Any suggestion?

    Thank you in advance

    Bogi Aditya
    Sisfo - IMTelkom
    http://www.imtelkom.ac.id

     
  • Tim Gerundt
    Tim Gerundt
    2011-05-23

    To be true, I never touch the session code from NOCC since I develop for the project. It works, but I don't know how exactly. ;-)

    One page, which start the NOCC session without login page is the RSS feed ("rss.php"). Maybe this code helps you:

    ---------------------------------------8<---------------------------------------
    require_once './utils/crypt.php';
    require_once './classes/user_prefs.php';
    session_name("NOCCSESSID");
    session_start();
    $from_rss = true;
    $_SESSION['nocc_user'] = base64_decode($_REQUEST['nocc_user']);
    $_SESSION['nocc_passwd'] = base64_decode($_REQUEST['nocc_passwd']);
    $_SESSION['nocc_login'] = base64_decode($_REQUEST['nocc_login']);
    $_SESSION['nocc_lang'] = base64_decode($_REQUEST['nocc_lang']);
    $_SESSION['nocc_smtp_server'] = base64_decode($_REQUEST['nocc_smtp_server']);
    $_SESSION['nocc_smtp_port'] = base64_decode($_REQUEST['nocc_smtp_port']);
    $_SESSION['nocc_theme'] = base64_decode($_REQUEST['nocc_theme']);
    $_SESSION['nocc_domain'] = base64_decode($_REQUEST['nocc_domain']);
    $_SESSION['imap_namespace'] = base64_decode($_REQUEST['imap_namespace']);
    $_SESSION['nocc_servr'] = base64_decode($_REQUEST['nocc_servr']);
    $_SESSION['nocc_folder'] = base64_decode($_REQUEST['nocc_folder']);
    $_SESSION['smtp_auth'] = base64_decode($_REQUEST['smtp_auth']);
    $_SESSION['ucb_pop_server'] = base64_decode($_REQUEST['ucb_pop_server']);
    $_SESSION['quota_enable'] = base64_decode($_REQUEST['quota_enable']);
    $_SESSION['quota_type'] = base64_decode($_REQUEST['quota_type']);
    if (!NOCC_Session::existsUserPrefs()) {
      //TODO: Move to NOCC_Session::loadUserPrefs()?
      $user_key = NOCC_Session::getUserKey();
      NOCC_Session::setUserPrefs(NOCCUserPrefs::read($user_key, $ev));
      if (NoccException::isException($ev)) {
              echo "<p>User prefs error ($user_key): ".$ev->getMessage()."</p>";
              exit(1);
      }
    }
    require_once './common.php';
    //...
    //...
    //...
    --------------------------------------->8---------------------------------------
    

    The RSS feed page get the values from URL parameter which are base64 encode. Instead URL parameters you can read maybe the values from your database and then redirect to the "action.php" page?

    But this is only an idea, I don't know if it works in practice!

    Greetings,
    Tim