1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00

Fix iframe feature with params added to the URL

This commit is contained in:
Hillel Coren 2017-03-26 23:18:25 +03:00
parent 0a29e79fb0
commit c45b9aecc3
3 changed files with 5 additions and 2 deletions

View File

@ -61,7 +61,8 @@ class Authenticate
} elseif ($invitation = $this->getInvitation($request->invitation_key)) { } elseif ($invitation = $this->getInvitation($request->invitation_key)) {
$contact = $invitation->contact; $contact = $invitation->contact;
Session::put('contact_key', $contact->contact_key); Session::put('contact_key', $contact->contact_key);
} else { }
if (! $contact) {
return \Redirect::to('client/sessionexpired'); return \Redirect::to('client/sessionexpired');
} }
$account = $contact->account; $account = $contact->account;
@ -109,6 +110,7 @@ class Authenticate
// check for extra params at end of value (from website feature) // check for extra params at end of value (from website feature)
list($key) = explode('&', $key); list($key) = explode('&', $key);
$key = substr($key, 0, RANDOM_KEY_LENGTH);
$invitation = Invitation::withTrashed()->where('invitation_key', '=', $key)->first(); $invitation = Invitation::withTrashed()->where('invitation_key', '=', $key)->first();
if ($invitation && ! $invitation->is_deleted) { if ($invitation && ! $invitation->is_deleted) {

View File

@ -847,6 +847,7 @@ class InvoiceRepository extends BaseRepository
{ {
// check for extra params at end of value (from website feature) // check for extra params at end of value (from website feature)
list($invitationKey) = explode('&', $invitationKey); list($invitationKey) = explode('&', $invitationKey);
$invitationKey = substr($invitationKey, 0, RANDOM_KEY_LENGTH);
/** @var \App\Models\Invitation $invitation */ /** @var \App\Models\Invitation $invitation */
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first(); $invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();

View File

@ -347,7 +347,7 @@
<script language="javascript"> <script language="javascript">
var iframe = document.getElementById('invoiceIFrame'); var iframe = document.getElementById('invoiceIFrame');
iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/' iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'
+ window.location.search.substring(1); + window.location.search.substring(1, 33);
&lt;/script&gt;</pre> &lt;/script&gt;</pre>
<p>{{ trans('texts.iframe_url_help2') }}</p> <p>{{ trans('texts.iframe_url_help2') }}</p>
<p><b>{{ trans('texts.iframe_url_help3') }}</b></p> <p><b>{{ trans('texts.iframe_url_help3') }}</b></p>