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

Merge pull request #7864 from turbo124/v5-develop

v5.5.31
This commit is contained in:
David Bomba 2022-10-10 07:12:41 +11:00 committed by GitHub
commit a295d5a24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 3 deletions

View File

@ -102,7 +102,7 @@ class SelfUpdateController extends BaseController
nlog('Extracting zip');
//clean up old snappdf installations
$this->cleanOldSnapChromeBinaries();
//$this->cleanOldSnapChromeBinaries();
$zipFile = new \PhpZip\ZipFile();

View File

@ -17,6 +17,7 @@ use App\Jobs\Mail\NinjaMailerObject;
use App\Mail\ClientContact\ClientContactResetPasswordObject;
use App\Models\Presenters\ClientContactPresenter;
use App\Notifications\ClientContactResetPassword;
use App\Utils\Ninja;
use App\Utils\Traits\MakesHash;
use Illuminate\Contracts\Translation\HasLocalePreference;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@ -257,8 +258,33 @@ class ClientContact extends Authenticatable implements HasLocalePreference
*/
public function getLoginLink()
{
$domain = isset($this->company->portal_domain) ? $this->company->portal_domain : $this->company->domain();
// $domain = isset($this->company->portal_domain) ? $this->company->portal_domain : $this->company->domain();
// return $domain.'/client/key_login/'.$this->contact_key;
if (Ninja::isHosted()) {
$domain = $this->company->domain();
} else {
$domain = config('ninja.app_url');
}
switch ($this->company->portal_mode) {
case 'subdomain':
return $domain.'/client/key_login/'.$this->contact_key;
break;
case 'iframe':
return $domain.'/client/key_login/'.$this->contact_key;
//return $domain . $entity_type .'/'. $this->contact->client->client_hash .'/'. $this->key;
break;
case 'domain':
return $domain.'/client/key_login/'.$this->contact_key;
break;
default:
return '';
break;
}
}
}