示例#1
0
    function cpu($id)
    {
        $this->id = $id;
        // Get the disk informations
        $q0 = get_link()->prepare('SELECT 
									c.id AS ID,
									c.logical_id AS LOGICALID,
									c.max_clock_speed AS MAXCLOCKSPEED,
									c.name AS NAME,
									c.created_date AS CREATED_DATE,
									c.created_id AS CREATED_ID,
									c.edited_date AS EDITED_DATE,
									c.edited_id AS EDITED_ID,
									c.deleted_date AS DELETED_DATE,
									c.deleted_id AS DELETED_ID
								FROM ' . get_ini('BDD_PREFIX') . 'cmdb_dev_os_cpu c 
								WHERE id=:id AND deleted_date=0');
        $q0->execute(array('id' => $id));
        $r0 = $q0->fetch(PDO::FETCH_OBJ);
        if (isset($r0->ID)) {
            $this->logicalId = $r0->LOGICALID;
            $this->maxClockSpeed = $r0->MAXCLOCKSPEED;
            $this->name = $r0->NAME;
            $this->createdDate = $r0->CREATED_DATE;
            $this->createdID = $r0->CREATED_ID;
            $this->editedDate = $r0->EDITED_DATE;
            $this->editedId = $r0->EDITED_ID;
            $this->deletedDate = $r0->DELETED_DATE;
            $this->deltedId = $r0->DELETED_ID;
        } else {
            // TODO add log management
            echo 'The cpu does not exist.';
            exit(100);
        }
    }
    function environment($id)
    {
        $this->id = $id;
        // Get the disk informations
        $q0 = get_link()->prepare('SELECT 
									e.id AS ID,
									e.id_parent AS ID_PARENT,
									e.name AS NAME,
									e.created_date AS CREATED_DATE,
									e.created_id AS CREATED_ID,
									e.edited_date AS EDITED_DATE,
									e.edited_id AS EDITED_ID,
									e.deleted_date AS DELETED_DATE,
									e.deleted_id AS DELETED_ID
								FROM ' . get_ini('BDD_PREFIX') . 'cmdb_environments e 
								WHERE id=:id AND deleted_date=0');
        $q0->execute(array('id' => $id));
        $r0 = $q0->fetch(PDO::FETCH_OBJ);
        if (isset($r0->ID)) {
            $this->parentId = $r0->ID_PARENT;
            $this->name = $r0->NAME;
            $this->createdDate = $r0->CREATED_DATE;
            $this->createdID = $r0->CREATED_ID;
            $this->editedDate = $r0->EDITED_DATE;
            $this->editedId = $r0->EDITED_ID;
            $this->deletedDate = $r0->DELETED_DATE;
            $this->deltedId = $r0->DELETED_ID;
        } else {
            // TODO add log management
            echo 'The environment don\'t exist.';
            exit(100);
        }
    }
 function perform(&$request, &$response)
 {
     $object_data =& fetch_requested_object($request);
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_all();
     foreach ($image_variations as $key => $value) {
         if (array_key_exists($key, $_GET)) {
             $variation = $key;
             break;
         }
     }
     if (empty($variation)) {
         $variation = 'thumbnail';
     }
     $image = $object_data['variations'][$variation];
     if (!$image) {
         $response->header("Content-type: image/gif");
         $response->readfile(SHARED_DIR . 'images/1x1.gif');
         if ($variation == 'original') {
             $request->set_status(REQUEST_STATUS_FAILURE);
             return;
         } else {
             $response->commit();
             //for speed
         }
     }
     if (!file_exists(MEDIA_DIR . $image['media_id'] . '.media')) {
         $response->header("HTTP/1.1 404 Not found");
         if ($variation == 'original') {
             $request->set_status(REQUEST_STATUS_FAILURE);
             return;
         } else {
             $response->commit();
             //for speed
         }
     }
     if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $image['etag']) {
         $response->use_client_cache();
         $response->header("Pragma: public");
         $response->header("Cache-Control: private");
         $response->header("Date: " . date("D, d M Y H:i:s") . " GMT");
         $response->header("Etag: {$image['etag']}");
     } else {
         $response->header("Pragma: public");
         $response->header("Cache-Control: private");
         $response->header("Date: " . date("D, d M Y H:i:s") . " GMT");
         $response->header("Etag: {$image['etag']}");
         $response->header("Content-type: {$image['mime_type']}");
         $response->header("Content-Disposition: filename={$image['file_name']}");
         $response->readfile(MEDIA_DIR . $image['media_id'] . '.media');
     }
     if ($variation == 'original') {
         return;
     } else {
         $response->commit();
         //for speed
     }
 }
 function _init_dataspace(&$request)
 {
     parent::_init_dataspace($request);
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_all();
     foreach ($image_variations as $variation => $variation_data) {
         $this->dataspace->set('upload_' . $variation . '_max_size', isset($variation_data['max_size']) ? $variation_data['max_size'] : '');
         $this->dataspace->set('generate_' . $variation . '_max_size', isset($variation_data['max_size']) ? $variation_data['max_size'] : '');
     }
 }
 function _init_dataspace()
 {
     parent::_init_dataspace();
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_named_array();
     foreach ($image_variations as $variation => $variation_data) {
         $this->_set('upload_' . $variation . '_max_size', isset($variation_data['max_size']) ? $variation_data['max_size'] : '');
         $this->_set('generate_' . $variation . '_max_size', isset($variation_data['max_size']) ? $variation_data['max_size'] : '');
     }
 }
 function _load_jobs()
 {
     $ini =& get_ini('cron.ini');
     $this->jobs = array();
     $groups = $ini->get_all();
     foreach ($groups as $group => $data) {
         if (strpos($group, 'cron-job') === 0) {
             $this->jobs[$group] = $data;
         }
     }
 }
 function run(&$filter_chain, &$request, &$response)
 {
     debug::add_timing_point('jip filter started');
     $fetcher =& fetcher::instance();
     $fetcher->set_jip_status(false);
     $user =& user::instance();
     if ($user->is_logged_in()) {
         $ini =& get_ini('jip_groups.ini');
         if ($user->is_in_groups(array_keys($ini->get_group('groups')))) {
             $fetcher->set_jip_status(true);
         }
     }
     debug::add_timing_point('jip filter done');
     $filter_chain->next();
 }
 function _get_variation(&$request)
 {
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_all();
     foreach ($image_variations as $key => $value) {
         if ($request->has_attribute($key)) {
             $variation = $key;
             break;
         }
     }
     if (empty($variation)) {
         $variation = 'thumbnail';
     }
     return $variation;
 }
 function _get_variation()
 {
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_all();
     foreach ($image_variations as $key => $value) {
         if (array_key_exists($key, $_GET)) {
             $variation = $key;
             break;
         }
     }
     if (empty($variation)) {
         $variation = 'thumbnail';
     }
     return $variation;
 }
示例#10
0
    function disk($id)
    {
        $this->id = $id;
        // Get the disk informations
        $q0 = get_link()->prepare('SELECT 
									d.id AS ID,
									d.name AS NAME,
									d.interfacetype AS INTERFACETYPE,
									d.disk_size AS TOTALSIZE,
									d.caption AS CAPTION,
									d.firmwarerevision AS FIRMWAREREVISION,
									d.manufacturer AS MANUFACTURER,
									d.model AS MODEL,
									d.serialnumber AS SERIALNUMBER,
									d.created_date AS CREATED_DATE,
									d.created_id AS CREATED_ID,
									d.edited_date AS EDITED_DATE,
									d.edited_id AS EDITED_ID,
									d.deleted_date AS DELETED_DATE,
									d.deleted_id AS DELETED_ID
								FROM ' . get_ini('BDD_PREFIX') . 'cmdb_dev_os_disks d 
								WHERE id=:id AND deleted_date=0');
        $q0->execute(array('id' => $id));
        $r0 = $q0->fetch(PDO::FETCH_OBJ);
        if (isset($r0->ID)) {
            $this->name = $r0->NAME;
            $this->interfaceType = $r0->INTERFACETYPE;
            $this->totalSize = $r0->TOTALSIZE;
            $this->caption = $r0->CAPTION;
            $this->firmwareRevision = $r0->FIRMWAREREVISION;
            $this->manufacturer = $r0->MANUFACTURER;
            $this->model = $r0->MODEL;
            $this->serialNumber = $r0->SERIALNUMBER;
            $this->createdDate = $r0->CREATED_DATE;
            $this->createdID = $r0->CREATED_ID;
            $this->editedDate = $r0->EDITED_DATE;
            $this->editedId = $r0->EDITED_ID;
            $this->deletedDate = $r0->DELETED_DATE;
            $this->deltedId = $r0->DELETED_ID;
        } else {
            // TODO add log management
            echo 'The disk does not exist.';
            exit(100);
        }
    }
示例#11
0
 function objects($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tobj.id AS ID,\n\t\t\t\t\t\t\t\t\tobj.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tobj.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tobj.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tobj.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tobj.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tobj.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_objects obj \n\t\t\t\t\t\t\t\tWHERE obj.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The disk don\'t exist.';
         exit(100);
     }
 }
示例#12
0
    function service($id)
    {
        $this->id = $id;
        // Get the disk informations
        $q0 = get_link()->prepare('SELECT 
									s.id AS ID,
									s.name AS NAME,
									s.path_name AS PATHNAME,
									s.start_mode AS STARTMODE,
									s.service_state AS SERVICESTATE,
									s.owner AS OWNER,
									s.created_date AS UP_CREATED_DATE,
									s.created_id AS UP_CREATED_ID,
									s.created_date AS CREATED_DATE,
									s.created_id AS CREATED_ID,
									s.edited_date AS EDITED_DATE,
									s.edited_id AS EDITED_ID,
									s.deleted_date AS DELETED_DATE,
									s.deleted_id AS DELETED_ID
								FROM ' . get_ini('BDD_PREFIX') . 'cmdb_dev_os_services s
								WHERE s.id=:id AND s.deleted_date=0');
        $q0->execute(array('id' => $id));
        $r0 = $q0->fetch(PDO::FETCH_OBJ);
        if (isset($r0->ID)) {
            $this->name = $r0->NAME;
            $this->pathName = $r0->PATHNAME;
            $this->startMode = $r0->STARTMODE;
            $this->serviceState = $r0->SERVICESTATE;
            $this->owner = $r0->OWNER;
            $this->createdDate = $r0->CREATED_DATE;
            $this->createdID = $r0->CREATED_ID;
            $this->editedDate = $r0->EDITED_DATE;
            $this->editedId = $r0->EDITED_ID;
            $this->deletedDate = $r0->DELETED_DATE;
            $this->deltedId = $r0->DELETED_ID;
        } else {
            // TODO add log management
            echo 'The service does not exist.';
            exit(100);
        }
    }
 function eventLog($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tev.id AS ID,\n\t\t\t\t\t\t\t\t\tev.log_statement AS LOGSTATEMENT,\n\t\t\t\t\t\t\t\t\tpg.name AS PLUGIN,\n\t\t\t\t\t\t\t\t\tev.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tev.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tev.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tev.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tev.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tev.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_event_logs ev,\n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_plugins pg\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tev.id_plugin=pg.id AND\n\t\t\t\t\t\t\t\tev.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->logStatement = $r0->LOGSTATEMENT;
         $this->plugin = $r0->PLUGIN;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         exit(100);
     }
 }
示例#14
0
 function access($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tsec.id AS ID,\n\t\t\t\t\t\t\t\t\tsec.id_source AS IDSOURCE,\n\t\t\t\t\t\t\t\t\tsec.id_target AS IDTARGET,\n\t\t\t\t\t\t\t\t\tsec.secure_level AS SECURELEVEL,\n\t\t\t\t\t\t\t\t\tsec.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tsec.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tsec.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tsec.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tsec.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tsec.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_access sec \n\t\t\t\t\t\t\t\tWHERE sec.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->secureLevel = $r0->SECURELEVEL;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The access doesn\'t exist.';
         exit(100);
     }
 }
