Skip to content

Commit

Permalink
Merge pull request #841 from ladybirdweb/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Ashutosh pathak authored May 8, 2019
2 parents 34918c8 + 93e7986 commit f10d448
Show file tree
Hide file tree
Showing 2,491 changed files with 58,963 additions and 78,911 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function requestOtp(Request $request)
try {
$code = $request->input('code');
$mobile = $request->input('mobile');
$number = $code.$mobile;
$number = '(+'.$code.') '.$mobile;
$result = $this->sendOtp($mobile, $code);
$response = ['type' => 'success', 'message' => 'OTP has been sent to '.$number.'.Please Verify to Login'];

Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Front/CheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public function postCheckout(Request $request)
$items = new \Illuminate\Support\Collection();
$invoiceid = $request->input('invoice_id');
$invoice = $this->invoice->find($invoiceid);
$invoice_no = $invoice->number;
$date = $this->getDate($invoice);
$items = $invoice->invoiceItem()->get();
$product = $this->product($invoiceid);
Expand All @@ -248,9 +249,8 @@ public function postCheckout(Request $request)
compact(
'amount',
'invoice_no',
' invoiceid',
' payment_method',
'phone',
'invoiceid',
'payment_method',
'invoice',
'items',
'product',
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Controllers/Front/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,19 @@ public function getOrder($id)

$plan = $subscription->plan()->first();
}
$licenseStatus = StatusSetting::pluck('license_status')->first();
if ($licenseStatus == 1) {
$cont = new \App\Http\Controllers\License\LicenseController();
$installationDetails = $cont->searchInstallationPath($order->serial_key, $order->product);
}
$product = $order->product()->first();
$price = $product->price()->first();
$licenseStatus = StatusSetting::pluck('license_status')->first();
$user = \Auth::user();

return view(
'themes.default1.front.clients.show-order',
compact('invoice', 'order', 'user', 'plan', 'product', 'subscription', 'licenseStatus')
compact('invoice', 'order', 'user', 'plan', 'product', 'subscription', 'licenseStatus', 'installationDetails')
);
} catch (Exception $ex) {
Bugsnag::notifyException($ex);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Front/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function edit($id)
$selectedParent = $this->page->where('id', $id)->pluck('parent_page_id')->toArray();
$parentName = $this->page->where('id', $selectedParent)->pluck('name', 'id')->toArray();

return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate','selectedParent',
return view('themes.default1.front.page.edit', compact('parents', 'page', 'selectedDefault', 'publishingDate','selectedParent',
'parentName'));
} catch (\Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
Expand Down
27 changes: 21 additions & 6 deletions app/Http/Controllers/License/LicenseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function updateLicensedDomain($licenseCode, $domain, $productId, $license
$licenseId = $searchLicense['licenseId'];
$productId = $searchLicense['productId'];
$licenseCode = $searchLicense['code'];
$updateLicense = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=licenses_edit&product_id=$productId&license_code=$licenseCode&license_id=$licenseId&license_order_number=$orderNo&license_require_domain=$requiredomain&license_status=1&license_expire_date=$l_expiry&license_updates_date=$u_expiry&license_support_date=$s_expiry&license_domain=$domain&license_ip=$ip");
$updateLicense = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=licenses_edit&product_id=$productId&license_code=$licenseCode&license_id=$licenseId&license_order_number=$orderNo&license_require_domain=$requiredomain&license_status=1&license_expire_date=$l_expiry&license_updates_date=$u_expiry&license_support_date=$s_expiry&license_domain=$domain&license_ip=$ip&license_limit=2");
}

public function searchLicenseId($licenseCode, $productId)
Expand Down Expand Up @@ -219,8 +219,6 @@ public function searchLicenseId($licenseCode, $productId)
//Update the Installation status as Inactive after Licensed Domain Is Chnaged
public function updateInstalledDomain($licenseCode, $productId)
{
$installation_id = '';
$installation_ip = '';
$url = $this->url;
$api_key_secret = $this->api_key_secret;
//Search for the Installation Id
Expand All @@ -231,11 +229,11 @@ public function updateInstalledDomain($licenseCode, $productId)
if ($detail->product_id == $productId) {
$installation_id = $detail->installation_id;
$installation_ip = $detail->installation_ip;
//delete all existing installation
$updateInstallation = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=installations_edit&installation_id=$installation_id&installation_ip=$installation_ip&installation_status=0&delete_record=1");
}
}
}
// deactivate The Existing Installation
$updateInstallation = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=installations_edit&installation_id=$installation_id&installation_ip=$installation_ip&installation_status=0");
}

