allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
94
vendor/safiull/laravel-installer/src/Controllers/PermissionsController.php
vendored
Normal file
94
vendor/safiull/laravel-installer/src/Controllers/PermissionsController.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\LaravelInstaller\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Laravel\LaravelInstaller\Helpers\PermissionsChecker;
|
||||
use Laravel\LaravelInstaller\Service\EnvatoService;
|
||||
|
||||
class PermissionsController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @var PermissionsChecker
|
||||
*/
|
||||
protected $permissions;
|
||||
protected $envUrl;
|
||||
|
||||
/**
|
||||
* @param PermissionsChecker $checker
|
||||
*/
|
||||
public function __construct(PermissionsChecker $checker)
|
||||
{
|
||||
$this->permissions = $checker;
|
||||
$this->envUrl = config('installer.api_url');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the permissions check page.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function permissions()
|
||||
{
|
||||
$permissions = $this->permissions->check(
|
||||
config('installer.permissions')
|
||||
);
|
||||
|
||||
return view('vendor.installer.permissions', compact('permissions'));
|
||||
}
|
||||
|
||||
public function verify()
|
||||
{
|
||||
return redirect()->route('LaravelInstaller::environment');
|
||||
}
|
||||
|
||||
public function codeVerifyProcess(Request $request)
|
||||
{
|
||||
$rules = ['purchase_code' => 'nullable'];
|
||||
$messages = [
|
||||
'purchase_code.required' => __('Purchase code field is required.'),
|
||||
];
|
||||
|
||||
$validator = Validator::make($request->all(), $rules, $messages);
|
||||
|
||||
if ($validator->fails()) {
|
||||
$errors = $validator->errors();
|
||||
return redirect()->back()->with(['errors' => $errors]);
|
||||
} else {
|
||||
$check = $this->checkEnvatoPurchaseCode($request);
|
||||
if ($check['success'] == false) {
|
||||
return redirect()->back()->with(['message' => $check['message']]);
|
||||
} else {
|
||||
if ($request->_tokens && $request->_tokens == 'purchase_code') {
|
||||
file_put_contents(storage_path('.license'), json_encode(['license' => $request->purchase_code]));
|
||||
return redirect('/')->with('message', __('Code verified successfully'));
|
||||
} else {
|
||||
return redirect()->route('LaravelInstaller::environment')->with('message', $check['message']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check envato purchase code
|
||||
public function checkEnvatoPurchaseCode($request)
|
||||
{
|
||||
return ['success' => true, 'message' => 'Code verified successfully'];
|
||||
}
|
||||
|
||||
public function verifyMessages($envPharseKey)
|
||||
{
|
||||
Cookie::queue('addenvparkey', $envPharseKey);
|
||||
}
|
||||
|
||||
|
||||
public function verifier()
|
||||
{
|
||||
return view('vendor.installer.verify-code');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user