/** * Manage user account synchronization. * The account is create or update. * @param $user_id The user unique identifier. * @param $domain_id The domain identifier. * @param $username The user name used to authentify the user. * @return int The user identifier if the user is created or updated, or false. */ protected function syncUserAccount ($user_id, $domain_id, $username) { if (!$this->isEnabled()) { return false; } if (!is_null($user_id) && $user_id !== false) { $update = $this->_engine->verifyUserData($username, $domain_id, $user_id); if ($update || $this->_forceUserUpdate) { return $this->_engine->updateUser($username, $domain_id, $user_id); } return $user_id; } else { return $this->_engine->addUser($username, $domain_id); } }