/** * Vreate new vitero user * @param ilObjUser $iu * @return <type> */ public function createUser(ilObjUser $iu) { try { $this->initClient(); $user = new stdClass(); $user->user = new stdClass(); $user->user->password = ilViteroUtils::randPassword(); $user->user->customeridlist = ilViteroSettings::getInstance()->getCustomer(); $this->loadFromUser($user->user, $iu); $nuser = $this->getClient()->createUser($user); return $nuser->userid; } catch (SoapFault $e) { $code = $this->parseErrorCode($e); $GLOBALS['ilLog']->write(__METHOD__ . ': Create user failed with message code: ' . $code); $GLOBALS['ilLog']->write(__METHOD__ . ': Last request: ' . $this->getClient()->__getLastRequest()); throw new ilViteroConnectorException($e->getMessage(), $code); } }