Skip to content

Commit

Permalink
Replace tabs with space, and improve plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
Poil committed Jan 14, 2018
1 parent 9bc942c commit 513c4e6
Show file tree
Hide file tree
Showing 356 changed files with 9,521 additions and 9,469 deletions.
6 changes: 3 additions & 3 deletions ajax/json_environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
$f_id_config_role=filter_input(INPUT_GET, 'f_id_config_role',FILTER_SANITIZE_NUMBER_INT);

if ($auth->verif_auth()) {
$project=new PROJECT($f_id_config_project);
$envs = (array) $project->get_servers_environments($f_id_config_role);
echo json_encode($envs);
$project=new PROJECT($f_id_config_project);
$envs = (array) $project->get_servers_environments($f_id_config_role);
echo json_encode($envs);
}
?>
6 changes: 3 additions & 3 deletions ajax/json_role.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
$f_id_config_environment=filter_input(INPUT_GET, 'f_id_config_environment',FILTER_SANITIZE_NUMBER_INT);

if ($auth->verif_auth()) {
$project=new PROJECT($f_id_config_project);
$envs = (array) $project->get_servers_roles($f_id_config_environment);
echo json_encode($envs);
$project=new PROJECT($f_id_config_project);
$envs = (array) $project->get_servers_roles($f_id_config_environment);
echo json_encode($envs);
}
?>
6 changes: 3 additions & 3 deletions ajax/json_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
$f_id_config_role=filter_input(INPUT_GET, 'f_id_config_role',FILTER_SANITIZE_NUMBER_INT);

if ($auth->verif_auth()) {
$project=new PROJECT($f_id_config_project);
$project=new PROJECT($f_id_config_project);

$servers = (array) $project->get_servers($f_id_config_environment, $f_id_config_role);
echo json_encode($servers);
$servers = (array) $project->get_servers($f_id_config_environment, $f_id_config_role);
echo json_encode($servers);
}
?>
60 changes: 30 additions & 30 deletions ajax/json_server_wh_q.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,38 @@
if ($auth->verif_auth()) {

if ($_GET['f_q']) {
$connSQL=new DB();
$f_q='%'.filter_input(INPUT_GET,'f_q',FILTER_SANITIZE_SPECIAL_CHARS).'%';
$s_id_user=filter_var($_SESSION['S_ID_USER'],FILTER_SANITIZE_NUMBER_INT);
$f_id_config_dynamic_dashboard=filter_input(INPUT_GET,'f_id_config_dynamic_dashboard',FILTER_SANITIZE_NUMBER_INT);

$lib='
SELECT
cs.id_config_server,
cs.server_name,
MAX(csp.id_config_project) as id_config_project
FROM config_server cs
LEFT JOIN config_server_project csp
ON cs.id_config_server=csp.id_config_server
LEFT JOIN perm_project_group ppg
ON ppg.id_config_project=csp.id_config_project
LEFT JOIN auth_group ag
ON ag.id_auth_group=ppg.id_auth_group
LEFT JOIN auth_user_group aug
ON aug.id_auth_group=ag.id_auth_group
WHERE aug.id_auth_user=:s_id_user
AND cs.server_name LIKE :f_q
GROUP BY id_config_server, server_name
ORDER BY server_name';
$connSQL=new DB();
$f_q='%'.filter_input(INPUT_GET,'f_q',FILTER_SANITIZE_SPECIAL_CHARS).'%';
$s_id_user=filter_var($_SESSION['S_ID_USER'],FILTER_SANITIZE_NUMBER_INT);
$f_id_config_dynamic_dashboard=filter_input(INPUT_GET,'f_id_config_dynamic_dashboard',FILTER_SANITIZE_NUMBER_INT);

$connSQL->bind('s_id_user',$s_id_user);
$connSQL->bind('f_q',$f_q);
$all_server=$connSQL->query($lib);
$cpt_server=count($all_server);
$lib='
SELECT
cs.id_config_server,
cs.server_name,
MAX(csp.id_config_project) as id_config_project
FROM config_server cs
LEFT JOIN config_server_project csp
ON cs.id_config_server=csp.id_config_server
LEFT JOIN perm_project_group ppg
ON ppg.id_config_project=csp.id_config_project
LEFT JOIN auth_group ag
ON ag.id_auth_group=ppg.id_auth_group
LEFT JOIN auth_user_group aug
ON aug.id_auth_group=ag.id_auth_group
WHERE aug.id_auth_user=:s_id_user
AND cs.server_name LIKE :f_q
GROUP BY id_config_server, server_name
ORDER BY server_name';

for ($i=0; $i<$cpt_server; $i++) {
echo '<a href="'.DIR_WEBROOT.'/index.php?module=dashboard&amp;component=view&amp;f_id_config_project='.$all_server[$i]->id_config_project.'&amp;f_id_config_server='.$all_server[$i]->id_config_server.'">'.$all_server[$i]->server_name.'</a><br />';
}
$connSQL->bind('s_id_user',$s_id_user);
$connSQL->bind('f_q',$f_q);
$all_server=$connSQL->query($lib);
$cpt_server=count($all_server);

for ($i=0; $i<$cpt_server; $i++) {
echo '<a href="'.DIR_WEBROOT.'/index.php?module=dashboard&amp;component=view&amp;f_id_config_project='.$all_server[$i]->id_config_project.'&amp;f_id_config_server='.$all_server[$i]->id_config_server.'">'.$all_server[$i]->server_name.'</a><br />';
}
}
}
?>
Expand Down
2 changes: 1 addition & 1 deletion ajax/screen_res.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

