Skip to content

Commit

Permalink
Merge branch 'release/2.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Oct 27, 2020
2 parents 26d7087 + 1d9c795 commit b9bebf9
Show file tree
Hide file tree
Showing 13 changed files with 223 additions and 357 deletions.
379 changes: 118 additions & 261 deletions composer.lock

Large diffs are not rendered by default.

96 changes: 50 additions & 46 deletions inc/sccm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,48 +47,7 @@ function getDevices($where = 0, $limit = 99999999) {
die;
}

$query = "SELECT csd.Description00 as \"CSD-Description\",
csd.Domain00 as \"CSD-Domain\",
csd.Manufacturer00 as \"CSD-Manufacturer\",
csd.Model00 as \"CSD-Model\",
csd.Roles00 as \"CSD-Roles\",
csd.SystemType00 as \"CSD-SystemType\",
csd.UserName00 as \"CSD-UserName\",
csd.MachineID as \"CSD-MachineID\",
csd.TimeKey as \"CSD-TimeKey\",
md.SystemName00 as \"MD-SystemName\",
osd.BuildNumber00 as \"OSD-BuildNumber\",
osd.Caption00 as \"OSD-Caption\",
osd.CSDVersion00 as \"OSD-CSDVersion\",
osd.BootDevice00 as \"OSD-BootDevice\",
osd.InstallDate00 as \"OSD-InstallDate\",
osd.LastBootUpTime00 as \"OSD-LastBootUpTime\",
osd.Manufacturer00 as \"OSD-Manufacturer\",
osd.Name00 as \"OSD-Name\",
osd.Organization00 as \"OSD-Organization\",
osd.RegisteredUser00 as \"OSD-RegisteredUser\",
osd.TotalVirtualMemorySize00 as \"OSD-TotalVirtualMemory\",
osd.TotalVisibleMemorySize00 as \"OSD-TotalVisibleMemory\",
osd.Version00 as \"OSD-Version\",
pbd.SerialNumber00 as \"PBD-SerialNumber\",
pbd.ReleaseDate00 as \"PBD-ReleaseDate\",
pbd.Name00 as \"PBD-Name\",
pbd.SMBIOSBIOSVersion00 as \"PBD-BiosVersion\",
pbd.Version00 as \"PBD-Version\",
pbd.Manufacturer00 as \"PBD-Manufacturer\",
sdi.User_Name0 as \"SDI-UserName\",
sd.SMSID0 as \"SD-UUID\",
sd.SystemRole0 as \"SD-SystemRole\",
VrS.User_Name0 as \"VrS-UserName\"
FROM Computer_System_DATA csd
LEFT JOIN Motherboard_DATA md ON csd.MachineID = md.MachineID
LEFT JOIN Operating_System_DATA osd ON csd.MachineID = osd.MachineID
LEFT JOIN PC_BIOS_DATA pbd ON csd.MachineID = pbd.MachineID
LEFT JOIN System_DISC sdi ON csd.MachineID = sdi.ItemKey
LEFT JOIN System_DATA sd ON csd.MachineID = sd.MachineID
INNER JOIN v_R_System VrS ON csd.MachineID = VrS.ResourceID
WHERE csd.MachineID is not null and csd.MachineID != ''
";
$query = self::getcomputerQuery();