public function searchInstallationId($licenseCode)
Expand All @@ -248,6 +246,23 @@ public function searchInstallationId($licenseCode)
return $getInstallId;
}

public function searchInstallationPath($licenseCode, $productId)
{
$installation_domain = [];
$installation_ip = [];
$details = json_decode($this->searchInstallationId($licenseCode));
if ($details->api_error_detected == 0 && is_array($details->page_message)) {
foreach ($details->page_message as $detail) {
if ($detail->product_id == $productId) {
$installation_domain[] = $detail->installation_domain;
$installation_ip[] = $detail->installation_ip;
}
}
}

return ['installed_path' => $installation_domain, 'installed_ip' => $installation_ip];
}

//Update Expiration Date After Renewal
public function updateExpirationDate($licenseCode, $expiryDate, $productId, $domain, $orderNo, $licenseExpiry, $supportExpiry)
{
Expand All @@ -267,6 +282,6 @@ public function updateExpirationDate($licenseCode, $expiryDate, $productId, $dom
$licenseId = $searchLicense['licenseId'];
$productId = $searchLicense['productId'];
$code = $searchLicense['code'];
$updateLicense = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=licenses_edit&product_id=$productId&license_code=$code&license_id=$licenseId&license_order_number=$orderNo&license_domain=$domain&license_ip=$ip&license_require_domain=$requiredomain&license_status=1&license_expire_date=$licenseExpiry&license_updates_date=$expiryDate&license_support_date=$supportExpiry");
$updateLicense = $this->postCurl($url, "api_key_secret=$api_key_secret&api_function=licenses_edit&product_id=$productId&license_code=$code&license_id=$licenseId&license_order_number=$orderNo&license_domain=$domain&license_ip=$ip&license_require_domain=$requiredomain&license_status=1&license_expire_date=$licenseExpiry&license_updates_date=$expiryDate&license_support_date=$supportExpiry&license_limit=2");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function edit($invoiceid, Request $request)
$totalSum = array_sum($payment);
}

return view('themes.default1.invoice.editInvoice', compact('userid', 'date', 'invoiceid', 'invoice', 'totalSum'));
return view('themes.default1.invoice.editInvoice', compact('date', 'invoiceid', 'invoice', 'totalSum'));
}

