Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: format code with Black and PHP CS Fixer #570

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions services/pulse2/database/xmppmaster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14402,9 +14402,7 @@ def get_update_history_by_machines(self, session, idmachines):
.filter(
and_(
Up_history.id_machine.in_(idmachines),
or_(
Up_history.delete_date != None, Up_history.delete_date != 0
),
or_(Up_history.delete_date != None, Up_history.delete_date != 0),
)
)
.join(Update_data, Up_history.update_id == Update_data.updateid)
Expand Down
132 changes: 66 additions & 66 deletions web/modules/xmppmaster/xmppmaster/ActionQuickconsole.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,75 +26,75 @@
require("graph/navbar.inc.php");
require_once("modules/xmppmaster/includes/xmlrpc.php");

$uuid = isset($_GET['objectUUID']) ? $_GET['objectUUID'] : ( isset($_POST['objectUUID']) ? $_POST['objectUUID'] : "");
//$machine = isset($_POST['Machine']) ? $_POST['Machine'] : xmlrpc_getjidMachinefromuuid( $uuid );
$jid = isset($_GET['jid']) ? $_GET['jid'] : ( isset($_POST['jid']) ? $_POST['jid'] : "");
$machine = isset($_POST['Machine']) ? $_POST['Machine'] : ($uuid != '' ? xmlrpc_getjidMachinefromuuid( $uuid ) : $jid);
$cmdsend = empty($_GET['customcmd']) ? $_GET['customcmd'] : $_POST['customcmd'];
$namecmd = empty($_GET['namecmd']) ? $_GET['namecmd'] : $_POST['namecmd'];
$os = empty($_GET['os']) ? $_GET['os'] : $_POST['os'];
$user = empty($_GET['user']) ? $_GET['user'] : $_POST['user'];
$description = empty($_GET['$description']) ? $_GET['$description'] : $_POST['$description'];
$COMMANDID = xmlrpc_setCommand_qa($namecmd, $cmdsend, $user, "", $uuid, $os, $jid);
$uuid = isset($_GET['objectUUID']) ? $_GET['objectUUID'] : (isset($_POST['objectUUID']) ? $_POST['objectUUID'] : "");
//$machine = isset($_POST['Machine']) ? $_POST['Machine'] : xmlrpc_getjidMachinefromuuid( $uuid );
$jid = isset($_GET['jid']) ? $_GET['jid'] : (isset($_POST['jid']) ? $_POST['jid'] : "");
$machine = isset($_POST['Machine']) ? $_POST['Machine'] : ($uuid != '' ? xmlrpc_getjidMachinefromuuid($uuid) : $jid);
$cmdsend = empty($_GET['customcmd']) ? $_GET['customcmd'] : $_POST['customcmd'];
$namecmd = empty($_GET['namecmd']) ? $_GET['namecmd'] : $_POST['namecmd'];
$os = empty($_GET['os']) ? $_GET['os'] : $_POST['os'];
$user = empty($_GET['user']) ? $_GET['user'] : $_POST['user'];
$description = empty($_GET['$description']) ? $_GET['$description'] : $_POST['$description'];
$COMMANDID = xmlrpc_setCommand_qa($namecmd, $cmdsend, $user, "", $uuid, $os, $jid);

