1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02: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)) {
$contact = $invitation->contact;
Session::put('contact_key', $contact->contact_key);
} else {
}
if (! $contact) {
return \Redirect::to('client/sessionexpired');
}
$account = $contact->account;
@ -109,6 +110,7 @@ class Authenticate
// check for extra params at end of value (from website feature)
list($key) = explode('&', $key);
$key = substr($key, 0, RANDOM_KEY_LENGTH);
$invitation = Invitation::withTrashed()->where('invitation_key', '=', $key)->first();
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)
list($invitationKey) = explode('&', $invitationKey);
$invitationKey = substr($invitationKey, 0, RANDOM_KEY_LENGTH);
/** @var \App\Models\Invitation $invitation */
$invitation = Invitation::where('invitation_key', '=', $invitationKey)->first();

View File

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