apps/sharebymail/lib/ShareByMailProvider.php
/**
	 * Update a share
	 *
	 * @param IShare $share
	 * @param string|null $plainTextPassword
	 * @return IShare The share object
	 */
Update a share
@param IShare $share
@param string|null $plainTextPassword
@return IShare The share object
Update a share @param IShare $share @param string|null $plainTextPassword @return IShare The share object
public function update(IShare $share, $plainTextPassword = null) {
		$originalShare = $this->getShareById($share->getId());
		$validPassword = $plainTextPassword !== null && $plainTextPassword !== '';
		if($validPassword && $originalShare->getPassword() !== $share->getPassword()) {
			$this->sendPassword($share, $plainTextPassword);
		}
		$qb = $this->dbConnection->getQueryBuilder();
		$qb->update('share')
			->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
			->set('permissions', $qb->createNamedParameter($share->getPermissions()))
			->set('uid_owner', $qb->createNamedParameter($share->getShareOwner()))
			->set('uid_initiator', $qb->createNamedParameter($share->getSharedBy()))
			->set('password', $qb->createNamedParameter($share->getPassword()))
			->set('expiration', $qb->createNamedParameter($share->getExpirationDate(), IQueryBuilder::PARAM_DATE))
			->execute();
		return $share;
	}
public function update ( IShare $ share , $ plainTextPassword = null ) { $ originalShare = $ this -> getShareById ( $ share -> getId ( ) ) ; $ validPassword = $ plainTextPassword !== null && $ plainTextPassword !== '' ; if ( $ validPassword && $ originalShare -> getPassword ( ) !== $ share -> getPassword ( ) ) { $ this -> sendPassword ( $ share , $ plainTextPassword ) ; } $ qb = $ this -> dbConnection -> getQueryBuilder ( ) ; $ qb -> update ( 'share' ) -> where ( $ qb -> expr ( ) -> eq ( 'id' , $ qb -> createNamedParameter ( $ share -> getId ( ) ) ) ) -> set ( 'permissions' , $ qb -> createNamedParameter ( $ share -> getPermissions ( ) ) ) -> set ( 'uid_owner' , $ qb -> createNamedParameter ( $ share -> getShareOwner ( ) ) ) -> set ( 'uid_initiator' , $ qb -> createNamedParameter ( $ share -> getSharedBy ( ) ) ) -> set ( 'password' , $ qb -> createNamedParameter ( $ share -> getPassword ( ) ) ) -> set ( 'expiration' , $ qb -> createNamedParameter ( $ share -> getExpirationDate ( ) , IQueryBuilder :: PARAM_DATE ) ) -> execute ( ) ; return $ share ; }
Update a share
 @param IShare $share
 @param string|null $plainTextPassword
 @return IShare The share object
Update a share @param IShare $share @param string|null $plainTextPassword @return IShare The share object
// a real password was given /*
		 * We allow updating the permissions and password of mail shares
		 */