Esempio n. 1
0
 public function build($obj_build_exclude = array())
 {
     if ($this->obj_debug) {
         echo "build()";
     }
     parent::build($obj_build_exclude);
     $this->obj_hfs = array();
     if (!in_array("obj_hfs", $obj_build_exclude)) {
         $user_hfs = new hf_id_user();
         $all_user_hfs = $user_hfs->get_from_hashrange($this->id_user);
         if ($all_user_hfs) {
             foreach ($all_user_hfs as $each_user_hf) {
                 $a_user_hf = new hf_id_user();
                 $a_user_hf->set($each_user_hf);
                 //$a_user_hf->build();
                 $this->obj_hfs[] = $a_user_hf;
             }
         }
     }
     $this->obj_servers = array();
     if (!in_array("obj_servers", $obj_build_exclude)) {
         $user_server = new user_server();
         $all_user_servers = $user_server->get_from_hashrange($this->id_user);
         if ($all_user_servers) {
             foreach ($all_user_servers as $each_user_server) {
                 $a_user_server = new user_server();
                 $a_user_server->set($each_user_server);
                 //$a_user_server->build();
                 $this->obj_servers[] = $a_user_server;
             }
         }
     }
     $this->obj_system_kinds = array();
     if (!in_array("obj_system_kinds", $obj_build_exclude)) {
         $user_system_kind = new user_system_kind();
         $all_user_system_kinds = $user_system_kind->get_from_hashrange($this->id_user);
         if ($all_user_system_kinds) {
             foreach ($all_user_system_kinds as $each_user_system_kind) {
                 $a_user_system_kind = new user_system_kind();
                 $a_user_system_kind->set($each_user_system_kind);
                 //$a_user_system_kind->build();
                 $this->obj_system_kinds[] = $a_user_system_kind;
             }
         }
     }
     $this->obj_inherits = array();
     if (!in_array("obj_inherits", $obj_build_exclude)) {
         $user_inherit = new user_inherit();
         $all_user_inherits = $user_inherit->get_from_hashrange($this->id_user);
         if ($all_user_inherits) {
             foreach ($all_user_inherits as $each_user_inherit) {
                 $a_user_inherit = new user_inherit();
                 $a_user_inherit->set($each_user_inherit);
                 //$a_user_inherit->build();
                 $this->obj_inherits[] = $a_user_inherit;
             }
             // END FOREACH
         }
         // END IF
     }
     // END IF
 }
Esempio n. 2
0
 $new_user_sk->create($props);
 $new_id = sha1(time() . rand(1, 20) . "Solaris" . "SunOS");
 $props = array();
 $props['id'] = $new_id;
 $props['name'] = "Solaris";
 $props['detection_text'] = "SunOS";
 $props['id_user'] = $new_user->id_user;
 $new_user_sk = new user_system_kind();
 $new_user_sk->create($props);
 $new_id = sha1(time() . rand(1, 20) . "Windows" . "indows");
 $props = array();
 $props['id'] = $new_id;
 $props['name'] = "Windows";
 $props['detection_text'] = "indows";
 $props['id_user'] = $new_user->id_user;
 $new_user_sk = new user_system_kind();
 $new_user_sk->create($props);
 $library_messages = "";
 global $library_messages;
 //include("controller.libraryinstall.php");
 $PAGE->body = $PAGE->body . "<p>" . getTranslation('The following tables were created.  Click Submit at the bottom of the page to continue.', $settings) . "</p>";
 $PAGE->body = $PAGE->body . "<table width='100%'><tr><td width='50%' valign='top'>";
 $PAGE->body = $PAGE->body . "<ul style='display:inline;'>";
 foreach ($tables_to_create as $table_created) {
     $PAGE->body = $PAGE->body . "<li>";
     $PAGE->body = $PAGE->body . $table_created;
     $PAGE->body = $PAGE->body . "</li>";
 }
 $PAGE->body = $PAGE->body . "</ul>";
 $PAGE->body = $PAGE->body . "</td>";
 $PAGE->body = $PAGE->body . "<td valign='top' align='right'>";
Esempio n. 3
0
 	if ($hf_resource->obj_overpowering)
 	{
 		continue;
 	}
 }
 */
 $BOOL_IS_CORRECT_SYSTEM_KIND = False;
 if (count($hf_resource->obj_system_kinds) == 0) {
     $BOOL_IS_CORRECT_SYSTEM_KIND = True;
 }
 foreach ($hf_resource->obj_system_kinds as $hf_sk) {
     if ($hf_sk->id_sk == "any") {
         $BOOL_IS_CORRECT_SYSTEM_KIND = True;
         break;
     } else {
         $a_sys_kind = new user_system_kind();
         $a_sys_kind->get_from_hashrange($JOB->id_user, $hf_sk->id_sk);
         if (strpos(php_uname("a"), $a_sys_kind->detection_text) !== False) {
             logger("\tSYSTEM KIND " . $a_sys_kind->name . " DETECTED\n");
             $BOOL_IS_CORRECT_SYSTEM_KIND = True;
             break;
         }
     }
 }
 if (!$BOOL_IS_CORRECT_SYSTEM_KIND) {
     logger("\tINCORRECT SYSTEM KIND FOR FILE " . $hf_resource->value_filename . "\n");
 } else {
     if (!isset($hf_resource->obj_inherited) || isset($hf_resource->obj_overpowering) && $hf_resource->obj_overpowering) {
         $filename_txt = $hf_resource->value_filename;
         $filename_txt = str_replace("/", "", $filename_txt);
         $filename_txt = str_replace("\\", "", $filename_txt);
Esempio n. 4
0
            $this_hf->get_from_hashrange($u->id_user, $qn);
            if ($this_hf->id != "undefined") {
                $this_hf->build(array("obj_expression", "obj_hf_parameters", "obj_hf_tags", "obj_hf_files", "obj_hf_kill", "obj_hf_resources", "obj_cache_out_xml", "obj_cache_out_cxml", "obj_cache_approved", "obj_cache_latest", "obj_cache_ad", "obj_fastresponse"));
                $this_hf->refresh_assignments();
            }
        }
    }
}
// main page - add a system kind
// main page - add a hf
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'add-system-kind') {
        if (isset($_POST['name']) && isset($_POST['detection_text'])) {
            if (strlen($_POST['name']) > 0 && strlen($_POST['detection_text']) > 0) {
                $new_id = sha1(time() . rand(1, 20) . $_POST['name'] . $_POST['detection_text']);
                $new_user_sk = new user_system_kind();
                $_POST['id'] = $new_id;
                $_POST['id_user'] = $u->id_user;
                $props = array();
                $new_user_sk->create($_POST);
            }
        }
    }
}
// main page - add a hf
if (isset($_GET['action'])) {
    if ($_GET['action'] == 'add-hf-inherit') {
        if (isset($_POST['id_hf'])) {
            if (strlen($_POST['id_hf']) > 0) {
                $sha1_hfi = sha1(time() . rand(1, 20) . $_POST['id_hf']);
                $found_hfi = false;
Esempio n. 5
0
         $db_print2 = "DemoDatabaseAddress.com";
     }
     $db_print1 = strtoupper($db_print1);
     //$db_print2=strtoupper($db_print2);
 }
 $sys_setting_version = new sys_setting();
 $sys_setting_version->get_from_hashrange("system", "version");
 echo "\n\t\t\t\tvar imageObjD = new Image();\n\t\t\t\timageObjD.onload = function() {\n\t\t\t\t\t\tcontext.drawImage(imageObjD, {$circle_center_x}+150, 300);\n\t\t\t\t\t\tcontext.font = 'italic bold 8pt Arial';\n\t\t\t\t\t\tcontext.fillText('" . getTranslation("HIS Database", $settings) . "', {$circle_center_x}+10+150,400);\n\t\t\t\t\tcontext.font = 'italic bold 12pt Arial';\n\t\t\t\t\tcontext.fillText('" . $db_print1 . "', {$circle_center_x}-50+100+70+150,350-20);\n\t\t\t\t\tcontext.fillText('" . $db_print2 . "', {$circle_center_x}-50+100+70+150,350);\n\t\t\t\t\tcontext.fillText('" . "(" . getTranslation("your data is here", $settings) . ")" . "', {$circle_center_x}-50+100+70+150,350+20);\n\t\t\t\t\tcontext.fillText('" . getTranslation("version", $settings) . " " . $sys_setting->val . "', {$circle_center_x}-50+100+70+150,350+20+20);\n\n\t\t\t\t};\n\t\t\t\timageObjD.src='images/his-overview.png';\n";
 echo "\n\t\t\t\tvar imageObjF = new Image();\n\t\t\t\timageObjF.onload = function() {\n\t\t\t\t\t\tcontext.drawImage(imageObjF, {$circle_center_x}-150, 300);\n\t\t\t\t\t\tcontext.font = 'italic bold 8pt Arial';\n\t\t\t\t\t\tcontext.fillText('HIS " . getTranslation("File Storage", $settings) . "', {$circle_center_x}+10-150,400);\n\t\t\t\t\tcontext.font = 'italic bold 12pt Arial';\n\t\t\t\t\tcontext.fillText('" . strtoupper($GLOBALS['settings']['storage']['@attributes']['value']) . "', {$circle_center_x}-50+100+70-150-280,350);\n\t\t\t\t\tcontext.fillText('" . "(" . getTranslation("your data is here", $settings) . ")" . "', {$circle_center_x}-50+100+70-430,350+20);\n\n\t\t\t\t};\n\t\t\t\timageObjF.src='images/files.png';\n";
 //$server_image_w=$server_image_w_orig;
 if ($server_image_w < $server_image_w_min) {
     $server_image_w = $server_image_w_min;
 }
 $server_image_h = $server_image_w / $server_image_w_orig * $server_image_h;
 for ($i = 0; $i < count($nodes); $i++) {
     $user_system_kind = new user_system_kind();
     $user_system_kind->get_from_hashrange($nodes[$i]->id_user, $nodes[$i]->id_sk);
     $server_image_addition = "";
     if ($user_system_kind->id != "undefined") {
         $server_image_addition = "-" . strtolower($user_system_kind->name);
     } else {
         $server_image_addition = "";
     }
     $server_image = "images/server{$server_image_addition}.png";
     if ($nodes[$i]->int_routable == "1") {
         $server_image = "images/server-routable.png";
     } else {
         //continue;
     }
     $server_x = $circle_center_x + $radius_w * cos($degree_separation * $r_cnt * 3.1415 / 180);
     $server_y = $circle_center_y + $radius_h * sin($degree_separation * $r_cnt * 3.1415 / 180);