function civicrm_invoke()
{
    civicrm_init();
    plugin_init();
    $user = JFactory::getUser();
    /* bypass synchronize if running upgrade
     * to avoid any serious non-recoverable error
     * which might hinder the upgrade process.
     */
    require_once 'CRM/Utils/Array.php';
    if (CRM_Utils_Array::value('task', $_REQUEST) != 'civicrm/upgrade') {
        require_once 'CRM/Core/BAO/UFMatch.php';
        CRM_Core_BAO_UFMatch::synchronize($user, FALSE, 'Joomla', 'Individual', TRUE);
    }
    require_once 'CRM/Utils/System/Joomla.php';
    CRM_Utils_System_Joomla::addHTMLHead(NULL, TRUE);
    if (isset($_GET['task'])) {
        $args = explode('/', trim($_GET['task']));
    } else {
        $_GET['task'] = 'civicrm/dashboard';
        $_GET['reset'] = 1;
        $args = array('civicrm', 'dashboard');
    }
    CRM_Core_Invoke::invoke($args);
}
Example #2
0
function civicrm_invoke()
{
    civicrm_init();
    plugin_init();
    $user = JFactory::getUser();
    require_once 'CRM/Core/BAO/UFMatch.php';
    CRM_Core_BAO_UFMatch::synchronize($user, false, 'Joomla', 'Individual');
    if (isset($_GET['task'])) {
        $args = explode('/', trim($_GET['task']));
        CRM_Core_Invoke::invoke($args);
    } else {
        $_GET['task'] = 'civicrm/dashboard';
        $_GET['reset'] = 1;
        $args = array('civicrm', 'dashboard');
        CRM_Core_Invoke::invoke($args);
    }
}
/**
 * \brief Initalize the fossology environment for cli use.  This routine loads
 * the plugins so they can be use by cli programs.  In the process of doing
 * that it disables the core-auth plugin.
 *
 * \return true
 */
function cli_Init()
{
    // every cli must perform these steps
    global $Plugins;
    /* Load the plugins */
    plugin_load(0);
    /* load but do not initialize */
    /* Turn off authentication */
    /** The auth module hijacks and disables plugins, so turn it off. **/
    $P =& $Plugins[plugin_find_any_id("auth")];
    if (!empty($P)) {
        $P->State = PLUGIN_STATE_FAIL;
    }
    $_SESSION['User'] = '******';
    /* Initialize plugins */
    /** This registers plugins with the menu structure and start the DB
       connection. **/
    plugin_init();
    /* this registers plugins with menus */
    return true;
}
Example #4
0
/**
 * Initialize all installed plugins.
 * Post-signals EVENT_PLUGIN_INIT.
 */
function plugin_init_installed()
{
    if (OFF == config_get_global('plugins_enabled') || !db_table_exists(db_get_table('plugin'))) {
        return;
    }
    global $g_plugin_cache, $g_plugin_current, $g_plugin_cache_priority, $g_plugin_cache_protected, $g_plugin_cache_init;
    $g_plugin_cache = array();
    $g_plugin_current = array();
    $g_plugin_cache_init = array();
    $g_plugin_cache_priority = array();
    $g_plugin_cache_protected = array();
    plugin_register('MantisCore');
    plugin_register_installed();
    $t_plugins = array_keys($g_plugin_cache);
    do {
        $t_continue = false;
        $t_plugins_retry = array();
        foreach ($t_plugins as $t_basename) {
            if (plugin_init($t_basename)) {
                $t_continue = true;
            } else {
                # Dependent plugin
                $t_plugins_retry[] = $t_basename;
            }
        }
        $t_plugins = $t_plugins_retry;
    } while ($t_continue);
    event_signal('EVENT_PLUGIN_INIT');
}
Example #5
0
/**
 * Activate the plugin
 */
function plugin_activate()
{
    // First load the init scripts in case any rewrite functionality is being loaded
    plugin_init();
    flush_rewrite_rules();
}
/**
 * \brief Load every module ui found in mods-enabled
 *
 * \param $CallInit 1 = call plugin_init(), else ignored.
 **/
function plugin_load($CallInit = 1)
{
    global $Plugins;
    global $SYSCONFDIR;
    $ModsEnabledDir = "{$SYSCONFDIR}/mods-enabled";
    /* Open $ModsEnabledDir and include all the php files found in the ui/ subdirectory */
    if (is_dir($ModsEnabledDir) and $EnabledDir = opendir($ModsEnabledDir)) {
        while (($ModDir = readdir($EnabledDir)) !== false) {
            $ModDirPath = "{$ModsEnabledDir}/{$ModDir}/ui";
            if (is_dir($ModDirPath) and $Dir = opendir($ModDirPath)) {
                while (($File = readdir($Dir)) !== false) {
                    if (substr($File, -4) === ".php" and !strstr($File, 'ndex.php')) {
                        /* Load php found in the ui directory */
                        include_once "{$ModDirPath}/{$File}";
                    }
                }
            }
        }
    }
    closedir($EnabledDir);
    closedir($Dir);
    if ($CallInit == 1) {
        plugin_init();
    }
}