Beispiel #1
0
 /**
  * Initialize Export
  * @access private
  */
 function __initExport($module, $moduleInstance)
 {
     if ($moduleInstance->isentitytype) {
         // We will be including the file, so do a security check.
         Vtiger_Utils::checkFileAccess("modules/{$module}/{$module}.php");
     }
     $this->_export_modulexml_file = fopen($this->__getManifestFilePath(), 'w');
     $this->__write("<?xml version='1.0'?>\n");
 }
Beispiel #2
0
 /**
  * Handle event registration for module
  * @param Vtiger_Module Instance of the module to use
  * @param String Name of the Event like vtiger.entity.aftersave, vtiger.entity.beforesave
  * @param String Name of the Handler class (should extend VTEventHandler)
  * @param String File path which has Handler class definition
  * @param String Condition for the event to trigger (default blank)
  */
 static function register($moduleInstance, $eventname, $classname, $filename, $condition = '', $dependent = '[]')
 {
     // Security check on fileaccess, don't die if it fails
     if (Vtiger_Utils::checkFileAccess($filename, false)) {
         $adb = PearDatabase::getInstance();
         $eventsManager = new VTEventsManager($adb);
         $eventsManager->registerHandler($eventname, $filename, $classname, $condition, $dependent);
         $eventsManager->setModuleForHandler($moduleInstance->name, $classname);
         self::log("Registering Event {$eventname} with [{$filename}] {$classname} ... DONE");
     }
 }
Beispiel #3
0
 /**
  * Get instance of the module class.
  * @param String Module name
  */
 static function getClassInstance($modulename)
 {
     if ($modulename == 'Calendar') {
         $modulename = 'Activity';
     }
     $instance = false;
     $filepath = "modules/{$modulename}/{$modulename}.php";
     if (Vtiger_Utils::checkFileAccess($filepath, false)) {
         include_once $filepath;
         if (class_exists($modulename)) {
             $instance = new $modulename();
         }
     }
     return $instance;
 }
Beispiel #4
0
<?php

/*+********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ********************************************************************************/
include_once 'vtlib/Vtiger/Utils.php';
if ($_REQUEST['module_settings'] == 'true') {
    $targetmodule = $_REQUEST['formodule'];
    $targetSettingPage = "modules/{$targetmodule}/Settings.php";
    if (file_exists($targetSettingPage)) {
        Vtiger_Utils::checkFileAccess($targetSettingPage);
        require_once $targetSettingPage;
    }
} else {
    $modulemanager_uploaddir = 'test/vtlib';
    if ($_REQUEST['module_import'] != '') {
        require_once 'modules/Settings/ModuleManager/Import.php';
        exit;
    } else {
        if ($_REQUEST['module_update'] != '') {
            require_once 'modules/Settings/ModuleManager/Update.php';
            exit;
        } else {
            if ($_REQUEST['module_import_cancel'] == 'true') {
                $uploadfile = $_REQUEST['module_import_file'];
                $uploadfilename = "{$modulemanager_uploaddir}/{$uploadfile}";