From 9feb616f1b281d910d39a3d34a2e3d594a596f4a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 27 Jul 2014 23:31:41 +0300 Subject: [PATCH] Added support for Zapier --- README.md | 1 + app/controllers/AccountController.php | 5 +- app/controllers/BaseController.php | 2 +- app/controllers/ClientApiController.php | 66 +- app/controllers/IntegrationController.php | 29 + app/controllers/InvoiceApiController.php | 40 ++ app/controllers/PaymentApiController.php | 40 ++ app/controllers/QuoteApiController.php | 40 ++ .../2014_07_24_171214_add_zapier_support.php | 42 ++ app/filters.php | 12 +- app/libraries/utils.php | 72 +++ app/models/Account.php | 4 + app/models/Activity.php | 21 +- app/models/Subscription.php | 7 + app/models/User.php | 4 +- app/ninja/repositories/ClientRepository.php | 161 +++-- app/ninja/repositories/InvoiceRepository.php | 36 +- app/routes.php | 23 +- app/start/global.php | 4 + app/views/users/reset_password.blade.php | 2 +- bootstrap/start.php | 8 + composer.lock | 594 ++++++++++++------ public/.htaccess | 3 + 23 files changed, 913 insertions(+), 303 deletions(-) create mode 100644 app/controllers/IntegrationController.php create mode 100644 app/controllers/InvoiceApiController.php create mode 100644 app/controllers/PaymentApiController.php create mode 100644 app/controllers/QuoteApiController.php create mode 100644 app/database/migrations/2014_07_24_171214_add_zapier_support.php create mode 100644 app/models/Subscription.php diff --git a/README.md b/README.md index 8a827d3000..c3704c3c23 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Site design by [kantorp-wegl.in](http://kantorp-wegl.in/) * Integrates with many payment providers * Recurring invoices * Tax rates and payment terms +* Multi-user support ### Steps to setup diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 7c257753e4..18190f417b 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -379,6 +379,7 @@ class AccountController extends \BaseController { $client = Client::createNew(); $contact = Contact::createNew(); $contact->is_primary = true; + $contact->send_invoice = true; $count++; foreach ($row as $index => $value) @@ -443,7 +444,7 @@ class AccountController extends \BaseController { $client->save(); $client->contacts()->save($contact); - Activity::createClient($client); + Activity::createClient($client, false); } $message = Utils::pluralize('created_client', $count); @@ -470,7 +471,7 @@ class AccountController extends \BaseController { if (count($csv->data) + Client::scope()->count() > Auth::user()->getMaxNumClients()) { - $message = Utils::pluralize('limit_clients', Auth::user()->getMaxNumClients()); + $message = trans('texts.limit_clients', ['count' => Auth::user()->getMaxNumClients()]); Session::flash('error', $message); return Redirect::to('company/import_export'); } diff --git a/app/controllers/BaseController.php b/app/controllers/BaseController.php index 625790ae00..5c28d5fa1c 100755 --- a/app/controllers/BaseController.php +++ b/app/controllers/BaseController.php @@ -17,6 +17,6 @@ class BaseController extends Controller { public function __construct() { - $this->beforeFilter('csrf', array('on' => array('post', 'delete', 'put'))); + $this->beforeFilter('csrf', array('on' => array('post', 'delete', 'put'))); } } \ No newline at end of file diff --git a/app/controllers/ClientApiController.php b/app/controllers/ClientApiController.php index 94b83e2569..e1e6f3afc2 100644 --- a/app/controllers/ClientApiController.php +++ b/app/controllers/ClientApiController.php @@ -3,58 +3,46 @@ use ninja\repositories\ClientRepository; use Client; -class ClientApiController extends \BaseController { +class ClientApiController extends Controller { protected $clientRepo; public function __construct(ClientRepository $clientRepo) { - parent::__construct(); - $this->clientRepo = $clientRepo; } + public function ping() + { + $headers = Utils::getApiHeaders(); + return Response::make('', 200, $headers); + } + public function index() { - $clients = Client::scope()->get(); - - /* - $response = [ - 'status' => 200, - 'error' => false, - 'clients' => $clients->toArray() - ]; - */ + if (!Utils::isPro()) { + Redirect::to('/'); + } - $response = json_encode($clients->toArray(), JSON_PRETTY_PRINT); - $headers = [ - 'Content-Type' => 'application/json', - 'Access-Control-Allow-Origin' => '*', - 'Access-Control-Allow-Methods' => 'GET', - //'Access-Control-Allow-Headers' => 'Origin, Content-Type, Accept, Authorization, X-Requested-With', - //'Access-Control-Allow-Credentials' => 'true', - //'X-Total-Count' => 0 - //'X-Rate-Limit-Limit' - The number of allowed requests in the current period - //'X-Rate-Limit-Remaining' - The number of remaining requests in the current period - //'X-Rate-Limit-Reset' - The number of seconds left in the current period, - ]; + $clients = Client::scope()->with('contacts')->orderBy('created_at', 'desc')->get(); + $clients = Utils::remapPublicIds($clients->toArray()); - /* - 200 OK - Response to a successful GET, PUT, PATCH or DELETE. Can also be used for a POST that doesn't result in a creation. - 201 Created - Response to a POST that results in a creation. Should be combined with a Location header pointing to the location of the new resource - 204 No Content - Response to a successful request that won't be returning a body (like a DELETE request) - 304 Not Modified - Used when HTTP caching headers are in play - 400 Bad Request - The request is malformed, such as if the body does not parse - 401 Unauthorized - When no or invalid authentication details are provided. Also useful to trigger an auth popup if the API is used from a browser - 403 Forbidden - When authentication succeeded but authenticated user doesn't have access to the resource - 404 Not Found - When a non-existent resource is requested - 405 Method Not Allowed - When an HTTP method is being requested that isn't allowed for the authenticated user - 410 Gone - Indicates that the resource at this end point is no longer available. Useful as a blanket response for old API versions - 415 Unsupported Media Type - If incorrect content type was provided as part of the request - 422 Unprocessable Entity - Used for validation errors - 429 Too Many Requests - When a request is rejected due to rate limiting - */ + $response = json_encode($clients, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(count($clients)); + return Response::make($response, 200, $headers); + } + public function store() + { + if (!Utils::isPro()) { + Redirect::to('/'); + } + + $data = Input::all(); + $client = $this->clientRepo->save(false, $data, false); + + $response = json_encode($client, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(); return Response::make($response, 200, $headers); } } \ No newline at end of file diff --git a/app/controllers/IntegrationController.php b/app/controllers/IntegrationController.php new file mode 100644 index 0000000000..03676ac9a1 --- /dev/null +++ b/app/controllers/IntegrationController.php @@ -0,0 +1,29 @@ +account_id)->where('event_id', '=', $eventId)->first(); + + if (!$subscription) + { + $subscription = new Subscription; + $subscription->account_id = Auth::user()->account_id; + $subscription->event_id = $eventId; + } + + $subscription->target_url = trim(Input::get('target_url')); + $subscription->save(); + + return Response::json('{"id":'.$subscription->id.'}', 201); + } + +} \ No newline at end of file diff --git a/app/controllers/InvoiceApiController.php b/app/controllers/InvoiceApiController.php new file mode 100644 index 0000000000..ea37bbace2 --- /dev/null +++ b/app/controllers/InvoiceApiController.php @@ -0,0 +1,40 @@ +invoiceRepo = $invoiceRepo; + } + + public function index() + { + if (!Utils::isPro()) { + Redirect::to('/'); + } + + $invoices = Invoice::scope()->where('invoices.is_quote', '=', false)->orderBy('created_at', 'desc')->get(); + $invoices = Utils::remapPublicIds($invoices->toArray()); + + $response = json_encode($invoices, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(count($invoices)); + return Response::make($response, 200, $headers); + } + + /* + public function store() + { + $data = Input::all(); + $invoice = $this->invoiceRepo->save(false, $data, false); + + $response = json_encode($invoice, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(); + return Response::make($response, 200, $headers); + } + */ +} \ No newline at end of file diff --git a/app/controllers/PaymentApiController.php b/app/controllers/PaymentApiController.php new file mode 100644 index 0000000000..f244ad83b0 --- /dev/null +++ b/app/controllers/PaymentApiController.php @@ -0,0 +1,40 @@ +paymentRepo = $paymentRepo; + } + + public function index() + { + if (!Utils::isPro()) { + Redirect::to('/'); + } + + $payments = Payment::scope()->orderBy('created_at', 'desc')->get(); + $payments = Utils::remapPublicIds($payments->toArray()); + + $response = json_encode($payments, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(count($payments)); + return Response::make($response, 200, $headers); + } + + /* + public function store() + { + $data = Input::all(); + $invoice = $this->invoiceRepo->save(false, $data, false); + + $response = json_encode($invoice, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(); + return Response::make($response, 200, $headers); + } + */ +} \ No newline at end of file diff --git a/app/controllers/QuoteApiController.php b/app/controllers/QuoteApiController.php new file mode 100644 index 0000000000..d5f9e1cd68 --- /dev/null +++ b/app/controllers/QuoteApiController.php @@ -0,0 +1,40 @@ +invoiceRepo = $invoiceRepo; + } + + public function index() + { + if (!Utils::isPro()) { + Redirect::to('/'); + } + + $invoices = Invoice::scope()->where('invoices.is_quote', '=', true)->orderBy('created_at', 'desc')->get(); + $invoices = Utils::remapPublicIds($invoices->toArray()); + + $response = json_encode($invoices, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(count($invoices)); + return Response::make($response, 200, $headers); + } + + /* + public function store() + { + $data = Input::all(); + $invoice = $this->invoiceRepo->save(false, $data, false); + + $response = json_encode($invoice, JSON_PRETTY_PRINT); + $headers = Utils::getApiHeaders(); + return Response::make($response, 200, $headers); + } + */ +} \ No newline at end of file diff --git a/app/database/migrations/2014_07_24_171214_add_zapier_support.php b/app/database/migrations/2014_07_24_171214_add_zapier_support.php new file mode 100644 index 0000000000..b7bfc0a5ba --- /dev/null +++ b/app/database/migrations/2014_07_24_171214_add_zapier_support.php @@ -0,0 +1,42 @@ +increments('id'); + $table->unsignedInteger('account_id')->nullable(); + + $table->timestamps(); + $table->softDeletes(); + + $table->unsignedInteger('event_id')->nullable(); + $table->string('target_url'); + + $table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); + $table->unique( ['account_id', 'event_id'] ); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('subscriptions'); + } + +} diff --git a/app/filters.php b/app/filters.php index 0b28abcca2..80e02cdf72 100755 --- a/app/filters.php +++ b/app/filters.php @@ -119,11 +119,11 @@ Route::filter('csrf', function() { $token = Request::ajax() ? Request::header('X-CSRF-Token') : Input::get('_token'); - if (Session::token() != $token) - { - Session::flash('warning', trans('texts.session_expired')); + if (Session::token() != $token) + { + Session::flash('warning', trans('texts.session_expired')); - return Redirect::to('/'); - //throw new Illuminate\Session\TokenMismatchException; - } + return Redirect::to('/'); + //throw new Illuminate\Session\TokenMismatchException; + } }); \ No newline at end of file diff --git a/app/libraries/utils.php b/app/libraries/utils.php index 12ed6d9c25..41f10c4222 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -463,4 +463,76 @@ class Utils } return join('-', $parts); } + + public static function lookupEventId($eventName) + { + if ($eventName == 'create_client') { + return EVENT_CREATE_CLIENT; + } else if ($eventName == 'create_invoice') { + return EVENT_CREATE_INVOICE; + } else if ($eventName == 'create_quote') { + return EVENT_CREATE_QUOTE; + } else if ($eventName == 'create_payment') { + return EVENT_CREATE_PAYMENT; + } else { + return false; + } + } + + public static function notifyZapier($subscription, $data) { + $curl = curl_init(); + + $jsonEncodedData = json_encode($data->toJson()); + $opts = [ + CURLOPT_URL => $subscription->target_url, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POST => 1, + CURLOPT_POSTFIELDS => $jsonEncodedData, + CURLOPT_HTTPHEADER => ['Content-Type: application/json', 'Content-Length: ' . strlen($jsonEncodedData)] + ]; + + curl_setopt_array($curl, $opts); + + $result = curl_exec($curl); + $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); + + curl_close($curl); + + if ($status == 410) + { + $subscription->delete(); + } + } + + public static function remapPublicIds($data) { + foreach ($data as $index => $record) { + if (!isset($data[$index]['public_id'])) { + continue; + } + $data[$index]['id'] = $data[$index]['public_id']; + unset($data[$index]['public_id']); + + foreach ($record as $key => $val) { + if (is_array($val)) { + $data[$index][$key] = Utils::remapPublicIds($val); + } + } + } + return $data; + } + + public static function getApiHeaders($count = 0) { + return [ + 'Content-Type' => 'application/json', + //'Access-Control-Allow-Origin' => '*', + //'Access-Control-Allow-Methods' => 'GET', + //'Access-Control-Allow-Headers' => 'Origin, Content-Type, Accept, Authorization, X-Requested-With', + //'Access-Control-Allow-Credentials' => 'true', + 'X-Total-Count' => $count, + //'X-Rate-Limit-Limit' - The number of allowed requests in the current period + //'X-Rate-Limit-Remaining' - The number of remaining requests in the current period + //'X-Rate-Limit-Reset' - The number of seconds left in the current period, + ]; + } } \ No newline at end of file diff --git a/app/models/Account.php b/app/models/Account.php index 4767cf5dc9..d02912827f 100755 --- a/app/models/Account.php +++ b/app/models/Account.php @@ -248,4 +248,8 @@ class Account extends Eloquent return $interval->y == 0; } + public function getSubscription($eventId) + { + return Subscription::where('account_id', '=', $this->id)->where('event_id', '=', $eventId)->first(); + } } \ No newline at end of file diff --git a/app/models/Activity.php b/app/models/Activity.php index 2dde981347..517c2bd516 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -67,13 +67,18 @@ class Activity extends Eloquent return $activity; } - public static function createClient($client) + public static function createClient($client, $notify = true) { $activity = Activity::getBlank(); $activity->client_id = $client->id; $activity->activity_type_id = ACTIVITY_TYPE_CREATE_CLIENT; $activity->message = Utils::encodeActivity(Auth::user(), 'created', $client); $activity->save(); + + if ($notify) + { + Activity::checkSubscriptions(EVENT_CREATE_CLIENT, $client); + } } public static function updateClient($client) @@ -129,6 +134,8 @@ class Activity extends Eloquent $activity->balance = $client->balance; $activity->adjustment = $adjustment; $activity->save(); + + Activity::checkSubscriptions($invoice->is_quote ? EVENT_CREATE_QUOTE : EVENT_CREATE_INVOICE, $invoice); } public static function archiveInvoice($invoice) @@ -290,6 +297,8 @@ class Activity extends Eloquent $activity->balance = $client->balance; $activity->adjustment = $payment->amount * -1; $activity->save(); + + Activity::checkSubscriptions(EVENT_CREATE_PAYMENT, $payment); } public static function updatePayment($payment) @@ -429,4 +438,14 @@ class Activity extends Eloquent $activity->balance = $credit->client->balance; $activity->save(); } + + private static function checkSubscriptions($event, $data) + { + $subscription = Auth::user()->account->getSubscription($event); + + if ($subscription) + { + Utils::notifyZapier($subscription, $data); + } + } } \ No newline at end of file diff --git a/app/models/Subscription.php b/app/models/Subscription.php new file mode 100644 index 0000000000..4b7f4ba74b --- /dev/null +++ b/app/models/Subscription.php @@ -0,0 +1,7 @@ +getKey(); } @@ -173,5 +173,5 @@ class User extends ConfideUser implements UserInterface, RemindableInterface public function getRememberTokenName() { return 'remember_token'; - } + } } \ No newline at end of file diff --git a/app/ninja/repositories/ClientRepository.php b/app/ninja/repositories/ClientRepository.php index 6b7631ca44..cce8175f71 100755 --- a/app/ninja/repositories/ClientRepository.php +++ b/app/ninja/repositories/ClientRepository.php @@ -32,13 +32,22 @@ class ClientRepository return $query; } - public function save($publicId, $data) - { - if ($publicId == "-1") + public function save($publicId, $data, $notify = true) + { + $contact = isset($data['contacts']) ? (array)$data['contacts'][0] : (isset($data['contact']) ? $data['contact'] : []); + $validator = \Validator::make($contact, ['email' => 'required|email']); + if ($validator->fails()) { + dd($validator->messages()); + return false; + } + + if (!$publicId || $publicId == "-1") { $client = Client::createNew(); + $client->currency_id = 1; $contact = Contact::createNew(); $contact->is_primary = true; + $contact->send_invoice = true; } else { @@ -46,66 +55,128 @@ class ClientRepository $contact = $client->contacts()->where('is_primary', '=', true)->firstOrFail(); } + if (isset($data['name'])) { + $client->name = trim($data['name']); + } + if (isset($data['work_phone'])) { + $client->work_phone = trim($data['work_phone']); + } + if (isset($data['custom_value1'])) { + $client->custom_value1 = trim($data['custom_value1']); + } + if (isset($data['custom_value2'])) { + $client->custom_value2 = trim($data['custom_value2']); + } + if (isset($data['address1'])) { + $client->address1 = trim($data['address1']); + } + if (isset($data['address2'])) { + $client->address2 = trim($data['address2']); + } + if (isset($data['city'])) { + $client->city = trim($data['city']); + } + if (isset($data['state'])) { + $client->state = trim($data['state']); + } + if (isset($data['postal_code'])) { + $client->postal_code = trim($data['postal_code']); + } + if (isset($data['country_id'])) { + $client->country_id = $data['country_id'] ? $data['country_id'] : null; + } + if (isset($data['private_notes'])) { + $client->private_notes = trim($data['private_notes']); + } + if (isset($data['size_id'])) { + $client->size_id = $data['size_id'] ? $data['size_id'] : null; + } + if (isset($data['industry_id'])) { + $client->industry_id = $data['industry_id'] ? $data['industry_id'] : null; + } + if (isset($data['currency_id'])) { + $client->currency_id = $data['currency_id'] ? $data['currency_id'] : 1; + } + if (isset($data['payment_terms'])) { + $client->payment_terms = $data['payment_terms']; + } + if (isset($data['website'])) { + $client->website = trim($data['website']); + } - $client->name = trim($data['name']); - $client->work_phone = trim($data['work_phone']); - $client->custom_value1 = trim($data['custom_value1']); - $client->custom_value2 = trim($data['custom_value2']); - $client->address1 = trim($data['address1']); - $client->address2 = trim($data['address2']); - $client->city = trim($data['city']); - $client->state = trim($data['state']); - $client->postal_code = trim($data['postal_code']); - $client->country_id = $data['country_id'] ? $data['country_id'] : null; - $client->private_notes = trim($data['private_notes']); - $client->size_id = $data['size_id'] ? $data['size_id'] : null; - $client->industry_id = $data['industry_id'] ? $data['industry_id'] : null; - $client->currency_id = $data['currency_id'] ? $data['currency_id'] : 1; - $client->payment_terms = $data['payment_terms']; - $client->website = trim($data['website']); $client->save(); $isPrimary = true; $contactIds = []; - foreach ($data['contacts'] as $record) + if (isset($data['contact'])) { - $record = (array) $record; - - if ($publicId != "-1" && isset($record['public_id']) && $record['public_id']) - { - $contact = Contact::scope($record['public_id'])->firstOrFail(); + $info = $data['contact']; + if (isset($info['email'])) { + $contact->email = trim(strtolower($info['email'])); } - else - { - $contact = Contact::createNew(); + if (isset($info['first_name'])) { + $contact->first_name = trim($info['first_name']); } - - $contact->email = trim(strtolower($record['email'])); - $contact->first_name = trim($record['first_name']); - $contact->last_name = trim($record['last_name']); - $contact->phone = trim($record['phone']); - $contact->is_primary = $isPrimary; - $contact->send_invoice = $record['send_invoice']; - $isPrimary = false; - + if (isset($info['last_name'])) { + $contact->last_name = trim($info['last_name']); + } + if (isset($info['phone'])) { + $contact->phone = trim($info['phone']); + } + $contact->is_primary = true; + $contact->send_invoice = true; $client->contacts()->save($contact); - $contactIds[] = $contact->public_id; } - - foreach ($client->contacts as $contact) + else { - if (!in_array($contact->public_id, $contactIds)) - { - $contact->delete(); + foreach ($data['contacts'] as $record) + { + $record = (array) $record; + + if ($publicId != "-1" && isset($record['public_id']) && $record['public_id']) + { + $contact = Contact::scope($record['public_id'])->firstOrFail(); + } + else + { + $contact = Contact::createNew(); + } + + if (isset($record['email'])) { + $contact->email = trim(strtolower($record['email'])); + } + if (isset($record['first_name'])) { + $contact->first_name = trim($record['first_name']); + } + if (isset($record['last_name'])) { + $contact->last_name = trim($record['last_name']); + } + if (isset($record['phone'])) { + $contact->phone = trim($record['phone']); + } + $contact->is_primary = $isPrimary; + $contact->send_invoice = isset($record['send_invoice']) ? $record['send_invoice'] : true; + $isPrimary = false; + + $client->contacts()->save($contact); + $contactIds[] = $contact->public_id; + } + + foreach ($client->contacts as $contact) + { + if (!in_array($contact->public_id, $contactIds)) + { + $contact->delete(); + } } } $client->save(); - if ($publicId == "-1") + if (!$publicId || $publicId == "-1") { - \Activity::createClient($client); + \Activity::createClient($client, $notify); } return $client; diff --git a/app/ninja/repositories/InvoiceRepository.php b/app/ninja/repositories/InvoiceRepository.php index 8b416314b2..f64546d973 100755 --- a/app/ninja/repositories/InvoiceRepository.php +++ b/app/ninja/repositories/InvoiceRepository.php @@ -154,30 +154,30 @@ class InvoiceRepository { $contact = (array) $input->client->contacts[0]; $rules = ['email' => 'required|email']; - $validator = \Validator::make($contact, $rules); + $validator = \Validator::make($contact, $rules); - if ($validator->fails()) - { - return $validator; - } + if ($validator->fails()) + { + return $validator; + } - $invoice = (array) $input; - $invoiceId = isset($invoice['public_id']) && $invoice['public_id'] ? Invoice::getPrivateId($invoice['public_id']) : null; - $rules = ['invoice_number' => 'required|unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id]; + $invoice = (array) $input; + $invoiceId = isset($invoice['public_id']) && $invoice['public_id'] ? Invoice::getPrivateId($invoice['public_id']) : null; + $rules = ['invoice_number' => 'required|unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id]; - if ($invoice['is_recurring'] && $invoice['start_date'] && $invoice['end_date']) - { - $rules['end_date'] = 'after:' . $invoice['start_date']; - } + if ($invoice['is_recurring'] && $invoice['start_date'] && $invoice['end_date']) + { + $rules['end_date'] = 'after:' . $invoice['start_date']; + } - $validator = \Validator::make($invoice, $rules); + $validator = \Validator::make($invoice, $rules); - if ($validator->fails()) - { - return $validator; - } + if ($validator->fails()) + { + return $validator; + } - return false; + return false; } public function save($publicId, $data, $entityType) diff --git a/app/routes.php b/app/routes.php index 781e1732fc..cd7309d5cb 100755 --- a/app/routes.php +++ b/app/routes.php @@ -1,5 +1,6 @@ 'auth'), function() Route::post('credits/bulk', 'CreditController@bulk'); }); -// Route group for API versioning +// Route group for API Route::group(array('prefix' => 'api/v1', 'before' => 'auth.basic'), function() { - Route::resource('clients', 'ClientApiController'); + Route::resource('ping', 'ClientApiController@ping'); + Route::resource('clients', 'ClientApiController'); + Route::resource('invoices', 'InvoiceApiController'); + Route::resource('quotes', 'QuoteApiController'); + Route::resource('payments', 'PaymentApiController'); }); +Route::group(array('before' => 'auth.basic'), function() +{ + Route::post('api/hooks', 'IntegrationController@subscribe'); +}); define('CONTACT_EMAIL', 'contact@invoiceninja.com'); define('CONTACT_NAME', 'Invoice Ninja'); @@ -215,12 +225,17 @@ define('GATEWAY_PAYPAL_EXPRESS', 17); define('GATEWAY_BEANSTREAM', 29); define('GATEWAY_PSIGATE', 30); +define('EVENT_CREATE_CLIENT', 1); +define('EVENT_CREATE_INVOICE', 2); +define('EVENT_CREATE_QUOTE', 3); +define('EVENT_CREATE_PAYMENT', 4); + define('REQUESTED_PRO_PLAN', 'REQUESTED_PRO_PLAN'); define('NINJA_ACCOUNT_KEY', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h'); define('NINJA_GATEWAY_ID', GATEWAY_AUTHORIZE_NET); define('NINJA_GATEWAY_CONFIG', '{"apiLoginId":"626vWcD5","transactionKey":"4bn26TgL9r4Br4qJ","testMode":"","developerMode":""}'); define('NINJA_URL', 'https://www.invoiceninja.com'); -define('NINJA_VERSION', '1.3.0'); +define('NINJA_VERSION', '1.3.1'); define('PRO_PLAN_PRICE', 50); define('LICENSE_PRICE', 30); @@ -380,3 +395,5 @@ if (Auth::check() && Auth::user()->id === 1) } */ + + diff --git a/app/start/global.php b/app/start/global.php index 3cbc1a5ac7..be0bfd5858 100755 --- a/app/start/global.php +++ b/app/start/global.php @@ -63,6 +63,10 @@ App::error(function(Exception $exception, $code) Utils::logError($exception . ' ' . $code); return Response::view('error', ['hideHeader' => true, 'error' => "A {$code} error occurred."], $code); } + else if (Utils::isNinjaDev()) + { + return "{$exception->getFile()}:{$exception->getLine()} => {$exception->getMessage()}"; + } else { return null; diff --git a/app/views/users/reset_password.blade.php b/app/views/users/reset_password.blade.php index df72ae24a9..54255488c7 100755 --- a/app/views/users/reset_password.blade.php +++ b/app/views/users/reset_password.blade.php @@ -57,7 +57,7 @@ 'password_confirmation' => 'required', )); }} -

Set Passord

  +

Set Password

 

diff --git a/bootstrap/start.php b/bootstrap/start.php index d265f8b1b7..1ec68eee06 100755 --- a/bootstrap/start.php +++ b/bootstrap/start.php @@ -32,6 +32,14 @@ if (!function_exists('gethostname')) { } } +// Fortrabbit HTTP AUTH CODE +if (!empty($_SERVER['REMOTE_USER'])) { + list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode( + ':', + base64_decode(substr($_SERVER['REMOTE_USER'], 6)) + ); +} + /* |-------------------------------------------------------------------------- diff --git a/composer.lock b/composer.lock index 69d6f05050..143f851a09 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,9 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" + "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file" ], - "hash": "3378ea7f0ef6ab58c78e0c21be7203bb", + "hash": "941a62dd9c259f138de7d7fa18a27ff5", "packages": [ { "name": "anahkiasen/former", @@ -95,7 +94,7 @@ ], "authors": [ { - "name": "Anahkiasen", + "name": "Maxime Fabre", "email": "ehtnam6@gmail.com" } ], @@ -157,18 +156,17 @@ "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-debugbar.git", - "reference": "f06e541b7dedf30c3aa27a26c3bf3629e677f279" + "reference": "0ca928a9437c5d5754b22612147ed2b2958c1e4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/f06e541b7dedf30c3aa27a26c3bf3629e677f279", - "reference": "f06e541b7dedf30c3aa27a26c3bf3629e677f279", + "url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/0ca928a9437c5d5754b22612147ed2b2958c1e4d", + "reference": "0ca928a9437c5d5754b22612147ed2b2958c1e4d", "shasum": "" }, "require": { - "illuminate/filesystem": "~4.0", - "illuminate/support": "~4.0", - "maximebf/debugbar": "1.9.x", + "laravel/framework": "~4.0", + "maximebf/debugbar": "~1.9", "php": ">=5.3.0", "symfony/finder": "~2.3" }, @@ -201,7 +199,7 @@ "profiler", "webprofiler" ], - "time": "2014-06-17 08:08:38" + "time": "2014-07-22 13:36:20" }, { "name": "chumper/datatable", @@ -588,37 +586,33 @@ }, { "name": "intervention/image", - "version": "dev-master", + "version": "1.6.x-dev", "source": { "type": "git", "url": "https://github.com/Intervention/image.git", - "reference": "edd507dacfacab7fcfcee6c5fcfad3335d0ec85f" + "reference": "432f3b28ea08455146b157c6bfdebf4ef5bc661e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Intervention/image/zipball/edd507dacfacab7fcfcee6c5fcfad3335d0ec85f", - "reference": "edd507dacfacab7fcfcee6c5fcfad3335d0ec85f", + "url": "https://api.github.com/repos/Intervention/image/zipball/432f3b28ea08455146b157c6bfdebf4ef5bc661e", + "reference": "432f3b28ea08455146b157c6bfdebf4ef5bc661e", "shasum": "" }, "require": { - "ext-fileinfo": "*", - "illuminate/config": "4.*", + "ext-gd": "*", "illuminate/support": "4.*", "php": ">=5.3.0" }, "require-dev": { - "mockery/mockery": "0.9.*", - "phpunit/phpunit": "3.*" + "phpunit/phpunit": "4.1.*" }, "suggest": { - "ext-gd": "to use GD library based image processing.", - "ext-imagick": "to use Imagick based image processing.", "intervention/imagecache": "Caching extension for the Intervention Image library" }, "type": "library", "autoload": { "psr-0": { - "Intervention\\Image\\": "src/" + "Intervention\\Image": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -637,12 +631,11 @@ "keywords": [ "gd", "image", - "imagick", "laravel", "thumbnail", "watermark" ], - "time": "2014-06-16 09:52:34" + "time": "2014-06-07 16:25:27" }, { "name": "ircmaxell/password-compat", @@ -908,17 +901,129 @@ "time": "2014-02-25 20:39:04" }, { - "name": "maximebf/debugbar", - "version": "1.9.14", + "name": "league/oauth2-server", + "version": "2.1.3", "source": { "type": "git", - "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "ab02c692d2bdad1009639f6ba319576af590620c" + "url": "https://github.com/thephpleague/oauth2-server.git", + "reference": "a9b52ab56a5bac383f7d300aec2e234285d7f861" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/ab02c692d2bdad1009639f6ba319576af590620c", - "reference": "ab02c692d2bdad1009639f6ba319576af590620c", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/a9b52ab56a5bac383f7d300aec2e234285d7f861", + "reference": "a9b52ab56a5bac383f7d300aec2e234285d7f861", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "replace": { + "league/oauth2server": "*", + "lncd/oauth2": "*" + }, + "require-dev": { + "mockery/mockery": ">=0.7.2" + }, + "suggest": { + "zetacomponents/database": "Allows use of the build in PDO storage classes" + }, + "type": "library", + "autoload": { + "psr-0": { + "League\\OAuth2\\Server": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Bilbie", + "email": "hello@alexbilbie.com", + "homepage": "http://www.alexbilbie.com", + "role": "Developer" + } + ], + "description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.", + "homepage": "https://github.com/php-loep/oauth2-server", + "keywords": [ + "Authentication", + "api", + "authorization", + "oauth", + "oauth2", + "resource", + "server" + ], + "time": "2014-05-23 15:29:49" + }, + { + "name": "lucadegasperi/oauth2-server-laravel", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/lucadegasperi/oauth2-server-laravel.git", + "reference": "abd252c22a84329532c0cd1e558842a82f710592" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lucadegasperi/oauth2-server-laravel/zipball/abd252c22a84329532c0cd1e558842a82f710592", + "reference": "abd252c22a84329532c0cd1e558842a82f710592", + "shasum": "" + }, + "require": { + "league/oauth2-server": "2.1.x", + "php": ">=5.3.0" + }, + "require-dev": { + "mockery/mockery": ">=0.7.2", + "orchestra/testbench": "2.0.*", + "phpunit/phpunit": "3.7.22", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/migrations", + "tests/TestCase.php" + ], + "psr-0": { + "LucaDegasperi\\OAuth2Server": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luca Degasperi", + "email": "packages@lucadegasperi.com" + } + ], + "description": "A Laravel 4 wrapper for the popular OAuth 2.0 Server package league/oauth2-server", + "keywords": [ + "api", + "laravel", + "oauth", + "oauth2", + "server" + ], + "time": "2014-05-30 16:48:54" + }, + { + "name": "maximebf/debugbar", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/maximebf/php-debugbar.git", + "reference": "e4f9adb2aceecde1acde860d480146a8d5e1ccac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/e4f9adb2aceecde1acde860d480146a8d5e1ccac", + "reference": "e4f9adb2aceecde1acde860d480146a8d5e1ccac", "shasum": "" }, "require": { @@ -934,6 +1039,11 @@ "predis/predis": "Redis storage" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-0": { "DebugBar": "src/" @@ -955,7 +1065,7 @@ "keywords": [ "debug" ], - "time": "2014-04-25 16:30:40" + "time": "2014-07-02 08:26:20" }, { "name": "monolog/monolog", @@ -963,18 +1073,21 @@ "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23" + "reference": "61145103b6521d04c0386d1ea6899437df9d45e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/25b16e801979098cb2f120e697bfce454b18bf23", - "reference": "25b16e801979098cb2f120e697bfce454b18bf23", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/61145103b6521d04c0386d1ea6899437df9d45e2", + "reference": "61145103b6521d04c0386d1ea6899437df9d45e2", "shasum": "" }, "require": { "php": ">=5.3.0", "psr/log": "~1.0" }, + "provide": { + "psr/log-implementation": "1.0.0" + }, "require-dev": { "aws/aws-sdk-php": "~2.4, >2.4.8", "doctrine/couchdb": "~1.0@dev", @@ -1012,8 +1125,7 @@ { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be", - "role": "Developer" + "homepage": "http://seld.be" } ], "description": "Sends your logs to files, sockets, inboxes, databases and various web services", @@ -1023,27 +1135,27 @@ "logging", "psr-3" ], - "time": "2014-06-04 16:30:04" + "time": "2014-07-19 19:11:34" }, { "name": "nesbot/carbon", - "version": "1.9.0", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "b94de7192b01d0e80794eae984dcc773220ab0dc" + "reference": "9b42a1aec56011c2ac4d75c0ddad0794762344fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/b94de7192b01d0e80794eae984dcc773220ab0dc", - "reference": "b94de7192b01d0e80794eae984dcc773220ab0dc", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/9b42a1aec56011c2ac4d75c0ddad0794762344fc", + "reference": "9b42a1aec56011c2ac4d75c0ddad0794762344fc", "shasum": "" }, "require": { "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "3.7.*" + "phpunit/phpunit": "~4.0" }, "type": "library", "autoload": { @@ -1069,7 +1181,7 @@ "datetime", "time" ], - "time": "2014-05-13 02:29:30" + "time": "2014-07-18 03:44:47" }, { "name": "nikic/php-parser", @@ -1077,12 +1189,12 @@ "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "5960ecfc105011b8d1bfedf7647b4b8989dbcb4c" + "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5960ecfc105011b8d1bfedf7647b4b8989dbcb4c", - "reference": "5960ecfc105011b8d1bfedf7647b4b8989dbcb4c", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/ef70767475434bdb3615b43c327e2cae17ef12eb", + "reference": "ef70767475434bdb3615b43c327e2cae17ef12eb", "shasum": "" }, "require": { @@ -1114,7 +1226,7 @@ "parser", "php" ], - "time": "2014-04-19 20:26:05" + "time": "2014-07-23 18:24:17" }, { "name": "omnipay/2checkout", @@ -1855,12 +1967,12 @@ "source": { "type": "git", "url": "https://github.com/omnipay/mollie.git", - "reference": "59bdc0afdf9ec432ce32e10d50bd623756fc228e" + "reference": "2f1f3734a7024a833ff02e983789c2ea2453aee7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/omnipay/mollie/zipball/59bdc0afdf9ec432ce32e10d50bd623756fc228e", - "reference": "59bdc0afdf9ec432ce32e10d50bd623756fc228e", + "url": "https://api.github.com/repos/omnipay/mollie/zipball/2f1f3734a7024a833ff02e983789c2ea2453aee7", + "reference": "2f1f3734a7024a833ff02e983789c2ea2453aee7", "shasum": "" }, "require": { @@ -1904,7 +2016,7 @@ "pay", "payment" ], - "time": "2014-04-14 11:26:02" + "time": "2014-07-17 15:56:03" }, { "name": "omnipay/multisafepay", @@ -2826,12 +2938,12 @@ "source": { "type": "git", "url": "https://github.com/patricktalmadge/bootstrapper.git", - "reference": "6c38f7efdb2d909c8d43dd33bb8fe0df276b20c1" + "reference": "aff9d17f31812a2b2f4ca355d7796e6890eedc3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/patricktalmadge/bootstrapper/zipball/6c38f7efdb2d909c8d43dd33bb8fe0df276b20c1", - "reference": "6c38f7efdb2d909c8d43dd33bb8fe0df276b20c1", + "url": "https://api.github.com/repos/patricktalmadge/bootstrapper/zipball/aff9d17f31812a2b2f4ca355d7796e6890eedc3f", + "reference": "aff9d17f31812a2b2f4ca355d7796e6890eedc3f", "shasum": "" }, "require": { @@ -2874,7 +2986,7 @@ "bootstrap", "laravel" ], - "time": "2014-06-17 15:45:54" + "time": "2014-06-23 09:37:18" }, { "name": "phpseclib/phpseclib", @@ -2882,12 +2994,12 @@ "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "9716d9b7e5db7a42275fbc09f9558240098f2f18" + "reference": "880bc9d9e60a4817ca138b8f5377e313741bf7db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/9716d9b7e5db7a42275fbc09f9558240098f2f18", - "reference": "9716d9b7e5db7a42275fbc09f9558240098f2f18", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/880bc9d9e60a4817ca138b8f5377e313741bf7db", + "reference": "880bc9d9e60a4817ca138b8f5377e313741bf7db", "shasum": "" }, "require": { @@ -2896,6 +3008,7 @@ "require-dev": { "phing/phing": "2.7.*", "phpunit/phpunit": "4.0.*", + "sami/sami": "1.*", "squizlabs/php_codesniffer": "1.*" }, "suggest": { @@ -2971,7 +3084,7 @@ "x.509", "x509" ], - "time": "2014-06-17 09:37:36" + "time": "2014-07-24 15:32:38" }, { "name": "predis/predis", @@ -2979,12 +3092,12 @@ "source": { "type": "git", "url": "https://github.com/nrk/predis.git", - "reference": "18853d1dbb7d35f7c60bcb161447b16c0753e2a3" + "reference": "8dd7f40d2110083724f6672035e04d85132eea9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nrk/predis/zipball/18853d1dbb7d35f7c60bcb161447b16c0753e2a3", - "reference": "18853d1dbb7d35f7c60bcb161447b16c0753e2a3", + "url": "https://api.github.com/repos/nrk/predis/zipball/8dd7f40d2110083724f6672035e04d85132eea9f", + "reference": "8dd7f40d2110083724f6672035e04d85132eea9f", "shasum": "" }, "require": { @@ -3021,7 +3134,7 @@ "predis", "redis" ], - "time": "2014-06-10 08:58:02" + "time": "2014-07-23 10:43:29" }, { "name": "psr/log", @@ -3151,9 +3264,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" }, { "name": "Chris Corbyn" @@ -3174,12 +3285,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/BrowserKit.git", - "reference": "5c80003d5772de6120b5429f4b2f6e22957d4a07" + "reference": "6ff8827c973325e0f1d53ae631adf991a2fdc198" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/5c80003d5772de6120b5429f4b2f6e22957d4a07", - "reference": "5c80003d5772de6120b5429f4b2f6e22957d4a07", + "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/6ff8827c973325e0f1d53ae631adf991a2fdc198", + "reference": "6ff8827c973325e0f1d53ae631adf991a2fdc198", "shasum": "" }, "require": { @@ -3222,7 +3333,7 @@ ], "description": "Symfony BrowserKit Component", "homepage": "http://symfony.com", - "time": "2014-05-12 09:27:48" + "time": "2014-07-09 09:04:55" }, { "name": "symfony/console", @@ -3231,12 +3342,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Console.git", - "reference": "24f723436e62598c9dddee2a8573d6992504dc5d" + "reference": "29ef7af8aa6e3c015445f34291ccab9b8019085b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Console/zipball/24f723436e62598c9dddee2a8573d6992504dc5d", - "reference": "24f723436e62598c9dddee2a8573d6992504dc5d", + "url": "https://api.github.com/repos/symfony/Console/zipball/29ef7af8aa6e3c015445f34291ccab9b8019085b", + "reference": "29ef7af8aa6e3c015445f34291ccab9b8019085b", "shasum": "" }, "require": { @@ -3277,7 +3388,7 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", - "time": "2014-05-14 21:48:29" + "time": "2014-07-09 12:44:38" }, { "name": "symfony/css-selector", @@ -3286,12 +3397,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/CssSelector.git", - "reference": "268d0a51166edaf84dfcf043c57f273685cb7c93" + "reference": "52c35be379ec341c15d2edc7f798f7fd69708645" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/CssSelector/zipball/268d0a51166edaf84dfcf043c57f273685cb7c93", - "reference": "268d0a51166edaf84dfcf043c57f273685cb7c93", + "url": "https://api.github.com/repos/symfony/CssSelector/zipball/52c35be379ec341c15d2edc7f798f7fd69708645", + "reference": "52c35be379ec341c15d2edc7f798f7fd69708645", "shasum": "" }, "require": { @@ -3330,7 +3441,7 @@ ], "description": "Symfony CssSelector Component", "homepage": "http://symfony.com", - "time": "2014-05-12 09:27:48" + "time": "2014-07-09 09:04:55" }, { "name": "symfony/debug", @@ -3339,12 +3450,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Debug.git", - "reference": "6e721ae2cd7bde0f8dfa9c3186808a6c4140469c" + "reference": "c9532f402136fcaab781791bb2897a0d674456ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Debug/zipball/6e721ae2cd7bde0f8dfa9c3186808a6c4140469c", - "reference": "6e721ae2cd7bde0f8dfa9c3186808a6c4140469c", + "url": "https://api.github.com/repos/symfony/Debug/zipball/c9532f402136fcaab781791bb2897a0d674456ee", + "reference": "c9532f402136fcaab781791bb2897a0d674456ee", "shasum": "" }, "require": { @@ -3387,7 +3498,7 @@ ], "description": "Symfony Debug Component", "homepage": "http://symfony.com", - "time": "2014-04-30 06:22:28" + "time": "2014-07-09 09:04:55" }, { "name": "symfony/dom-crawler", @@ -3396,12 +3507,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/DomCrawler.git", - "reference": "277c9b7763045d2e5b4e741e59d27415fa28d886" + "reference": "503b3de47f93ac9549218570acfe3f5859cafdff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/277c9b7763045d2e5b4e741e59d27415fa28d886", - "reference": "277c9b7763045d2e5b4e741e59d27415fa28d886", + "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/503b3de47f93ac9549218570acfe3f5859cafdff", + "reference": "503b3de47f93ac9549218570acfe3f5859cafdff", "shasum": "" }, "require": { @@ -3442,7 +3553,7 @@ ], "description": "Symfony DomCrawler Component", "homepage": "http://symfony.com", - "time": "2014-06-12 10:00:57" + "time": "2014-07-09 09:04:55" }, { "name": "symfony/event-dispatcher", @@ -3451,12 +3562,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", - "reference": "7a4f4b42886f8c2e35acb1071f157a0b8eb1bd39" + "reference": "c2f8a5d3181736d107d6622a536fbdcd55436674" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/7a4f4b42886f8c2e35acb1071f157a0b8eb1bd39", - "reference": "7a4f4b42886f8c2e35acb1071f157a0b8eb1bd39", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/c2f8a5d3181736d107d6622a536fbdcd55436674", + "reference": "c2f8a5d3181736d107d6622a536fbdcd55436674", "shasum": "" }, "require": { @@ -3501,7 +3612,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", - "time": "2014-05-23 14:36:49" + "time": "2014-07-09 09:06:26" }, { "name": "symfony/filesystem", @@ -3510,12 +3621,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", - "reference": "8ec53ca0a09cf07b58a62590b67166f4a39af81b" + "reference": "0eb05b75932460ef615b926caac9f6086cc022f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Filesystem/zipball/8ec53ca0a09cf07b58a62590b67166f4a39af81b", - "reference": "8ec53ca0a09cf07b58a62590b67166f4a39af81b", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/0eb05b75932460ef615b926caac9f6086cc022f5", + "reference": "0eb05b75932460ef615b926caac9f6086cc022f5", "shasum": "" }, "require": { @@ -3550,7 +3661,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", - "time": "2014-05-23 14:36:49" + "time": "2014-07-09 14:44:54" }, { "name": "symfony/finder", @@ -3559,12 +3670,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Finder.git", - "reference": "46295af1b1e24304b35d5f20f1bf1ec0c2c4934a" + "reference": "b495517531feb9f27c35991d0ed606ffb210faea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Finder/zipball/46295af1b1e24304b35d5f20f1bf1ec0c2c4934a", - "reference": "46295af1b1e24304b35d5f20f1bf1ec0c2c4934a", + "url": "https://api.github.com/repos/symfony/Finder/zipball/b495517531feb9f27c35991d0ed606ffb210faea", + "reference": "b495517531feb9f27c35991d0ed606ffb210faea", "shasum": "" }, "require": { @@ -3599,7 +3710,7 @@ ], "description": "Symfony Finder Component", "homepage": "http://symfony.com", - "time": "2014-05-22 13:46:01" + "time": "2014-07-15 14:07:10" }, { "name": "symfony/http-foundation", @@ -3608,12 +3719,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/HttpFoundation.git", - "reference": "4dbd3a116c8effa12b927a92b576845c4bddfbef" + "reference": "68abe34601c519359b60363b99c29ecfb6679bc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/4dbd3a116c8effa12b927a92b576845c4bddfbef", - "reference": "4dbd3a116c8effa12b927a92b576845c4bddfbef", + "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/68abe34601c519359b60363b99c29ecfb6679bc4", + "reference": "68abe34601c519359b60363b99c29ecfb6679bc4", "shasum": "" }, "require": { @@ -3654,7 +3765,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "http://symfony.com", - "time": "2014-06-16 09:30:02" + "time": "2014-07-15 14:07:10" }, { "name": "symfony/http-kernel", @@ -3663,12 +3774,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/HttpKernel.git", - "reference": "1bf2554713702ed304a57cc12c4a674403dadd1f" + "reference": "28666d56db07ca4869fdf940c1f7883adcd1a91d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/1bf2554713702ed304a57cc12c4a674403dadd1f", - "reference": "1bf2554713702ed304a57cc12c4a674403dadd1f", + "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/28666d56db07ca4869fdf940c1f7883adcd1a91d", + "reference": "28666d56db07ca4869fdf940c1f7883adcd1a91d", "shasum": "" }, "require": { @@ -3714,20 +3825,18 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony HttpKernel Component", "homepage": "http://symfony.com", - "time": "2014-06-01 15:15:23" + "time": "2014-07-15 20:38:14" }, { "name": "symfony/process", @@ -3736,12 +3845,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "b6fd92d337a6038e8dfc8a6532c99916f8b646ac" + "reference": "63856ca1129b4ed8ac15d936a9dac2fe11471300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/b6fd92d337a6038e8dfc8a6532c99916f8b646ac", - "reference": "b6fd92d337a6038e8dfc8a6532c99916f8b646ac", + "url": "https://api.github.com/repos/symfony/Process/zipball/63856ca1129b4ed8ac15d936a9dac2fe11471300", + "reference": "63856ca1129b4ed8ac15d936a9dac2fe11471300", "shasum": "" }, "require": { @@ -3763,20 +3872,18 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2014-06-12 10:00:57" + "time": "2014-07-24 16:59:59" }, { "name": "symfony/routing", @@ -3785,12 +3892,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Routing.git", - "reference": "74229f66e16bce6d2415ca44d4756f8e7ea880f8" + "reference": "d290f15b7083cee926e17299ab6889210058b30e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Routing/zipball/74229f66e16bce6d2415ca44d4756f8e7ea880f8", - "reference": "74229f66e16bce6d2415ca44d4756f8e7ea880f8", + "url": "https://api.github.com/repos/symfony/Routing/zipball/d290f15b7083cee926e17299ab6889210058b30e", + "reference": "d290f15b7083cee926e17299ab6889210058b30e", "shasum": "" }, "require": { @@ -3844,7 +3951,7 @@ "uri", "url" ], - "time": "2014-04-23 14:04:21" + "time": "2014-07-09 09:04:55" }, { "name": "symfony/translation", @@ -3853,12 +3960,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Translation.git", - "reference": "9a3941444487ea57acd38f5c61bee1e0c3f69293" + "reference": "71609ff98581944cd1c23cc23042621c2b5a2df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Translation/zipball/9a3941444487ea57acd38f5c61bee1e0c3f69293", - "reference": "9a3941444487ea57acd38f5c61bee1e0c3f69293", + "url": "https://api.github.com/repos/symfony/Translation/zipball/71609ff98581944cd1c23cc23042621c2b5a2df9", + "reference": "71609ff98581944cd1c23cc23042621c2b5a2df9", "shasum": "" }, "require": { @@ -3888,20 +3995,18 @@ "MIT" ], "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, { "name": "Symfony Community", "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" } ], "description": "Symfony Translation Component", "homepage": "http://symfony.com", - "time": "2014-05-22 13:46:01" + "time": "2014-07-24 16:59:59" }, { "name": "webpatser/laravel-countries", @@ -3909,12 +4014,12 @@ "source": { "type": "git", "url": "https://github.com/webpatser/laravel-countries.git", - "reference": "bbd7cea0461bcaf034f957e04a0f830a13552bef" + "reference": "82983e90bf14ed0c9ec3976bd616a01dd62c984b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webpatser/laravel-countries/zipball/bbd7cea0461bcaf034f957e04a0f830a13552bef", - "reference": "bbd7cea0461bcaf034f957e04a0f830a13552bef", + "url": "https://api.github.com/repos/webpatser/laravel-countries/zipball/82983e90bf14ed0c9ec3976bd616a01dd62c984b", + "reference": "82983e90bf14ed0c9ec3976bd616a01dd62c984b", "shasum": "" }, "require": { @@ -3953,7 +4058,7 @@ "iso_3166_3", "laravel" ], - "time": "2014-06-14 11:46:12" + "time": "2014-07-24 13:26:08" }, { "name": "zizaco/confide", @@ -4023,12 +4128,12 @@ "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "40c4e46e3225dbb104d654ad83e569beec22c326" + "reference": "f6b802a6bbfd0b852eba0dd477704df75608cec7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/40c4e46e3225dbb104d654ad83e569beec22c326", - "reference": "40c4e46e3225dbb104d654ad83e569beec22c326", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/f6b802a6bbfd0b852eba0dd477704df75608cec7", + "reference": "f6b802a6bbfd0b852eba0dd477704df75608cec7", "shasum": "" }, "require": { @@ -4084,7 +4189,7 @@ "functional testing", "unit testing" ], - "time": "2014-06-06 00:12:20" + "time": "2014-07-04 10:31:02" }, { "name": "facebook/webdriver", @@ -4132,17 +4237,17 @@ "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "c57f300af7b288306a3665c89b930ea9b70ba214" + "reference": "8e90e67c65b0dc08ef608c8993d6cb08b94b4b1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/c57f300af7b288306a3665c89b930ea9b70ba214", - "reference": "c57f300af7b288306a3665c89b930ea9b70ba214", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/8e90e67c65b0dc08ef608c8993d6cb08b94b4b1a", + "reference": "8e90e67c65b0dc08ef608c8993d6cb08b94b4b1a", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/streams": "~1.0", + "guzzlehttp/streams": "~1.4", "php": ">=5.4.0" }, "require-dev": { @@ -4189,20 +4294,20 @@ "rest", "web service" ], - "time": "2014-06-10 17:18:37" + "time": "2014-07-23 19:40:03" }, { "name": "guzzlehttp/streams", - "version": "1.1.0", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/guzzle/streams.git", - "reference": "cf0c8c33ca95cc147efba4c714f630ee44767180" + "reference": "3b761a328e5ed6ed519e960aded95d7acbe77894" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/streams/zipball/cf0c8c33ca95cc147efba4c714f630ee44767180", - "reference": "cf0c8c33ca95cc147efba4c714f630ee44767180", + "url": "https://api.github.com/repos/guzzle/streams/zipball/3b761a328e5ed6ed519e960aded95d7acbe77894", + "reference": "3b761a328e5ed6ed519e960aded95d7acbe77894", "shasum": "" }, "require": { @@ -4214,7 +4319,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.4.x-dev" } }, "autoload": { @@ -4242,7 +4347,120 @@ "Guzzle", "stream" ], - "time": "2014-04-03 04:48:24" + "time": "2014-07-19 18:43:42" + }, + { + "name": "ocramius/instantiator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/Instantiator.git", + "reference": "cc754c2289ffd4483c319f6ed6ee88ce21676f64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/Instantiator/zipball/cc754c2289ffd4483c319f6ed6ee88ce21676f64", + "reference": "cc754c2289ffd4483c319f6ed6ee88ce21676f64", + "shasum": "" + }, + "require": { + "ocramius/lazy-map": "1.0.*", + "php": "~5.3" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Instantiator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://marco-pivetta.com/", + "role": "Developer" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/Ocramius/Instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2014-06-15 11:44:46" + }, + { + "name": "ocramius/lazy-map", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/LazyMap.git", + "reference": "5c77102e225d225ae2d74d5f2cc488527834b821" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/LazyMap/zipball/5c77102e225d225ae2d74d5f2cc488527834b821", + "reference": "5c77102e225d225ae2d74d5f2cc488527834b821", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "athletic/athletic": "~0.1.7", + "phpmd/phpmd": "1.5.*", + "phpunit/phpunit": ">=3.7", + "satooshi/php-coveralls": "~0.6", + "squizlabs/php_codesniffer": "1.4.*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "LazyMap\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/", + "role": "Developer" + } + ], + "description": "A library that provides lazy instantiation logic for a map of objects", + "homepage": "https://github.com/Ocramius/LazyMap", + "keywords": [ + "lazy", + "lazy instantiation", + "lazy loading", + "map", + "service location" + ], + "time": "2014-05-01 22:15:23" }, { "name": "phpunit/php-code-coverage", @@ -4250,25 +4468,25 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48b59bcb201db52fa8509dd764ab3422df82e3af" + "reference": "9171bca1b0c859fe6d8b5951bf0805a741794afd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48b59bcb201db52fa8509dd764ab3422df82e3af", - "reference": "48b59bcb201db52fa8509dd764ab3422df82e3af", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9171bca1b0c859fe6d8b5951bf0805a741794afd", + "reference": "9171bca1b0c859fe6d8b5951bf0805a741794afd", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-file-iterator": ">=1.3.0", - "phpunit/php-text-template": ">=1.2.0", - "phpunit/php-token-stream": ">=1.1.3", - "sebastian/environment": ">=1.0.0", - "sebastian/version": ">=1.0.0" + "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-text-template": "~1.2.0", + "phpunit/php-token-stream": "~1.2.2", + "sebastian/environment": "~1.0.0", + "sebastian/version": "~1.0.3" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "4.2.*@dev" + "phpunit/phpunit": "dev-master" }, "suggest": { "ext-dom": "*", @@ -4307,7 +4525,7 @@ "testing", "xunit" ], - "time": "2014-05-26 12:16:12" + "time": "2014-07-09 09:03:35" }, { "name": "phpunit/php-file-iterator", @@ -4448,12 +4666,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "955c24b708f8bfd6a05f303217a8dac3a443d531" + "reference": "a0802561692c3b2bb0ed972f7ffafbfab068e580" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/955c24b708f8bfd6a05f303217a8dac3a443d531", - "reference": "955c24b708f8bfd6a05f303217a8dac3a443d531", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a0802561692c3b2bb0ed972f7ffafbfab068e580", + "reference": "a0802561692c3b2bb0ed972f7ffafbfab068e580", "shasum": "" }, "require": { @@ -4490,7 +4708,7 @@ "keywords": [ "tokenizer" ], - "time": "2014-05-12 05:34:42" + "time": "2014-06-26 07:15:38" }, { "name": "phpunit/phpunit", @@ -4498,12 +4716,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "1a5575b9148c2d2f6cb19d1551597e5d9bbd402d" + "reference": "e243de0b5264da8454105455bda0881f5b2ac972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1a5575b9148c2d2f6cb19d1551597e5d9bbd402d", - "reference": "1a5575b9148c2d2f6cb19d1551597e5d9bbd402d", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e243de0b5264da8454105455bda0881f5b2ac972", + "reference": "e243de0b5264da8454105455bda0881f5b2ac972", "shasum": "" }, "require": { @@ -4564,7 +4782,7 @@ "testing", "xunit" ], - "time": "2014-06-17 01:59:42" + "time": "2014-07-22 22:57:02" }, { "name": "phpunit/phpunit-mock-objects", @@ -4572,15 +4790,16 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "32f97c9198be565b6051983c70dc8d8e758725f4" + "reference": "f9f31b9e7f93483fd4dbd500ee41e2e5fc0923b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/32f97c9198be565b6051983c70dc8d8e758725f4", - "reference": "32f97c9198be565b6051983c70dc8d8e758725f4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/f9f31b9e7f93483fd4dbd500ee41e2e5fc0923b7", + "reference": "f9f31b9e7f93483fd4dbd500ee41e2e5fc0923b7", "shasum": "" }, "require": { + "ocramius/instantiator": "~1.0", "php": ">=5.3.3", "phpunit/php-text-template": "~1.2" }, @@ -4621,7 +4840,7 @@ "mock", "xunit" ], - "time": "2014-06-12 07:22:27" + "time": "2014-07-05 15:46:50" }, { "name": "sebastian/comparator", @@ -4898,12 +5117,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "b01d366060f33e18fd98b0008c41a01b0d25c95c" + "reference": "07ff901ce8b081cf227091b4919d347fa999b2a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/b01d366060f33e18fd98b0008c41a01b0d25c95c", - "reference": "b01d366060f33e18fd98b0008c41a01b0d25c95c", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/07ff901ce8b081cf227091b4919d347fa999b2a0", + "reference": "07ff901ce8b081cf227091b4919d347fa999b2a0", "shasum": "" }, "require": { @@ -4938,19 +5157,24 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2014-06-04 06:43:44" + "time": "2014-07-09 09:06:26" } ], - "aliases": [], + "aliases": [ + + ], "minimum-stability": "dev", "stability-flags": { "patricktalmadge/bootstrapper": 20, "anahkiasen/former": 20, "barryvdh/laravel-debugbar": 20, - "intervention/image": 20, "webpatser/laravel-countries": 20, "codeception/codeception": 20 }, - "platform": [], - "platform-dev": [] + "platform": [ + + ], + "platform-dev": [ + + ] } diff --git a/public/.htaccess b/public/.htaccess index 417caecb3d..8d4271fb32 100755 --- a/public/.htaccess +++ b/public/.htaccess @@ -5,4 +5,7 @@ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] + + RewriteCond %{HTTP:Authorization} . + RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}] \ No newline at end of file