/** * * @method * * Update a user with the given data. * * @name PMFUpdateUser * @label PMF Update User * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFUpdateUser.28.29 * * @param string(32) | $userUid | User UID | The user UID. * @param string(32) | $userName | User ID | The username for the user. * @param string(32) | $firstName=null | Firstname of the user | Optional parameter. The first name of the user, which can be up to 50 characters long. * @param string(32) | $lastName=null | Lastname of the user | Optional parameter. The last name of the user, which can be up to 50 characters long. * @param string(32) | $email=null | Email the user | Optional parameter. The email of the user, which can be up to 100 characters long. * @param string(32) | $dueDate=null | Expiration date | Optional parameter. The expiration date must be a string in the format "yyyy-mm-dd". * @param string(32) | $status=null | Status of the user | Optional parameter. The user's status, such as "ACTIVE", "INACTIVE" or "VACATION". * @param string(32) | $role=null | Rol of the user | The role of the user such as "PROCESSMAKER_ADMIN" or "PROCESSMAKER_OPERATOR". * @param string(32) | $password=null | Password of the user | The password of the user, which can be up to 32 characters long. * @return int | $result | Result of the update | Returns 1 if the user is updated successfully; otherwise, returns 0 if an error occurred. * */ function PMFUpdateUser($userUid, $userName, $firstName = null, $lastName = null, $email = null, $dueDate = null, $status = null, $role = null, $password = null) { G::LoadClass("wsBase"); $ws = new wsBase(); $result = $ws->updateUser($userUid, $userName, $firstName, $lastName, $email, $dueDate, $status, $role, $password); if ($result->status_code == 0) { return 1; } else { return 0; } }
function updateUser($params) { $result = isValidSession($params->sessionId); if ($result->status_code != 0) { return $result; } if (ifPermission($params->sessionId, "PM_USERS") == 0) { $result = new wsResponse(2, G::LoadTranslation('ID_NOT_PRIVILEGES')); return $result; } $ws = new wsBase(); $result = $ws->updateUser($params->userUid, $params->userName, isset($params->firstName) ? $params->firstName : null, isset($params->lastName) ? $params->lastName : null, isset($params->email) ? $params->email : null, isset($params->dueDate) ? $params->dueDate : null, isset($params->status) ? $params->status : null, isset($params->role) ? $params->role : null, isset($params->password) ? $params->password : null); return $result; }
function updateUser($params) { $result = isValidSession($params->sessionId); if ($result->status_code != 0) { return $result; } if (ifPermission($params->sessionId, "PM_USERS") == 0) { $result = new wsResponse(2, "You do not have privileges"); return $result; } $ws = new wsBase(); $result = $ws->updateUser($params->userUid, $params->userName, isset($params->firstName) ? $params->firstName : null, isset($params->lastName) ? $params->lastName : null, isset($params->email) ? $params->email : null, isset($params->dueDate) ? $params->dueDate : null, isset($params->status) ? $params->status : null, isset($params->role) ? $params->role : null, isset($params->password) ? $params->password : null); return $result; }