示例#15
0
 function table($id)
 {
     $this->id = $id;
     // Get the group informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tt.id AS ID,\n\t\t\t\t\t\t\t\t\tt.name AS NAME,\n\t\t\t\t\t\t\t\t\tt.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tt.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tt.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tt.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tt.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tt.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_tables t \n\t\t\t\t\t\t\t\tWHERE t.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->name = $r0->NAME;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The table does not exist.';
         exit(100);
     }
 }
 function authMethod($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tuam.id AS ID,\n\t\t\t\t\t\t\t\t\tuam.name AS NAME,\n\t\t\t\t\t\t\t\t\tuam.icon AS ICON,\n\t\t\t\t\t\t\t\t\tuam.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tuam.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tuam.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tuam.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tuam.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tuam.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_user_auth_methods uam \n\t\t\t\t\t\t\t\tWHERE uam.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->name = $r0->NAME;
         $this->icon = $r0->ICON;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The disk don\'t exist.';
         exit(100);
     }
 }
示例#17
0
 function local($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tloc.id AS ID,\n\t\t\t\t\t\t\t\t\tloc.short_name AS SHORT_NAME,\n\t\t\t\t\t\t\t\t\tloc.long_name AS LONG_NAME,\n\t\t\t\t\t\t\t\t\tloc.flag_path AS FLAG_PATH,\n\t\t\t\t\t\t\t\t\tloc.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tloc.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tloc.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tloc.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tloc.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tloc.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\t\t" . get_ini('BDD_PREFIX') . "core_locale loc\n\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\tloc.id = :id\n\t\t\t\t\t\t\t\t");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->shortName = $r0->SHORT_NAME;
         $this->longName = $r0->LONG_NAME;
         $this->flagPath = $r0->FLAG_PATH;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deletedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The locale don\'t exist.';
         exit(100);
     }
 }
 function parameter($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tparam.id AS ID,\n\t\t\t\t\t\t\t\t\tparam.id_plugin AS ID_PLUGIN,\n\t\t\t\t\t\t\t\t\tparam.name AS NAME,\n\t\t\t\t\t\t\t\t\tparam.parameter_value AS PARAMETER_VALUE,\n\t\t\t\t\t\t\t\t\tparam.default_value AS DEFAULT_VALUE,\n\t\t\t\t\t\t\t\t\tparam.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tparam.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tparam.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tparam.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tparam.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tparam.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_parameters param \n\t\t\t\t\t\t\t\tWHERE param.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->idPlugin = $r0->ID_PLUGIN;
         $this->name = $r0->NAME;
         $this->parameterValue = $r0->PARAMETER_VALUE;
         $this->defaultValue = $r0->DEFAULT_VALUE;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The parameter don\'t exist.';
         exit(100);
     }
 }
 function parameter($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\ttrans.id AS ID,\n\t\t\t\t\t\t\t\t\ttrans.id_plugin AS ID_PLUGIN,\n\t\t\t\t\t\t\t\t\ttrans.id_locale AS ID_LOCALE,\n\t\t\t\t\t\t\t\t\ttrans.index_translation AS INDEX_TRANSLATION,\n\t\t\t\t\t\t\t\t\ttrans.translation AS TRANSLATION,\n\t\t\t\t\t\t\t\t\ttrans.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\ttrans.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\ttrans.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\ttrans.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\ttrans.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\ttrans.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_translation trans \n\t\t\t\t\t\t\t\tWHERE trans.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->idPlugin = $r0->ID_PLUGIN;
         $this->idLocale = $r0->ID_LOCALE;
         $this->indexTranslation = $r0->INDEX_TRANSLATION;
         $this->translation = $r0->TRANSLATION;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deletedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The translation don\'t exist.';
         exit(100);
     }
 }
 public function __construct($cache = false, $design = 'base', $lang = 'fr', $loadStructure = true)
 {
     $this->infos = array('design' => $design, 'lang' => $lang);
     if (isset($_SERVER['PHP_SELF'])) {
         $urlPage = $_SERVER['PHP_SELF'];
     } elseif (isset($_SERVER['SCRIPT_NAME'])) {
         $urlPage = $_SERVER['PHP_SELF'];
     } else {
         $urlPage = '/accueil/index.php';
     }
     $elementsUrl = explode('/', $urlPage);
     $this->infos['module'] = $elementsUrl[count($elementsUrl) - 2];
     $this->infos['page'] = basename($urlPage, '.php');
     if (!$cache) {
         $this->cache = NULL;
     } else {
         $this->cache = $cache;
     }
     $this->defaultParams['lang'] = DEFAULT_LANG;
     $this->defaultParams['theme'] = DEFAULT_DESIGN;
     $this->defaultParams['module'] = DEFAULT_MODULE;
     if (!is_dir(ROOT . 'designs/' . $this->infos['design'] . '/')) {
         $this->infos['design'] = 'base';
     }
     define('DESIGN', ROOTU . 'designs/' . $this->infos['design'] . '/');
     if ($loadStructure === true) {
         $iniDesign = is_file(ROOT . 'designs/' . $this->infos['design'] . '/design.ini') ? get_ini('designs/' . $this->infos['design'] . '/design.ini') : get_ini('designs/base/design.ini');
         foreach ($iniDesign['config']['menus'] as $nameMenu) {
             $menuData = new MenusConstructor($nameMenu);
             $this->menus[$nameMenu] = $menuData->parse_menus($menuData->getContent());
         }
         $this->extract_infos();
         $this->organization['footer'] = $iniDesign['config']['footer'];
         $this->organization['header'] = $iniDesign['config']['header'];
     }
 }
