Code Search for Developers
 
 
  

index.php from Brim at Krugle


Show index.php syntax highlighted

<?php

/**
 * The application entry point. Defaults to dashboard if no plugin is found
 *
 * This file is part of the Brim project.
 * The brim-project is located at the following
 * location: {@link http://www.brim-project.org/ http://www.brim-project.org/}
 *
 * <pre> Enjoy :-) </pre>
 *
 * @author Barry Nauta - January 2004
 * @package org.brim-project.framework
 * @subpackage install
 *
 * @copyright [brim-project.org] - Copyright (c) 2003 - 2007 Barry Nauta
 *
 * @license http://opensource.org/licenses/gpl-license.php
 * The GNU Public License
 */

if (isset ($_REQUEST['ajax']))
{
	//
	// AJAX!
	//
	$plugin = $_REQUEST['plugin'];
	// 
	// Remove all path references to avoid hacking
	//
	$plugin = str_replace("..", "", $plugin);
	$function = $_REQUEST['function'];
	//
	// Register the session id
	//
	if (isset ($_REQUEST['PHPSESSID']))
	{
		session_register ($_REQUEST['PHPSESSID']);
		unset ($_REQUEST['PHPSESSID']);
	}
	unset ($_REQUEST['ajax']);
	unset ($_REQUEST['plugin']);
	unset ($_REQUEST['function']);
	//
	// Ok, we now have a plugin, a function and the session id.
	// Ask for a specific ajax controller (some sort of security,
	// we can only execute the functions in those controllers
	// using an async callback
	//
	if ($plugin != 'framework')
	{
		//
		// Plugin specifc ajaxcontroller, read from the config
		//
		include 'plugins/'.$plugin.'/configuration/hookup.php';
		$controllerClass = $plugins [$plugin]['ajaxController'];
		$controllerName = $plugins [$plugin]['ajaxControllerName'];
		require_once 'plugins/'.$plugin.'/'.$controllerClass;
	}
	else
	{
		//
		// Framework ajaxcontroller
		//
		$controllerClass = 'AjaxController.php';
		$controllerName = 'AjaxController';
		require_once 'framework/AjaxController.php';
	}
	//
	// And execute
	//
	$controller = new $controllerName ();
	if (method_exists ($controller, $function))
	{
		$result = $controller->$function ($_REQUEST);
		echo $result;
	}
	else
	{
		//
		// This should be handled a bit better
		//
		require_once ('ext/JSON.php');
 		$json = new Services_JSON();
		$status ['error'] = 'Invalid access '.$function;
		echo $json->encode ($status); 
	}
	return;
	
}
else if (!isset ($_GET['plugin']) && !isset ($_POST['plugin']))
{
	//
	// No plugin speficified? Default to dashboard
	//
	require_once ('framework/DashboardController.php');
	$controller = new DashboardController ();
	$controller -> activate ();
	$controller -> display ();
}
else
{
	//
	// No ajax
	//
	// Execute the plugin specific controller
	//
	$plugin = isset ($_GET['plugin'])?$_GET['plugin']:$_POST['plugin'];
	// 
	// Remove all path references to avoid hacking
	//
	$plugin = str_replace("..", "", $plugin);
	include 'plugins/'.$plugin.'/configuration/hookup.php';
	$controllerClass = $plugins[$plugin]['controller'];
	$controllerName = $plugins[$plugin]['controllerName'];
	require_once 'plugins/'.$plugin.'/'.$controllerClass;
	//
	// Execute the specific controller
	//
	$controller = new $controllerName();
	$controller -> activate ();
	$controller -> display ();
}
?>




See more files for this project here

Brim

BRIM is a MVC framework, written in PHP and based on items with a hierarchical relationship. The list of plugins make BRIM a Information Manager with plugins like bookmarks, a calendar, contacts tasks, notes, RSS etc. The application is multilingual.

Project homepage: http://sourceforge.net/projects/brim
Programming language(s): JavaScript,PHP,SQL
License: other

  documentation/
    css/
      brim.css
      index.php
    pics/
      background.jpg
      design.png
      feet_booby.jpg
      index.php
      mvc.gif
      question_booby.gif
      question_booby.jpg
      shadow.gif
      shadow2.gif
      shadowAlpha.png
      sleeping_booby.jpg
      treeback.jpg
      white_boobies.jpg
    booby2brim_changes.txt
    changelog.txt
    coding_conventions.html
    contributions.html
    design.html
    directory_structure.html
    faq.html
    gpl.html
    how_to_enable_calendar_reminders_per_email.html
    how_to_enable_calendar_reminders_per_email.txt
    how_to_write_a_template.html
    how_to_write_a_template.txt
    index.php
    installation_guide.html
    mvc.html
    security.html
    todo.txt
    uninstall.html
    upgrade_guide.html
    used_versions.txt
    which_package.html
  ext/
    File/
      IMC/
        Build/
          vCard.php
        Parse/
          vCalendar.php
          vCard.php
        Build.php
        Parse.php
      IMC.php
    Savant/
      Savant/
        docs/
          README
          index.php
        filters/
          Savant_Filter_colorizeCode.php
          Savant_Filter_trimwhitespace.php
          index.php
        plugins/
          Savant_Plugin_ahref.php
          Savant_Plugin_checkbox.php
          Savant_Plugin_checkboxes.php
          Savant_Plugin_cycle.php
          Savant_Plugin_dateformat.php
          Savant_Plugin_image.php
          Savant_Plugin_input.php
          Savant_Plugin_javascript.php
          Savant_Plugin_modify.php
          Savant_Plugin_options.php
          Savant_Plugin_radios.php
          Savant_Plugin_stylesheet.php
          Savant_Plugin_textarea.php
          index.php
        Filter.php
        Plugin.php
        index.php
      Savant.php
      index.php
    adodb/
      contrib/
      datadict/
      drivers/
      lang/
      pear/
      perf/
      session/
      xsl/
      adodb-csvlib.inc.php
    jQuery/
    javascript/
    overlib/
    simpletest/
    JSON.php
    PEAR.php
    index.php
    json.js
    package.xml
  framework/
  plugins/
  templates/
  tools/
  AboutController.php
  AdminController.php
  BookmarkController.php
  BookmarkSidebarController.php
  HelpController.php
  PluginController.php
  PreferenceController.php
  README.txt
  SearchController.php
  SysinfoController.php
  TranslateController.php
  UPGRADE.txt
  UserController.php
  brim.php
  favicon.ico
  index.php
  install.php
  login.php
  loginAction.php
  logout.php
  lostPassword.php
  lostPasswordAction.php
  signup.php
  signupAction.php
  test.php