mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Merge pull request #5804 from turbo124/v5-develop
Fixes for language files
This commit is contained in:
commit
a525762b6e
@ -476,4 +476,62 @@ class LoginController extends BaseController
|
||||
->header('X-App-Version', config('ninja.app_version'))
|
||||
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
||||
}
|
||||
|
||||
public function redirectToProvider(string $provider)
|
||||
{
|
||||
//'https://www.googleapis.com/auth/gmail.send','email','profile','openid'
|
||||
$scopes = [];
|
||||
|
||||
if($provider == 'google'){
|
||||
$scopes = ['https://www.googleapis.com/auth/gmail.send','email','profile','openid'];
|
||||
}
|
||||
|
||||
if (request()->has('code')) {
|
||||
return $this->handleProviderCallback($provider);
|
||||
} else {
|
||||
return Socialite::driver($provider)->scopes($scopes)->redirect();
|
||||
}
|
||||
}
|
||||
|
||||
public function handleProviderCallback(string $provider)
|
||||
{
|
||||
$socialite_user = Socialite::driver($provider)
|
||||
->stateless()
|
||||
->user();
|
||||
|
||||
// if($user = OAuth::handleAuth($socialite_user, $provider))
|
||||
// {
|
||||
// Auth::login($user, true);
|
||||
|
||||
// return redirect($this->redirectTo);
|
||||
// }
|
||||
// else if(MultiDB::checkUserEmailExists($socialite_user->getEmail()))
|
||||
// {
|
||||
// Session::flash('error', 'User exists in system, but not with this authentication method'); //todo add translations
|
||||
|
||||
// return view('auth.login');
|
||||
// }
|
||||
// else {
|
||||
// //todo
|
||||
// $name = OAuth::splitName($socialite_user->getName());
|
||||
|
||||
// $new_account = [
|
||||
// 'first_name' => $name[0],
|
||||
// 'last_name' => $name[1],
|
||||
// 'password' => '',
|
||||
// 'email' => $socialite_user->getEmail(),
|
||||
// 'oauth_user_id' => $socialite_user->getId(),
|
||||
// 'oauth_provider_id' => $provider
|
||||
// ];
|
||||
|
||||
// $account = CreateAccount::dispatchNow($new_account);
|
||||
|
||||
// Auth::login($account->default_company->owner(), true);
|
||||
|
||||
// $cookie = cookie('db', $account->default_company->db);
|
||||
|
||||
// return redirect($this->redirectTo)->withCookie($cookie);
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ class BaseController extends Controller
|
||||
*/
|
||||
public function notFoundClient()
|
||||
{
|
||||
return abort(404);
|
||||
abort(404, 'Page not found in client portal.');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ class DocumentController extends Controller
|
||||
|
||||
$documents->map(function ($document) {
|
||||
if (auth()->user('contact')->client->id != $document->documentable->id) {
|
||||
abort(401);
|
||||
abort(401, 'Permission denied');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -31,7 +31,7 @@ class EntityViewController extends Controller
|
||||
public function index(string $entity_type, string $invitation_key)
|
||||
{
|
||||
if (! in_array($entity_type, $this->entity_types)) {
|
||||
abort(404);
|
||||
abort(404, 'Entity not found');
|
||||
}
|
||||
|
||||
$invitation_entity = sprintf('App\\Models\\%sInvitation', ucfirst($entity_type));
|
||||
@ -91,7 +91,7 @@ class EntityViewController extends Controller
|
||||
public function handlePassword(string $entity_type, string $invitation_key)
|
||||
{
|
||||
if (! in_array($entity_type, $this->entity_types)) {
|
||||
abort(404);
|
||||
abort(404, 'Entity not found');
|
||||
}
|
||||
|
||||
$invitation_entity = sprintf('App\\Models\\%sInvitation', ucfirst($entity_type));
|
||||
|
@ -149,6 +149,6 @@ class PaymentMethodController extends Controller
|
||||
return $gateway = auth()->user()->client->getBankTransferGateway();
|
||||
}
|
||||
|
||||
return abort(404);
|
||||
abort(404, 'Gateway not found.');
|
||||
}
|
||||
}
|
||||
|
@ -93,11 +93,16 @@ class LoginController extends BaseController
|
||||
public function redirectToProvider(string $provider)
|
||||
{
|
||||
//'https://www.googleapis.com/auth/gmail.send','email','profile','openid'
|
||||
//
|
||||
$scopes = [];
|
||||
|
||||
if($provider == 'google'){
|
||||
$scopes = ['https://www.googleapis.com/auth/gmail.send','email','profile','openid'];
|
||||
}
|
||||
|
||||
if (request()->has('code')) {
|
||||
return $this->handleProviderCallback($provider);
|
||||
} else {
|
||||
return Socialite::driver($provider)->scopes()->redirect();
|
||||
return Socialite::driver($provider)->scopes($scopes)->redirect();
|
||||
}
|
||||
}
|
||||
|
||||
@ -231,43 +236,5 @@ class LoginController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Received the returning object from the provider
|
||||
* which we will use to resolve the user, we return the response in JSON format
|
||||
*
|
||||
* @return json
|
||||
|
||||
public function handleProviderCallbackApiUser(string $provider)
|
||||
{
|
||||
$socialite_user = Socialite::driver($provider)->stateless()->user();
|
||||
|
||||
if($user = OAuth::handleAuth($socialite_user, $provider))
|
||||
{
|
||||
return $this->itemResponse($user);
|
||||
}
|
||||
else if(MultiDB::checkUserEmailExists($socialite_user->getEmail()))
|
||||
{
|
||||
|
||||
return $this->errorResponse(['message'=>'User exists in system, but not with this authentication method'], 400);
|
||||
|
||||
}
|
||||
else {
|
||||
//todo
|
||||
$name = OAuth::splitName($socialite_user->getName());
|
||||
|
||||
$new_account = [
|
||||
'first_name' => $name[0],
|
||||
'last_name' => $name[1],
|
||||
'password' => '',
|
||||
'email' => $socialite_user->getEmail(),
|
||||
];
|
||||
|
||||
$account = CreateAccount::dispatchNow($new_account);
|
||||
|
||||
return $this->itemResponse($account->default_company->owner());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
@ -643,18 +643,12 @@ class TaskController extends BaseController
|
||||
|
||||
$sort_status_id = $this->decodePrimaryKey($key);
|
||||
|
||||
// nlog($task_list);
|
||||
|
||||
foreach ($task_list as $key => $task)
|
||||
{
|
||||
|
||||
// nlog($task);
|
||||
|
||||
$task_record = Task::where('id', $this->decodePrimaryKey($task))
|
||||
->where('company_id', auth()->user()->company()->id)
|
||||
->first();
|
||||
|
||||
// nlog($task_record->id);
|
||||
|
||||
$task_record->status_order = $key;
|
||||
$task_record->status_id = $sort_status_id;
|
||||
@ -663,6 +657,6 @@ class TaskController extends BaseController
|
||||
|
||||
}
|
||||
|
||||
return response()->json(['message' => 'Ok'],200);
|
||||
return response()->json(['message' => 'Ok'], 200);
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,6 @@ class ContactRegister
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
return abort(404);
|
||||
abort(404, 'ContactRegister Middlware');
|
||||
}
|
||||
}
|
||||
|
@ -53,6 +53,6 @@ class RegisterRequest extends FormRequest
|
||||
return $company;
|
||||
}
|
||||
|
||||
abort(404);
|
||||
abort(404, 'Register request not found.');
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,9 @@
|
||||
namespace App\Jobs\Company;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Company;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Http\Request;
|
||||
@ -60,6 +62,12 @@ class CreateCompany
|
||||
$company->subdomain = isset($this->request['subdomain']) ? $this->request['subdomain'] : '';
|
||||
$company->custom_fields = new \stdClass;
|
||||
$company->default_password_timeout = 1800000;
|
||||
|
||||
if(Ninja::isHosted())
|
||||
$company->subdomain = MultiDB::randomSubdomainGenerator();
|
||||
else
|
||||
$company->subdomain = '';
|
||||
|
||||
$company->save();
|
||||
|
||||
return $company;
|
||||
|
@ -307,7 +307,7 @@ class MultiDB
|
||||
return false;
|
||||
}
|
||||
|
||||
public function randomSubdomainGenerator()
|
||||
public static function randomSubdomainGenerator()
|
||||
{
|
||||
$current_db = config('database.default');
|
||||
|
||||
|
@ -45,7 +45,7 @@ class VendorUpdatedActivity implements ShouldQueue
|
||||
|
||||
$fields = new stdClass;
|
||||
|
||||
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
|
||||
$user_id = array_key_exists('user_id', $event->event_vars) ? $event->event_vars['user_id'] : $event->vendor->user_id;
|
||||
|
||||
$fields->vendor_id = $vendor->id;
|
||||
$fields->user_id = $user_id;
|
||||
|
@ -59,12 +59,13 @@ class SupportMessageSent extends Mailable
|
||||
|
||||
$subject = "Customer MSG {$user->present()->name} - [{$plan} - DB:{$company->db}]";
|
||||
|
||||
return $this->from(config('mail.from.address'), config('mail.from.name')) //todo this needs to be fixed to handle the hosted version
|
||||
->subject($subject)
|
||||
->markdown('email.support.message', [
|
||||
'message' => $this->message,
|
||||
'system_info' => $system_info,
|
||||
'laravel_log' => $log_lines,
|
||||
]);
|
||||
return $this->from(config('mail.from.address'), config('mail.from.name'))
|
||||
->replyTo($user, $user->present()->name())
|
||||
->subject($subject)
|
||||
->markdown('email.support.message', [
|
||||
'message' => $this->message,
|
||||
'system_info' => $system_info,
|
||||
'laravel_log' => $log_lines,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Task;
|
||||
use App\Services\Client\ClientService;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@ -301,6 +302,10 @@ class InvoiceService
|
||||
//UnlinkFile::dispatchNow(config('filesystems.default'), $this->invoice->client->invoice_filepath() . $this->invoice->numberFormatter().'.pdf');
|
||||
Storage::disk(config('filesystems.default'))->delete($this->invoice->client->invoice_filepath() . $this->invoice->numberFormatter().'.pdf');
|
||||
|
||||
if(Ninja::isHosted()) {
|
||||
Storage::disk('public')->delete($this->invoice->client->invoice_filepath() . $this->invoice->numberFormatter().'.pdf');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1775,7 +1775,7 @@ $LANG = array(
|
||||
'lang_Chinese - Taiwan' => 'Chinese - Taiwan',
|
||||
'lang_Serbian' => 'Serbian',
|
||||
'lang_Bulgarian' => 'Bulgarian',
|
||||
'lang_Russian' => 'Russian',
|
||||
'lang_Russian (Russia)' => 'Russian (Russia)',
|
||||
|
||||
// Industries
|
||||
'industry_Accounting & Legal' => 'Accounting & Legal',
|
||||
@ -4250,7 +4250,7 @@ $LANG = array(
|
||||
'new_login_description' => 'You recently logged in to your Invoice Ninja account from a new location or device:<br><br><b>IP:</b> :ip<br><b>Time:</b> :time<br><b>Email:</b> :email',
|
||||
'download_backup_subject' => 'Your company backup is ready for download',
|
||||
'contact_details' => 'Contact Details',
|
||||
'download_backup_subject' => ':company backup is ready for download',
|
||||
'download_backup_subject' => 'Your company backup is ready for download',
|
||||
'account_passwordless_login' => 'Account passwordless login',
|
||||
);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1776,6 +1776,7 @@ $LANG = array(
|
||||
'lang_Chinese - Taiwan' => 'Chinese - Taiwan',
|
||||
'lang_Serbian' => 'Serbian',
|
||||
'lang_Bulgarian' => 'Bulgarian',
|
||||
'lang_Russian (Russia)' => 'Russian (Russia)',
|
||||
|
||||
// Industries
|
||||
'industry_Accounting & Legal' => 'Accounting & Legal',
|
||||
@ -3969,7 +3970,7 @@ $LANG = array(
|
||||
'list_of_recurring_invoices' => 'List of recurring invoices',
|
||||
'details_of_recurring_invoice' => 'Here are some details about recurring invoice',
|
||||
'cancellation' => 'Cancellation',
|
||||
'about_cancellation' => 'In case you want to stop the recurring invoice,\n please click the request the cancellation.',
|
||||
'about_cancellation' => 'In case you want to stop the recurring invoice, please click the request the cancellation.',
|
||||
'cancellation_warning' => 'Warning! You are requesting a cancellation of this service.\n Your service may be cancelled with no further notification to you.',
|
||||
'cancellation_pending' => 'Cancellation pending, we\'ll be in touch!',
|
||||
'list_of_payments' => 'List of payments',
|
||||
@ -4175,6 +4176,10 @@ $LANG = array(
|
||||
'zoho' => 'Zoho',
|
||||
'accounting' => 'Accounting',
|
||||
'required_files_missing' => 'Please provide all CSVs.',
|
||||
'migration_auth_label' => 'Let\'s continue by authenticating.',
|
||||
'api_secret' => 'API secret',
|
||||
'migration_api_secret_notice' => 'You can find API_SECRET in the .env file or Invoice Ninja v5. If property is missing, leave field blank.',
|
||||
'billing_coupon_notice' => 'Your discount will be applied on the checkout.',
|
||||
'use_last_email' => 'Use last email',
|
||||
'activate_company' => 'Activate Company',
|
||||
'activate_company_help' => 'Enable emails, recurring invoices and notifications',
|
||||
@ -4197,8 +4202,57 @@ $LANG = array(
|
||||
'disable_two_factor' => 'Disable Two Factor',
|
||||
'invoice_task_datelog' => 'Invoice Task Datelog',
|
||||
'invoice_task_datelog_help' => 'Add date details to the invoice line items',
|
||||
'lang_Russian' => 'Russian',
|
||||
'promo_code' => 'Promo code',
|
||||
'recurring_invoice_issued_to' => 'Recurring invoice issued to',
|
||||
'subscription' => 'Subscription',
|
||||
'new_subscription' => 'New Subscription',
|
||||
'deleted_subscription' => 'Successfully deleted subscription',
|
||||
'removed_subscription' => 'Successfully removed subscription',
|
||||
'restored_subscription' => 'Successfully restored subscription',
|
||||
'search_subscription' => 'Search 1 Subscription',
|
||||
'search_subscriptions' => 'Search :count Subscriptions',
|
||||
'subdomain_is_not_available' => 'Subdomain is not available',
|
||||
'connect_gmail' => 'Connect Gmail',
|
||||
'disconnect_gmail' => 'Disconnect Gmail',
|
||||
'connected_gmail' => 'Successfully connected Gmail',
|
||||
'disconnected_gmail' => 'Successfully disconnected Gmail',
|
||||
'update_fail_help' => 'Changes to the codebase may be blocking the update, you can run this command to discard the changes:',
|
||||
'client_id_number' => 'Client ID Number',
|
||||
'count_minutes' => ':count Minutes',
|
||||
'password_timeout' => 'Password Timeout',
|
||||
'shared_invoice_credit_counter' => 'Shared Invoice/Credit Counter',
|
||||
|
||||
'activity_80' => ':user created subscription :subscription',
|
||||
'activity_81' => ':user updated subscription :subscription',
|
||||
'activity_82' => ':user archived subscription :subscription',
|
||||
'activity_83' => ':user deleted subscription :subscription',
|
||||
'activity_84' => ':user restored subscription :subscription',
|
||||
'amount_greater_than_balance_v5' => 'The amount is greater than the invoice balance. You cannot overpay an invoice.',
|
||||
'click_to_continue' => 'Click to continue',
|
||||
|
||||
'notification_invoice_created_body' => 'The following invoice :invoice was created for client :client for :amount.',
|
||||
'notification_invoice_created_subject' => 'Invoice :invoice was created for :client',
|
||||
'notification_quote_created_body' => 'The following quote :invoice was created for client :client for :amount.',
|
||||
'notification_quote_created_subject' => 'Quote :invoice was created for :client',
|
||||
'notification_credit_created_body' => 'The following credit :invoice was created for client :client for :amount.',
|
||||
'notification_credit_created_subject' => 'Credit :invoice was created for :client',
|
||||
'max_companies' => 'Maximum companies migrated',
|
||||
'max_companies_desc' => 'You have reached your maximum number of companies. Delete existing companies to migrate new ones.',
|
||||
'migration_already_completed' => 'Company already migrated',
|
||||
'migration_already_completed_desc' => 'Looks like you already migrated <b> :company_name </b>to the V5 version of the Invoice Ninja. In case you want to start over, you can force migrate to wipe existing data.',
|
||||
'payment_method_cannot_be_authorized_first' => 'This payment method can be can saved for future use, once you complete your first transaction. Don\'t forget to check "Store credit card details" during payment process.',
|
||||
'new_account' => 'New account',
|
||||
'activity_100' => ':user created recurring invoice :recurring_invoice',
|
||||
'activity_101' => ':user updated recurring invoice :recurring_invoice',
|
||||
'activity_102' => ':user archived recurring invoice :recurring_invoice',
|
||||
'activity_103' => ':user deleted recurring invoice :recurring_invoice',
|
||||
'activity_104' => ':user restored recurring invoice :recurring_invoice',
|
||||
'new_login_detected' => 'New login detected for your account.',
|
||||
'new_login_description' => 'You recently logged in to your Invoice Ninja account from a new location or device:<br><br><b>IP:</b> :ip<br><b>Time:</b> :time<br><b>Email:</b> :email',
|
||||
'download_backup_subject' => 'Your company backup is ready for download',
|
||||
'contact_details' => 'Contact Details',
|
||||
'download_backup_subject' => 'Your company backup is ready for download',
|
||||
'account_passwordless_login' => 'Account passwordless login',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
File diff suppressed because it is too large
Load Diff
1510
resources/lang/sq/texts.php
Executable file → Normal file
1510
resources/lang/sq/texts.php
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -24,7 +24,7 @@ Route::post('password/reset', 'Auth\ResetPasswordController@reset')->middleware(
|
||||
* Social authentication
|
||||
*/
|
||||
|
||||
// Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
||||
Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
||||
// Route::get('auth/{provider}/create', 'Auth\LoginController@redirectToProviderAndCreate');
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user