Skip to content

Commit

Permalink
Resync from 2.40 @ Work
Browse files Browse the repository at this point in the history
  • Loading branch information
Poil committed Jan 14, 2018
1 parent 513c4e6 commit ca29cd1
Show file tree
Hide file tree
Showing 19 changed files with 1,035 additions and 168 deletions.
8 changes: 8 additions & 0 deletions graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@
require_once 'type/GenericStacked.class.php';
$obj = new Type_GenericStacked($CONFIG, $_GET, $pluginconfig);
break;
case 'stackedbis':
require_once 'type/GenericStackedBis.class.php';
$obj = new Type_GenericStackedBis($CONFIG, $_GET);
break;
case 'io':
require_once 'type/GenericIO.class.php';
$obj = new Type_GenericIO($CONFIG, $_GET, $pluginconfig);
Expand All @@ -122,6 +126,10 @@
require_once 'type/Uptime.class.php';
$obj = new Type_Uptime($CONFIG, $_GET, $pluginconfig);
break;
case 'filled':
require_once 'type/GenericFilled.class.php';
$obj = new Type_GenericFilled($CONFIG, $_GET, $pluginconfig);
break;
case 'iowpm':
require_once 'type/GenericIOWPM.class.php';
$obj = new Type_GenericIOWPM($CONFIG, $_GET, $pluginconfig);
Expand Down
2 changes: 1 addition & 1 deletion html/config/environment/f_environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
->labelGrid(IL_CSS)
->inputGrid(I_CSS);

$e_form->add('text', 'f_environment_desc')
$e_form->add('text', 'f_environment_description')
->value(@$cur_environment->environment_description)
->label(DESC)
->autocomplete(false)
Expand Down
2 changes: 1 addition & 1 deletion html/config/role/f_role.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
->labelGrid(IL_CSS)
->inputGrid(I_CSS);

$m_form->add('text', 'f_role_desc')
$m_form->add('text', 'f_role_description')
->value(@$cur_role->role_description)
->label(DESC)
->autocomplete(false)
Expand Down
33 changes: 20 additions & 13 deletions html/config/server/r_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,43 @@
$filelist=array_merge(array_values(array_diff(scandir($datadir), array('..', '.', 'lost+found'))), $filelist);
}

$cpt_filelist=count($filelist);
for($i=0; $i<$cpt_filelist; $i++) {
if (strpos($filelist[$i],':') !== false) {
$filelist[$i] = substr($filelist[$i], 0, strpos($filelist[$i],':'));
}
}
$filelist = array_unique($filelist);
$filelist = array_filter($filelist);
$filelist = array_values($filelist);

$lib='
CREATE TEMPORARY TABLE server_list (
`server_name` varchar(45) NOT NULL default \'\'
)';
$connSQL->query($lib);


$find='0';
$lib= 'INSERT INTO server_list (server_name) VALUES (';
$lib= 'INSERT INTO server_list (server_name) VALUES (';
$cpt_filelist=count($filelist);
for($i=0; $i<$cpt_filelist; $i++) {
if (strpos($filelist[$i],':')==false) {
if($find=='1') {
$lib.=" ), (";
}
$lib.= '\''.$filelist[$i].'\'';
$find='1';
}
}
if($find=='1') {
$lib.=" ), (";
}
$lib.= '\''.$filelist[$i].'\'';
$find='1';
}
$lib.=' )';

if ($find=='1') $connSQL->query($lib);

$lib='
SELECT *
FROM server_list
SELECT *
FROM server_list
WHERE server_name NOT IN (
SELECT server_name FROM config_server
) ORDER BY server_name';

$all_rrdserver=$connSQL->query($lib);
$cpt_rrdserver=count($all_rrdserver);
?>

