diff --git a/.travis.yml b/.travis.yml index 6b5e89c3e4..98767f1a58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,10 @@ language: php +sudo: required +dist: xenial env: global: - - GLPI=master + - GLPI=9.4/bugfixes - DB=mysql cache: @@ -13,6 +15,7 @@ matrix: include: - php: 5.6 addons: + mariadb: 10.2 apt: packages: - ant @@ -27,19 +30,39 @@ matrix: - php: 7.1 env: CS=true addons: - mariadb: 10.1 + mariadb: 10.3 apt: packages: - ant - xsltproc - php: 7.2 addons: + mariadb: 10.3 apt: packages: - ant - xsltproc - php: 7.3 + addons: + mariadb: 10.3 + apt: + packages: + - ant + - xsltproc + - php: 7.4 + addons: + mariadb: 10.3 + apt: + packages: + - ant + - xsltproc - php: nightly + addons: + mariadb: 10.4 + apt: + packages: + - ant + - xsltproc allow_failures: - php: nightly @@ -49,12 +72,10 @@ before_install: - cd glpi - composer install --no-dev -o - cd .. - - mysql -u root -e "SET PASSWORD FOR 'travis'@'localhost' = PASSWORD('travis')" - - mysql -u root -e "GRANT ALL PRIVILEGES ON glpi.* TO 'travis'@'localhost';" - - mysql -u root -e "FLUSH PRIVILEGES;" + - mysql -u root -e "CREATE DATABASE glpi;" - mv -f fusioninventory-for-glpi glpi/plugins/fusioninventory - pushd glpi - - bin/console db:install --no-interaction --db-name=glpi --db-user=travis --db-password=travis + - bin/console db:install --no-interaction --db-name=glpi --db-user=root - bin/console db:update |grep -q "No migration needed." || (echo "db:update FAILED" && exit 1) - popd - ant -Dclearsavepoint='true' -Dbasedir=. -f ./glpi/plugins/fusioninventory/phpunit/build.xml composer @@ -65,6 +86,7 @@ before_install: before_script: - phpenv version-name | grep ^5.[34] && echo "extension=apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true - phpenv version-name | grep ^5.[34] && echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true + - phpenv config-rm xdebug.ini - php -S localhost:8088 -t glpi > /dev/null 2>&1 & script: diff --git a/ajax/deploydropdown_operatingsystems.php b/ajax/deploydropdown_operatingsystems.php deleted file mode 100644 index c03454d918..0000000000 --- a/ajax/deploydropdown_operatingsystems.php +++ /dev/null @@ -1,115 +0,0 @@ -. - * - * ------------------------------------------------------------------------ - * - * This file is called by ajax function and display an operating system - * dropdown for deploy. - * - * ------------------------------------------------------------------------ - * - * @package FusionInventory - * @author David Durieux - * @copyright Copyright (c) 2010-2016 FusionInventory team - * @license AGPL License 3.0 or (at your option) any later version - * http://www.gnu.org/licenses/agpl-3.0-standalone.html - * @link http://www.fusioninventory.org/ - * @link https://github.com/fusioninventory/fusioninventory-for-glpi - * - */ - -include ("../../../inc/includes.php"); -Session::checkLoginUser(); - -header("Content-Type: text/html; charset=UTF-8"); -Html::header_nocache(); - -//Session::checkRight('create_ticket', "1"); - -// Security -$table = filter_input(INPUT_POST, "table"); -if (empty($table) || !$DB->tableExists($table)) { - exit(); -} - -$where = "WHERE 1"; - -$searchText = filter_input(INPUT_POST, "searchText"); -if (strlen($searchText) > 0 && $searchText != $CFG_GLPI["ajax_wildcard"]) { - $search = Search::makeTextSearch($searchText); - - $where .= " AND (`name` ".$search." - OR `id` = '".$searchText."'"; - $where .= ")"; -} - -$NBMAX = $CFG_GLPI["dropdown_max"]; -$LIMIT = "LIMIT 0, $NBMAX"; - -if ($searchText == $CFG_GLPI["ajax_wildcard"]) { - $LIMIT = ""; -} - -$query = "SELECT * - FROM `".$table."` - $where - ORDER BY `name` - $LIMIT"; -$result = $DB->query($query); - -$myname = filter_input(INPUT_POST, "myname"); -echo ""; - diff --git a/ajax/dropdownIcon.php b/ajax/dropdownIcon.php new file mode 100644 index 0000000000..130dafcc52 --- /dev/null +++ b/ajax/dropdownIcon.php @@ -0,0 +1,1450 @@ +. + * --------------------------------------------------------------------- + */ + +include ('../../../inc/includes.php'); +Html::header_nocache(); + +Session::checkLoginUser(); + +if (!isset($_REQUEST['style'])) { + throw new \RuntimeException('Required argument missing or incorrect!'); +} + +$iconsList = [ + 'fas' => [ + 'ad', + 'address-book', + 'address-card', + 'adjust', + 'air-freshener', + 'align-center', + 'align-justify', + 'align-left', + 'align-right', + 'allergies', + 'ambulance', + 'american-sign-language-interpreting', + 'anchor', + 'angle-double-down', + 'angle-double-left', + 'angle-double-right', + 'angle-double-up', + 'angle-down', + 'angle-left', + 'angle-right', + 'angle-up', + 'angry', + 'ankh', + 'apple-alt', + 'archive', + 'archway', + 'arrow-alt-circle-down', + 'arrow-alt-circle-left', + 'arrow-alt-circle-right', + 'arrow-alt-circle-up', + 'arrow-circle-down', + 'arrow-circle-left', + 'arrow-circle-right', + 'arrow-circle-up', + 'arrow-down', + 'arrow-left', + 'arrow-right', + 'arrow-up', + 'arrows-alt', + 'arrows-alt-h', + 'arrows-alt-v', + 'assistive-listening-systems', + 'asterisk', + 'at', + 'atlas', + 'atom', + 'audio-description', + 'award', + 'backspace', + 'backward', + 'balance-scale', + 'ban', + 'band-aid', + 'barcode', + 'bars', + 'baseball-ball', + 'basketball-ball', + 'bath', + 'battery-empty', + 'battery-full', + 'battery-half', + 'battery-quarter', + 'battery-three-quarters', + 'bed', + 'beer', + 'bell', + 'bell-slash', + 'bezier-curve', + 'bible', + 'bicycle', + 'binoculars', + 'birthday-cake', + 'blender', + 'blender-phone', + 'blind', + 'bold', + 'bolt', + 'bomb', + 'bone', + 'bong', + 'book', + 'book-dead', + 'book-open', + 'book-reader', + 'bookmark', + 'bowling-ball', + 'box', + 'box-open', + 'boxes', + 'braille', + 'brain', + 'briefcase', + 'briefcase-medical', + 'broadcast-tower', + 'broom', + 'brush', + 'bug', + 'building', + 'bullhorn', + 'bullseye', + 'burn', + 'bus', + 'bus-alt', + 'business-time', + 'calculator', + 'calendar', + 'calendar-alt', + 'calendar-check', + 'calendar-minus', + 'calendar-plus', + 'calendar-times', + 'camera', + 'camera-retro', + 'campground', + 'cannabis', + 'capsules', + 'car', + 'car-alt', + 'car-battery', + 'car-crash', + 'car-side', + 'caret-down', + 'caret-left', + 'caret-right', + 'caret-square-down', + 'caret-square-left', + 'caret-square-right', + 'caret-square-up', + 'caret-up', + 'cart-arrow-down', + 'cart-plus', + 'cat', + 'certificate', + 'chair', + 'chalkboard', + 'chalkboard-teacher', + 'charging-station', + 'chart-area', + 'chart-bar', + 'chart-line', + 'chart-pie', + 'check', + 'check-circle', + 'check-double', + 'check-square', + 'chess', + 'chess-bishop', + 'chess-board', + 'chess-king', + 'chess-knight', + 'chess-pawn', + 'chess-queen', + 'chess-rook', + 'chevron-circle-down', + 'chevron-circle-left', + 'chevron-circle-right', + 'chevron-circle-up', + 'chevron-down', + 'chevron-left', + 'chevron-right', + 'chevron-up', + 'child', + 'church', + 'circle', + 'circle-notch', + 'city', + 'clipboard', + 'clipboard-check', + 'clipboard-list', + 'clock', + 'clone', + 'closed-captioning', + 'cloud', + 'cloud-download-alt', + 'cloud-meatball', + 'cloud-moon', + 'cloud-moon-rain', + 'cloud-rain', + 'cloud-showers-heavy', + 'cloud-sun', + 'cloud-sun-rain', + 'cloud-upload-alt', + 'cocktail', + 'code', + 'code-branch', + 'coffee', + 'cog', + 'cogs', + 'coins', + 'columns', + 'comment', + 'comment-alt', + 'comment-dollar', + 'comment-dots', + 'comment-slash', + 'comments', + 'comments-dollar', + 'compact-disc', + 'compass', + 'compress', + 'concierge-bell', + 'cookie', + 'cookie-bite', + 'copy', + 'copyright', + 'couch', + 'credit-card', + 'crop', + 'crop-alt', + 'cross', + 'crosshairs', + 'crow', + 'crown', + 'cube', + 'cubes', + 'cut', + 'database', + 'deaf', + 'democrat', + 'desktop', + 'dharmachakra', + 'diagnoses', + 'dice', + 'dice-d20', + 'dice-d6', + 'dice-five', + 'dice-four', + 'dice-one', + 'dice-six', + 'dice-three', + 'dice-two', + 'digital-tachograph', + 'directions', + 'divide', + 'dizzy', + 'dna', + 'dog', + 'dollar-sign', + 'dolly', + 'dolly-flatbed', + 'donate', + 'door-closed', + 'door-open', + 'dot-circle', + 'dove', + 'download', + 'drafting-compass', + 'dragon', + 'draw-polygon', + 'drum', + 'drum-steelpan', + 'drumstick-bite', + 'dumbbell', + 'dungeon', + 'edit', + 'eject', + 'ellipsis-h', + 'ellipsis-v', + 'envelope', + 'envelope-open', + 'envelope-open-text', + 'envelope-square', + 'equals', + 'eraser', + 'euro-sign', + 'exchange-alt', + 'exclamation', + 'exclamation-circle', + 'exclamation-triangle', + 'expand', + 'expand-arrows-alt', + 'external-link-alt', + 'external-link-square-alt', + 'eye', + 'eye-dropper', + 'eye-slash', + 'fast-backward', + 'fast-forward', + 'fax', + 'feather', + 'feather-alt', + 'female', + 'fighter-jet', + 'file', + 'file-alt', + 'file-archive', + 'file-audio', + 'file-code', + 'file-contract', + 'file-csv', + 'file-download', + 'file-excel', + 'file-export', + 'file-image', + 'file-import', + 'file-invoice', + 'file-invoice-dollar', + 'file-medical', + 'file-medical-alt', + 'file-pdf', + 'file-powerpoint', + 'file-prescription', + 'file-signature', + 'file-upload', + 'file-video', + 'file-word', + 'fill', + 'fill-drip', + 'film', + 'filter', + 'fingerprint', + 'fire', + 'fire-extinguisher', + 'first-aid', + 'fish', + 'fist-raised', + 'flag', + 'flag-checkered', + 'flag-usa', + 'flask', + 'flushed', + 'folder', + 'folder-minus', + 'folder-open', + 'folder-plus', + 'font', + 'football-ball', + 'forward', + 'frog', + 'frown', + 'frown-open', + 'funnel-dollar', + 'futbol', + 'gamepad', + 'gas-pump', + 'gavel', + 'gem', + 'genderless', + 'ghost', + 'gift', + 'glass-martini', + 'glass-martini-alt', + 'glasses', + 'globe', + 'globe-africa', + 'globe-americas', + 'globe-asia', + 'golf-ball', + 'gopuram', + 'graduation-cap', + 'greater-than', + 'greater-than-equal', + 'grimace', + 'grin', + 'grin-alt', + 'grin-beam', + 'grin-beam-sweat', + 'grin-hearts', + 'grin-squint', + 'grin-squint-tears', + 'grin-stars', + 'grin-tears', + 'grin-tongue', + 'grin-tongue-squint', + 'grin-tongue-wink', + 'grin-wink', + 'grip-horizontal', + 'grip-vertical', + 'h-square', + 'hammer', + 'hamsa', + 'hand-holding', + 'hand-holding-heart', + 'hand-holding-usd', + 'hand-lizard', + 'hand-paper', + 'hand-peace', + 'hand-point-down', + 'hand-point-left', + 'hand-point-right', + 'hand-point-up', + 'hand-pointer', + 'hand-rock', + 'hand-scissors', + 'hand-spock', + 'hands', + 'hands-helping', + 'handshake', + 'hanukiah', + 'hashtag', + 'hat-wizard', + 'hdd', + 'heading', + 'headphones', + 'headphones-alt', + 'headset', + 'heart', + 'heartbeat', + 'helicopter', + 'highlighter', + 'hiking', + 'hippo', + 'history', + 'hockey-puck', + 'home', + 'horse', + 'hospital', + 'hospital-alt', + 'hospital-symbol', + 'hot-tub', + 'hotel', + 'hourglass', + 'hourglass-end', + 'hourglass-half', + 'hourglass-start', + 'house-damage', + 'hryvnia', + 'i-cursor', + 'id-badge', + 'id-card', + 'id-card-alt', + 'image', + 'images', + 'inbox', + 'indent', + 'industry', + 'infinity', + 'info', + 'info-circle', + 'italic', + 'jedi', + 'joint', + 'journal-whills', + 'kaaba', + 'key', + 'keyboard', + 'khanda', + 'kiss', + 'kiss-beam', + 'kiss-wink-heart', + 'kiwi-bird', + 'landmark', + 'language', + 'laptop', + 'laptop-code', + 'laugh', + 'laugh-beam', + 'laugh-squint', + 'laugh-wink', + 'layer-group', + 'leaf', + 'lemon', + 'less-than', + 'less-than-equal', + 'level-down-alt', + 'level-up-alt', + 'life-ring', + 'lightbulb', + 'link', + 'lira-sign', + 'list', + 'list-alt', + 'list-ol', + 'list-ul', + 'location-arrow', + 'lock', + 'lock-open', + 'long-arrow-alt-down', + 'long-arrow-alt-left', + 'long-arrow-alt-right', + 'long-arrow-alt-up', + 'low-vision', + 'luggage-cart', + 'magic', + 'magnet', + 'mail-bulk', + 'male', + 'map', + 'map-marked', + 'map-marked-alt', + 'map-marker', + 'map-marker-alt', + 'map-pin', + 'map-signs', + 'marker', + 'mars', + 'mars-double', + 'mars-stroke', + 'mars-stroke-h', + 'mars-stroke-v', + 'mask', + 'medal', + 'medkit', + 'meh', + 'meh-blank', + 'meh-rolling-eyes', + 'memory', + 'menorah', + 'mercury', + 'meteor', + 'microchip', + 'microphone', + 'microphone-alt', + 'microphone-alt-slash', + 'microphone-slash', + 'microscope', + 'minus', + 'minus-circle', + 'minus-square', + 'mobile', + 'mobile-alt', + 'money-bill', + 'money-bill-alt', + 'money-bill-wave', + 'money-bill-wave-alt', + 'money-check', + 'money-check-alt', + 'monument', + 'moon', + 'mortar-pestle', + 'mosque', + 'motorcycle', + 'mountain', + 'mouse-pointer', + 'music', + 'network-wired', + 'neuter', + 'newspaper', + 'not-equal', + 'notes-medical', + 'object-group', + 'object-ungroup', + 'oil-can', + 'om', + 'otter', + 'outdent', + 'paint-brush', + 'paint-roller', + 'palette', + 'pallet', + 'paper-plane', + 'paperclip', + 'parachute-box', + 'paragraph', + 'parking', + 'passport', + 'pastafarianism', + 'paste', + 'pause', + 'pause-circle', + 'paw', + 'peace', + 'pen', + 'pen-alt', + 'pen-fancy', + 'pen-nib', + 'pen-square', + 'pencil-alt', + 'pencil-ruler', + 'people-carry', + 'percent', + 'percentage', + 'person-booth', + 'phone', + 'phone-slash', + 'phone-square', + 'phone-volume', + 'piggy-bank', + 'pills', + 'place-of-worship', + 'plane', + 'plane-arrival', + 'plane-departure', + 'play', + 'play-circle', + 'plug', + 'plus', + 'plus-circle', + 'plus-square', + 'podcast', + 'poll', + 'poll-h', + 'poo', + 'poo-storm', + 'poop', + 'portrait', + 'pound-sign', + 'power-off', + 'pray', + 'praying-hands', + 'prescription', + 'prescription-bottle', + 'prescription-bottle-alt', + 'print', + 'procedures', + 'project-diagram', + 'puzzle-piece', + 'qrcode', + 'question', + 'question-circle', + 'quidditch', + 'quote-left', + 'quote-right', + 'quran', + 'rainbow', + 'random', + 'receipt', + 'recycle', + 'redo', + 'redo-alt', + 'registered', + 'reply', + 'reply-all', + 'republican', + 'retweet', + 'ribbon', + 'ring', + 'road', + 'robot', + 'rocket', + 'route', + 'rss', + 'rss-square', + 'ruble-sign', + 'ruler', + 'ruler-combined', + 'ruler-horizontal', + 'ruler-vertical', + 'running', + 'rupee-sign', + 'sad-cry', + 'sad-tear', + 'save', + 'school', + 'screwdriver', + 'scroll', + 'search', + 'search-dollar', + 'search-location', + 'search-minus', + 'search-plus', + 'seedling', + 'server', + 'shapes', + 'share', + 'share-alt', + 'share-alt-square', + 'share-square', + 'shekel-sign', + 'shield-alt', + 'ship', + 'shipping-fast', + 'shoe-prints', + 'shopping-bag', + 'shopping-basket', + 'shopping-cart', + 'shower', + 'shuttle-van', + 'sign', + 'sign-in-alt', + 'sign-language', + 'sign-out-alt', + 'signal', + 'signature', + 'sitemap', + 'skull', + 'skull-crossbones', + 'slash', + 'sliders-h', + 'smile', + 'smile-beam', + 'smile-wink', + 'smog', + 'smoking', + 'smoking-ban', + 'snowflake', + 'socks', + 'solar-panel', + 'sort', + 'sort-alpha-down', + 'sort-alpha-up', + 'sort-amount-down', + 'sort-amount-up', + 'sort-down', + 'sort-numeric-down', + 'sort-numeric-up', + 'sort-up', + 'spa', + 'space-shuttle', + 'spider', + 'spinner', + 'splotch', + 'spray-can', + 'square', + 'square-full', + 'square-root-alt', + 'stamp', + 'star', + 'star-and-crescent', + 'star-half', + 'star-half-alt', + 'star-of-david', + 'star-of-life', + 'step-backward', + 'step-forward', + 'stethoscope', + 'sticky-note', + 'stop', + 'stop-circle', + 'stopwatch', + 'store', + 'store-alt', + 'stream', + 'street-view', + 'strikethrough', + 'stroopwafel', + 'subscript', + 'subway', + 'suitcase', + 'suitcase-rolling', + 'sun', + 'superscript', + 'surprise', + 'swatchbook', + 'swimmer', + 'swimming-pool', + 'synagogue', + 'sync', + 'sync-alt', + 'syringe', + 'table', + 'table-tennis', + 'tablet', + 'tablet-alt', + 'tablets', + 'tachometer-alt', + 'tag', + 'tags', + 'tape', + 'tasks', + 'taxi', + 'teeth', + 'teeth-open', + 'temperature-high', + 'temperature-low', + 'terminal', + 'text-height', + 'text-width', + 'th', + 'th-large', + 'th-list', + 'theater-masks', + 'thermometer', + 'thermometer-empty', + 'thermometer-full', + 'thermometer-half', + 'thermometer-quarter', + 'thermometer-three-quarters', + 'thumbs-down', + 'thumbs-up', + 'thumbtack', + 'ticket-alt', + 'times', + 'times-circle', + 'tint', + 'tint-slash', + 'tired', + 'toggle-off', + 'toggle-on', + 'toilet-paper', + 'toolbox', + 'tooth', + 'torah', + 'torii-gate', + 'tractor', + 'trademark', + 'traffic-light', + 'train', + 'transgender', + 'transgender-alt', + 'trash', + 'trash-alt', + 'tree', + 'trophy', + 'truck', + 'truck-loading', + 'truck-monster', + 'truck-moving', + 'truck-pickup', + 'tshirt', + 'tty', + 'tv', + 'umbrella', + 'umbrella-beach', + 'underline', + 'undo', + 'undo-alt', + 'universal-access', + 'university', + 'unlink', + 'unlock', + 'unlock-alt', + 'upload', + 'user', + 'user-alt', + 'user-alt-slash', + 'user-astronaut', + 'user-check', + 'user-circle', + 'user-clock', + 'user-cog', + 'user-edit', + 'user-friends', + 'user-graduate', + 'user-injured', + 'user-lock', + 'user-md', + 'user-minus', + 'user-ninja', + 'user-plus', + 'user-secret', + 'user-shield', + 'user-slash', + 'user-tag', + 'user-tie', + 'user-times', + 'users', + 'users-cog', + 'utensil-spoon', + 'utensils', + 'vector-square', + 'venus', + 'venus-double', + 'venus-mars', + 'vial', + 'vials', + 'video', + 'video-slash', + 'vihara', + 'volleyball-ball', + 'volume-down', + 'volume-mute', + 'volume-off', + 'volume-up', + 'vote-yea', + 'vr-cardboard', + 'walking', + 'wallet', + 'warehouse', + 'water', + 'weight', + 'weight-hanging', + 'wheelchair', + 'wifi', + 'wind', + 'window-close', + 'window-maximize', + 'window-minimize', + 'window-restore', + 'wine-bottle', + 'wine-glass', + 'wine-glass-alt', + 'won-sign', + 'wrench', + 'x-ray', + 'yen-sign', + 'yin-yang' + ], + 'fab' => [ + '500px', + 'accessible-icon', + 'accusoft', + 'acquisitions-incorporated', + 'adn', + 'adversal', + 'affiliatetheme', + 'algolia', + 'alipay', + 'amazon', + 'amazon-pay', + 'amilia', + 'android', + 'angellist', + 'angrycreative', + 'angular', + 'app-store', + 'app-store-ios', + 'apper', + 'apple', + 'apple-pay', + 'asymmetrik', + 'audible', + 'autoprefixer', + 'avianex', + 'aviato', + 'aws', + 'bandcamp', + 'behance', + 'behance-square', + 'bimobject', + 'bitbucket', + 'bitcoin', + 'bity', + 'black-tie', + 'blackberry', + 'blogger', + 'blogger-b', + 'bluetooth', + 'bluetooth-b', + 'btc', + 'buromobelexperte', + 'buysellads', + 'cc-amazon-pay', + 'cc-amex', + 'cc-apple-pay', + 'cc-diners-club', + 'cc-discover', + 'cc-jcb', + 'cc-mastercard', + 'cc-paypal', + 'cc-stripe', + 'cc-visa', + 'centercode', + 'chrome', + 'cloudscale', + 'cloudsmith', + 'cloudversify', + 'codepen', + 'codiepie', + 'connectdevelop', + 'contao', + 'cpanel', + 'creative-commons', + 'creative-commons-by', + 'creative-commons-nc', + 'creative-commons-nc-eu', + 'creative-commons-nc-jp', + 'creative-commons-nd', + 'creative-commons-pd', + 'creative-commons-pd-alt', + 'creative-commons-remix', + 'creative-commons-sa', + 'creative-commons-sampling', + 'creative-commons-sampling-plus', + 'creative-commons-share', + 'creative-commons-zero', + 'critical-role', + 'css3', + 'css3-alt', + 'cuttlefish', + 'd-and-d', + 'd-and-d-beyond', + 'dashcube', + 'delicious', + 'deploydog', + 'deskpro', + 'dev', + 'deviantart', + 'digg', + 'digital-ocean', + 'discord', + 'discourse', + 'dochub', + 'docker', + 'draft2digital', + 'dribbble', + 'dribbble-square', + 'dropbox', + 'drupal', + 'dyalog', + 'earlybirds', + 'ebay', + 'edge', + 'elementor', + 'ello', + 'ember', + 'empire', + 'envira', + 'erlang', + 'ethereum', + 'etsy', + 'evernote', + 'expeditedssl', + 'facebook', + 'facebook-f', + 'facebook-messenger', + 'facebook-square', + 'fantasy-flight-games', + 'firefox', + 'first-order', + 'first-order-alt', + 'firstdraft', + 'flickr', + 'flipboard', + 'fly', + 'font-awesome', + 'font-awesome-alt', + 'font-awesome-flag', + 'fonticons', + 'fonticons-fi', + 'fort-awesome', + 'fort-awesome-alt', + 'forumbee', + 'foursquare', + 'free-code-camp', + 'freebsd', + 'fulcrum', + 'galactic-republic', + 'galactic-senate', + 'get-pocket', + 'gg', + 'gg-circle', + 'git', + 'git-square', + 'github', + 'github-alt', + 'github-square', + 'gitkraken', + 'gitlab', + 'gitter', + 'glide', + 'glide-g', + 'gofore', + 'goodreads', + 'goodreads-g', + 'google', + 'google-drive', + 'google-play', + 'google-plus', + 'google-plus-g', + 'google-plus-square', + 'google-wallet', + 'gratipay', + 'grav', + 'gripfire', + 'grunt', + 'gulp', + 'hacker-news', + 'hacker-news-square', + 'hackerrank', + 'hips', + 'hire-a-helper', + 'hooli', + 'hornbill', + 'hotjar', + 'houzz', + 'html5', + 'hubspot', + 'ideal', + 'imdb', + 'instagram', + 'internet-explorer', + 'ioxhost', + 'itunes', + 'itunes-note', + 'java', + 'jedi-order', + 'jenkins', + 'joget', + 'joomla', + 'js', + 'js-square', + 'jsfiddle', + 'kaggle', + 'keybase', + 'keycdn', + 'kickstarter', + 'kickstarter-k', + 'korvue', + 'laravel', + 'lastfm', + 'lastfm-square', + 'leanpub', + 'less', + 'line', + 'linkedin', + 'linkedin-in', + 'linode', + 'linux', + 'lyft', + 'magento', + 'mailchimp', + 'mandalorian', + 'markdown', + 'mastodon', + 'maxcdn', + 'medapps', + 'medium', + 'medium-m', + 'medrt', + 'meetup', + 'megaport', + 'microsoft', + 'mix', + 'mixcloud', + 'mizuni', + 'modx', + 'monero', + 'napster', + 'neos', + 'nimblr', + 'node', + 'node-js', + 'npm', + 'ns8', + 'nutritionix', + 'odnoklassniki', + 'odnoklassniki-square', + 'old-republic', + 'opencart', + 'openid', + 'opera', + 'optin-monster', + 'osi', + 'page4', + 'pagelines', + 'palfed', + 'patreon', + 'paypal', + 'penny-arcade', + 'periscope', + 'phabricator', + 'phoenix-framework', + 'phoenix-squadron', + 'php', + 'pied-piper', + 'pied-piper-alt', + 'pied-piper-hat', + 'pied-piper-pp', + 'pinterest', + 'pinterest-p', + 'pinterest-square', + 'playstation', + 'product-hunt', + 'pushed', + 'python', + 'qq', + 'quinscape', + 'quora', + 'r-project', + 'ravelry', + 'react', + 'reacteurope', + 'readme', + 'rebel', + 'red-river', + 'reddit', + 'reddit-alien', + 'reddit-square', + 'redhat', + 'renren', + 'replyd', + 'researchgate', + 'resolving', + 'rev', + 'rocketchat', + 'rockrms', + 'safari', + 'sass', + 'schlix', + 'scribd', + 'searchengin', + 'sellcast', + 'sellsy', + 'servicestack', + 'shirtsinbulk', + 'shopware', + 'simplybuilt', + 'sistrix', + 'sith', + 'skyatlas', + 'skype', + 'slack', + 'slack-hash', + 'slideshare', + 'snapchat', + 'snapchat-ghost', + 'snapchat-square', + 'soundcloud', + 'speakap', + 'spotify', + 'squarespace', + 'stack-exchange', + 'stack-overflow', + 'staylinked', + 'steam', + 'steam-square', + 'steam-symbol', + 'sticker-mule', + 'strava', + 'stripe', + 'stripe-s', + 'studiovinari', + 'stumbleupon', + 'stumbleupon-circle', + 'superpowers', + 'supple', + 'teamspeak', + 'telegram', + 'telegram-plane', + 'tencent-weibo', + 'the-red-yeti', + 'themeco', + 'themeisle', + 'think-peaks', + 'trade-federation', + 'trello', + 'tripadvisor', + 'tumblr', + 'tumblr-square', + 'twitch', + 'twitter', + 'twitter-square', + 'typo3', + 'uber', + 'uikit', + 'uniregistry', + 'untappd', + 'usb', + 'ussunnah', + 'vaadin', + 'viacoin', + 'viadeo', + 'viadeo-square', + 'viber', + 'vimeo', + 'vimeo-square', + 'vimeo-v', + 'vine', + 'vk', + 'vnv', + 'vuejs', + 'weebly', + 'weibo', + 'weixin', + 'whatsapp', + 'whatsapp-square', + 'whmcs', + 'wikipedia-w', + 'windows', + 'wix', + 'wizards-of-the-coast', + 'wolf-pack-battalion', + 'wordpress', + 'wordpress-simple', + 'wpbeginner', + 'wpexplorer', + 'wpforms', + 'wpressr', + 'xbox', + 'xing', + 'xing-square', + 'y-combinator', + 'yahoo', + 'yandex', + 'yandex-international', + 'yelp', + 'yoast', + 'youtube', + 'youtube-square', + 'zhihu' + ] +]; + + +// https://stackoverflow.com/questions/57730640/font-awesome-in-select-menu +echo ' + +'; + +echo ' + + +'; + + +echo ' + +
".__('Size', 'fusioninventory')." | "; echo ""; - $a_data = $this->find("`plugin_fusioninventory_collects_files_id`='".$collects_files_id."'", - "`pathfile`"); + $a_data = $this->find(['plugin_fusioninventory_collects_files_id' => $collects_files_id], + ['pathfile']); foreach ($a_data as $data) { echo "|||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
';
diff --git a/inc/collect_registry_content.class.php b/inc/collect_registry_content.class.php
index 989b018ff0..eea6437fb0 100644
--- a/inc/collect_registry_content.class.php
+++ b/inc/collect_registry_content.class.php
@@ -155,9 +155,8 @@ function updateComputer($computers_id, $registry_data, $collects_registries_id)
function showForComputer($computers_id) {
$pfCollect_Registry = new PluginFusioninventoryCollect_Registry();
echo "
| |||||||||||||||||||||||||||||||||||||||||||||||
"; - Html::checkAllAsCheckbox("checksList$rand", mt_rand()); + echo Html::getCheckAllAsCheckbox("checksList$rand", mt_rand()); echo " |
"; if ($networkPort->fields['instantiation_type'] == 'NetworkPortEthernet') { - $npes = $networkPortEthernet->find("`networkports_id`='".$networkPort->fields['id']."'", '', 1); + $npes = $networkPortEthernet->find(['networkports_id' => $networkPort->fields['id']], [], 1); foreach ($npes as $npe) { echo Dropdown::getDropdownName("glpi_netpoints", $npe["netpoints_id"]); } diff --git a/inc/networkinventory.class.php b/inc/networkinventory.class.php index da510e8384..c17cfdf138 100644 --- a/inc/networkinventory.class.php +++ b/inc/networkinventory.class.php @@ -291,9 +291,10 @@ function prepareRun($taskjobs_id) { $a_devicesubnet[$ip_subnet]['NetworkEquipment'][$items_id] = 1; } foreach ($a_Printer as $items_id) { - $a_ports = $NetworkPort->find("`itemtype`='Printer' - AND `items_id`='".$items_id."' - AND `ip`!='127.0.0.1'"); + $a_ports = $NetworkPort->find( + ['itemtype' => 'Printer', + 'items_id' => $items_id, + ['ip'] => ['!=', '127.0.0.1']]); foreach ($a_ports as $a_port) { $a_ip = explode(".", $a_port['ip']); $ip_subnet = $a_ip[0].".".$a_ip[1].".".$a_ip[2]."."; @@ -574,6 +575,7 @@ function run($jobstate) { $pfTaskjoblog = new PluginFusioninventoryTaskjoblog(); $pfConfigSecurity = new PluginFusioninventoryConfigSecurity(); $pfToolbox = new PluginFusioninventoryToolbox(); + $pfConfig = new PluginFusioninventoryConfig(); $current = $jobstate; $pfAgent->getFromDB($current->fields['plugin_fusioninventory_agents_id']); @@ -592,10 +594,22 @@ function run($jobstate) { $sxml_option = $this->message->addChild('OPTION'); $sxml_option->addChild('NAME', 'SNMPQUERY'); $sxml_param = $sxml_option->addChild('PARAM'); - $sxml_param->addAttribute('THREADS_QUERY', - $pfAgent->fields["threads_networkinventory"]); - $sxml_param->addAttribute('TIMEOUT', - $pfAgent->fields["timeout_networkinventory"]); + // Use general config when threads number is set to 0 on the agent + if ($pfAgent->fields["threads_networkinventory"] == 0) { + $sxml_param->addAttribute('THREADS_QUERY', + $pfConfig->getValue('threads_networkinventory')); + } else { + $sxml_param->addAttribute('THREADS_QUERY', + $pfAgent->fields["threads_networkinventory"]); + } + // Use general config when timeout is set to 0 on the agent + if ($pfAgent->fields["timeout_networkinventory"] == 0) { + $sxml_param->addAttribute('TIMEOUT', + $pfConfig->getValue('timeout_networkinventory')); + } else { + $sxml_param->addAttribute('TIMEOUT', + $pfAgent->fields["timeout_networkinventory"]); + } $sxml_param->addAttribute('PID', $current->fields['id']); $changestate = 0; @@ -606,11 +620,11 @@ function run($jobstate) { if ($jobstate->fields['itemtype'] == 'Printer') { $sxml_device->addAttribute('TYPE', 'PRINTER'); $pfPrinter = new PluginFusioninventoryPrinter(); - $a_extended = current($pfPrinter->find("`printers_id`='".$jobstate->fields['items_id']."'", '', 1)); + $a_extended = current($pfPrinter->find(['printers_id' => $jobstate->fields['items_id']], [], 1)); } else if ($jobstate->fields['itemtype'] == 'NetworkEquipment') { $sxml_device->addAttribute('TYPE', 'NETWORKING'); $pfNetworkEquipment = new PluginFusioninventoryNetworkEquipment(); - $a_extended = current($pfNetworkEquipment->find("`networkequipments_id`='".$jobstate->fields['items_id']."'", '', 1)); + $a_extended = current($pfNetworkEquipment->find(['networkequipments_id' => $jobstate->fields['items_id']], [], 1)); } $sxml_device->addAttribute('ID', $jobstate->fields['items_id']); diff --git a/inc/networkport.class.php b/inc/networkport.class.php index 2b54d29016..519365c0bd 100644 --- a/inc/networkport.class.php +++ b/inc/networkport.class.php @@ -220,7 +220,7 @@ function loadNetworkport($networkports_id) { $networkport->getFromDB($networkports_id); $this->portDB = $networkport->fields; - $a_fusports = $this->find("`networkports_id`='".$networkports_id."'", "", 1); + $a_fusports = $this->find(['networkports_id' => $networkports_id], [], 1); if (count($a_fusports) > 0) { $a_fusport = current($a_fusports); foreach ($a_fusport as $key=>$value) { @@ -332,358 +332,6 @@ function getNetworkPortsID() { } - /** - * Search networkport with IP and ifdescr - * - * @global object $DB - * @param string $IP - * @param string $ifDescr - * @param string $sysdescr - * @param string $sysname - * @param string $model - * @return integer - */ - function getPortIDfromDeviceIP($IP, $ifDescr, $sysdescr, $sysname, $model) { - global $DB; - - $pfUnmanaged = new PluginFusioninventoryUnmanaged(); - $NetworkPort = new NetworkPort(); - $networkName = new NetworkName(); - $iPAddress = new IPAddress(); - - $PortID = ""; - - // search port have ifdescr + ip (in most cases not find it) - $queryPort = "SELECT `glpi_networkports`.`id` - FROM `glpi_plugin_fusioninventory_networkports` - LEFT JOIN `glpi_networkports` - ON `glpi_plugin_fusioninventory_networkports`.`networkports_id`= - `glpi_networkports`.`id` - LEFT JOIN `glpi_networknames` - ON `glpi_networknames`.`items_id`=`glpi_networkports`.`id` - AND `glpi_networknames`.`itemtype`='NetworkPort' - LEFT JOIN `glpi_ipaddresses` - ON `glpi_ipaddresses`.`items_id`=`glpi_networknames`.`id` - AND `glpi_ipaddresses`.`itemtype`='NetworkName' - - WHERE (`ifdescr`='".$ifDescr."' - OR `glpi_networkports`.`name`='".$ifDescr."') - AND `glpi_networkports`.`itemtype`='NetworkEquipment' - AND `glpi_ipaddresses`.`name`='".$IP."'"; - $resultPort = $DB->query($queryPort); - if ($DB->numrows($resultPort) == 0) { - // Search a management port of networkequipment have this IP - $queryManagement = "SELECT `glpi_networkports`.`itemtype`, - `glpi_networkports`.`items_id` FROM `glpi_networkports` - LEFT JOIN `glpi_networknames` - ON `glpi_networknames`.`items_id`=`glpi_networkports`.`id` - AND `glpi_networknames`.`itemtype`='NetworkPort' - LEFT JOIN `glpi_ipaddresses` - ON `glpi_ipaddresses`.`items_id`=`glpi_networknames`.`id` - AND `glpi_ipaddresses`.`itemtype`='NetworkName' - - WHERE `glpi_ipaddresses`.`name`='".$IP."' - AND `instantiation_type`='NetworkPortAggregate' - LIMIT 1"; - $resultManagement = $DB->query($queryManagement); - if ($DB->numrows($resultManagement) == 1) { - $dataManagement = $DB->fetch_assoc($resultManagement); - // Seach a port have this ifdescr for this same networkequipment - $queryPort = "SELECT `glpi_networkports`.`id` - FROM `glpi_plugin_fusioninventory_networkports` - LEFT JOIN `glpi_networkports` - ON `glpi_plugin_fusioninventory_networkports`.`networkports_id`= - `glpi_networkports`.`id` - WHERE `glpi_networkports`.`itemtype`='".$dataManagement['itemtype']."' - AND `glpi_networkports`.`items_id`='".$dataManagement['items_id']."' - AND (`ifdescr`='".$ifDescr."' - OR `glpi_networkports`.`name`='".$ifDescr."') - LIMIT 1"; - $resultPort = $DB->query($queryPort); - if ($DB->numrows($resultPort) == 1) { - $dataPort = $DB->fetch_assoc($resultPort); - $PortID = $dataPort["id"]; - } - } - } else { - $dataPort = $DB->fetch_assoc($resultPort); - $PortID = $dataPort['id']; - } - - // Detect IP Phone - if ($PortID == "") { - if (strstr($model, "Phone") - || $model == '') { - $queryPort = "SELECT glpi_networkports.* FROM `glpi_phones` - LEFT JOIN `glpi_networkports` - ON `glpi_phones`.`id`=`glpi_networkports`.`items_id` - LEFT JOIN `glpi_networknames` - ON `glpi_networknames`.`items_id`=`glpi_networkports`.`id` - AND `glpi_networknames`.`itemtype`='NetworkPort' - LEFT JOIN `glpi_ipaddresses` - ON `glpi_ipaddresses`.`items_id`=`glpi_networknames`.`id` - AND `glpi_ipaddresses`.`itemtype`='NetworkName' - - WHERE `glpi_ipaddresses`.`name`='".$IP."' - AND `glpi_networkports`.`itemtype`='Phone' - AND `glpi_phones`.`name`='".$sysname."' - LIMIT 1"; - $resultPort = $DB->query($queryPort); - if ($DB->numrows($resultPort) == 1) { - $dataPort = $DB->fetch_assoc($resultPort); - if (isset($dataPort['id'])) { - $PortID = $dataPort["id"]; - } - } - } - } - - if ($PortID == "") { - $query = "SELECT * FROM `glpi_plugin_fusioninventory_unmanageds` - WHERE `ip`='".$IP."' - LIMIT 1"; - $result = $DB->query($query); - if ($DB->numrows($result) == "1") { - $data = $DB->fetch_assoc($result); - // Search port and add if required - $query1 = "SELECT * - FROM `glpi_networkports` - WHERE `itemtype`='PluginFusioninventoryUnmanaged' - AND `items_id`='".$data['id']."' - AND `name`='".$ifDescr."' - LIMIT 1"; - $result1 = $DB->query($query1); - if ($DB->numrows($result1) == "1") { - $data1 = $DB->fetch_assoc($result1); - $PortID = $data1['id']; - } else { - // Add port - $input = []; - $input['items_id'] = $data['id']; - $input['itemtype'] = 'PluginFusioninventoryUnmanaged'; - $input['ip'] = $IP; - $input['name'] = $ifDescr; - $input['instantiation_type'] = 'NetworkPortEthernet'; - $PortID = $NetworkPort->add($input); - } - // Update unmanaged device - $input = []; - $input['id'] = $data['id']; - $input['ip'] = $IP; - if (strstr($model, "Phone")) { - $input['item_type'] = 'Phone'; - } - if ($sysname != '') { - $input['name'] = $sysname; - } - if ($sysdescr != '') { - $input['sysdescr'] = $sysdescr; - } - $pfUnmanaged->update($input); - return $PortID; - } - - $query0 = "SELECT `glpi_networkports`.* FROM `glpi_networkports` - LEFT JOIN `glpi_networknames` - ON `glpi_networknames`.`items_id`=`glpi_networkports`.`id` - AND `glpi_networknames`.`itemtype`='NetworkPort' - LEFT JOIN `glpi_ipaddresses` - ON `glpi_ipaddresses`.`items_id`=`glpi_networknames`.`id` - AND `glpi_ipaddresses`.`itemtype`='NetworkName' - - WHERE `glpi_networkports`.`itemtype`='PluginFusioninventoryUnmanaged' - AND `glpi_ipaddresses`.`name`='".$IP."' - LIMIT 1"; - $result0 = $DB->query($query0); - if ($DB->numrows($result0) == 1) { - $data0 = $DB->fetch_assoc($result0); - // Search port and add if required - $query1 = "SELECT * - FROM `glpi_networkports` - WHERE `itemtype`='PluginFusioninventoryUnmanaged' - AND `items_id`='".$data0['items_id']."' - AND `name`='".$ifDescr."' - LIMIT 1"; - $result1 = $DB->query($query1); - if ($DB->numrows($result1) == "1") { - $data1 = $DB->fetch_assoc($result1); - $PortID = $data1['id']; - } else { - // Add port - $input = []; - $input['items_id'] = $data0['items_id']; - $input['itemtype'] = 'PluginFusioninventoryUnmanaged'; - $input['name'] = $ifDescr; - $input['instantiation_type'] = 'NetworkPortEthernet'; - $PortID = $NetworkPort->add($input); - - $input = []; - $input['itemtype'] = 'NetworkPort'; - $input['items_id'] = $PortID; - $networknames_id = $networkName->add($input); - - $input = []; - $input['itemtype'] = 'NetworkName'; - $input['items_id'] = $networknames_id; - $input['name'] = $IP; - $iPAddress->add($input); - } - return $PortID; - } - // Add unmanaged device - $input = []; - $input['ip'] = $IP; - if (strstr($model, "Phone")) { - $input['item_type'] = 'Phone'; - } - if ($sysname != '') { - $input['name'] = $sysname; - } - if ($model != '') { - $input['comment'] = $model; - } - if (isset($_SESSION["plugin_fusioninventory_entity"])) { - $input['entities_id'] = $_SESSION["plugin_fusioninventory_entity"]; - } - if ($sysdescr != '') { - $input['sysdescr'] = $sysdescr; - } - $unkonwn_id = $pfUnmanaged->add($input); - // Add port - $input = []; - $input['items_id'] = $unkonwn_id; - $input['itemtype'] = 'PluginFusioninventoryUnmanaged'; - $input['name'] = $ifDescr; - $input['instantiation_type'] = 'NetworkPortEthernet'; - $PortID = $NetworkPort->add($input); - - $input = []; - $input['itemtype'] = 'NetworkPort'; - $input['items_id'] = $PortID; - $networknames_id = $networkName->add($input); - - $input = []; - $input['itemtype'] = 'NetworkName'; - $input['items_id'] = $networknames_id; - $input['name'] = $IP; - $iPAddress->add($input); - - return $PortID; - } - return $PortID; - } - - - /** - * Find a port of a device with MAC address and port number (from LLDP - * information) - * - * @global object $DB - * @param string $sysmac - * @param integer $ifnumber - * @param array $params - * @return integer - */ - function getPortIDfromSysmacandPortnumber($sysmac, $ifnumber, $params = []) { - global $DB; - - $PortID = ''; - $queryPort = "SELECT * - FROM `glpi_networkports` - WHERE `mac`='".$sysmac."' - AND `itemtype`='NetworkEquipment' - AND `logical_number`='".$ifnumber."' - LIMIT 1"; - $resultPort = $DB->query($queryPort); - if ($DB->numrows($resultPort) == "1") { - $dataPort = $DB->fetch_assoc($resultPort); - $PortID = $dataPort['id']; - } - - if ($PortID == '') { - // case where mac is of switch and not of the port (like Procurve) - $queryPort = "SELECT * - FROM `glpi_plugin_fusioninventory_networkports` - LEFT JOIN `glpi_networkports` - ON `glpi_plugin_fusioninventory_networkports`.`networkports_id`= - `glpi_networkports`.`id` - LEFT JOIN `glpi_networkequipments` - ON `glpi_networkports`.`items_id`= - `glpi_networkequipments`.`id` - WHERE `glpi_networkports`.`mac`='".$sysmac."' - AND `glpi_networkports`.`itemtype`='NetworkEquipment' - AND `logical_number`='".$ifnumber."' - LIMIT 1"; - $resultPort = $DB->query($queryPort); - $dataPort = $DB->fetch_assoc($resultPort); - if ($DB->numrows($resultPort) == "1") { - $PortID = $dataPort['networkports_id']; - } - } - - // In case of mac is mac of switch, not a port - if ($PortID == '') { - $queryPort = "SELECT * - FROM `glpi_networkports` - WHERE `logical_number`='".$ifnumber."' - AND `itemtype`='NetworkEquipment' - AND `items_id` IN - (SELECT `items_id` - FROM `glpi_networkports` - WHERE `instantiation_type`='NetworkPortAggregate' - AND `mac`='".$sysmac."') - LIMIT 1"; - $resultPort = $DB->query($queryPort); - $dataPort = $DB->fetch_assoc($resultPort); - if (isset($dataPort['id'])) { - $PortID = $dataPort['id']; - } - } - - if ($PortID == "") { - $NetworkPort = new NetworkPort(); - $PluginFusioninventoryUnmanaged = new PluginFusioninventoryUnmanaged(); - - $query = "SELECT * - FROM `glpi_networkports` - WHERE `itemtype`='PluginFusioninventoryUnmanaged' - AND `mac`='".$sysmac."' - LIMIT 1"; - $result = $DB->query($query); - if ($DB->numrows($result) == "1") { - $data = $DB->fetch_assoc($result); - return $data['id']; - } - // Add unmanaged device because not find device - $input = []; - $input['mac'] = $sysmac; - if (isset($params['sysname'])) { - $input['name'] = $params['sysname']; - } - if (isset($_SESSION["plugin_fusioninventory_entity"])) { - $input['entities_id'] = $_SESSION["plugin_fusioninventory_entity"]; - } - if (isset($params['sysdescr'])) { - $input['sysdescr'] = $params['sysdescr']; - } - $unkonwn_id = $PluginFusioninventoryUnmanaged->add($input); - // Add port - $input = []; - $input['items_id'] = $unkonwn_id; - $input['itemtype'] = 'PluginFusioninventoryUnmanaged'; - $input['mac'] = $sysmac; - if (isset($params['ifdescr'])) { - $input['name'] = $params['ifdescr']; - } - $input['instantiation_type'] = 'NetworkPortEthernet'; - $PortID = $NetworkPort->add($input); - return $PortID; - } - - return $PortID; - } - - /** * Function used to detect if port has multiple mac connected * diff --git a/inc/networkporttype.class.php b/inc/networkporttype.class.php index 0fee118012..d631932f7e 100644 --- a/inc/networkporttype.class.php +++ b/inc/networkporttype.class.php @@ -383,10 +383,12 @@ function isImportType($type) { $type = str_replace("-", "", $type); } - $a_ports = $this->find("(`number`='".$type."' - OR `name`='".$type."' - OR `othername`='".$type."') - AND `import`='1'"); + $a_ports = $this->find( + ['OR' => + ['number' => $type, + 'name' => $type, + 'othername' => $type], + 'import' => 1]); if (count($a_ports) > 0) { return true; } @@ -400,8 +402,8 @@ function isImportType($type) { */ function showNetworkporttype() { - $a_notimports = $this->find("`import` = '0'"); - $a_imports = $this->find("`import` = '1'"); + $a_notimports = $this->find(['import' => 0]); + $a_imports = $this->find(['import' => 1]); echo " |