Beispiel #1
0
 public function __construct()
 {
     global $_OSCODE;
     if (olivfile_exists(system::OLIV_OLIVSCRIPT() . "define.xml")) {
         $_OSCODE = olivxml_load_file(system::OLIV_OLIVSCRIPT() . "define.xml");
     } else {
         OLIVError::fire("OLIVScript::construct - olivscript definition not found");
     }
 }
Beispiel #2
0
 private function scan($path)
 {
     $modules = array();
     $cnt = 0;
     if ($modDir = olivopendir($path)) {
         while ($file = readdir($modDir)) {
             if (olivis_dir($path . $file) and $file != "." and $file != "..") {
                 $filePath = "{$file}/";
                 // get modules define.xml
                 if (olivfile_exists($path . $filePath)) {
                     // load module information
                     $xml = olivxml_load_file($path . $filePath . "define.xml");
                     //------------------------------------------------------------------------------
                     // check for session directory
                     $sessionDir = system::oliv_module_path() . $filePath;
                     if (sessionfile_exists($sessionDir)) {
                         $contentPath = $xml->content;
                         $templatePath = $xml->template;
                         // write directory permissions to module header
                         $xml->content['permission'] = get_permission(session_path($sessionDir) . $contentPath);
                         $xml->template['permission'] = get_permission(session_path($sessionDir) . $templatePath);
                     } else {
                         // session directory don't exist
                         $xml->status = "NO_SESSION_DIR";
                         $xml->permission = 0;
                     }
                     //------------------------------------------------------------------------------
                     // save module metadata
                     $modules[(string) $xml->name] = $xml;
                     $cnt++;
                 }
             }
         }
         closedir($modDir);
         system::set("modules", $modules);
         return $cnt;
     } else {
         OLIVError::fire("module::scan - directory {$path} not found");
     }
     return FALSE;
 }
Beispiel #3
0
 private static function scan($path)
 {
     global $_PLUGIN;
     //    $_PLUGIN = new simpleXmlElement("<plugin></plugin>");
     $_PLUGIN = new simpleXmlElement("<plugins></plugins>");
     if ($pluginDir = olivopendir($path)) {
         $cnt = 0;
         while ($file = readdir($pluginDir)) {
             if (olivis_dir($path . $file) and $file != "." and $file != "..") {
                 $file .= "/";
                 // get define.xml
                 if (olivfile_exists($path . $file . "define.xml")) {
                     $xml = olivxml_load_file($path . $file . "define.xml");
                     //TODO include plugin script
                     // get type of plugin
                     olivxml_insert($_PLUGIN, $xml, "ALL");
                 }
             }
         }
         closedir($pluginDir);
         return $cnt;
     } else {
         OLIVError::fire("plugin::scan - directory {$path} not found");
     }
     return FALSE;
 }
Beispiel #4
0
        die("init.php - no session constant definitions found");
    }
} else {
    die("init.php - session.xml not found");
}
//------------------------------------------------------------------------------
// load session user rights
global $_access;
if (system::OLIV_ACCESS_FILE() == "local") {
    if (sessionfile_exists("access.xml")) {
        $_access = sessionxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
} else {
    if (olivfile_exists("access.xml")) {
        $_access = olivxml_load_file("access.xml");
    } else {
        die("init.php - session access.xml not found");
    }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// set page arguments
// insert GET POST messages in argv
foreach ($_GET as $key => $value) {
    argv::set($key, $value);
}
foreach ($_POST as $key => $value) {
    argv::set($key, $value);
}