1 change: 0 additions & 1 deletion html/dashboard/dashboard_light/d_dashboard_light.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
/* VMHOST LibVirt */
$vmlist = array();
foreach($allDatadir as $datadir){
//$vmlist=array_merge($vmlist,preg_find('#^'.$cur_server->server_name.':#', $datadir.'/', PREG_FIND_DIRMATCH|PREG_FIND_SORTBASENAME));
$vmlist=array_merge($vmlist,glob($datadir.'/'.$cur_server->server_name.':*'));
}

Expand Down
18 changes: 11 additions & 7 deletions modules/AUTH_USER.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function verif_auth() {
$try_auth=False;
// Auth Form
if (isset($_POST['f_submit_auth'])) {
$this->user=mysql_escape_string($_POST['f_user']);
$this->passwd=mysql_escape_string($_POST['f_passwd']);
$this->user=$_POST['f_user'];
$this->passwd=$_POST['f_passwd'];
$try_auth=True;
// Auth Basic if "&f_basic_auth=true" WARNING You can't logout with BasicAuth (see http://httpd.apache.org/docs/1.3/howto/auth.html How do I log out?)
} else if (isset($_GET['f_basic_auth']) && !isset($_SESSION['S_USER']) && !isset($_SERVER['PHP_AUTH_USER'])) {
Expand All @@ -35,7 +35,9 @@ function verif_auth() {
if (isset($_GET['f_logout'])) {
$this->logout();
} else if ($try_auth==True) {
$res=$this->connSQL->row('SELECT id_auth_user, user, type FROM auth_user WHERE user="'.$this->user.'"');
$lib='SELECT id_auth_user, user, type FROM auth_user WHERE user=:user';
$this->connSQL->bind('user', $this->user);
$res=$this->connSQL->row($lib);
if (!$res) {
return false;
}
Expand Down Expand Up @@ -63,8 +65,8 @@ function verif_auth() {
}
}
} else if (isset($_SESSION['S_USER'])) {
$this->user=mysql_escape_string($_SESSION['S_USER']);
$this->passwd=mysql_escape_string($_SESSION['S_PASSWD']);
$this->user=$_SESSION['S_USER'];
$this->passwd=$_SESSION['S_PASSWD'];
$this->id_auth_user=intval($_SESSION['S_ID_USER']);
if ($this->verif_auth_mysql(false)) {
return true;
Expand Down Expand Up @@ -97,10 +99,12 @@ function verif_auth_ldap($new_user) { // Verification du compte dans le LDAP

function verif_auth_mysql($new_ident) {
if ($new_ident==true) {
$lib='SELECT `user`,`passwd` FROM auth_user WHERE `user`="'.$this->user.'" AND `passwd`=password("'.$this->passwd.'")';
$lib='SELECT `user`,`passwd` FROM auth_user WHERE `user`=:user AND `passwd`=password(:passwd)';
} else {
$lib='SELECT `user`,`passwd` FROM auth_user WHERE `user`="'.$this->user.'" AND `passwd`="'.$this->passwd.'"';
$lib='SELECT `user`,`passwd` FROM auth_user WHERE `user`=:user AND `passwd`=:passwd';
}
$this->connSQL->bind('user', $this->user);
$this->connSQL->bind('passwd', $this->passwd);
$res=$this->connSQL->row($lib);
if ($res->user == $this->user) {
$_SESSION['S_USER']=$res->user;
Expand Down
1 change: 1 addition & 0 deletions modules/InputCheckbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class InputCheckbox extends Field{
private $checked = false;
private $default = false;
private $labelclass = null;

public function buildField(){
$field = '<div class="form-group">'."\n";
Expand Down
2 changes: 1 addition & 1 deletion modules/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function buildField(){
} else {
$fieldclass='';
}
if ($formcontrol==true) {
if ($this->formcontrol==true) {
$fieldclass='form-control '.$fieldclass;
}

Expand Down
175 changes: 175 additions & 0 deletions plugin/curl_json-apc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"files-entries": {
"title": "Cache entries statistics on {{HOST}}",
"vertical": "Nb",
"legend_format": "%5.1lf%s",
"legend": {
"entries-opcode": {
"name": "Opcode (files) entries",
"color": "00ff00"
},
"entries-user": {
"name": "User (variables) entries",
"color": "ff0000"
}
}
},
"cache_ratio-opcode": {
"title": "Opcode cache queries on {{HOST}}",
"vertical": "%",
"type": "stacked",
"legend_format": "%5.1lf%s",
"legend": {
"opcode-hits": {
"name": "Opcode hits",
"color": "00ff00"
},
"opcode-misses": {
"name": "Opcode misses",
"color": "ff0000"
}
}
},
"cache_ratio-user": {
"title": "User cache queries on {{HOST}}",
"vertical": "%",
"type": "stacked",
"legend_format": "%5.1lf%s",
"legend": {
"user-hits": {
"name": "User hits",
"color": "00ff00"
},
"user-misses": {
"name": "User misses",
"color": "ff0000"
}
}
},
"cache_size-mem": {
"title": "Cache size on {{HOST}}",
"vertical": "Bytes",
"type": "stacked",
"legend_format": "%5.1lf%s",
"legend": {
"mem-free": {
"name": "Free",
"color": "00ff00"
},
"mem-used": {
"name": "Used",
"color": "ff0000"
},
"mem-size": {
"name": "Total",
"color": "4444ff"
}
}
},
"cache_size-sizes": {
"title": "Cache size per cache on {{HOST}}",
"vertical": "Size",
"legend_format": "%5.1lf%s",
"legend": {
"sizes-user": {
"name": "User (variables) mem size",
"color": "4444ff"
},
"sizes-opcode": {
"name": "Opcode (files) mem size",
"color": "00cf00"
}
}
},
"files-opcode_rates": {
"title": "Opcode (files) cache statistics on {{HOST}}",
"vertical": "req/s",
"legend_format": "%5.1lf%s",
"legend": {
"opcode_rates-hits": {
"name": "Files hits",
"color": "00cf00"
},
"opcode_rates-misses": {
"name": "Files misses",
"color": "ff0000"
},
"opcode_rates-inserts": {
"name": "Files inserts",
"color": "f24ac8"
},
"opcode_rates-requests": {
"name": "Files requests",
"color": "4444ff"
}
}
},
"files-user_rates": {
"title": "User (variables) cache statistics on {{HOST}}",
"vertical": "req/s",
"legend_format": "%5.1lf%s",
"legend": {
"user_rates-hits": {
"name": "Variables hits",
"color": "00cf00"
},
"user_rates-misses": {
"name": "Variables misses",
"color": "ff0000"
},
"user_rates-inserts": {
"name": "Variables inserts",
"color": "f24ac8"
},
"user_rates-requests": {
"name": "Variables requests",
"color": "4444ff"
}
}
},
"cache_ratio-fragment_percentage": {
"title": "Cache memory fragmentation on {{HOST}}",
"vertical": "%",
"type": "stacked",
"legend_format": "%5.1lf%s",
"legend": {
"fragment_percentage": {
"name": "Fragmentation",
"color": "00ff00"
}
}
},
"files-files": {
"title": "Files on {{HOST}}",
"vertical": "Files",
"type": "stackedtotal",
"legend_format": "%5.1lf%s",
"legend": {
"files-cached": {
"name": "Cached",
"color": "ff0000"
},
"files-deleted": {
"name": "Deleted",
"color": "ff00ff"
}
}
},
"cache_result-num": {
"title": "Cache results on {{HOST}}",
"vertical": "Num",
"type": "stacked",
"legend_format": "%5.1lf%s",
"legend": {
"num-hits": {
"name": "Hits",
"color": "00ff00"
},
"num-misses": {
"name": "Misses",
"color": "ff0000"
}
}
}
}

Loading

0 comments on commit ca29cd1

Please sign in to comment.