コード例 #1
0
ファイル: panel.php プロジェクト: jhbsz/ossimTest
 if (GET('avtchangename') != "") {
     $file = GET('avtchangename');
     $newname = GET('newname');
     if (strlen($newname) > 25) {
         $newname = substr($newname, 0, 25);
         $truncmsg = _("Warning: Tab name too long, truncated to 15 characters.");
     }
     ossim_valid($file, OSS_ALPHA, OSS_PUNC, OSS_DIGIT, OSS_SPACE, 'error: Invalid file name.');
     ossim_valid($newname, OSS_ALPHA, OSS_PUNC, OSS_DIGIT, OSS_SPACE, 'error: Invalid file name.');
     if (ossim_error()) {
         echo ossim_error();
     }
     list($file_id, $file_values) = getavt($file);
     $newfile = preg_replace("/([^\\_]+)\\_[^\\_]+\\_(\\d+)/", "\\1_" . base64_encode($newname) . "_\\2", $file);
     rename($configs_dir . "/" . $file, $configs_dir . "/" . $newfile);
     $tabsavt = gettabsavt($configs_dir, $cloud_instance);
 }
 if (GET('tabdefault') != "") {
     $newtabdefault = GET('tabdefault');
     ossim_valid($newtabdefault, OSS_DIGIT, 'error: Invalid tab id.');
     if (ossim_error()) {
         echo ossim_error();
     }
     require_once 'classes/User_config.inc';
     $login = Session::get_session_user();
     $db = new ossim_db();
     $conn = $db->connect();
     $config = new User_config($conn);
     $_SESSION['views'][$name] = array('cols' => $columns_arr);
     $config->set($login, 'panel_default', $newtabdefault, 'simple', 'main');
     $tabdefault = $newtabdefault;
コード例 #2
0
ファイル: custom_graph.php プロジェクト: jhbsz/ossimTest
    if (file_exists($configs_dir . "/" . $file)) {
        $data = file($configs_dir . "/" . $file);
        if (preg_match("/([^\\_]+)\\_([^\\_]+)\\_([^\\_]+)\\_disabled\\.avt/", $file, $found)) {
            return array($found[3], array("tab_name" => base64_decode($found[2]), "tab_file" => $file, "tab_data" => $data, "tab_icon_url" => "../pixmaps/alienvault_icon.gif", "disable" => 1));
        } elseif (preg_match("/([^\\_]+)\\_([^\\_]+)\\_([^\\_]+)\\.avt/", $file, $found)) {
            return array($found[3], array("tab_name" => base64_decode($found[2]), "tab_file" => $file, "tab_data" => $data, "tab_icon_url" => "../pixmaps/alienvault_icon.gif", "disable" => 0));
        }
    } else {
        return array("", array());
    }
}
Session::logcheck("MenuControlPanel", "ControlPanelExecutive");
$conf = $GLOBALS["CONF"];
$jpgraph = $conf->get_conf("jpgraph_path");
$configs_dir = $conf->get_conf('panel_configs_dir');
$tabsavt = gettabsavt($configs_dir);
require_once "{$jpgraph}/jpgraph.php";
//
// This will show errors (both PHP Errors and those detected in the code)
// as graphics, so they can be read.
//
function mydie($errno, $errstr = '', $errfile = '', $errline = '')
{
    $err = $errstr ? $errstr : $errno;
    if ($errfile) {
        switch ($errno) {
            case 1:
                $errprefix = 'Error';
                break;
            case 2:
                $errprefix = 'Warning';