示例#21
0
        if ($parameterM->getId(getPluginId('core'), 'LANG_it_IT') == 0) {
            $parameterM->create(getPluginId('core'), 'LANG_it_IT', 'NONE', 'NONE');
        }
        // Add pages
        // TODO
        echo '<BR><BR><a href="setup.php?s=23"><span class="icon iconfa-stackoverflow"> Fill the auxiliary tables</a>';
        break;
    case 20:
        echo '
<h3>Step 3/6 - Fill the database</h3>
	    ';
        if (is_file('plugins/core/setup/database.php')) {
            include 'plugins/core/setup/database.php';
            foreach ($databaseArray['MYSQL']['create_frame'] as $sql) {
                try {
                    $q0 = get_link()->prepare(str_replace('<prefix>', get_ini('BDD_PREFIX'), $sql));
                    $q0->execute();
                } catch (Exception $e) {
                }
            }
        }
        echo '<BR><BR><a href="setup.php?s=22"><span class="icon iconfa-download"> Fill tables</a>';
        break;
    case 10:
        echo '
<form action="setup.php?s=12" method="post">
<h3>Step 2/6 - Databases</h3>

Type * <BR>
<select name="db_type"><option value="oracle">Oracle</option><option value="mysql">MySql</option></select><BR>
<BR>
  function _get_variations_ini_list()
  {
    $ini =& get_ini('image_variations.ini');

    return $ini->get_all();
  }
 function _load_rules()
 {
     include_once LIMB_DIR . '/core/lib/util/ini.class.php';
     $ini =& get_ini('partial_page_cache.ini');
     $this->rules = array();
     $groups = $ini->get_all();
     foreach ($groups as $group => $data) {
         if (strpos($group, 'rule') === 0) {
             $this->rules[] = $data;
         }
     }
 }
