1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00
invoiceninja/app/Constants/Domain.php

47 lines
1002 B
PHP
Raw Normal View History

2017-01-30 20:40:43 +01:00
<?php
namespace App\Constants;
2017-01-12 14:12:02 +01:00
2018-03-29 10:11:32 +02:00
use App\Libraries\Utils;
2017-01-12 14:12:02 +01:00
class Domain
{
const INVOICENINJA_COM = 1;
const INVOICE_SERVICES = 2;
public static function getDomainFromId($id)
{
switch ($id) {
case static::INVOICENINJA_COM:
return 'invoiceninja.com';
case static::INVOICE_SERVICES:
return 'invoice.services';
}
return 'invoiceninja.com';
}
public static function getLinkFromId($id)
{
return 'https://app.' . static::getDomainFromId($id);
}
public static function getEmailFromId($id)
{
return 'maildelivery@' . static::getDomainFromId($id);
}
2018-03-29 10:11:32 +02:00
public static function getCookieDomain($url)
{
if (! Utils::isNinjaProd() || Utils::isReseller()) {
return '';
}
if (strpos($url, '.services') !== false) {
return '.invoice.services';
} else {
return '.invoiceninja.com';
}
}
2017-01-12 14:12:02 +01:00
}