Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vdeville committed Jun 2, 2016
0 parents commit 58d1ce9
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 0 deletions.
22 changes: 22 additions & 0 deletions APACHE/Map.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@


package Apache::Ocsinventory::Plugins::Teamviewer::Map;

use strict;

use Apache::Ocsinventory::Map;

$DATA_MAP{teamviewer} = {
mask => 0,
multi => 1,
auto => 1,
delOnReplace => 1,
sortBy => 'TWID',
writeDiff => 0,
cache => 0,
fields => {
TWID => {},
VERSION => {}
}
};
1;
1 change: 1 addition & 0 deletions APACHE/Teamviewer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PerlModule Apache::Ocsinventory::Plugins::Teamviewer::Map
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Teamviewer
Retrieve version and ID of teamviewer
11 changes: 11 additions & 0 deletions agent/teamviewer.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'Author: Valentin DEVILLE

Set shell = WScript.CreateObject("WScript.Shell")
twID = shell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\TeamViewer\ClientID")
twVersion = shell.RegRead ("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\TeamViewer\Version")


Wscript.Echo "<TEAMVIEWER>"
Wscript.Echo "<TWID>" & twID & "</TWID>"
Wscript.Echo "<VERSION>" & twVersion & "</VERSION>"
Wscript.Echo "</TEAMVIEWER>"
48 changes: 48 additions & 0 deletions cd_teamviewer/cd_teamviewer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/*
====================================================================================
OCS INVENTORY
Copyleft Valentin DEVILLE
Web: http://www.ocsinventory-ng.org
====================================================================================
*/

if(AJAX){
parse_str($protectedPost['ocs']['0'], $params);
$protectedPost+=$params;
ob_start();
$ajax = true;
}
else{
$ajax=false;
}
print_item_header("Teamviewer");

if (!isset($protectedPost['SHOW'])){
$protectedPost['SHOW'] = 'NOSHOW';
}
$form_name="teamviewer";
$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(
'ID' => 'TWID',
'Version' => 'VERSION'
);
$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();
}
10 changes: 10 additions & 0 deletions infos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"displayName" : "Teamviewer",
"author" : ["Valentin DEVILLE"],
"contributor" : [],
"supportedAgent" : ["Windows"],
"description" : {
"fr" : "Remonte la version et l'id teamviewer",
"en" : "Retrieve version and ID of teamviewer"
}
}
32 changes: 32 additions & 0 deletions install.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
function plugin_version_teamviewer()
{
return array('name' => 'teamviewer',
'version' => '1.0',
'author'=> 'Valentin DEVILLE',
'license' => 'GPLv2',
'verMinOcs' => '2.2');
}

function plugin_init_teamviewer()
{
$object = new plugins;
$object -> add_cd_entry("teamviewer","other");

$object -> sql_query("CREATE TABLE IF NOT EXISTS `teamviewer` (
`ID` INT(11) NOT NULL AUTO_INCREMENT,
`HARDWARE_ID` INT(11) NOT NULL,
`TWID` VARCHAR(255) DEFAULT NULL,
`VERSION` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`ID`,`HARDWARE_ID`)
) ENGINE=INNODB;");

}

function plugin_delete_teamviewer()
{
$object = new plugins;
$object -> del_cd_entry("teamviewer");
$object -> sql_query("DROP TABLE `teamviewer`");

}
Binary file added preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 58d1ce9

Please sign in to comment.