Bitrix Site Manager

CUser::Update

bool
CUser::Update(
 int id,
 array fields
)

The method Update modifies parameters of the user. Returns true on success. In case of an error the method will return false, and the LAST_ERROR property will contain the error description.

Parameters

ParameterDescription
id User ID.
fields An array of values in the format array("field"=>"value" [, ...]). The field names may include all the CUser class fields as well as GROUP_ID - an array of user group ID's to which the user belongs.

See Also

Example



<?
$user = new CUser;
$fields = Array(
  "NAME"              => "Duncan",
  "LAST_NAME"         => "McCleod",
  "EMAIL"             => "dc@eternity.com",
  "LOGIN"             => "duncan",
  "LID"               => "en",
  "ACTIVE"            => "Y",
  "GROUP_ID"          => array(1,2),
  "PASSWORD"          => "123456",
  "CONFIRM_PASSWORD"  => "123456",
  );
$user->Update($ID, $fields);
$strError .= $user->LAST_ERROR;
?>