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

User interactions for software deployment #2366

Merged
merged 17 commits into from Dec 11, 2017

Conversation

Projects
None yet
2 participants
@wawax
Member

wawax commented Nov 30, 2017

Add user interactions deployment feature for Windows

User interactions for software deployment
fix tests

remove superflu requires

abstract

temp test

remove abstract & var_dump

remove postponed

default value for user interaction behaviors

fix retry

try to fix tests

fix tests

try to fix tests

review migration of taskjobstates

try to fix tests

clean

@orthagh orthagh referenced this pull request Dec 1, 2017

Closed

User interactions #2198

@wawax wawax added the feature label Dec 4, 2017

Walid Nouh
break;
}
$class = new $classname();

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

Really, you use a class name passed with the _$POST, it's not secure.

I think need test if the $classname is in values array

This comment has been minimized.

@ddurieux

ddurieux Dec 10, 2017

Member

I not want to test if exist, but test if $classname is one of a defined list to be more secure

?>
/**
* Append needed informations to the json job for an agent
* @since 9.2

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

since 9.2 or 9.3?

This comment has been minimized.

@wawax

wawax Dec 5, 2017

Member

this code is intended for the next major release of the plugin for glpi 9.2, so the @SInCE is correct

This comment has been minimized.

@ddurieux
//Job has reached the maximum number of retries, do not interact with the user
//and execute the job
$jobstate->getFromDBByUniqID($job['job']['uuid']);

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

Need add code to bypass the code below in case agent not manage the interaction (so test on version of the agent)

This comment has been minimized.

@wawax

wawax Dec 5, 2017

Member

done

//on_nouser, on_ok, on_cancel, on_abort, on_retry, on_ignore,
//on_yes, on_no, on_tryagain, on_continue, on_timeout, on_async,
//on_mutilusers

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

Typo: on_multiusers instead on_mutilusers

This comment has been minimized.

@ddurieux

ddurieux Dec 10, 2017

Member

Not fixed

//Process response if an agent provides a behavior, a type and an event
//the user parameter is not mandatory
if (isset($behavior) && isset($type) && isset($event)) {

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

Be careful, the use of filter_input before with not $_GET['behavior'] for example will define $behavior with empty value, so the isset will be always true

This comment has been minimized.

@wawax

wawax Dec 5, 2017

Member

done, I've used !== instead of isset

" `itemtype` = '" . $item_type . "'",
"AND `items_id` = ".$item_id,
"AND `plugin_fusioninventory_taskjobs_id` = ". $job_id,
"AND `state` = '".
PluginFusioninventoryTaskjobstate::FINISHED."'",
"AND `state` IN (".

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

If you have only 1 value, use the =, not the IN because the = if more performant

'glpi_plugin_fusioninventory_taskjobstates' => 'id']]
],
'FIELDS' => ['itemtype'],
'WHERE' => ['id' => $taskjoblogs_id],

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

This can't works, we don't know of what table the id is searched

This comment has been minimized.

@wawax

wawax Dec 5, 2017

Member

well it seems that this method is only used in hook.php for search options, but I cannot understand why it's still here...

@@ -772,17 +756,32 @@ function displayShortLogs($taskjobs_id, $veryshort=0) {
WHERE `uniqid`='".$uniqid."'

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

This query replaced below, so delete it

),
'nb_retry' => array(
'type' => 'integer',
'value' => NULL

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

value = 0

),
'max_retry' => array(
'type' => 'integer',
'value' => NULL

This comment has been minimized.

@ddurieux

ddurieux Dec 4, 2017

Member

value = 1

@wawax wawax self-assigned this Dec 7, 2017

"pluginfusioninventorymenu", "deployuserinteractiontemplate");
PluginFusioninventoryMenu::displayMenu("mini");
}
$template->display($_GET);

This comment has been minimized.

@ddurieux

ddurieux Dec 10, 2017

Member

We must define default value of $_GET['id'] if not defined

This comment has been minimized.

@wawax

wawax Dec 11, 2017

Member

done

This comment has been minimized.

@wawax

wawax Dec 11, 2017

Member

sorry. done !

?>
/**
* Append needed informations to the json job for an agent
* @since 9.2

This comment has been minimized.

@ddurieux

@wawax wawax merged commit 2d3f9bb into fusioninventory:master Dec 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

wawax pushed a commit that referenced this pull request Dec 11, 2017

Walid Nouh
User interactions for software deployment (#2366)
Manage user interactions for Windows software deployment (agent 2.3.21 or higher mandatory)

mohierf added a commit to mohierf/fusioninventory-for-glpi that referenced this pull request Jan 10, 2018

User interactions for software deployment (fusioninventory#2366)
Manage user interactions for Windows software deployment (agent 2.3.21 or higher mandatory)

mohierf added a commit to mohierf/fusioninventory-for-glpi that referenced this pull request Jan 19, 2018

User interactions for software deployment (fusioninventory#2366)
Manage user interactions for Windows software deployment (agent 2.3.21 or higher mandatory)

@ddurieux ddurieux added this to the 9.2+2.0 milestone May 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment