JSON/REST: When specifying a case log entry (or the whole), it was not possible to set the user name without knowing a valid user id -retrofit from trunk

SVN:2.1.0[3594]
This commit is contained in:
Romain Quetiez
2015-06-16 09:51:51 +00:00
parent 1804903ee4
commit f048c6cb1f

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2012 Combodo SARL
// Copyright (C) 2010-2015 Combodo SARL
//
// This file is part of iTop.
//
@@ -23,7 +23,7 @@ define('CASELOG_SEPARATOR', "\n".'========== %1$s : %2$s (%3$d) ============'."\
/**
* Class to store a "case log" in a structured way, keeping track of its successive entries
*
* @copyright Copyright (C) 2010-2012 Combodo SARL
* @copyright Copyright (C) 2010-2015 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
class ormCaseLog {
@@ -394,7 +394,7 @@ class ormCaseLog {
{
throw new Exception("Only administrators can set the user id", RestResult::UNAUTHORIZED);
}
if ($bCheckUserId)
if ($bCheckUserId && ($oJson->user_id != 0))
{
try
{