$customqa = array();
$customqa['user'] = $user;
$customqa['customcmd'] = $cmdsend;
$customqa['os'] = $os;
$customqa['description'] = $description;
$customqa['namecmd'] = $namecmd;
$result = [];
$machinegroup = array();
$machinegroup = xmlrpc_getMachinefromuuid($uuid);
if (safeCount($machinegroup) != 0 ){
echo strtoupper($machinegroup['platform']);echo "<br>";
echo $os;
if ( strpos(strtoupper($machinegroup['platform']), strtoupper($os)) !== false){
// machine presente et os correct pour la QA
$customqa = array();
$customqa['user'] = $user;
$customqa['customcmd'] = $cmdsend;
$customqa['os'] = $os;
$customqa['description'] = $description;
$customqa['namecmd'] = $namecmd;
$result = [];
$machinegroup = array();
$machinegroup = xmlrpc_getMachinefromuuid($uuid);
if (safeCount($machinegroup) != 0) {
echo strtoupper($machinegroup['platform']);
echo "<br>";
echo $os;
if (strpos(strtoupper($machinegroup['platform']), strtoupper($os)) !== false) {
// machine presente et os correct pour la QA

$machineinfos = array_merge($_GET, $machinegroup,$customqa,$result);
unset($machineinfos['picklekeypublic']);
unset($machineinfos['urlguacamole']);
unset($machineinfos['module']);
unset($machineinfos['mod']);
unset($machineinfos['actionqa']);$machineinfos = array();
$result = array();
$result['cmdid'] = $COMMANDID;
$machineinfos = array_merge($_GET, $machinegroup, $customqa, $result);
xmlrpc_runXmppAsyncCommand( trim($customqa['customcmd']) , $machineinfos );
echo "send";
}
else{
$msg = sprintf(_T("Sorry the operating system of the machine %s is [%s].<br>The custom QA is defined for operating system [%s]", "xmppmaster"), $machine, $machinegroup['platform'], $os);
xmlrpc_setCommand_action( $uuid, $COMMANDID, "consoleweb", '<span style = "color : navy;">'. $msg.'</span>', "warning", $jid);
}
$machineinfos = array_merge($_GET, $machinegroup, $customqa, $result);
unset($machineinfos['picklekeypublic']);
unset($machineinfos['urlguacamole']);
unset($machineinfos['module']);
unset($machineinfos['mod']);
unset($machineinfos['actionqa']);
$machineinfos = array();
$result = array();
$result['cmdid'] = $COMMANDID;
$machineinfos = array_merge($_GET, $machinegroup, $customqa, $result);
xmlrpc_runXmppAsyncCommand(trim($customqa['customcmd']), $machineinfos);
echo "send";
} else {
$msg = sprintf(_T("Sorry the operating system of the machine %s is [%s].<br>The custom QA is defined for operating system [%s]", "xmppmaster"), $machine, $machinegroup['platform'], $os);
xmlrpc_setCommand_action($uuid, $COMMANDID, "consoleweb", '<span style = "color : navy;">'. $msg.'</span>', "warning", $jid);
}
else{
// update table command action
$msg = sprintf(_T("Sorry the machine '%s' is off", "xmppmaster"), $machine );
xmlrpc_setCommand_action( $uuid, $COMMANDID, "consoleweb", '<span style = "color : Orange;">'. $msg.'</span>', "warning", $jid);
}
// Directement to result a action to $action = QAcustommachgrp
// Table Action Quick $action = ActionQuickGroup
$action = "ActionQuickGroup";
echo "<form name='formcmdcustom' id ='formcmdcustom' action='main.php' method='GET' >";
echo "<input type='hidden' name ='module' value ='xmppmaster'>";
echo "<input type='hidden' name ='submod' value ='xmppmaster'>";
echo "<input type='hidden' name ='action' value ='$action'>";
echo "<input type='hidden' name ='cmd_id' value ='$COMMANDID'>";
echo "<input type='hidden' name ='gid' value =''>";
echo "<input type='hidden' name ='uuid' value ='$uuid'>";
echo "<input type='hidden' name ='date' value =''>";
echo "<input type='hidden' name ='os' value ='$os'>";
echo "<input type='hidden' name ='login' value ='$user'>";
echo "<input type='hidden' name ='machname' value ='$machine'>";
echo "<input type='hidden' name ='namecmd' value ='$namecmd'>";
echo "<input type=submit >";
echo "<form>";
sleep(1);
echo '<script type="text/javascript">';
echo 'jQuery( document ).ready(function() {
} else {
// update table command action
$msg = sprintf(_T("Sorry the machine '%s' is off", "xmppmaster"), $machine);
xmlrpc_setCommand_action($uuid, $COMMANDID, "consoleweb", '<span style = "color : Orange;">'. $msg.'</span>', "warning", $jid);
}
// Directement to result a action to $action = QAcustommachgrp
// Table Action Quick $action = ActionQuickGroup
$action = "ActionQuickGroup";
echo "<form name='formcmdcustom' id ='formcmdcustom' action='main.php' method='GET' >";
echo "<input type='hidden' name ='module' value ='xmppmaster'>";
echo "<input type='hidden' name ='submod' value ='xmppmaster'>";
echo "<input type='hidden' name ='action' value ='$action'>";
echo "<input type='hidden' name ='cmd_id' value ='$COMMANDID'>";
echo "<input type='hidden' name ='gid' value =''>";
echo "<input type='hidden' name ='uuid' value ='$uuid'>";
echo "<input type='hidden' name ='date' value =''>";
echo "<input type='hidden' name ='os' value ='$os'>";
echo "<input type='hidden' name ='login' value ='$user'>";
echo "<input type='hidden' name ='machname' value ='$machine'>";
echo "<input type='hidden' name ='namecmd' value ='$namecmd'>";
echo "<input type=submit >";
echo "<form>";
sleep(1);
echo '<script type="text/javascript">';
echo 'jQuery( document ).ready(function() {
jQuery( \'#formcmdcustom\' ).submit();
});';

echo '</script>';
echo '</script>';