-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f369582
Showing
9 changed files
with
470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PerlModule Apache::Ocsinventory::Plugins::Listprinters::Map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
|
||
package Apache::Ocsinventory::Plugins::Listprinters::Map; | ||
|
||
use strict; | ||
|
||
use Apache::Ocsinventory::Map; | ||
|
||
$DATA_MAP{listprinters} = { | ||
mask => 0, | ||
multi => 1, | ||
auto => 1, | ||
delOnReplace => 1, | ||
sortBy => 'NAME', | ||
writeDiff => 0, | ||
cache => 0, | ||
fields => { | ||
NAME => {}, | ||
ADDRESS => {} | ||
} | ||
}; | ||
1; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# List printers | ||
Retrieve connected printers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'Author: Valentin DEVILLE | ||
|
||
|
||
Set WshNetwork = WScript.CreateObject("WScript.Network") | ||
Set oPrinters = WshNetwork.EnumPrinterConnections | ||
|
||
|
||
For i = 0 to oPrinters.Count - 1 Step 2 | ||
Wscript.Echo "<LISTPRINTERS>" | ||
Wscript.Echo "<NAME>" & oPrinters.Item(i+1) & "</NAME>" | ||
Wscript.Echo "<ADDRESS>" & oPrinters.Item(i) & "</ADDRESS>" | ||
Wscript.Echo "</LISTPRINTERS>" | ||
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/* | ||
==================================================================================== | ||
OCS INVENTORY | ||
Copyleft Valentin DEVILLE 2016 | ||
Web: http://www.ocsinventory-ng.org | ||
This code is open source and may be copied and modified as long as the source code is always made freely available. | ||
Please refer to the General Public Licence http://www.gnu.org/ or LiCENSE.MD | ||
==================================================================================== | ||
*/ | ||
|
||
if(AJAX){ | ||
parse_str($protectedPost['ocs']['0'], $params); | ||
$protectedPost+=$params; | ||
ob_start(); | ||
$ajax = true; | ||
} | ||
else{ | ||
$ajax=false; | ||
} | ||
print_item_header("Printers list"); | ||
|
||
if (!isset($protectedPost['SHOW'])){ | ||
$protectedPost['SHOW'] = 'NOSHOW'; | ||
} | ||
$form_name="listprinters"; | ||
$table_name=$form_name; | ||
$tab_options=$protectedPost; | ||
$tab_options['form_name']=$form_name; | ||
$tab_options['table_name']=$table_name; | ||
echo open_form($form_name); | ||
$list_fields = array( | ||
'Name' => 'NAME', | ||
'Address' => 'ADDRESS' | ||
); | ||
$list_col_cant_del=$list_fields; | ||
$default_fields= $list_fields; | ||
$sql=prepare_sql_tab($list_fields); | ||
|
||
$sql['SQL'] .= "FROM $table_name WHERE (hardware_id = $systemid)"; | ||
array_push($sql['ARG'],$systemid); | ||
$tab_options['ARG_SQL']=$sql['ARG']; | ||
$tab_options['ARG_SQL_COUNT']=$systemid; | ||
ajaxtab_entete_fixe($list_fields,$default_fields,$tab_options,$list_col_cant_del); | ||
echo close_form(); | ||
if ($ajax){ | ||
ob_end_clean(); | ||
tab_req($list_fields,$default_fields,$list_col_cant_del,$sql['SQL'],$tab_options); | ||
ob_start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"displayName" : "List printers", | ||
"author" : ["Valentin DEVILLE"], | ||
"contributor" : [], | ||
"supportedAgent" : ["Windows"], | ||
"description" : { | ||
"fr" : "Remonte les imprimantes connectés", | ||
"en" : "Retrieve connected printers" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
function plugin_version_listprinters() | ||
{ | ||
return array('name' => 'List printers', | ||
'version' => '1.0', | ||
'author'=> 'Valentin DEVILLE', | ||
'license' => 'GPLv2', | ||
'verMinOcs' => '2.2'); | ||
} | ||
|
||
function plugin_init_listprinters() | ||
{ | ||
$object = new plugins; | ||
$object -> add_cd_entry("listprinters","other"); | ||
|
||
$object -> sql_query("CREATE TABLE IF NOT EXISTS `listprinters` ( | ||
`ID` INT(11) NOT NULL AUTO_INCREMENT, | ||
`HARDWARE_ID` INT(11) NOT NULL, | ||
`NAME` VARCHAR(255) DEFAULT NULL, | ||
`ADDRESS` VARCHAR(255) DEFAULT NULL, | ||
PRIMARY KEY (`ID`,`HARDWARE_ID`) | ||
) ENGINE=INNODB;"); | ||
|
||
} | ||
|
||
function plugin_delete_listprinters() | ||
{ | ||
$object = new plugins; | ||
$object -> del_cd_entry("listprinters"); | ||
$object -> sql_query("DROP TABLE `listprinters`"); | ||
|
||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.