$_SESSION['detail-width'] = $f_width;
$_SESSION['detail-height'] = $f_height;
}
}
?>
2 changes: 1 addition & 1 deletion component/auth/group.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_group.php');
include(DIR_FSROOT.'/view/backend/v_group.php');
?>
2 changes: 1 addition & 1 deletion component/auth/user.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_user.php');
include(DIR_FSROOT.'/view/backend/v_user.php');
?>
2 changes: 1 addition & 1 deletion component/config/dynamic_dashboard.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_dynamic_dashboard.php');
include(DIR_FSROOT.'/view/backend/v_dynamic_dashboard.php');
?>
2 changes: 1 addition & 1 deletion component/config/environment.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_environment.php');
include(DIR_FSROOT.'/view/backend/v_environment.php');
?>
2 changes: 1 addition & 1 deletion component/config/plugin.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_plugin_filter.php');
include(DIR_FSROOT.'/view/backend/v_plugin_filter.php');
?>
2 changes: 1 addition & 1 deletion component/config/project.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_project.php');
include(DIR_FSROOT.'/view/backend/v_project.php');
?>
2 changes: 1 addition & 1 deletion component/config/role.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_role.php');
include(DIR_FSROOT.'/view/backend/v_role.php');
?>
2 changes: 1 addition & 1 deletion component/config/server.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_server.php');
include(DIR_FSROOT.'/view/backend/v_server.php');
?>
2 changes: 1 addition & 1 deletion component/dashboard/dynamic.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
include(DIR_FSROOT.'/modules/preg_find.php');
include(DIR_FSROOT.'/modules/preg_find.php');
include(DIR_FSROOT.'/html/dashboard/dynamic/r_dynamic.php');
?>
2 changes: 1 addition & 1 deletion component/dashboard/light.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
include(DIR_FSROOT.'/modules/preg_find.php');
include(DIR_FSROOT.'/modules/preg_find.php');
include(DIR_FSROOT.'/html/dashboard/dashboard_light/d_dashboard_light.php');
?>
8 changes: 4 additions & 4 deletions component/dashboard/view.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
if (isset($_GET['f_id_config_server'])) {
if (isset($_GET['f_id_config_server'])) {
include(DIR_FSROOT.'/modules/preg_find.php');
include(DIR_FSROOT.'/html/config/server/r_server_wh_id.php');
include(DIR_FSROOT.'/html/dashboard/server_plugins/d_server_plugins.php');
}
include(DIR_FSROOT.'/html/config/server/r_server_wh_id.php');
include(DIR_FSROOT.'/html/dashboard/server_plugins/d_server_plugins.php');
}

?>
2 changes: 1 addition & 1 deletion component/perm/module.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_module.php');
include(DIR_FSROOT.'/view/backend/v_module.php');
?>
2 changes: 1 addition & 1 deletion component/small_admin/myaccount.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
echo '<h1>'.MY_ACCOUNT.'</h1>';
echo '<h1>'.MY_ACCOUNT.'</h1>';
echo '<fieldset>';
echo '<legend>'.EDIT.'</legend>';
include(DIR_FSROOT.'/html/small_admin/myaccount/w_myaccount.php');
Expand Down
2 changes: 1 addition & 1 deletion component/small_admin/mydashboard.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php
include(DIR_FSROOT.'/view/backend/v_small_admin_mydashboard.php');
include(DIR_FSROOT.'/view/backend/v_small_admin_mydashboard.php');
?>
4 changes: 2 additions & 2 deletions component/small_admin/mygroup.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
echo '<h1>'.MANAGE_MYGROUP.'</h1>';
echo '<h1>'.MANAGE_MYGROUP.'</h1>';
include(DIR_FSROOT.'/html/small_admin/mygroup/w_group.php');
include(DIR_FSROOT.'/html/small_admin/mygroup/r_group_wh_id.php');
include(DIR_FSROOT.'/html/small_admin/mygroup/r_group.php');
Expand Down Expand Up @@ -44,7 +44,7 @@
echo '<div class="clearfix"></div>';
if (isset($_GET['f_id_auth_user'])) {
echo '<strong>'.DEL.'</strong>';
} else {
} else {
echo '<strong>'.ADD.'</strong>';
}
include(DIR_FSROOT.'/html/small_admin/mygroup_user/f_group_user.php');
Expand Down
2 changes: 1 addition & 1 deletion component/small_admin/newuser.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
echo '<h1>'.ADD_USER.'</h1>';
echo '<h1>'.ADD_USER.'</h1>';
echo '<fieldset>';
echo '<legend>'.EDIT.'</legend>';
include(DIR_FSROOT.'/html/small_admin/newuser/w_user.php');
Expand Down
28 changes: 14 additions & 14 deletions config/module.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
function removeqsvar($url, $varname) {
if (is_array($varname)) {
foreach ($varname as $cur_var) {
Expand All @@ -19,19 +19,19 @@ function removeqsvar($url, $varname) {
$perm_mod = new PERMS();

if(preg_match("/^[0-9a-z_]*$/", $module) && preg_match("/^[0-9a-z_]*$/", $component)){
if ($perm_mod->perm_module($module, $component)) { // DEBUT PERM MODULE
if(file_exists(DIR_FSROOT.'/component/'.$module.'/'.$component.'.php')){
include(DIR_FSROOT.'/component/'.$module.'/'.$component.'.php');
}else{
echo $CONFIG['welcome_text'];
}
} else {
if ($component && $module) {
echo '<br />'.NO_ACCESS.'<br />';
}
}
if ($perm_mod->perm_module($module, $component)) { // DEBUT PERM MODULE
if(file_exists(DIR_FSROOT.'/component/'.$module.'/'.$component.'.php')){
include(DIR_FSROOT.'/component/'.$module.'/'.$component.'.php');
}else{
echo $CONFIG['welcome_text'];
}
} else {
if ($component && $module) {
echo '<br />'.NO_ACCESS.'<br />';
}
}
} else {
echo '<br />'.NO_ACCESS.'<br />';
die();
echo '<br />'.NO_ACCESS.'<br />';
die();
}
?>
Loading

0 comments on commit 513c4e6

Please sign in to comment.