mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Working on L5
This commit is contained in:
parent
4750bacd71
commit
717d214157
@ -1,5 +1,9 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Utils;
|
||||
use Response;
|
||||
use Input;
|
||||
use App\Models\Client;
|
||||
use App\Ninja\Repositories\ClientRepository;
|
||||
|
||||
class ClientApiController extends Controller
|
||||
|
@ -1,6 +1,13 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Auth;
|
||||
use Utils;
|
||||
use Response;
|
||||
use Input;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Client;
|
||||
use App\Models\Product;
|
||||
use App\Models\Invitation;
|
||||
use App\Ninja\Repositories\InvoiceRepository;
|
||||
use App\Ninja\Mailers\ContactMailer as Mailer;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Utils;
|
||||
use Response;
|
||||
use App\Models\Payment;
|
||||
use App\Ninja\Repositories\PaymentRepository;
|
||||
|
||||
class PaymentApiController extends Controller
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php namespace App\Http\Controllers;
|
||||
|
||||
use Utils;
|
||||
use Response;
|
||||
use App\Models\Invoice;
|
||||
use App\Ninja\Repositories\InvoiceRepository;
|
||||
|
||||
class QuoteApiController extends Controller
|
||||
|
@ -5,6 +5,8 @@ use Utils;
|
||||
use Request;
|
||||
use Session;
|
||||
use Response;
|
||||
use Auth;
|
||||
use Cache;
|
||||
|
||||
use App\Models\AccountToken;
|
||||
|
||||
@ -47,7 +49,7 @@ class ApiCheck {
|
||||
$hour_throttle = Cache::get("hour_throttle:{$accountId}", null);
|
||||
$last_api_request = Cache::get("last_api_request:{$accountId}", 0);
|
||||
$last_api_diff = time() - $last_api_request;
|
||||
|
||||
|
||||
if (is_null($hour_throttle)) {
|
||||
$new_hour_throttle = 0;
|
||||
} else {
|
||||
|
@ -5,6 +5,14 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
private $openRoutes = [
|
||||
'api/v1/clients',
|
||||
'api/v1/invoices',
|
||||
'api/v1/quotes',
|
||||
'api/v1/payments',
|
||||
'api/v1/email_invoice',
|
||||
];
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
@ -14,6 +22,13 @@ class VerifyCsrfToken extends BaseVerifier {
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
foreach($this->openRoutes as $route) {
|
||||
|
||||
if ($request->is($route)) {
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
|
||||
|
@ -176,8 +176,4 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
return 'remember_token';
|
||||
}
|
||||
|
||||
// public function confirm(){}
|
||||
// public function forgotPassword(){}
|
||||
// public function isValid(){}
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ require __DIR__.'/../vendor/autoload.php';
|
||||
|
|
||||
*/
|
||||
|
||||
$compiledPath = __DIR__.'/../storage/framework/compiled.php';
|
||||
$compiledPath = __DIR__.'/../vendor/compiled.php';
|
||||
|
||||
if (file_exists($compiledPath))
|
||||
{
|
||||
|
@ -121,7 +121,7 @@
|
||||
setArchiveEnabled();
|
||||
});
|
||||
|
||||
$('tbody tr').click(function(event) {
|
||||
$('tbody tr').click(function(event) {
|
||||
if (event.target.type !== 'checkbox' && event.target.type !== 'button' && event.target.tagName.toLowerCase() !== 'a') {
|
||||
$checkbox = $(this).closest('tr').find(':checkbox:not(:disabled)');
|
||||
var checked = $checkbox.prop('checked');
|
||||
@ -152,7 +152,7 @@
|
||||
|
||||
function setArchiveEnabled() {
|
||||
var checked = $('tbody :checkbox:checked').length > 0;
|
||||
$('#archive > button').prop('disabled', !checked);
|
||||
$('button.archive').prop('disabled', !checked);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user