n°1617 - iTop Fence

- iTop Fence now lock user fetch/creation per login to prevent duplicates
 - iTop now provide a mean to create safe lock when used untrusted strings
 - better log message & function names
 - reduced cyclomatic complexity

(thanks @piRGoif)
This commit is contained in:
bruno DA SILVA
2019-11-28 16:31:12 +01:00
parent 4798bf2f79
commit 0473269132

View File

@@ -88,6 +88,25 @@ class iTopMutex
$this->InitMySQLSession();
}
/**
* Get instance of self but with an escaped $sName
*
* this is meant to be used with non trusted string such as user inputs.
*
* @param mixed ...$aArgs smae as __construct()
*
* @return \iTopMutex
* @since 2.7.0
*
*/
public static function GetInstanceFromUserInput(...$aArgs)
{
$aArgs[0] = \CMDBSource::Quote($aArgs[0]);
return new iTopMutex(...$aArgs);
}
public function __destruct()
{
if ($this->bLocked)