示例#24
0
<?php

switch ($a) {
    case 'list':
        $processIndex = array();
        $processArray = array();
        $q0 = get_link()->prepare("SELECT id AS ID, cmd AS CMD, status AS STATUS, percent AS PERCENT FROM " . get_ini('BDD_PREFIX') . "core_processus WHERE deleted_date >= :deleted_date AND created_id = :created_id ORDER BY created_date DESC");
        $q0->execute(array('deleted_date' => time() - 3600, 'created_id' => $_SESSION['USER_ID']));
        while ($r0 = $q0->fetch(PDO::FETCH_OBJ)) {
            if (!in_array($r0->ID, $processIndex)) {
                array_push($processIndex, $r0->ID);
            }
            $processArray[$r0->ID]['CMD'] = $r0->CMD;
            $processArray[$r0->ID]['STATUS'] = $r0->STATUS;
            $processArray[$r0->ID]['PERCENT'] = $r0->PERCENT;
        }
        $q0->closeCursor();
        echo '
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
	<i class="icon iconastic-tasks"></i>
		';
        if (count($processIndex) > 0) {
            echo '<span class="label label-danger">' . count($processIndex) . '</span>';
        }
        echo '
</a>
<ul class="dropdown-menu">
<li>
		';
        if (count($processIndex) == 0) {
            echo '
 function processus($id)
 {
     $this->id = $id;
     // Get the disk informations
     $q0 = get_link()->prepare("SELECT \n\t\t\t\t\t\t\t\t\tpcs.id AS ID,\n\t\t\t\t\t\t\t\t\tpcs.id_parent AS ID_PARENT,\n\t\t\t\t\t\t\t\t\tpcs.cmd AS CMD,\n\t\t\t\t\t\t\t\t\tpcs.args AS ARGS,\n\t\t\t\t\t\t\t\t\tpcs.status AS STATUS,\n\t\t\t\t\t\t\t\t\tpcs.percent AS PERCENT,\n\t\t\t\t\t\t\t\t\tpcs.comments AS COMMENTS,\n\t\t\t\t\t\t\t\t\tpcs.timeout AS TIMEOUT,\n\t\t\t\t\t\t\t\t\tpcs.created_date AS CREATED_DATE,\n\t\t\t\t\t\t\t\t\tpcs.created_id AS CREATED_ID,\n\t\t\t\t\t\t\t\t\tpcs.edited_date AS EDITED_DATE,\n\t\t\t\t\t\t\t\t\tpcs.edited_id AS EDITED_ID,\n\t\t\t\t\t\t\t\t\tpcs.deleted_date AS DELETED_DATE,\n\t\t\t\t\t\t\t\t\tpcs.deleted_id AS DELETED_ID\n\t\t\t\t\t\t\t\tFROM " . get_ini('BDD_PREFIX') . "core_processus pcs \n\t\t\t\t\t\t\t\tWHERE pcs.id=:id");
     $q0->execute(array('id' => $id));
     $r0 = $q0->fetch(PDO::FETCH_OBJ);
     if (isset($r0->ID)) {
         $this->idParent = $r0->ID_PARENT;
         $this->cmd = $r0->CMD;
         $this->args = $r0->ARGS;
         $this->status = $r0->STATUS;
         $this->percent = $r0->PERCENT;
         $this->comments = $r0->COMMENTS;
         $this->timeout = $r0->TIMEOUT;
         $this->createdDate = $r0->CREATED_DATE;
         $this->createdID = $r0->CREATED_ID;
         $this->editedDate = $r0->EDITED_DATE;
         $this->editedId = $r0->EDITED_ID;
         $this->deletedDate = $r0->DELETED_DATE;
         $this->deltedId = $r0->DELETED_ID;
     } else {
         // TODO add log management
         echo 'The processus does not exist.';
         exit(100);
     }
 }
示例#26
0
function get_ini_option($filename, $block_name, $var_name, $use_cache = null)
{
    $ini =& get_ini($filename, $use_cache);
    return $ini->variable($block_name, $var_name);
}
示例#27
0
function get_ini_option($file_path, $var_name, $group_name = 'default', $use_cache = null)
{
	$ini =& get_ini($file_path, $use_cache);

	return $ini->get_option($var_name, $group_name);
} 
示例#28
0
    set_time_limit($item_HEADER->getElementsByTagName('TIMEOUT')->item(0)->nodeValue);
    $q0 = get_link()->prepare('UPDATE ' . get_ini('BDD_PREFIX') . 'core_processus SET timeout=:timeout WHERE id=:id');
    $q0->execute(array('timeout' => time() + $item_HEADER->getElementsByTagName('TIMEOUT')->item(0)->nodeValue, 'id' => $proc->id));
    // Include the file we need
    $g = $item_HEADER->getElementsByTagName('PLUGIN')->item(0)->nodeValue;
    $p = $item_HEADER->getElementsByTagName('PAGE')->item(0)->nodeValue;
    // Get the date
    $xmlDate = toTime($item_HEADER->getElementsByTagName('DATE')->item(0)->nodeValue);
    // If the Xsd file exist
    if (is_file('plugins/' . $g . '/xsd/' . $p . '.xsd') && $domXmlFile->schemaValidate('plugins/' . $g . '/xsd/' . $p . '.xsd') && is_file('plugins/' . $g . '/' . $p . '.php') || !is_file('plugins/' . $g . '/xsd/' . $p . '.xsd') && is_file('plugins/' . $g . '/' . $p . '.php')) {
        if ($g != 'core' && is_file('plugins/' . $g . '/__functions.php')) {
            require_once 'plugins/' . $g . '/__functions.php';
        }
        include 'plugins/' . $g . '/' . $p . '.php';
    } else {
        $error = 'XML file is not valid or process file does not exist.';
    }
} else {
    $error = 'XML file is not valid.';
}
// if ko, archive the file in the failed folder
if (isset($error)) {
    $procM->update($proc->id, 'failed', '100');
    $procM->delete();
    rename(get_ini('UPLOAD_FOLDER') . 'running/' . $proc->cmd, get_ini('UPLOAD_FOLDER') . 'failed/' . time() . '-' . $proc->cmd);
} else {
    // if ok, archive the file
    rename(get_ini('UPLOAD_FOLDER') . 'running/' . $proc->cmd, get_ini('UPLOAD_FOLDER') . 'archived/' . time() . '-' . $proc->cmd);
    $procM->update($proc->id, 'ended', '100');
    $procM->delete($proc->id);
}
        $parentId = $projM->getId($projectsArray[$project]['PARENT']);
    } else {
        $parentId = 0;
    }
    if ($projM->getId($project) > 0) {
        $projM->update($projM->getId($project), $parentId, $project);
    } else {
        $projM->create($parentId, $project);
    }
}
$procM->update($proc->id, 'running', '60');
// Devices
//
$devM = new deviceManager();
// Delete device store in database and not in the data array
$q0 = get_link()->prepare('SELECT name AS NAME FROM ' . get_ini('BDD_PREFIX') . 'cmdb_devices WHERE deleted_date=0 OR deleted_date>:deleted_date');
$q0->execute(array('deleted_date' => time()));
while ($r0 = $q0->fetch(PDO::FETCH_OBJ)) {
    if (!in_array($r0->NAME, $serversIndex)) {
        $devM->delete($devM->getId('server', $r0->NAME));
    }
}
foreach ($serversIndex as $server) {
    if ($devM->getId('server', $serversArray[$server]['PARENT']) > 0) {
        $parentId = $devM->getId('server', $serversArray[$server]['PARENT']);
    } else {
        $parentId = 0;
    }
    if ($devM->getId('server', $server) > 0) {
        $devM->update($devM->getId('server', $server), $parentId, $server, 'server', '');
    } else {
 function perform()
 {
     $object_data =& fetch_mapped_by_url();
     ob_end_clean();
     $ini =& get_ini('image_variations.ini');
     $image_variations = $ini->get_named_array();
     foreach ($image_variations as $key => $value) {
         if (array_key_exists($key, $_GET)) {
             $variation = $key;
             break;
         }
     }
     if (empty($variation)) {
         $variation = 'thumbnail';
     }
     $image = $object_data['variations'][$variation];
     if (!$image) {
         header("Content-type: image/gif");
         readfile(SHARED_DIR . 'images/1x1.gif');
         if ($variation == 'original') {
             return new exit_response(RESPONSE_STATUS_FAILURE);
         } else {
             exit;
         }
         //for speed
     }
     if (!file_exists(MEDIA_DIR . $image['media_id'] . '.media')) {
         header("HTTP/1.1 404 Not found");
         if ($variation == 'original') {
             return new exit_response(RESPONSE_STATUS_FAILURE);
         } else {
             exit;
         }
         //for speed
     }
     if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $image['etag']) {
         header("HTTP/1.1 304 Not modified");
         header("Pragma: public");
         header("Cache-Control: private");
         header("Date: " . date("D, d M Y H:i:s") . " GMT");
         header("Etag: {$image['etag']}");
     } else {
         header("Pragma: public");
         header("Cache-Control: private");
         header("Date: " . date("D, d M Y H:i:s") . " GMT");
         header("Etag: {$image['etag']}");
         header("Content-type: {$image['mime_type']}");
         header("Content-Disposition: filename={$image['file_name']}");
         readfile(MEDIA_DIR . $image['media_id'] . '.media');
     }
     if ($variation == 'original') {
         return new exit_response();
     } else {
         exit;
     }
     //for speed
 }