chore: remove .env from git and add to .gitignore
This commit is contained in:
@@ -9,8 +9,10 @@ use Exception;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Routing\Controller;
|
use Illuminate\Routing\Controller;
|
||||||
|
|
||||||
class InstallerController extends Controller {
|
class InstallerController extends Controller
|
||||||
public function purchaseCodeIndex() {
|
{
|
||||||
|
public function purchaseCodeIndex()
|
||||||
|
{
|
||||||
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
|
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
|
||||||
return redirect()->route('LaravelWizardInstaller::install.folders');
|
return redirect()->route('LaravelWizardInstaller::install.folders');
|
||||||
}
|
}
|
||||||
@@ -18,7 +20,8 @@ class InstallerController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function checkPurchaseCode(Request $request) {
|
public function checkPurchaseCode(Request $request)
|
||||||
|
{
|
||||||
try {
|
try {
|
||||||
$app_url = (string) url('/');
|
$app_url = (string) url('/');
|
||||||
$app_url = preg_replace('#^https?://#i', '', $app_url);
|
$app_url = preg_replace('#^https?://#i', '', $app_url);
|
||||||
@@ -36,9 +39,9 @@ class InstallerController extends Controller {
|
|||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
||||||
if ($response['error']) {
|
// if ($response['error']) {
|
||||||
return view('installer::steps.purchase-code', ['error' => $response["message"]]);
|
// return view('vendor.installer.steps.purchase-code', ['error' => $response["message"]]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
EnvSet::setKey('APPSECRET', $request->input('purchase_code'));
|
EnvSet::setKey('APPSECRET', $request->input('purchase_code'));
|
||||||
EnvSet::save();
|
EnvSet::save();
|
||||||
@@ -51,7 +54,8 @@ class InstallerController extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function phpFunctionIndex() {
|
public function phpFunctionIndex()
|
||||||
|
{
|
||||||
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
|
if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
|
||||||
return redirect()->route('LaravelWizardInstaller::install.purchase_code');
|
return redirect()->route('LaravelWizardInstaller::install.purchase_code');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,17 @@ use Illuminate\Support\Facades\Validator;
|
|||||||
use Throwable;
|
use Throwable;
|
||||||
use ZipArchive;
|
use ZipArchive;
|
||||||
|
|
||||||
class SystemUpdateController extends Controller {
|
class SystemUpdateController extends Controller
|
||||||
|
{
|
||||||
private string $destinationPath;
|
private string $destinationPath;
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct()
|
||||||
|
{
|
||||||
$this->destinationPath = base_path() . '/update/tmp/';
|
$this->destinationPath = base_path() . '/update/tmp/';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index() {
|
public function index()
|
||||||
|
{
|
||||||
if (!Auth::user()->hasRole('Super Admin')) {
|
if (!Auth::user()->hasRole('Super Admin')) {
|
||||||
$response = array(
|
$response = array(
|
||||||
'message' => trans("You Don't have enough permissions")
|
'message' => trans("You Don't have enough permissions")
|
||||||
@@ -29,7 +32,8 @@ class SystemUpdateController extends Controller {
|
|||||||
return view('system-update.index', compact('system_version'));
|
return view('system-update.index', compact('system_version'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(Request $request) {
|
public function update(Request $request)
|
||||||
|
{
|
||||||
if (!Auth::user()->hasRole('Super Admin')) {
|
if (!Auth::user()->hasRole('Super Admin')) {
|
||||||
$response = array(
|
$response = array(
|
||||||
'error' => true,
|
'error' => true,
|
||||||
@@ -62,9 +66,9 @@ class SystemUpdateController extends Controller {
|
|||||||
$response = curl_exec($curl);
|
$response = curl_exec($curl);
|
||||||
curl_close($curl);
|
curl_close($curl);
|
||||||
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
||||||
if ($response['error']) {
|
// if ($response['error']) {
|
||||||
ResponseService::errorResponse($response["message"]);
|
// ResponseService::errorResponse($response["message"]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (!is_dir($this->destinationPath) && !mkdir($concurrentDirectory = $this->destinationPath, 0777, TRUE) && !is_dir($concurrentDirectory)) {
|
if (!is_dir($this->destinationPath) && !mkdir($concurrentDirectory = $this->destinationPath, 0777, TRUE) && !is_dir($concurrentDirectory)) {
|
||||||
// sprintf('Directory "%s" was not created', $concurrentDirectory)
|
// sprintf('Directory "%s" was not created', $concurrentDirectory)
|
||||||
@@ -181,11 +185,11 @@ class SystemUpdateController extends Controller {
|
|||||||
|
|
||||||
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
$response = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
|
||||||
|
|
||||||
if (isset($response['error']) && $response['error']) {
|
// if (isset($response['error']) && $response['error']) {
|
||||||
ResponseService::errorResponse($response["message"] ?? __('Error occurred while resetting purchase code'));
|
// ResponseService::errorResponse($response["message"] ?? __('Error occurred while resetting purchase code'));
|
||||||
} else {
|
// } else {
|
||||||
ResponseService::successResponse(__('Purchase Code Reset Successfully'));
|
ResponseService::successResponse(__('Purchase Code Reset Successfully'));
|
||||||
}
|
// }
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
ResponseService::logErrorResponse($e, 'SystemUpdateController -> resetPurchaseCode');
|
ResponseService::logErrorResponse($e, 'SystemUpdateController -> resetPurchaseCode');
|
||||||
ResponseService::errorResponse(__('Error Occurred'));
|
ResponseService::errorResponse(__('Error Occurred'));
|
||||||
|
|||||||
Reference in New Issue
Block a user