if ($where!=0) {
$query.= " WHERE csd.MachineID = '" . $where . "'";
Expand Down Expand Up @@ -563,6 +522,50 @@ static function executeCollect($task) {
return $retcode;
}

static function getcomputerQuery() {
return "SELECT csd.Description00 as \"CSD-Description\",
csd.Domain00 as \"CSD-Domain\",
csd.Manufacturer00 as \"CSD-Manufacturer\",
csd.Model00 as \"CSD-Model\",
csd.Roles00 as \"CSD-Roles\",
csd.SystemType00 as \"CSD-SystemType\",
csd.UserName00 as \"CSD-UserName\",
csd.MachineID as \"CSD-MachineID\",
csd.TimeKey as \"CSD-TimeKey\",
md.SystemName00 as \"MD-SystemName\",
osd.BuildNumber00 as \"OSD-BuildNumber\",
osd.Caption00 as \"OSD-Caption\",
osd.CSDVersion00 as \"OSD-CSDVersion\",
osd.BootDevice00 as \"OSD-BootDevice\",
osd.InstallDate00 as \"OSD-InstallDate\",
osd.LastBootUpTime00 as \"OSD-LastBootUpTime\",
osd.Manufacturer00 as \"OSD-Manufacturer\",
osd.Name00 as \"OSD-Name\",
osd.Organization00 as \"OSD-Organization\",
osd.RegisteredUser00 as \"OSD-RegisteredUser\",
osd.TotalVirtualMemorySize00 as \"OSD-TotalVirtualMemory\",
osd.TotalVisibleMemorySize00 as \"OSD-TotalVisibleMemory\",
osd.Version00 as \"OSD-Version\",
pbd.SerialNumber00 as \"PBD-SerialNumber\",
pbd.ReleaseDate00 as \"PBD-ReleaseDate\",
pbd.Name00 as \"PBD-Name\",
pbd.SMBIOSBIOSVersion00 as \"PBD-BiosVersion\",
pbd.Version00 as \"PBD-Version\",
pbd.Manufacturer00 as \"PBD-Manufacturer\",
sdi.User_Name0 as \"SDI-UserName\",
sd.SMSID0 as \"SD-UUID\",
sd.SystemRole0 as \"SD-SystemRole\",
VrS.User_Name0 as \"VrS-UserName\"
FROM Computer_System_DATA csd
LEFT JOIN Motherboard_DATA md ON csd.MachineID = md.MachineID
LEFT JOIN Operating_System_DATA osd ON csd.MachineID = osd.MachineID
LEFT JOIN PC_BIOS_DATA pbd ON csd.MachineID = pbd.MachineID
LEFT JOIN System_DISC sdi ON csd.MachineID = sdi.ItemKey
LEFT JOIN System_DATA sd ON csd.MachineID = sd.MachineID
INNER JOIN v_R_System VrS ON csd.MachineID = VrS.ResourceID
WHERE csd.MachineID is not null and csd.MachineID != ''";
}


static function executePush($task) {

Expand All @@ -574,14 +577,15 @@ static function executePush($task) {

if ($PluginSccmConfig->getField('active_sync') == 1) {
if ($res) {
$query = "SELECT MachineID FROM Computer_System_DATA WHERE MachineID is not null and MachineID != ''";

$query = self::getcomputerQuery();
$result = $PluginSccmSccmdb->exec_query($query);

$tab = [];

while ($tab = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) {

$REP_XML = realpath(GLPI_PLUGIN_DOC_DIR.'/sccm/xml/'.$tab['MachineID'].'.ocs');
$REP_XML = realpath(GLPI_PLUGIN_DOC_DIR.'/sccm/xml/'.$tab['CSD-MachineID'].'.ocs');

if ($REP_XML === false) {
Toolbox::logInFile('sccm', "There is a problem with the path, realpath function return false.\nPath : ".$REP_XML."\n", true);
Expand Down Expand Up @@ -627,11 +631,11 @@ static function executePush($task) {
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$body = substr($ch_result, $header_size);

Toolbox::logInFile('sccm', "Push KO - ".$tab['MachineID']." -> STATUS CODE : ".$httpcode." \n", true);
Toolbox::logInFile('sccm', "Push KO - ".$tab['CSD-MachineID']." -> STATUS CODE : ".$httpcode." \n", true);
Toolbox::logInFile('sccm', "ERROR RETURNED : ".$body." \n", true);
} else {
$task->addVolume(1);
Toolbox::logInFile('sccm', "Push OK - ".$tab['MachineID']." \n", true);
Toolbox::logInFile('sccm', "Push OK - ".$tab['CSD-MachineID']." \n", true);
}

}
Expand Down
12 changes: 6 additions & 6 deletions locales/cs_CZ.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
"Last-Translator: Pavel Borecki <[email protected]>, 2018\n"
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/teclib/teams/28042/cs_CZ/)\n"
Expand Down Expand Up @@ -41,27 +41,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Před použitím si přečtete dokumentaci."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Rozhraní – SCCMCollect"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Rozhraní – SCCMPush"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "Shromažďování je vypnuté nastavením."

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "Odesílání je vypnuté nastavením."

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "Napojení na SCCM"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Rozhraní – SCCM"

Expand Down
Binary file modified locales/en_GB.mo
Binary file not shown.
14 changes: 7 additions & 7 deletions locales/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"PO-Revision-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2020-10-27 15:27+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: en_GB\n"
Expand Down Expand Up @@ -37,27 +37,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Please, read the documentation before using that."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Interface - SCCMCollect"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Interface - SCCMPush"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "Collect is disabled by configuration."

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "Push is disabled by configuration."

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "SCCM Connector"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Interface - SCCM"

Expand Down
12 changes: 6 additions & 6 deletions locales/fi_FI.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
"Last-Translator: Markku Vepsä, 2018\n"
"Language-Team: Finnish (Finland) (https://www.transifex.com/teclib/teams/28042/fi_FI/)\n"
Expand Down Expand Up @@ -41,27 +41,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Lue käyttöohjeet ennen käyttöä."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Liitäntä - SCCMCollect"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Liitäntä - SCCMPush"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "\"Collect\" on poistettu käytöstä asetusten perusteella."

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "\"Push\" on poistettu käytöstä asetusten perusteella."

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "SCCM-liitin"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Liitäntä - SCCM"

Expand Down
12 changes: 6 additions & 6 deletions locales/fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
"Last-Translator: Cédric Anne, 2018\n"
"Language-Team: French (France) (https://www.transifex.com/teclib/teams/28042/fr_FR/)\n"
Expand Down Expand Up @@ -41,27 +41,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Merci de lire la documentation avant d'utiliser cette URL."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Interface - SCCMCollect"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Interface - SCCMPush"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "La collecte est désactivé par la configuration"

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "L'implantation est désactivé par la configuration"

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "Connecteur SCCM"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Interface - SCCM"

Expand Down
12 changes: 6 additions & 6 deletions locales/hr_HR.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
"Last-Translator: milotype <[email protected]>, 2020\n"
"Language-Team: Croatian (Croatia) (https://www.transifex.com/teclib/teams/28042/hr_HR/)\n"
Expand Down Expand Up @@ -41,27 +41,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Prije upotrebe pročitaj dokumentaciju."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Sučelje – SCCMCollect (upit)"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Sučelje – SCCMPush (umetanje datoteka)"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "Slanje upita (collect) je deaktivirano u konfiguraciji."

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "Umetanje datoteka (push) je deaktivirano u konfiguraciji."

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "SCCM konektor"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Sučelje – SCCM"

Expand Down
12 changes: 6 additions & 6 deletions locales/it_IT.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
"Last-Translator: Cédric Anne, 2019\n"
"Language-Team: Italian (Italy) (https://www.transifex.com/teclib/teams/28042/it_IT/)\n"
Expand Down Expand Up @@ -41,27 +41,27 @@ msgstr "SCCM"
msgid "Please, read the documentation before using that."
msgstr "Per favore, leggi la documentazione prima di usarla."

#: inc/sccm.class.php:504
#: inc/sccm.class.php:463
msgid "Interface - SCCMCollect"
msgstr "Interfaccia: SCCMCollect"

#: inc/sccm.class.php:507
#: inc/sccm.class.php:466
msgid "Interface - SCCMPush"
msgstr "Interfaccia: SCCMPush"

#: inc/sccm.class.php:560
#: inc/sccm.class.php:519
msgid "Collect is disabled by configuration."
msgstr "La raccolta è disabilitata dalla configurazione."

#: inc/sccm.class.php:648
#: inc/sccm.class.php:652
msgid "Push is disabled by configuration."
msgstr "Push è disabilitato dalla configurazione."

#: inc/menu.class.php:29 inc/menu.class.php:33
msgid "SCCM Connector"
msgstr "Connettore SCCM"

#: inc/config.class.php:51 setup.php:58
#: inc/config.class.php:51 setup.php:61
msgid "Interface - SCCM"
msgstr "Interfaccia - SCCM"

Expand Down
Loading

0 comments on commit b9bebf9

Please sign in to comment.