public_html/cloud/settings/Controller/UsersController.php
/**
	 * update account manager with new user data
	 *
	 * @param IUser $user
	 * @param array $data
	 * @throws ForbiddenException
	 */
update account manager with new user data
@param IUser $user
@param array $data
@throws ForbiddenException
update account manager with new user data @param IUser $user @param array $data @throws ForbiddenException
protected function saveUserSettings(IUser $user, $data) {
		$oldDisplayName = $user->getDisplayName();
		$oldDisplayName = is_null($oldDisplayName) ? '' : $oldDisplayName;
		if (isset($data[AccountManager::PROPERTY_DISPLAYNAME]['value'])
			&& $oldDisplayName !== $data[AccountManager::PROPERTY_DISPLAYNAME]['value']
		) {
			$result = $user->setDisplayName($data[AccountManager::PROPERTY_DISPLAYNAME]['value']);
			if ($result === false) {
				throw new ForbiddenException($this->l10n->t('Unable to change full name'));
			}
		}
		$oldEmailAddress = $user->getEMailAddress();
		$oldEmailAddress = is_null($oldEmailAddress) ? '' : $oldEmailAddress;
		if (isset($data[AccountManager::PROPERTY_EMAIL]['value'])
			&& $oldEmailAddress !== $data[AccountManager::PROPERTY_EMAIL]['value']
		) {
			if (!$user->canChangeDisplayName()) {
				throw new ForbiddenException($this->l10n->t('Unable to change email address'));
			}
			$user->setEMailAddress($data[AccountManager::PROPERTY_EMAIL]['value']);
		}
		$this->accountManager->updateUser($user, $data);
	}
protected function saveUserSettings ( IUser $ user , $ data ) { $ oldDisplayName = $ user -> getDisplayName ( ) ; $ oldDisplayName = is_null ( $ oldDisplayName ) ? '' : $ oldDisplayName ; if ( isset ( $ data [ AccountManager :: PROPERTY_DISPLAYNAME ] [ 'value' ] ) && $ oldDisplayName !== $ data [ AccountManager :: PROPERTY_DISPLAYNAME ] [ 'value' ] ) { $ result = $ user -> setDisplayName ( $ data [ AccountManager :: PROPERTY_DISPLAYNAME ] [ 'value' ] ) ; if ( $ result === false ) { throw new ForbiddenException ( $ this -> l10n -> t ( 'Unable to change full name' ) ) ; } } $ oldEmailAddress = $ user -> getEMailAddress ( ) ; $ oldEmailAddress = is_null ( $ oldEmailAddress ) ? '' : $ oldEmailAddress ; if ( isset ( $ data [ AccountManager :: PROPERTY_EMAIL ] [ 'value' ] ) && $ oldEmailAddress !== $ data [ AccountManager :: PROPERTY_EMAIL ] [ 'value' ] ) { if ( ! $ user -> canChangeDisplayName ( ) ) { throw new ForbiddenException ( $ this -> l10n -> t ( 'Unable to change email address' ) ) ; } $ user -> setEMailAddress ( $ data [ AccountManager :: PROPERTY_EMAIL ] [ 'value' ] ) ; } $ this -> accountManager -> updateUser ( $ user , $ data ) ; }
update account manager with new user data
 @param IUser $user
 @param array $data
 @throws ForbiddenException
update account manager with new user data @param IUser $user @param array $data @throws ForbiddenException
// keep the user back-end up-to-date with the latest display name and email // address // this is the only permission a backend provides and is also used // for the permission of setting a email address