public function postEdit($invoiceid, Request $request)
Expand Down
8 changes: 1 addition & 7 deletions app/Http/Controllers/Order/ExtendedOrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,7 @@ public function getAllowedDomains($seperateDomains)
{
$needle = 'www';
foreach ($seperateDomains as $domain) {
$isIP = (bool) ip2long($domain);
if ($isIP == true) {
$allowedDomains[] = $domain;
} else {
$customDomain = (strpos($domain, $needle) !== false) ? str_replace('www.', '', $domain) : 'www.'.$domain;
$allowedDomains[] = ($domain.','.$customDomain);
}
$allowedDomains[] = $domain;
}

return $allowedDomains;
Expand Down
6 changes: 5 additions & 1 deletion app/Http/Controllers/Order/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,13 @@ public function show($id)
$invoiceItems = $this->invoice_items->where('invoice_id', $invoiceid)->get();
$user = $this->user->find($invoice->user_id);
$licenseStatus = StatusSetting::pluck('license_status')->first();
if ($licenseStatus == 1) {
$cont = new \App\Http\Controllers\License\LicenseController();
$installationDetails = $cont->searchInstallationPath($order->serial_key, $order->product);
}

return view('themes.default1.order.show',
compact('invoiceItems', 'invoice', 'user', 'order', 'subscription', 'licenseStatus'));
compact('invoiceItems', 'invoice', 'user', 'order', 'subscription', 'licenseStatus', 'installationDetails'));
} catch (\Exception $ex) {
Bugsnag::notifyException($ex);

Expand Down
3 changes: 1 addition & 2 deletions app/Http/Controllers/Payment/TaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ public function edit($id)
// }

return view('themes.default1.payment.tax.edit',
compact('tax', 'txClass', 'states', 'state',
'defaultValue', 'taxClassName'));
compact('tax', 'txClass', 'states', 'state', 'taxClassName'));
} catch (\Exception $ex) {
return redirect()->back()->with('fails', $ex->getMessage());
}
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/Product/BaseProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,16 @@ public function userDownload($uploadid, $userid, $invoice_number, $version_id =
if (is_array($release) && array_key_exists('type', $release)) {
$release = $release['release'];

return view('themes.default1.front.download', compact('release', 'form'));
return view('themes.default1.front.download', compact('release'));
} else {
header('Content-type: Zip');
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.$name.'.zip');
//header("Content-type: application/zip");
header('Content-type: application/zip');
header('Content-Length: '.filesize($release));
ob_end_clean();
// flush();
readfile($release);
// ob_end_clean();
// flush();
}
} else {
return redirect('auth/login')->with('fails', \Lang::get('activate-your-account'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function adminDownload($id, $invoice = '', $api = false)
header('Content-Disposition: attachment; filename = '.$name.'.zip');
header('Content-Length: '.filesize($release));
readfile($release);
ob_end_clean();
// ob_end_clean();
}
} catch (\Exception $e) {
if ($api) {
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/Product/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,8 @@ public function edit($id)
'subscription',
'currency',
'group',
'price',
'cartUrl',
'products',
'regular',
'sales',
'taxes',
'saved_taxes',
'savedTaxes',
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/RazorpayController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getViewMessageAfterPayment($invoice, $state, $currency)

\Cart::clear();
$status = 'success';
$message = view('themes.default1.front.postPaymentTemplate', compact('invoice','date','orders',
$message = view('themes.default1.front.postPaymentTemplate', compact('invoice','orders',
'invoiceItems', 'state', 'currency'))->render();

return ['status'=>$status, 'message'=>$message];
Expand All @@ -146,7 +146,7 @@ public function getViewMessageAfterRenew($invoice, $state, $currency)
\Cart::clear();
$status = 'success';

$message = view('themes.default1.front.postRenewTemplate', compact('invoice','date','order',
$message = view('themes.default1.front.postRenewTemplate', compact('invoice','date',
'product', 'invoiceItem', 'state', 'currency'))->render();

return ['status'=>$status, 'message'=>$message];
Expand Down
2 changes: 0 additions & 2 deletions app/Http/Controllers/User/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,7 @@ public function show($id)
'id',
'client',
'invoices',
'model_popup',
'orders',
'payments',
'invoiceSum',
'amountReceived',
'pendingAmount',
Expand Down
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Kernel extends HttpKernel
// \Illuminate\View\Middleware\ShareErrorsFromSession::class,
// \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Barryvdh\Cors\HandleCors::class,
// \App\Http\Middleware\IsInstalled::class,

],
Expand Down
2 changes: 1 addition & 1 deletion app/Traits/PaymentsAndInvoices.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public function postRazorpayPayment($invoiceid, $grand_total)
$paymentRenewal = $this->updateInvoicePayment(
$invoiceid,
$payment_method,
$payment_status,
$payment_status,
$payment_date,
$amount
);
Expand Down
Loading

0 comments on commit f10d448

Please sign in to comment.