mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 19:04:33 -04:00
Integrate phantom js secret default value into config
This commit is contained in:
parent
7a50032b35
commit
6360f62ef3
@ -212,7 +212,7 @@ class SetupController extends Controller
|
|||||||
public function checkPdf(Request $request)
|
public function checkPdf(Request $request)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (config('ninja.phantomjs_key')) {
|
if (config('ninja.phantomjs_pdf_generation')) {
|
||||||
return $this->testPhantom();
|
return $this->testPhantom();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ class SetupController extends Controller
|
|||||||
private function testPhantom()
|
private function testPhantom()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$key = config('ninja.phantomjs_key');
|
$key = config('ninja.phantomjs_pdf_generation');
|
||||||
$url = 'https://www.invoiceninja.org/';
|
$url = 'https://www.invoiceninja.org/';
|
||||||
|
|
||||||
$phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D";
|
$phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D";
|
||||||
|
@ -466,6 +466,9 @@ class UserController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function destroy(DestroyUserRequest $request, User $user)
|
public function destroy(DestroyUserRequest $request, User $user)
|
||||||
{
|
{
|
||||||
|
if($user->isOwner())
|
||||||
|
return response()->json(['message', 'Cannot detach owner.'],400);
|
||||||
|
|
||||||
/* If the user passes the company user we archive the company user */
|
/* If the user passes the company user we archive the company user */
|
||||||
$user = $this->user_repo->delete($request->all(), $user);
|
$user = $this->user_repo->delete($request->all(), $user);
|
||||||
|
|
||||||
@ -603,6 +606,9 @@ class UserController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function detach(DetachCompanyUserRequest $request, User $user)
|
public function detach(DetachCompanyUserRequest $request, User $user)
|
||||||
{
|
{
|
||||||
|
if($user->isOwner())
|
||||||
|
return response()->json(['message', 'Cannot detach owner.'],400);
|
||||||
|
|
||||||
$company_user = CompanyUser::whereUserId($user->id)
|
$company_user = CompanyUser::whereUserId($user->id)
|
||||||
->whereCompanyId(auth()->user()->companyId())->first();
|
->whereCompanyId(auth()->user()->companyId())->first();
|
||||||
|
|
||||||
|
@ -107,6 +107,9 @@ class UserRepository extends BaseRepository
|
|||||||
|
|
||||||
public function destroy(array $data, User $user)
|
public function destroy(array $data, User $user)
|
||||||
{
|
{
|
||||||
|
if($user->isOwner())
|
||||||
|
return $user;
|
||||||
|
|
||||||
if (array_key_exists('company_user', $data)) {
|
if (array_key_exists('company_user', $data)) {
|
||||||
$this->forced_includes = 'company_users';
|
$this->forced_includes = 'company_users';
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ return [
|
|||||||
'hash_salt' => env('HASH_SALT', ''),
|
'hash_salt' => env('HASH_SALT', ''),
|
||||||
'currency_converter_api_key' => env('OPENEXCHANGE_APP_ID', ''),
|
'currency_converter_api_key' => env('OPENEXCHANGE_APP_ID', ''),
|
||||||
'enabled_modules' => 32767,
|
'enabled_modules' => 32767,
|
||||||
'phantomjs_key' => env('PHANTOMJS_KEY', false),
|
'phantomjs_key' => env('PHANTOMJS_KEY', 'a-demo-key-with-low-quota-per-ip-address'),
|
||||||
'phantomjs_secret' => env('PHANTOMJS_SECRET', false),
|
'phantomjs_secret' => env('PHANTOMJS_SECRET', false),
|
||||||
'phantomjs_pdf_generation' => env('PHANTOMJS_PDF_GENERATION', true),
|
'phantomjs_pdf_generation' => env('PHANTOMJS_PDF_GENERATION', true),
|
||||||
'trusted_proxies' => env('TRUSTED_PROXIES', false),
|
'trusted_proxies' => env('TRUSTED_PROXIES', false),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user