summaryrefslogtreecommitdiff
blob: 1215d543ce131af07d6bdae3940647caf212be63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php

function normalize_path($path) {
  if ($path && strlen($path) > 0) {
    return preg_replace('/^(.*?)[\/]?$/', '$1/', $path);
  } else {
    return $path;
  }
}

function dumper($var) {
  ob_start();
  var_dump($var);
  return ob_get_clean();
}

function pre_var_dump($var) {
  print "<pre>";
  var_dump($var);
  print "</pre>";
}

function add_leftbar(&$leftbar_menu, $entry_name, $entry_link) {
	$temp_menu_entry['name'] = $entry_name;
	$temp_menu_entry['link'] = $entry_link;
	array_push($leftbar_menu, $temp_menu_entry);
}

function get_clients_fields() {
	$fields['hostname'] = array('name' => 'Hostname', 'sortable' => True);
	$fields['ip'] = array('name' => 'IP Address', 'sortable' => True);
	$fields['mac'] = array('name' => 'MAC Address', 'sortable' => True);
	$fields['digest'] = array('name' => 'Cert Digest', 'sortable' => False);
	$fields['profile_name'] = array('name' => 'GLI Profile', 'sortable' => True);
	$fields['osname'] = array('name' => 'OS Name', 'sortable' => True);
	$fields['username'] = array('name' => 'User Contact', 'sortable' => True);
	$fields['installtime'] = array('name' => 'Install Time', 'sortable' => True);
	$fields['status'] = array('name' => 'Status', 'sortable' => True);
	$fields['groups'] = array('name' => 'Client Groups', 'sortable' => False);
	return $fields;
}

function get_default_clients_fields() {
	return 'hostname,ip,profile_name,osname,username,status,groups';
}

function get_users_fields() {
	$fields['username'] = array('name' => 'Username', 'sortable' => True);
	$fields['real_name'] = array('name' => 'Real Name', 'sortable' => True);
	$fields['comment'] = array('name' => 'Comment', 'sortable' => False);
	$fields['status'] = array('name' => 'Status', 'sortable' => True);
	$fields['groups'] = array('name' => 'User Groups', 'sortable' => False);
	return $fields;
}

function get_default_users_fields() {
	return 'username,real_name,comment,status,groups';
}

function get_jobs_fields() {
	$fields['hostname'] = array('name' => 'Hostname', 'sortable' => True);
	$fields['priority'] = array('name' => 'Priority', 'sortable' => True);
	$fields['created'] = array('name' => 'Created', 'sortable' => True);
	$fields['username'] = array('name' => 'Created By', 'sortable' => True);
	$fields['scriptname'] = array('name' => 'Script Name', 'sortable' => True);
	$fields['pending'] = array('name' => '# Pending', 'sortable' => True);
	$fields['failed'] = array('name' => '# Failed', 'sortable' => True);
	$fields['permname'] = array('name' => 'Permission', 'sortable' => True);
	$fields['description'] = array('name' => 'Description', 'sortable' => False);
	return $fields;
}

function get_default_jobs_fields() {
	return 'hostname,scriptname,priority,created,permname,pending,failed';
}

function get_priorities() {
	return array('1','2','3','4','5','6','7','8','9');
}



?>