Google2Fa ready to upload

This commit is contained in:
Kevin Adametz 2021-11-09 18:38:44 +01:00
parent e3495be8b8
commit 73e38a006e
127 changed files with 2637 additions and 589 deletions

View file

@ -2,8 +2,8 @@
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
@ -29,10 +29,12 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*
* @throws \Exception
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
@ -41,10 +43,12 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}

View file

@ -22,7 +22,7 @@ class ReportController extends Controller
{
public function __construct()
{
$this->middleware('superadmin');
$this->middleware(['superadmin', '2fa']);
}
public function bookings()

View file

@ -4,15 +4,16 @@ namespace App\Http\Controllers;
use App\Mail\MailVerifyContact;
use App\Models\Account;
use App\Repositories\UserRepository;
use App\Services\HTMLHelper;
use App\User;
use Illuminate\Support\Facades\Mail;
use Request;
use App\User;
use Validator;
use DataTables;
use App\Models\Account;
use App\Services\HTMLHelper;
use App\Services\MyGoogle2FA;
use App\Mail\MailVerifyContact;
use App\Repositories\UserRepository;
use Illuminate\Support\Facades\Mail;
class AdminUserController extends Controller
{
@ -20,9 +21,8 @@ class AdminUserController extends Controller
public function __construct(UserRepository $userRepo)
{
$this->middleware('superadmin');
$this->middleware(['superadmin', '2fa']);
$this->userRepo = $userRepo;
}
/**
@ -34,6 +34,12 @@ class AdminUserController extends Controller
//'values' => User::where('admin', 0)->get(),
'values' => User::where('confirmation_code_remider', '!=', 2)->get(),
];
$user = User::findOrFail(8);
/* $MyGoogle2FA = new MyGoogle2FA();
$valid = $MyGoogle2FA->init($user)->check2Fa('676493');
dd($valid); */
return view('admin.users', $data);
}
@ -121,40 +127,97 @@ class AdminUserController extends Controller
public function loadModal($id){
if(Request::ajax()) {
$data = Request::all();
$user = User::findOrFail($id);
if(isset($data['action'])){
if($data['action'] === 'show-user-roles'){
$fill = [
'user' => $user,
'action' => $data['action'],
'groups' => config('permissions.groups'),
'roles' => config('permissions.roles')
];
return view("admin.user_modal", $fill )->render();
}
if($data['action'] === 'show-user-active'){
$fill = [
'user' => $user,
'action' => $data['action'],
];
return view("admin.active_modal", $fill )->render();
}
$data = [
'user' => $user,
'groups' => config('permissions.groups'),
'roles' => config('permissions.roles')
];
return view("admin.user_modal", $data )->render();
if($data['action'] === 'show-user-google2fa'){
if($user->isGoogle2Fa()){
$MyGoogle2FA = new MyGoogle2FA();
$MyGoogle2FA->init($user);
$fill = [
'user' => $user,
'action' => 'delete-user-google2fa',
'MyGoogle2FA' => $MyGoogle2FA,
];
return view("admin.google2fa_delete_modal", $fill )->render();
}else{
$MyGoogle2FA = new MyGoogle2FA();
$MyGoogle2FA->init($user)->generate();
$fill = [
'user' => $user,
'action' => 'activate-user-google2fa',
'MyGoogle2FA' => $MyGoogle2FA,
];
return view("admin.google2fa_modal", $fill )->render();
}
}
}
}
return false;
}
public function updateModal($step = false){
public function updateModal($action = false){
if($step == 'user'){
if($action=== 'show-user-roles'){
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->permissions = isset($data['permissions']) ? $data['permissions'] : [];
$user->admin = $data['admin'];
$user->confirmed = isset($data['confirmed']) ? true : false;
$user->active = isset($data['active']) ? true : false;
$user->save();
\Session()->flash('alert-save', true);
}
if($action=== 'show-user-active'){
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->active = isset($data['active']) ? true : false;
$user->save();
\Session()->flash('alert-save', true);
}
if($action=== 'activate-user-google2fa'){
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->google2fa = true;
$user->save();
\Session()->flash('alert-save', true);
}
if($action=== 'delete-user-google2fa'){
$data = Request::all();
$user = User::findOrFail($data['id']);
$user->google2fa = false;
$user->secret_key = null;
$user->save();
\Session()->flash('alert-save', true);
}
\Session()->flash('alert-save', true);
return redirect('/admin/users');
}
//
public function getUsers()
{
//confirmation_code_remider is delete 2
@ -165,13 +228,20 @@ class AdminUserController extends Controller
return '<a href="' . route('admin_user_edit', [$user->id]) . '" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('admin', function (User $user) {
return '<a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" class="update_modal_data_show">'.HTMLHelper::getRoleLabel($user->admin, '<i class="fa fa-edit"></i> Rechte + ','').'</a>';
return '<a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-roles" class="update_modal_data_show">'.HTMLHelper::getRoleLabel($user->admin, '<i class="fa fa-edit"></i> Rechte + ','').'</a>';
})
->addColumn('google2fa', function (User $user) {
$icon = $user->google2fa ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>';
$color = $user->google2fa ? 'primary' : 'danger';
return ' <a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-google2fa" class="update_modal_data_show btn btn-sm btn-'.$color.'">'.$icon.' google2fa</a>';
})
->addColumn('confirmed', function (User $user) {
return $user->confirmed ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('active', function (User $user) {
return $user->active ? ' <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
$active = $user->active ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
return ' <a href="#" data-url="'.route('admin_user_load_modal', $user->id).'" data-data="'.$user->id.'" data-action="show-user-active" class="update_modal_data_show">'.$active.'</a>';
})
->addColumn('action_delete', function (User $user) {
return '<a href="' . route('admin_user_delete', [$user->id]) . '" class="btn icon-btn btn-sm btn-danger" onclick="return confirm(\''.__('Really delete entry?').'\');"><span class="fa fa-trash"></span></a>';
@ -179,7 +249,7 @@ class AdminUserController extends Controller
->orderColumn('confirmed', 'confirmed $1')
->orderColumn('active', 'active $1')
->orderColumn('admin', 'active $1')
->rawColumns(['action_edit', 'admin', 'confirmed', 'active', 'action_delete'])
->rawColumns(['action_edit', 'admin', 'confirmed', 'active', 'action_delete', 'google2fa'])
->make(true);
}

View file

@ -52,18 +52,15 @@ class LoginController extends Controller
}
protected function validateLogin(Request $request)
{
$this->validate($request, [
$this->username() => 'required|exists:users,' . $this->username() . ',active,1',
'password' => 'required',
], [
$this->username() . '.exists' => trans('validation.usernotactive'),
]);
//*
//
/* protected function validateLogin(Request $request)
{
$this->validate($request, [
$this->username() => 'required|exists:users,' . $this->username() . ',active,1',
'password' => 'required',
], [
$this->username() . '.exists' => trans('validation.usernotactive'),
]);
}
*/
}
}

View file

@ -4,7 +4,6 @@ namespace App\Http\Controllers;
use Request;
use App\Models\Booking;
use App\Models\Customer;
use App\Models\BookingFile;
use App\Models\BookingNotice;
use App\Models\ServiceProvider;
@ -24,8 +23,8 @@ class BookingController extends Controller
protected $bookingRepo;
public function __construct(BookingRepository $bookingRepo)
{
$this->middleware('admin');
{
$this->middleware(['admin', '2fa']);
$this->bookingRepo = $bookingRepo;
}

View file

@ -23,6 +23,8 @@ class CMSAnswerQuestionController extends Controller
public function __construct()
{
$this->middleware(['admin', '2fa']);
$this->identifier_options = IQContentCategory::where('identifier', 'faq')
->where('active', true)
->orderBy('pos', 'ASC')

View file

@ -24,6 +24,8 @@ class CMSBookingController extends Controller
public function __construct()
{
$this->middleware(['admin', '2fa']);
$this->identifier_general_name = config('booking.identifier_general_name');
$this->identifier_content_name = config('booking.identifier_content_name');
$this->identifier_general = config('booking.identifier_general');
@ -78,12 +80,11 @@ class CMSBookingController extends Controller
}
}
if($data['action'] === 'addItem'){
$general_name = CMSContent::findOrFail($id);
$identifier_general = $this->identifier_general.$general_name->id;
$create = [
'name' => 'Abschnitt',
'name' => '#empty#',
'field' => 'full_text',
'decimal' => 1,
'identifier' => $identifier_general,
@ -102,6 +103,8 @@ class CMSBookingController extends Controller
foreach ($data['contents'] as $content_id => $item) {
$content = CMSContent::findOrFail($content_id);
$content->setObjectBy('page-break', (isset($item['page-break']) ? true : false));
$content->setObjectBy('repeat-country', (isset($item['repeat-country']) ? true : false));
$content->setObjectBy('repeat-airline', (isset($item['repeat-airline']) ? true : false));
$content->name = $item['name'];
$content->slug = null;
$content->decimal = isset($item['in_pdf']) ? 1 : 0;
@ -121,7 +124,13 @@ class CMSBookingController extends Controller
public function deleteAll($id, $do){
if($do === 'name'){
$general_name = CMSContent::findOrFail($id);
$find = CMSContent::findObjectsBy('general_id', $general_name->id);
if(count($find)){
\Session()->flash('alert-error', __('Vorlage kann nicht gelöscht werden, ist bei den Inhalten noch in Verwendung.'));
return back();
}
$identifier_general = $this->identifier_general.$general_name->id;
//check is use
$contents = CMSContent::where('identifier', '=', $identifier_general)->get();
foreach($contents as $con){
$con->delete();
@ -206,7 +215,7 @@ class CMSBookingController extends Controller
if($data['action'] === 'addItem' && isset($data['content_pos_id'])) {
$create = [
'name' => 'Abschnitt',
'name' => '#empty#',
'field' => 'full_text',
'decimal' => 1,
'integer' => $data['content_pos_id'],
@ -220,8 +229,6 @@ class CMSBookingController extends Controller
return redirect(route('cms_booking_content_detail', [$id]));
}
if($data['action'] === 'saveAll'){
$i = 1;
$last_content_id = null;
@ -233,6 +240,8 @@ class CMSBookingController extends Controller
}
if ($item['identifier'] === $identifier_content) {
$content->setObjectBy('page-break', (isset($item['page-break']) ? true : false));
$content->setObjectBy('repeat-country', (isset($item['repeat-country']) ? true : false));
$content->setObjectBy('repeat-airline', (isset($item['repeat-airline']) ? true : false));
$content->name = $item['name'];
$content->slug = null;
$content->decimal = isset($item['in_pdf']) ? 1 : 0;

View file

@ -19,6 +19,7 @@ class CMSContentAuthorController extends Controller
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}

View file

@ -17,8 +17,8 @@ class CMSContentController extends Controller
public function __construct()
{
$this->middleware(['admin', '2fa']);
$this->identifier_content = 'general';
}

View file

@ -23,6 +23,8 @@ class CMSContentInfoController extends Controller
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}
public function index()

View file

@ -21,6 +21,8 @@ class CMSFeWoController extends Controller
public function __construct()
{
$this->middleware(['admin', '2fa']);
$this->identifier_content = config('fewo.identifier_content');
$this->identifier_fewo = config('fewo.identifier_fewo');
}

View file

@ -18,6 +18,8 @@ class CMSFeedbackController extends Controller
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}

View file

@ -18,6 +18,7 @@ class CMSSidebarController extends Controller
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}
/**

View file

@ -24,6 +24,7 @@ class CMSTravelGuideController extends Controller
*/
public function __construct()
{
$this->middleware(['admin', '2fa']);
}
public function index()

View file

@ -22,8 +22,6 @@ class CronController extends Controller
public function __construct(UserRepository $userRepo)
{
$this->userRepo = $userRepo;
// $this->middleware('auth');
}
public function index()

View file

@ -14,7 +14,7 @@ class CustomerController extends Controller
public function __construct(CustomerRepository $custRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->custRepo = $custRepo;
}

View file

@ -25,7 +25,7 @@ class CustomerFewoMailController extends Controller
public function __construct(CustomerFewoMailRepository $customerMailRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->customerMailRepo = $customerMailRepo;
}

View file

@ -26,7 +26,7 @@ class CustomerMailController extends Controller
public function __construct(CustomerMailRepository $customerMailRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->customerMailRepo = $customerMailRepo;
}
@ -129,7 +129,7 @@ class CustomerMailController extends Controller
$value = new Collection();
$value->id = "add";
$value->customers = $customers;
$value->message = "Sehr #geehrte/r# #Anrede# #Vorname# #Nachname#,\n\nText ....";
$value->message = "Sehr #geehrte:r# #Anrede# #Vorname# #Nachname#,\n\nText ....";
$data['title'] = "E-Mail-Nachricht an Auswahl";
$url = route('requests_send_customer_mail');
$ret = view("customer.mail.modal-mail", compact('data','value', 'url') )->render();

View file

@ -11,8 +11,7 @@ class DraftController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
}
public function index($step = false)

View file

@ -21,7 +21,7 @@ class ContentModalController extends Controller
*/
public function __construct()
{
// $this->middleware('auth');
$this->middleware(['admin', '2fa']);
}
/**

View file

@ -26,7 +26,7 @@ class ContentTreeController extends Controller
*/
public function __construct(ContentSiteRepository $contentSiteRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->contentSiteRepo = $contentSiteRepo;
}

View file

@ -19,7 +19,7 @@ class ContentLinkController extends Controller
*/
public function __construct()
{
// $this->middleware('auth');
$this->middleware(['sysadmin', '2fa']);
}
/**

View file

@ -16,7 +16,7 @@ class TravelGroupController extends Controller
public function __construct(TravelRepository $tavelRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->tavelRepo = $tavelRepo;
}

View file

@ -16,7 +16,7 @@ class TravelItemController extends Controller
public function __construct(TravelRepository $tavelRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->tavelRepo = $tavelRepo;
}

View file

@ -16,7 +16,7 @@ class TravelProgrammController extends Controller
public function __construct(TravelRepository $travelRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->travelRepo = $travelRepo;
}

View file

@ -22,7 +22,7 @@ class LeadController extends Controller
public function __construct(LeadRepository $leadRepo, CustomerRepository $custRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->leadRepo = $leadRepo;
$this->custRepo = $custRepo;
@ -238,6 +238,8 @@ class LeadController extends Controller
if($lead->lead_mails->count()){
$lead_mail = $lead->lead_mails_sent_at->last();
$badge = $lead_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$lead_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$lead_mail->getSentAtRaw().'" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
@ -248,7 +250,9 @@ class LeadController extends Controller
data-action="show-lead-mail"
data-redirect="back"
data-route="'.route('lead_mail_modal_load').'">
<span class="badge '.($lead_mail->is_answer ? 'badge-default' : 'badge-secondary').'">'.$lead_mail->sent_at.'</span>
<span class="badge '.$badge.'">'
.($lead_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$lead_mail->sent_at.'</span>
</a>';
}
return '<span data-order="">-</span>';

View file

@ -28,7 +28,7 @@ class LeadMailController extends Controller
public function __construct(LeadMailRepository $leadMailRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->leadMailRepo = $leadMailRepo;
}

View file

@ -15,7 +15,7 @@ class MailController extends Controller
public function __construct()
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
}
public function leads()
@ -48,20 +48,6 @@ class MailController extends Controller
->addColumn('action_edit', function (LeadMail $lead_mail) {
return '<a href="'.route('lead_detail', [$lead_mail->lead_id]).'#collapseLeadMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('action_see', function (LeadMail $lead_mail) {
return '<a data-order="'.$lead_mail->getSentAtRaw().'" class="btn icon-btn btn-sm btn-secondary" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-lead_id="'.$lead_mail->lead->id.'"
data-lead_mail_id="'.$lead_mail->id.'"
data-action="show-lead-mail"
data-redirect="back"
data-route="'.route('lead_mail_modal_load').'">
<i class="fa fa-eye"></i>
</a>';
})
->addColumn('lead_id', function (LeadMail $lead_mail) {
return '<a data-order="'.$lead_mail->lead_id.'" href="'.route('lead_detail', [$lead_mail->lead_id]).'#collapseLeadMails">'.$lead_mail->lead_id.'</a>';
})
@ -69,10 +55,22 @@ class MailController extends Controller
return $lead_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('date', function (LeadMail $lead_mail) {
if($lead_mail->send){
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$lead_mail->sent_at.'</span>';
}
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$lead_mail->sent_at.'</span>';
$badge = $lead_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$lead_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$lead_mail->getSentAtRaw().'" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-lead_id="'.$lead_mail->lead->id.'"
data-lead_mail_id="'.$lead_mail->id.'"
data-action="show-lead-mail"
data-redirect="back"
data-route="'.route('lead_mail_modal_load').'">
<span class="badge '.$badge.'">'
.($lead_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$lead_mail->sent_at.'</span>
</a>';
})
->orderColumn('lead_id', 'lead_id $1')
->orderColumn('send', 'send $1')
@ -88,7 +86,7 @@ class MailController extends Controller
$query->where('lead_id', 'LIKE', '%'.$keyword.'%');
}
})
->rawColumns(['action_edit', 'send', 'date', 'lead_id', 'action_see'])
->rawColumns(['action_edit', 'send', 'date', 'lead_id'])
->make(true);
}
@ -100,20 +98,6 @@ class MailController extends Controller
->addColumn('action_edit', function (CustomerMail $customer_mail) {
return '<a href="'.route('booking_detail', [$customer_mail->booking_id]).'#collapseBookingMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('action_see', function (CustomerMail $customer_mail) {
return '<a data-order="'.$customer_mail->getSentAtRaw().'" class="btn icon-btn btn-sm btn-secondary" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-booking_id="'.$customer_mail->booking->id.'"
data-customer_mail_id="'.$customer_mail->id.'"
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('requests_modal_load').'">
<i class="fa fa-eye"></i>
</a>';
})
->addColumn('booking', function (CustomerMail $customer_mail) {
$out = $customer_mail->booking->travel_country_id ? $customer_mail->booking->travel_country->name." | " : "- | ";
$out .= $customer_mail->booking->travelagenda_id ? $customer_mail->booking->travel_agenda->name."" : "-";
@ -126,10 +110,22 @@ class MailController extends Controller
return $customer_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('date', function (CustomerMail $customer_mail) {
if($customer_mail->send){
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_mail->sent_at.'</span>';
}
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_mail->sent_at.'</span>';
$badge = $customer_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$customer_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$customer_mail->getSentAtRaw().'" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-booking_id="'.$customer_mail->booking->id.'"
data-customer_mail_id="'.$customer_mail->id.'"
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('requests_modal_load').'">
<span class="badge '.$badge.'">'
.($customer_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$customer_mail->sent_at.'</span>
</a>';
})
->orderColumn('booking_id', 'booking_id $1')
->orderColumn('send', 'send $1')
@ -157,21 +153,6 @@ class MailController extends Controller
->addColumn('action_edit', function (CustomerFewoMail $customer_fewo_mail) {
return '<a href="'.route('travel_user_booking_fewo_detail', [$customer_fewo_mail->travel_user_booking_fewo_id]).'#collapseBookingMails" class="btn icon-btn btn-sm btn-primary"><span class="fa fa-edit"></span></a>';
})
->addColumn('action_see', function (CustomerFewoMail $customer_fewo_mail) {
return '<a data-order="'.$customer_fewo_mail->getSentAtRaw().'" class="btn icon-btn btn-sm btn-secondary" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="true"
data-travel_user_booking_fewo_id="'.$customer_fewo_mail->travel_user_booking_fewo_id.'"
data-customer_mail_id="'.$customer_fewo_mail->id.'"
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('customer_fewo_modal_load').'">
<i class="fa fa-eye"></i>
</a>';
})
->addColumn('booking', function (CustomerFewoMail $customer_fewo_mail) {
$out = ($customer_fewo_mail->booking && $customer_fewo_mail->booking->fewo_lodging) ? $customer_fewo_mail->booking->fewo_lodging->name : "-";
return $out;
@ -183,10 +164,23 @@ class MailController extends Controller
return $customer_fewo_mail->send ? '<span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>' : '<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>';
})
->addColumn('date', function (CustomerFewoMail $customer_fewo_mail) {
if($customer_fewo_mail->send){
return '<span class="badge badge-success" style="background-color: #94ae59"><i class="fa fa-check-circle"></i> '.$customer_fewo_mail->sent_at.'</span>';
}
return '<span class="badge badge-default"><i class="fa fa-times-circle"></i> '.$customer_fewo_mail->sent_at.'</span>';
$badge = $customer_fewo_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$customer_fewo_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$customer_fewo_mail->getSentAtRaw().'" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
data-url="mail"
data-preview="'.$customer_fewo_mail->send.'"
data-travel_user_booking_fewo_id="'.$customer_fewo_mail->travel_user_booking_fewo_id.'"
data-customer_mail_id="'.$customer_fewo_mail->id.'"
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('customer_fewo_modal_load').'">
<span class="badge '.$badge.'">'
.($customer_fewo_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$customer_fewo_mail->sent_at.'</span>
</a>';
})
->orderColumn('booking_id', 'booking_id $1')
->orderColumn('send', 'send $1')
@ -202,7 +196,7 @@ class MailController extends Controller
$query->where('booking_id', 'LIKE', '%'.$keyword.'%');
}
})
->rawColumns(['action_edit', 'send', 'date', 'booking_id', 'action_see'])
->rawColumns(['action_edit', 'send', 'date', 'booking_id'])
->make(true);
}

View file

@ -3,6 +3,7 @@
namespace App\Http\Controllers;
use Request;
use App\Models\CMSContent;
use App\Models\GeneralFile;
use App\Models\IQContentSite;
use App\Models\TravelCountry;
@ -19,7 +20,7 @@ class ModalController extends Controller
public function __construct()
{
$this->middleware('auth');
$this->middleware(['admin', '2fa']);
}
public function load(){
@ -104,6 +105,17 @@ class ModalController extends Controller
$ret = view("admin.modal.iq_travel_program-item", compact('data', 'value'))->render();
}
if($data['action'] === 'modal-cms_booking_content_edit'){
if($data['id'] === 'new'){
$value = new CMSContent();
}else{
$value = CMSContent::find($data['id']);
}
$ret = view("admin.modal.cms_booking_content_edit", compact('data', 'value'))->render();
}
}
return response()->json(['response' => $data, 'html'=>$ret, 'status'=>$status]);
}

View file

@ -22,7 +22,7 @@ class RequestController extends Controller
public function __construct()
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
}
public function index($step = false)
@ -111,7 +111,6 @@ class RequestController extends Controller
if(Request::get('travel_option_lead_status_id') != ""){
$query->whereHas('lead', function ($q) {
$q->whereIn('status_id', Request::get('travel_option_lead_status_id'));
});
}
if(Request::get('travel_option_paying_out') != ""){
@ -426,6 +425,8 @@ class RequestController extends Controller
->addColumn('last_customer_email', function (Booking $booking) {
if($booking->customer_mails->count()){
$customer_mail = $booking->customer_mails_sent_at->last();
$badge = $customer_mail->is_answer ? 'badge-default' : 'badge-secondary';
$badge = !$customer_mail->send ? $badge : 'badge-success';
return '<a data-order="'.$customer_mail->getSentAtRaw().'" href="#" data-toggle="modal"
data-target="#modals-load-content"
data-id="show-mail"
@ -436,7 +437,9 @@ class RequestController extends Controller
data-action="show-customer-mail"
data-redirect="back"
data-route="'.route('requests_modal_load').'">
<span class="badge '.($customer_mail->is_answer ? 'badge-default' : 'badge-secondary').'">'.$customer_mail->sent_at.'</span>
<span class="badge '.$badge.'">'
.($customer_mail->send ? '<i class="fa fa-check-circle"></i>' : '<i class="fa fa-times-circle"></i>').' '
.$customer_mail->sent_at.'</span>
</a>';
}
return '<span data-order="">-</span>';

View file

@ -13,8 +13,7 @@ class AirlineController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -11,7 +11,7 @@ class BookingStatusController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -12,7 +12,7 @@ class CategoryController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -21,11 +21,11 @@ class EmailsController extends Controller
public function __construct()
{
$this->identifier_booking_file = 'booking-email-file';
$this->identifier_fewo_file = 'fewo-email-file';
$this->identifier_lead_file = 'lead-email-file';
$this->middleware(['superadmin', '2fa']);
$this->middleware('admin');
$this->identifier_booking_file = 'booking-email-file';
$this->identifier_fewo_file = 'fewo-email-file';
$this->identifier_lead_file = 'lead-email-file';
}

View file

@ -12,7 +12,7 @@ class InsuranceController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -11,8 +11,7 @@ class KeywordController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -13,7 +13,7 @@ class ServiceProviderController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -12,8 +12,7 @@ class TravelAgendaController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -13,7 +13,7 @@ class TravelCompanyController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -25,8 +25,7 @@ class TravelCountryController extends Controller
*/
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)

View file

@ -12,8 +12,7 @@ class TravelNationalityController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)
@ -24,7 +23,6 @@ class TravelNationalityController extends Controller
return view('settings.travel_nationality.index', $data);
}
public function update(){
$data = Request::all();

View file

@ -13,7 +13,7 @@ class TravelPlaceController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['superadmin', '2fa']);
}
public function index($step = false)
@ -24,12 +24,9 @@ class TravelPlaceController extends Controller
return view('settings.place.index', $data);
}
public function update(){
$data = Request::all();
$data['active'] = isset($data['active']) ? true : false;
if($data['id'] === "new"){

View file

@ -29,7 +29,7 @@ class ContentLinkController extends Controller
*/
public function __construct()
{
// $this->middleware('auth');
$this->middleware(['sysadmin', '2fa']);
}
public function filterHTML(){

View file

@ -15,7 +15,7 @@ class TravelProgramController extends Controller
public function __construct(TravelProgramRepository $travelProgramRepo)
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
$this->travelProgramRepo = $travelProgramRepo;
}

View file

@ -22,13 +22,11 @@ use Request;
class TravelUserBookingFewoController extends Controller
{
protected $userBookingFewoRepo;
// protected $identifier_fewo;
public function __construct(TravelUserBookingFewoRepository $userBookingFewoRepo)
{
$this->middleware('admin');
$this->userBookingFewoRepo = $userBookingFewoRepo;
// $this->identifier_fewo = 'fewo-pdf-';
$this->middleware(['admin', '2fa']);
$this->userBookingFewoRepo = $userBookingFewoRepo;
}
public function index($step = false)

View file

@ -11,8 +11,7 @@ class TravelUserController extends Controller
{
public function __construct()
{
$this->middleware('admin');
$this->middleware(['admin', '2fa']);
}
public function index($step = false)

View file

@ -52,8 +52,9 @@ class Kernel extends HttpKernel
* @var array
*/
protected $routeMiddleware = [
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'2fa' => \App\Http\Middleware\MiddleGoogle2FA::class,
'admin' => \App\Http\Middleware\Admin::class,
'superadmin' => \App\Http\Middleware\SuperAdmin::class,
'sysadmin' => \App\Http\Middleware\SysAdmin::class,

View file

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class AuthGoogle2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}

View file

@ -0,0 +1,99 @@
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Auth\Factory as Auth;
use Illuminate\Contracts\Auth\Middleware\AuthenticatesRequests;
class Authenticate implements AuthenticatesRequests
{
/**
* The authentication factory instance.
*
* @var \Illuminate\Contracts\Auth\Factory
*/
protected $auth;
/**
* Create a new middleware instance.
*
* @param \Illuminate\Contracts\Auth\Factory $auth
* @return void
*/
public function __construct(Auth $auth)
{
$this->auth = $auth;
}
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string[] ...$guards
* @return mixed
*
* @throws \Illuminate\Auth\AuthenticationException
*/
public function handle($request, Closure $next, ...$guards)
{
$this->authenticate($request, $guards);
if(!$this->auth->user()->active){
abort(403, 'Konto ist nicht aktiv');
}
return $next($request);
}
/**
* Determine if the user is logged in to any of the given guards.
*
* @param \Illuminate\Http\Request $request
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function authenticate($request, array $guards)
{
if (empty($guards)) {
$guards = [null];
}
foreach ($guards as $guard) {
if ($this->auth->guard($guard)->check()) {
return $this->auth->shouldUse($guard);
}
}
$this->unauthenticated($request, $guards);
}
/**
* Handle an unauthenticated user.
*
* @param \Illuminate\Http\Request $request
* @param array $guards
* @return void
*
* @throws \Illuminate\Auth\AuthenticationException
*/
protected function unauthenticated($request, array $guards)
{
throw new AuthenticationException(
'Unauthenticated.', $guards, $this->redirectTo($request)
);
}
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
//
}
}

View file

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class Google2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}

View file

@ -0,0 +1,25 @@
<?php
namespace App\Http\Middleware;
use Closure;
use PragmaRX\Google2FALaravel\Support\Authenticator;
use Auth;
class Google2FA
{
public function handle($request, Closure $next)
{
$authenticator = app(Authenticator::class)->boot($request);
dd(Auth::user()->isGoogle2Fa());
if(Auth::user()->isGoogle2Fa()){
}
if ($authenticator->isAuthenticated()) {
return $next($request);
}
return $authenticator->makeRequestOneTimePasswordResponse();
}
}

View file

@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Auth;
use Closure;
use App\Services\AuthGoogle2FA;
class MiddleGoogle2FA
{
public function handle($request, Closure $next)
{
$AuthGoogle2FA = app(AuthGoogle2FA::class)->init($request);
if(!Auth::user()->isGoogle2Fa()){
\App\Services\MyGoogle2FA::logout();
return $AuthGoogle2FA->makeActiveOneTimePasswordResponse();
}
if ($AuthGoogle2FA->isAuthenticated()) {
return $next($request);
}
return $AuthGoogle2FA->makeRequestOneTimePasswordResponse();
}
}

View file

@ -31,6 +31,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereNameFull($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Airline whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $flight_info
* @property string|null $check_in
* @property string|null $baggage
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereBaggage($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereCheckIn($value)
* @method static \Illuminate\Database\Eloquent\Builder|Airline whereFlightInfo($value)
*/
class Airline extends Model
{

View file

@ -183,6 +183,11 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read \App\Models\TravelNationality|null $travel_nationality
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereComfort($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Booking whereNationalityId($value)
* @property bool|null $participant_pass
* @property array|null $airline_ids
* @property-read \App\Models\BookingStorno|null $booking_strono
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereAirlineIds($value)
* @method static \Illuminate\Database\Eloquent\Builder|Booking whereParticipantPass($value)
*/
class Booking extends Model
{

View file

@ -11,14 +11,20 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class Branch
*
*
* @property int $id
* @property string $name
*
* @property Collection|Booking[] $bookings
* @property Collection|SfGuardUser[] $sf_guard_users
*
* @package App\Models
* @property-read int|null $bookings_count
* @property-read int|null $sf_guard_users_count
* @method static \Illuminate\Database\Eloquent\Builder|Branch newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Branch newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|Branch query()
* @method static \Illuminate\Database\Eloquent\Builder|Branch whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|Branch whereName($value)
* @mixin \Eloquent
*/
class Branch extends Model
{

View file

@ -38,6 +38,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent whereObject($value)
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSContent withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class CMSContent extends Model
{
@ -82,6 +83,16 @@ class CMSContent extends Model
];
}
public function setNameAttribute($value){
$this->attributes['name'] = $value == '' ? '#empty#' : $value;
}
public function getNameWithEmpty(){
if(!$this->attributes['name']){ return ""; }
return $this->attributes['name'] === '#empty#' ? '' : $this->attributes['name'];
}
public static function getFieldsOptions($setKey = false){
$options = self::$fields;
$ret = "";
@ -229,6 +240,11 @@ class CMSContent extends Model
$this->object = $obj;
}
public static function findObjectsBy($key, $value){
$find = '"'.$key.'":"'.$value.'"';
return CMSContent::where('object', 'LIKE', '%'.$find.'%')->get();
}
public static function getContentBySlug($slug){
$CMSContent = CMSContent::whereSlug(trim($slug))->first();
if($CMSContent){

View file

@ -39,6 +39,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int $bool
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereBool($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSInfo whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder|CMSInfo withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class CMSInfo extends Model
{

View file

@ -38,6 +38,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereUpdatedAt($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|IQContentCategory withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class IQContentCategory extends Model
{

View file

@ -48,6 +48,7 @@ use Illuminate\Support\Str;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTree wherePageId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTree whereRootId($value)
* @property-read int|null $iq_content_tree_nodes_count
* @method static \Illuminate\Database\Eloquent\Builder|IQContentTree withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class IQContentTree extends Model
{

View file

@ -63,6 +63,7 @@ use Illuminate\Support\Str;
* @property-read int|null $iq_content_faq_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faqs
* @property-read int|null $iq_content_faqs_count
* @method static \Illuminate\Database\Eloquent\Builder|IQContentTreeNode withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class IQContentTreeNode extends Model
{

View file

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Collection;
/**
* Class IQTravelGroup
*
*
* @property int $id
* @property string $name
* @property string $description
@ -27,10 +27,26 @@ use Illuminate\Database\Eloquent\Collection;
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Collection|IQTravelGroupItem[] $i_q_travel_group_items
*
* @package App\Models
* @property-read int|null $i_q_travel_group_items_count
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereDaysDuration($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereDaysStart($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereHighlights($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereMinPersons($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup wherePriceAdult($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup wherePriceChildren($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroup whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQTravelGroup extends Model
{

View file

@ -11,18 +11,26 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class IQTravelGroupItem
*
*
* @property int $id
* @property int $i_q_travel_group_id
* @property int $i_q_travel_item_id
* @property int $pos
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property IQTravelGroup $i_q_travel_group
* @property IQTravelItem $i_q_travel_item
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem whereIQTravelGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem whereIQTravelItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelGroupItem whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQTravelGroupItem extends Model
{

View file

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Collection;
/**
* Class IQTravelItem
*
*
* @property int $id
* @property string $name
* @property string $description
@ -29,12 +29,32 @@ use Illuminate\Database\Eloquent\Collection;
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property TravelCountry $travel_country
* @property Collection|IQTravelGroupItem[] $i_q_travel_group_items
* @property Collection|IQTravelItemPlace[] $i_q_travel_item_places
*
* @package App\Models
* @property-read \App\Models\DraftType|null $draft_type
* @property-read int|null $i_q_travel_group_items_count
* @property-read int|null $i_q_travel_item_places_count
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereDaysDuration($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereDaysStart($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereDraftTypeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereHighlights($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereMinPersons($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem wherePriceAdult($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem wherePriceChildren($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereTravelCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItem whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQTravelItem extends Model
{

View file

@ -11,18 +11,26 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class IQTravelItemPlace
*
*
* @property int $id
* @property int $i_q_travel_item_id
* @property int $travel_place_id
* @property int $pos
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property IQTravelItem $i_q_travel_item
* @property TravelPlace $travel_place
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace whereIQTravelItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace whereTravelPlaceId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelItemPlace whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQTravelItemPlace extends Model
{

View file

@ -13,7 +13,7 @@ use Illuminate\Database\Eloquent\Collection;
/**
* Class IQTravelProgram
*
*
* @property int $id
* @property string $name
* @property string $code
@ -31,11 +31,33 @@ use Illuminate\Database\Eloquent\Collection;
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property TravelCountry $travel_country
* @property Collection|IQTravelProgramItem[] $i_q_travel_program_items
*
* @package App\Models
* @property int|null $typ
* @property-read int|null $i_q_travel_program_items_count
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereCode($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereDaysDuration($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereDepositPro($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereDiscount($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereHighlights($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereNotIncluded($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram wherePriceAdultTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram wherePriceChildrenTotal($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereTravelCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereTravelInsurance($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereTyp($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgram whereWeekdays($value)
* @mixin \Eloquent
*/
class IQTravelProgram extends Model
{

View file

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class IQTravelProgramItem
*
*
* @property int $id
* @property int $i_q_travel_program_id
* @property int $i_q_travel_item_id
@ -21,12 +21,23 @@ use Illuminate\Database\Eloquent\Model;
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property IQTravelGroup $i_q_travel_group
* @property IQTravelItem $i_q_travel_item
* @property IQTravelProgram $i_q_travel_program
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem query()
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereIQTravelGroupId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereIQTravelItemId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereIQTravelProgramId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereTyp($value)
* @method static \Illuminate\Database\Eloquent\Builder|IQTravelProgramItem whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQTravelProgramItem extends Model
{

View file

@ -95,6 +95,15 @@ use Illuminate\Database\Eloquent\Collection;
* @property-read \App\Models\Sym\TravelCountry|null $travel_country_crm
* @property bool|null $is_rebook
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Lead whereIsRebook($value)
* @property-read Collection|\App\Models\LeadFile[] $lead_files
* @property-read int|null $lead_files_count
* @property-read \App\Models\LeadMail|null $lead_mail_last
* @property-read Collection|\App\Models\LeadMail[] $lead_mails
* @property-read int|null $lead_mails_count
* @property-read Collection|\App\Models\LeadMail[] $lead_mails_sent_at
* @property-read int|null $lead_mails_sent_at_count
* @property-read Collection|\App\Models\LeadNotice[] $lead_notices
* @property-read int|null $lead_notices_count
*/
class Lead extends Model
{

View file

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class LeadFile
*
*
* @property int $id
* @property int $lead_id
* @property int $lead_mail_id
@ -24,11 +24,25 @@ use Illuminate\Database\Eloquent\Model;
* @property int $size
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Lead $lead
* @property LeadMail $lead_mail
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile query()
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereDir($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereExt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereFilename($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereIdentifier($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereLeadId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereLeadMailId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereMine($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereOriginalName($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereSize($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadFile whereUpdatedAt($value)
* @mixin \Eloquent
*/
class LeadFile extends Model
{

View file

@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class LeadMail
*
*
* @property int $id
* @property int $lead_id
* @property int $customer_id
@ -37,13 +37,41 @@ use Illuminate\Database\Eloquent\Model;
* @property Carbon $delivered_at
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property Customer $customer
* @property Lead $lead
* @property CustomerMail $customer_mail
* @property Collection|LeadFile[] $lead_files
*
* @package App\Models
* @property-read int|null $lead_files_count
* @property-read LeadMail|null $lead_mail
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail query()
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereBcc($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereCc($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereCustomerId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereDeliveredAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereDir($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereDraft($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereEmail($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereError($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereFail($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereForward($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereImportant($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereIsAnswer($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereLeadId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereMessage($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereRecipient($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereReplyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereScheduledAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereSend($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereSentAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereSubdir($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereSubject($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadMail whereUpdatedAt($value)
* @mixin \Eloquent
*/
class LeadMail extends Model
{

View file

@ -13,7 +13,7 @@ use App\User;
/**
* Class LeadNotice
*
*
* @property int $id
* @property int $lead_id
* @property int $from_user_id
@ -24,11 +24,25 @@ use App\User;
* @property Carbon $edit_at
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property User $user
* @property Lead $lead
*
* @package App\Models
* @property-read User $from_user
* @property-read User|null $to_user
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice query()
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereEditAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereFromUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereImportant($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereLeadId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereMessage($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereShow($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereToUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadNotice whereUpdatedAt($value)
* @mixin \Eloquent
*/
class LeadNotice extends Model
{

View file

@ -31,6 +31,11 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\LeadParticipant whereParticipantSalutationId($value)
* @mixin \Eloquent
* @property int|null $participant_child
* @property int|null $nationality_id
* @property-read \App\Models\TravelNationality|null $travel_nationality
* @method static \Illuminate\Database\Eloquent\Builder|LeadParticipant whereNationalityId($value)
* @method static \Illuminate\Database\Eloquent\Builder|LeadParticipant whereParticipantChild($value)
*/
class LeadParticipant extends Model
{

View file

@ -36,6 +36,10 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $nationality_id
* @property-read \App\Models\TravelNationality|null $travel_nationality
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Participant whereNationalityId($value)
* @property bool|null $participant_pass
* @property bool|null $participant_storno
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantPass($value)
* @method static \Illuminate\Database\Eloquent\Builder|Participant whereParticipantStorno($value)
*/
class Participant extends Model
{
@ -48,7 +52,9 @@ class Participant extends Model
'booking_id' => 'int',
'participant_salutation_id' => 'int',
'participant_child' => 'bool',
'participant_pass' => 'bool'
'participant_pass' => 'bool',
'participant_storno' => 'bool'
];
protected $dates = [
@ -63,7 +69,8 @@ class Participant extends Model
'participant_salutation_id',
'participant_child',
'nationality_id',
'participant_pass'
'participant_pass',
'participant_storno'
];
public function booking()

View file

@ -54,6 +54,7 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SfGuardUser query()
* @property-read \App\User|null $user
* @property-read mixed $fullname
*/
class SfGuardUser extends Model
{

View file

@ -40,6 +40,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $pos
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent whereObject($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\CmsContent wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|CmsContent withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class CmsContent extends Model
{

View file

@ -51,6 +51,8 @@ use Illuminate\Database\Eloquent\Model;
* @property-read int|null $travel_country_services_count
* @property string|null $destco
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Sym\TravelCountry whereDestco($value)
* @property string|null $visum_text
* @method static \Illuminate\Database\Eloquent\Builder|TravelCountry whereVisumText($value)
*/
class TravelCountry extends Model
{

View file

@ -71,6 +71,8 @@ use Illuminate\Support\Str;
* @property-read int|null $travel_country_services_count
* @property string|null $destco
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereDestco($value)
* @property string|null $visum_text
* @method static \Illuminate\Database\Eloquent\Builder|TravelCountry whereVisumText($value)
*/
class TravelCountry extends Model
{
@ -201,4 +203,13 @@ class TravelCountry extends Model
}
return "";
}
public static function getAsNameIdArray($empty = true, $id = 'crm_id'){
$ret = TravelCountry::get()->pluck('name', $id)->toArray();
if($empty){
$first = [null => "-"];
return $first + $ret;
}
return $ret;
}
}

View file

@ -51,6 +51,7 @@ use Illuminate\Database\Eloquent\Model;
* @property int|null $author_id
* @property-read \App\Models\CMSAuthor|null $author
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereAuthorId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelGuide withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class TravelGuide extends Model
{

View file

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class TravelPlace
*
*
* @property int $id
* @property string $name
* @property string $description
@ -21,10 +21,21 @@ use Illuminate\Database\Eloquent\Model;
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property TravelCountry $travel_country
*
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace query()
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereDescription($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereLatitude($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereLongitude($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereTravelCountryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelPlace whereUpdatedAt($value)
* @mixin \Eloquent
*/
class TravelPlace extends Model
{

View file

@ -106,6 +106,8 @@ use App\Services\Util;
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelUserBookingFile[] $booking_files
* @property-read int|null $booking_files_count
* @property-read \App\Models\TravelUser $customer
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelUserBookingFewoNotice[] $booking_fewo_notices
* @property-read int|null $booking_fewo_notices_count
*/
class TravelUserBookingFewo extends Model
{

View file

@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model;
/**
* Class TravelUserBookingFewoNotice
*
*
* @property int $id
* @property int $travel_user_booking_fewo_id
* @property int $from_user_id
@ -23,10 +23,24 @@ use Illuminate\Database\Eloquent\Model;
* @property Carbon $edit_at
* @property Carbon $created_at
* @property Carbon $updated_at
*
* @property TravelUserBookingFewo $travel_user_booking_fewo
*
* @package App\Models
* @property-read User $from_user
* @property-read User|null $to_user
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice query()
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereEditAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereFromUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereImportant($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereMessage($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereShow($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereToUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereTravelUserBookingFewoId($value)
* @method static \Illuminate\Database\Eloquent\Builder|TravelUserBookingFewoNotice whereUpdatedAt($value)
* @mixin \Eloquent
*/
class TravelUserBookingFewoNotice extends Model
{

View file

@ -209,6 +209,7 @@ class BookingRepository extends BaseRepository {
abort(500);
}
$fill['participant_pass'] = isset($fill['participant_pass']) ? true : false;
$fill['participant_storno'] = isset($fill['participant_storno']) ? true : false;
$fill['participant_child'] = isset($fill['participant_child']) ? true : false;
$fill['participant_birthdate'] = isset($fill['participant_birthdate']) ? _reformat_date($fill['participant_birthdate']) : null;
$Participant->fill($fill);
@ -223,7 +224,6 @@ class BookingRepository extends BaseRepository {
$this->model->participant_birthdate = isset($data['participant_birthdate']) ? _reformat_date($data['participant_birthdate']) : null;
$this->model->participant_pass = isset($data['participant_pass']) ? true : false;
$this->model->save();
return $this->model;
}

View file

@ -243,7 +243,6 @@ class CustomerMailRepository extends BaseRepository {
}
}
}
}
foreach ($value->customers as $key=>$val){
$val['email'] = $first_mail;

View file

@ -300,7 +300,7 @@ class LeadMailRepository extends BaseRepository {
$value->lead_title_id = " - (".$value->lead->id.")";
$tmp = [];
$tmp['email'] = $lead->customer ? $lead->customer->email : "";
$tmp['email'] = $lead_mail->customer ? $lead_mail->email : "";
$tmp['name'] = $lead->customer ? $lead->customer->firstname . " " . $lead->customer->name . " | " : "- | ";
$tmp['name'] .= $lead->id ? $lead->id. " | " : "- | ";
$data['customers'][$lead->id] = $tmp;

View file

@ -0,0 +1,235 @@
<?php
namespace App\Services;
use Illuminate\Http\Request as IlluminateRequest;
use Illuminate\Http\Response as IlluminateHtmlResponse;
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
use Illuminate\Support\MessageBag;
use Google2FA;
use Request;
class AuthGoogle2FA
{
const CONFIG_PACKAGE_NAME = 'google2fa';
const SESSION_AUTH_PASSED = 'auth_passed';
const OTP_EMPTY = 'empty';
const OTP_VALID = 'valid';
const OTP_INVALID = 'invalid';
protected $password;
protected $request;
protected $auth;
public function __construct(IlluminateRequest $request)
{
$this->request = $request;
return $this;
}
public function init(IlluminateRequest $request)
{
$this->request = $request;
return $this;
}
public function isAuthenticated()
{
if(!$this->hasSecretKey() || !$this->isEnabled() || $this->noUserIsAuthenticated()){
return false;
}
if($this->twoFactorAuthStillValid()){
return true;
}
return ($this->checkOTP() === $this::OTP_VALID);
}
public function logout()
{
$this->sessionForget();
}
public function makeActiveOneTimePasswordResponse()
{
if($this->request->isMethod('post') && Request::get('action') === 'activate_user_one_time_password'){
$user = $this->getUser();
$user->google2fa = true;
$user->save();
return back();
}
$MyGoogle2FA = new MyGoogle2FA();
$MyGoogle2FA->init($this->getUser())->generate();
$fill = [
'MyGoogle2FA' => $MyGoogle2FA,
];
$view = view("auth.google2fa_activate", $fill);
return new IlluminateHtmlResponse($view);
}
public function makeRequestOneTimePasswordResponse()
{
$view = view($this->config('view'));
$statusCode = $this->makeStatusCode();
if ($statusCode !== SymfonyResponse::HTTP_OK) {
$view->withErrors($this->getErrorBagForStatusCode($statusCode));
}
return new IlluminateHtmlResponse($view, $statusCode);
}
protected function checkOTP()
{
if (!$this->request->has($this->config('otp_input') )|| empty($this->request->input($this->config('otp_input')))) {
return $this::OTP_EMPTY;
}
$isValid = $this->verifyOneTimePassword();
if ($isValid) {
$this->login();
return $this::OTP_VALID;
}
return $this::OTP_INVALID;
}
protected function login()
{
$this->sessionPut($this::SESSION_AUTH_PASSED, true);
}
protected function verifyOneTimePassword()
{
return Google2FA::verifyKey($this->getGoogle2FASecretKey(), $this->getOneTimePassword());
}
private function getOneTimePassword()
{
$password =$this->request->input($this->config('otp_input'));
if (is_null($password) || empty($password)) {
if ($this->config('throw_exceptions', true)) {
throw new \Exception($this->config('error_messages.cannot_be_empty')); }
}
return $password;
}
private function getGoogle2FASecretKey()
{
return $this->getUser()->{$this->config('otp_secret_column')};
}
private function hasSecretKey()
{
$secret = $this->getGoogle2FASecretKey();
return !is_null($secret) && !empty($secret);
}
private function twoFactorAuthStillValid()
{
return (bool) $this->sessionGet($this::SESSION_AUTH_PASSED, false);
}
private function isEnabled()
{
return $this->config('enabled');
}
private function noUserIsAuthenticated()
{
return is_null($this->getUser());
}
private function config($string, $default = null)
{
if (is_null(config($config = $this::CONFIG_PACKAGE_NAME))) {
throw new \Exception("Config ({$config}.php) not found. Have you published it?");
}
return config(
implode('.', [$this::CONFIG_PACKAGE_NAME, $string]),
$default
);
}
private function getAuth()
{
if (is_null($this->auth)) {
$this->auth = app($this->config('auth'));
if (!empty($this->config('guard'))) {
$this->auth = app($this->config('auth'))->guard($this->config('guard'));
}
}
return $this->auth;
}
private function getUser()
{
return $this->getAuth()->user();
}
private function makeSessionVarName($name = null)
{
return $this->config('session_var') . (is_null($name) || empty($name) ? '' : '.' . $name);
}
private function sessionGet($var = null, $default = null)
{
return $this->request->session()->get(
$this->makeSessionVarName($var),
$default
);
}
private function sessionPut($var, $value)
{
$this->request->session()->put(
$this->makeSessionVarName($var),
$value
);
return $value;
}
private function sessionForget($var = null)
{
$this->request->session()->forget(
$this->makeSessionVarName($var)
);
}
private function makeStatusCode()
{
if ($this->request->isMethod('get') || ($this->checkOTP() === $this::OTP_VALID)) {
return SymfonyResponse::HTTP_OK;
}
if ($this->checkOTP() === $this::OTP_EMPTY) {
return SymfonyResponse::HTTP_BAD_REQUEST;
}
return SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY;
}
private function getErrorBagForStatusCode($statusCode)
{
$errorMap = [
SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY => 'google2fa.error_messages.wrong_otp',
SymfonyResponse::HTTP_BAD_REQUEST => 'google2fa.error_messages.cannot_be_empty',
];
return $this->createErrorBagForMessage(
trans(
config(
array_key_exists($statusCode, $errorMap) ? $errorMap[$statusCode] : 'google2fa.error_messages.unknown'
)
)
);
}
private function createErrorBagForMessage($message)
{
return new MessageBag([
'message' => $message,
]);
}
}

127
app/Services/Google2FA.php Normal file
View file

@ -0,0 +1,127 @@
<?php
namespace App\Services;
use App\Models\Airline;
use App\Models\Insurance;
use App\Models\CMSContent;
use App\Models\CustomerMail;
use App\Models\TravelCompany;
class Booking
{
private static $output_dirs = [];
public static function contentFiles(){
$booking_email_files = CMSContent::where('identifier', '=', 'booking-email-file')->get()->sortByDesc('pos')->pluck('slug', 'id');
return $booking_email_files;
}
public static function setOutputDirs($dir, $subdir){
self::$output_dirs[$dir][] = $subdir;
}
public static function getMailDirNotInOutput($booking_id, $dir){
$is_o_dirs = isset(self::$output_dirs[$dir]) ? self::$output_dirs[$dir] : [];
$ret = [];
$CustomerMails = CustomerMail::whereBookingId($booking_id)->whereDir($dir)->get();
if($CustomerMails){
foreach($CustomerMails as $CustomerMail){
if(!in_array($CustomerMail->subdir, $is_o_dirs)){
$ret[] = $CustomerMail->subdir;
}
}
}
return $ret;
}
public static function getCustomerMailDirs(){
$customer_mail_dirs = CMSContent::where('identifier', '=', 'customer-mail-dirs')->get()->sortBy('pos');
return $customer_mail_dirs;
}
public static function getCustomerMailDir($id){
return CMSContent::where('identifier', '=', 'customer-mail-dirs')->where('pos', '=', $id)->first();
}
public static function getCustomerMailName($customer_mail_dir, $mail_dir_id){
switch ($customer_mail_dir->getArrayContent('model')){
case 'TravelCountry':
$model = \App\Models\Sym\TravelCountry::find($mail_dir_id);
break;
case 'Airline':
$model = Airline::find($mail_dir_id);
break;
case 'Insurance':
$model = Insurance::find($mail_dir_id);
break;
case 'TravelCompany':
$model = TravelCompany::find($mail_dir_id);
break;
default:
return '';
}
if($model){
if($customer_mail_dir->getArrayContent('model') === 'TravelCountry'){
return $model->mail_dir_name;
}
return $model->name;
}
return "";
}
public static function getCustomerMailEmails($customer_mail_dir, $mail_dir_id){
switch ($customer_mail_dir->getArrayContent('model')){
case 'TravelCountry':
$model = \App\Models\Sym\TravelCountry::find($mail_dir_id);
break;
case 'Airline':
$model = Airline::find($mail_dir_id);
break;
case 'Insurance':
$model = Insurance::find($mail_dir_id);
break;
case 'TravelCompany':
$model = TravelCompany::find($mail_dir_id);
break;
default:
//direkt from CMSContent
return $customer_mail_dir->getArrayContent('emails');
}
if($model){
return $model->contact_emails;
}
return [];
}
public static function getBookingInstructionPDFName($fewo){
return "HINWEISE-FERIENWOHNUNG-".$fewo->pdf_name.".pdf";
}
public static function getBookingCMSContent($content, $identifier){
return CMSContent::where('identifier', '=', $identifier)->where('integer', $content->id)->get()->sortBy('pos');
}
public static function getBookingCMSContentForPDF($identifier_content, $identifier){
$pdf_content = [];
$contents = CMSContent::where('identifier', '=', $identifier_content)->get()->sortBy('pos');
foreach ($contents as $content){
if($content->decimal > 0){ //in_pdf
$pdf_content[] = $content;
}
if($fewo_contents = self::getBookingCMSContent($content, $identifier)){
foreach ($fewo_contents as $fewo_content){
if($fewo_content->decimal > 0){ //in_pdf
$pdf_content[] = $fewo_content;
}
}
}
}
return $pdf_content;
}
}

View file

@ -239,7 +239,7 @@ class HTMLHelper
$ret = '<option value="0">Keine Vorlage</option>\n';
}
foreach ($options as $option){
$attr = ($option->id === $setId) ? 'selected="selected"' : '';
$attr = ($option->id === intval($setId)) ? 'selected="selected"' : '';
$ret .= '<option value="'.$option->id.'" '.$attr.'>'.$option->name.'</option>\n';
}
return $ret;

View file

@ -0,0 +1,105 @@
<?php
namespace App\Services;
use Google2FA;
class MyGoogle2FA
{
private $fileName = 'google2fasecret.key';
private $name = 'mein.sterntours.de';
private $email = '';
private $secretKey;
private $keySize = 32;
private $keyPrefix = '';
private $inlineUrl = '';
private $valid = '';
private $user = null;
public function init($user){
$this->name = str_replace('https://', '', config('app.url'));
$this->user = $user;
$this->email = $user->email;
return $this;
}
public function generate()
{
$this->generateSecretKey();
$this->inlineUrl = $this->getQRCodeInline();
}
public function check2Fa($code)
{
if(!$this->getSecretKey()){
return false;
}
$this->valid = $this->validateInput($code);
return $this->valid;
}
public function getBy($key){
return isset($this->{$key}) ? $this->{$key} : '';
}
private function getQRCodeInline()
{
return Google2FA::getQRCodeInline(
$this->name,
$this->email,
$this->secretKey
);
}
private function getSecretKey()
{
if (! $this->secretKey = $this->getStoredKey())
{
return null;
}
return $this->secretKey;
}
private function generateSecretKey()
{
if (! $this->secretKey = $this->getStoredKey())
{
$this->secretKey = Google2FA::generateSecretKey($this->keySize, $this->keyPrefix);
$this->user->secret_key = $this->secretKey;
$this->user->save();
}
return $this->secretKey;
}
private function getStoredKey()
{
// No need to read it from disk it again if we already have it
if ($this->secretKey)
{
return $this->secretKey;
}
if(! $this->user->secret_key){
return null;
}
return $this->user->secret_key;
}
private function validateInput($code)
{
// Verify the code
return Google2FA::verifyKey($this->secretKey, $code);
}
public static function logout()
{
(new AuthGoogle2FA(request()))->logout();
}
}

View file

@ -10,7 +10,7 @@ class Placeholder
{
public static $placeholder_booking = [
'dear' => '#geehrte/r#',
'dear' => '#geehrte:r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
'first_name' => '#Vorname#',
@ -26,6 +26,7 @@ class Placeholder
'net_price_travel' => '#Nettopreise_Rundreise#',
'net_price_extra_services' => '#Nettopreise_zugebuchte_Leistungen#',
'booked_rooms' => '#Gebuchte_Zimmer#',
'myjack_nr' => "#MyJackNr#",
'filekey' => "#Filekey#",
'flight_info' => "#Airline_Fluginfo#",
'check_in' => "#Airline_Checkin#",
@ -35,7 +36,7 @@ class Placeholder
];
public static $placeholder_lead = [
'dear' => '#geehrte/r#',
'dear' => '#geehrte:r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
'first_name' => '#Vorname#',
@ -49,7 +50,7 @@ class Placeholder
];
public static $placeholder_fewo= [
'dear' => '#geehrte/r#',
'dear' => '#geehrte:r#',
'salutation' => '#Anrede#',
'title' => '#Titel#',
'first_name' => '#Vorname#',
@ -60,6 +61,36 @@ class Placeholder
'booking_date' => '#Buchungsdatum#',
];
public static function getOptionsSummernote($key){
/*
[{value:'blockChainId', content:'blockChainId'},
{value:'attachement', content:'attachement'},
{value:'address', content:'address'}]*/
$ret = "";
switch ($key) {
case 'booking':
$placehoder = self::$placeholder_booking;
break;
case 'lead':
$placehoder = self::$placeholder_lead;
break;
case 'fewo':
$placehoder = self::$placeholder_fewo;
break;
default:
$placehoder = self::$placeholder_booking;
break;
}
foreach ($placehoder as $key => $value) {
$value = str_replace('#', '', $value);
$ret .= "'".$value."',";
}
return $ret;
}
public static function getOptionsQuill($key){
$ret = "";
switch ($key) {
@ -93,6 +124,7 @@ class Placeholder
}
return $ret;
}
public static function getLeadOptions(){
$ret = "";
foreach (self::$placeholder_lead as $key => $value) {
@ -140,6 +172,8 @@ class Placeholder
$net_price_extra_services = self::getBookingPlaceholdersBy('net_price_extra_services', $booking);
$booked_rooms = self::getBookingPlaceholdersBy('booked_rooms', $booking);
$myjack_nr = $booking->merlin_order_number;
$participants = "Teilnehmer:<br>";
//first
if($booking->participant_firstname){
@ -164,10 +198,8 @@ class Placeholder
$replace = [];
foreach (self::$placeholder_booking as $key => $value) {
if(isset(${$key})){
$search[] = $value;
$replace[] = ${$key};
}
$search[] = $value;
$replace[] = isset(${$key}) ? ${$key} : "";
}
$content = str_replace($search, $replace, $content);
$content = preg_replace('/<placeholder.*?>(.*?)<\/placeholder>/', '$1', $content);
@ -234,11 +266,7 @@ class Placeholder
return $content;
}
private static function getBookingPlaceholdersBy($key, $booking){
if($booking->new_drafts){
$booked_rooms = '';
$extra_services = '';
@ -281,7 +309,6 @@ class Placeholder
}
}
}
private static function cleanText($text){

View file

@ -7,10 +7,11 @@ use App\Models\SfGuardUser;
use App\Mail\MailResetPassword;
use Laravel\Passport\HasApiTokens;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Crypt;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use PhpOffice\PhpSpreadsheet\Calculation\Statistical\Distributions\F;
/**
* App\User
@ -93,7 +94,6 @@ class User extends Authenticatable
protected $dates = ['deleted_at'];
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
@ -109,7 +109,7 @@ class User extends Authenticatable
* @var array
*/
protected $hidden = [
'password', 'remember_token', 'token',
'password', 'remember_token', 'token', 'secret_key',
];
protected $casts = [
@ -134,6 +134,20 @@ class User extends Authenticatable
return $this->hasMany('App\Models\UserUpdateEmail', 'user_id', 'id');
}
public function isGoogle2Fa(){
return ($this->google2fa && $this->secret_key) ? true : false;
}
public function setSecretKeyAttribute($value)
{
$this->attributes['secret_key'] = $value ? Crypt::encryptString($value) : null;
}
public function getSecretKeyAttribute($value)
{
return $value ? Crypt::decryptString($value) : null;
}
/**
* @return bool
*/
@ -149,6 +163,9 @@ class User extends Authenticatable
*/
public function isAdmin()
{
if(!$this->active){
return false;
}
if($this->admin >= 1){
return true;
}
@ -160,6 +177,9 @@ class User extends Authenticatable
*/
public function isSuperAdmin()
{
if(!$this->active){
return false;
}
if($this->admin >= 2){
return true;
}
@ -171,6 +191,9 @@ class User extends Authenticatable
*/
public function isSySAdmin()
{
if(!$this->active){
return false;
}
if($this->admin >= 3){
return true;
}

View file

@ -35,6 +35,28 @@
0 => 'Cviebrock\\EloquentSluggable\\ServiceProvider',
),
),
'digital-bird/shoppingcart' =>
array (
'providers' =>
array (
0 => 'Gloudemans\\Shoppingcart\\ShoppingcartServiceProvider',
),
'aliases' =>
array (
'Cart' => 'Gloudemans\\Shoppingcart\\Facades\\Cart',
),
),
'facade/ignition' =>
array (
'providers' =>
array (
0 => 'Facade\\Ignition\\IgnitionServiceProvider',
),
'aliases' =>
array (
'Flare' => 'Facade\\Ignition\\Facades\\Flare',
),
),
'fideloper/proxy' =>
array (
'providers' =>
@ -42,6 +64,13 @@
0 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
),
),
'fruitcake/laravel-cors' =>
array (
'providers' =>
array (
0 => 'Fruitcake\\Cors\\CorsServiceProvider',
),
),
'intervention/image' =>
array (
'providers' =>
@ -92,6 +121,13 @@
0 => 'Laravel\\Passport\\PassportServiceProvider',
),
),
'laravel/sail' =>
array (
'providers' =>
array (
0 => 'Laravel\\Sail\\SailServiceProvider',
),
),
'laravel/tinker' =>
array (
'providers' =>
@ -99,6 +135,13 @@
0 => 'Laravel\\Tinker\\TinkerServiceProvider',
),
),
'laravel/ui' =>
array (
'providers' =>
array (
0 => 'Laravel\\Ui\\UiServiceProvider',
),
),
'laravelcollective/html' =>
array (
'providers' =>
@ -136,6 +179,17 @@
0 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
),
),
'pragmarx/google2fa-laravel' =>
array (
'providers' =>
array (
0 => 'PragmaRX\\Google2FALaravel\\ServiceProvider',
),
'aliases' =>
array (
'Google2FA' => 'PragmaRX\\Google2FALaravel\\Facade',
),
),
'reliese/laravel' =>
array (
'providers' =>

View file

@ -27,33 +27,39 @@
23 => 'Barryvdh\\DomPDF\\ServiceProvider',
24 => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
25 => 'Cviebrock\\EloquentSluggable\\ServiceProvider',
26 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
27 => 'Intervention\\Image\\ImageServiceProvider',
28 => 'IqContent\\LaravelFilemanager\\LaravelFilemanagerServiceProvider',
29 => 'Jenssegers\\Date\\DateServiceProvider',
30 => 'Laracasts\\Flash\\FlashServiceProvider',
31 => 'Laravel\\Passport\\PassportServiceProvider',
32 => 'Laravel\\Tinker\\TinkerServiceProvider',
33 => 'Collective\\Html\\HtmlServiceProvider',
34 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
35 => 'Carbon\\Laravel\\ServiceProvider',
36 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
37 => 'Reliese\\Coders\\CodersServiceProvider',
38 => 'Yajra\\DataTables\\DataTablesServiceProvider',
39 => 'Laravel\\Tinker\\TinkerServiceProvider',
40 => 'Laravel\\Passport\\PassportServiceProvider',
41 => 'App\\Providers\\AppServiceProvider',
42 => 'App\\Providers\\AuthServiceProvider',
43 => 'App\\Providers\\EventServiceProvider',
44 => 'App\\Providers\\RouteServiceProvider',
45 => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
46 => 'Barryvdh\\DomPDF\\ServiceProvider',
47 => 'Jenssegers\\Date\\DateServiceProvider',
48 => 'Collective\\Html\\HtmlServiceProvider',
49 => 'Intervention\\Image\\ImageServiceProvider',
50 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
51 => 'Yajra\\DataTables\\DataTablesServiceProvider',
52 => 'Reliese\\Coders\\CodersServiceProvider',
26 => 'Gloudemans\\Shoppingcart\\ShoppingcartServiceProvider',
27 => 'Facade\\Ignition\\IgnitionServiceProvider',
28 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
29 => 'Fruitcake\\Cors\\CorsServiceProvider',
30 => 'Intervention\\Image\\ImageServiceProvider',
31 => 'IqContent\\LaravelFilemanager\\LaravelFilemanagerServiceProvider',
32 => 'Jenssegers\\Date\\DateServiceProvider',
33 => 'Laracasts\\Flash\\FlashServiceProvider',
34 => 'Laravel\\Passport\\PassportServiceProvider',
35 => 'Laravel\\Sail\\SailServiceProvider',
36 => 'Laravel\\Tinker\\TinkerServiceProvider',
37 => 'Laravel\\Ui\\UiServiceProvider',
38 => 'Collective\\Html\\HtmlServiceProvider',
39 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
40 => 'Carbon\\Laravel\\ServiceProvider',
41 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
42 => 'PragmaRX\\Google2FALaravel\\ServiceProvider',
43 => 'Reliese\\Coders\\CodersServiceProvider',
44 => 'Yajra\\DataTables\\DataTablesServiceProvider',
45 => 'Laravel\\Tinker\\TinkerServiceProvider',
46 => 'Laravel\\Passport\\PassportServiceProvider',
47 => 'App\\Providers\\AppServiceProvider',
48 => 'App\\Providers\\AuthServiceProvider',
49 => 'App\\Providers\\EventServiceProvider',
50 => 'App\\Providers\\RouteServiceProvider',
51 => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
52 => 'Barryvdh\\DomPDF\\ServiceProvider',
53 => 'Jenssegers\\Date\\DateServiceProvider',
54 => 'Collective\\Html\\HtmlServiceProvider',
55 => 'Intervention\\Image\\ImageServiceProvider',
56 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
57 => 'Yajra\\DataTables\\DataTablesServiceProvider',
58 => 'Reliese\\Coders\\CodersServiceProvider',
),
'eager' =>
array (
@ -69,31 +75,34 @@
9 => 'Illuminate\\View\\ViewServiceProvider',
10 => 'Barryvdh\\Debugbar\\ServiceProvider',
11 => 'Barryvdh\\DomPDF\\ServiceProvider',
12 => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
13 => 'Cviebrock\\EloquentSluggable\\ServiceProvider',
14 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
15 => 'Intervention\\Image\\ImageServiceProvider',
16 => 'IqContent\\LaravelFilemanager\\LaravelFilemanagerServiceProvider',
17 => 'Jenssegers\\Date\\DateServiceProvider',
18 => 'Laracasts\\Flash\\FlashServiceProvider',
19 => 'Laravel\\Passport\\PassportServiceProvider',
20 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
21 => 'Carbon\\Laravel\\ServiceProvider',
22 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
23 => 'Reliese\\Coders\\CodersServiceProvider',
24 => 'Yajra\\DataTables\\DataTablesServiceProvider',
25 => 'Laravel\\Passport\\PassportServiceProvider',
26 => 'App\\Providers\\AppServiceProvider',
27 => 'App\\Providers\\AuthServiceProvider',
28 => 'App\\Providers\\EventServiceProvider',
29 => 'App\\Providers\\RouteServiceProvider',
30 => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
31 => 'Barryvdh\\DomPDF\\ServiceProvider',
32 => 'Jenssegers\\Date\\DateServiceProvider',
33 => 'Intervention\\Image\\ImageServiceProvider',
34 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
35 => 'Yajra\\DataTables\\DataTablesServiceProvider',
36 => 'Reliese\\Coders\\CodersServiceProvider',
12 => 'Cviebrock\\EloquentSluggable\\ServiceProvider',
13 => 'Gloudemans\\Shoppingcart\\ShoppingcartServiceProvider',
14 => 'Facade\\Ignition\\IgnitionServiceProvider',
15 => 'Fideloper\\Proxy\\TrustedProxyServiceProvider',
16 => 'Fruitcake\\Cors\\CorsServiceProvider',
17 => 'Intervention\\Image\\ImageServiceProvider',
18 => 'IqContent\\LaravelFilemanager\\LaravelFilemanagerServiceProvider',
19 => 'Jenssegers\\Date\\DateServiceProvider',
20 => 'Laracasts\\Flash\\FlashServiceProvider',
21 => 'Laravel\\Passport\\PassportServiceProvider',
22 => 'Laravel\\Ui\\UiServiceProvider',
23 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
24 => 'Carbon\\Laravel\\ServiceProvider',
25 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider',
26 => 'PragmaRX\\Google2FALaravel\\ServiceProvider',
27 => 'Reliese\\Coders\\CodersServiceProvider',
28 => 'Yajra\\DataTables\\DataTablesServiceProvider',
29 => 'Laravel\\Passport\\PassportServiceProvider',
30 => 'App\\Providers\\AppServiceProvider',
31 => 'App\\Providers\\AuthServiceProvider',
32 => 'App\\Providers\\EventServiceProvider',
33 => 'App\\Providers\\RouteServiceProvider',
34 => 'Barryvdh\\DomPDF\\ServiceProvider',
35 => 'Jenssegers\\Date\\DateServiceProvider',
36 => 'Intervention\\Image\\ImageServiceProvider',
37 => 'Maatwebsite\\Excel\\ExcelServiceProvider',
38 => 'Yajra\\DataTables\\DataTablesServiceProvider',
39 => 'Reliese\\Coders\\CodersServiceProvider',
),
'deferred' =>
array (
@ -103,16 +112,20 @@
'Illuminate\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Contracts\\Bus\\Dispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Contracts\\Bus\\QueueingDispatcher' => 'Illuminate\\Bus\\BusServiceProvider',
'Illuminate\\Bus\\BatchRepository' => 'Illuminate\\Bus\\BusServiceProvider',
'cache' => 'Illuminate\\Cache\\CacheServiceProvider',
'cache.store' => 'Illuminate\\Cache\\CacheServiceProvider',
'cache.psr6' => 'Illuminate\\Cache\\CacheServiceProvider',
'memcached.connector' => 'Illuminate\\Cache\\CacheServiceProvider',
'Illuminate\\Cache\\RateLimiter' => 'Illuminate\\Cache\\CacheServiceProvider',
'command.cache.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cache.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.clear-compiled' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.auth.resets.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.config.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.config.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Database\\Console\\DbCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.db.prune' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.db.wipe' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.down' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.environment' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
@ -123,26 +136,36 @@
'command.optimize' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.optimize.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.package.discover' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.preset' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.failed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.flush' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.forget' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.listen' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.monitor' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.prune-batches' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.prune-failed-jobs' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.restart' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.retry' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.retry-batch' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.work' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.route.list' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.schema.dump' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.seed' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleFinishCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleListCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleRunCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleTestCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'Illuminate\\Console\\Scheduling\\ScheduleWorkCommand' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.storage.link' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.up' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.view.cache' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.view.clear' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cache.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.cast.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.channel.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.component.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.console.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.controller.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.event.generate' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
@ -161,12 +184,14 @@
'command.provider.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.failed-table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.queue.batches-table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.request.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.resource.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.rule.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.seeder.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.session.table' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.serve' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.stub.publish' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.test.make' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'command.vendor.publish' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'migrator' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
@ -183,16 +208,15 @@
'composer' => 'Illuminate\\Foundation\\Providers\\ConsoleSupportServiceProvider',
'hash' => 'Illuminate\\Hashing\\HashServiceProvider',
'hash.driver' => 'Illuminate\\Hashing\\HashServiceProvider',
'mail.manager' => 'Illuminate\\Mail\\MailServiceProvider',
'mailer' => 'Illuminate\\Mail\\MailServiceProvider',
'swift.mailer' => 'Illuminate\\Mail\\MailServiceProvider',
'swift.transport' => 'Illuminate\\Mail\\MailServiceProvider',
'Illuminate\\Mail\\Markdown' => 'Illuminate\\Mail\\MailServiceProvider',
'Illuminate\\Contracts\\Pipeline\\Hub' => 'Illuminate\\Pipeline\\PipelineServiceProvider',
'queue' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.worker' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.listener' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.failer' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.connection' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.failer' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.listener' => 'Illuminate\\Queue\\QueueServiceProvider',
'queue.worker' => 'Illuminate\\Queue\\QueueServiceProvider',
'redis' => 'Illuminate\\Redis\\RedisServiceProvider',
'redis.connection' => 'Illuminate\\Redis\\RedisServiceProvider',
'auth.password' => 'Illuminate\\Auth\\Passwords\\PasswordResetServiceProvider',
@ -201,6 +225,10 @@
'translation.loader' => 'Illuminate\\Translation\\TranslationServiceProvider',
'validator' => 'Illuminate\\Validation\\ValidationServiceProvider',
'validation.presence' => 'Illuminate\\Validation\\ValidationServiceProvider',
'command.ide-helper.generate' => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
'command.ide-helper.models' => 'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider',
'Laravel\\Sail\\Console\\InstallCommand' => 'Laravel\\Sail\\SailServiceProvider',
'Laravel\\Sail\\Console\\PublishCommand' => 'Laravel\\Sail\\SailServiceProvider',
'command.tinker' => 'Laravel\\Tinker\\TinkerServiceProvider',
'html' => 'Collective\\Html\\HtmlServiceProvider',
'form' => 'Collective\\Html\\HtmlServiceProvider',
@ -245,6 +273,12 @@
'Illuminate\\Validation\\ValidationServiceProvider' =>
array (
),
'Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider' =>
array (
),
'Laravel\\Sail\\SailServiceProvider' =>
array (
),
'Laravel\\Tinker\\TinkerServiceProvider' =>
array (
),

View file

@ -14,35 +14,41 @@
}
],
"require": {
"php": "^7.2",
"barryvdh/laravel-dompdf": "^0.8.5",
"setasign/fpdf": "1.8.*",
"setasign/fpdi": "^2.0",
"php": "^7.3|^8.0",
"barryvdh/laravel-dompdf": "*",
"cviebrock/eloquent-sluggable": "*",
"digital-bird/shoppingcart": "^3.0",
"doctrine/dbal": "*",
"fideloper/proxy": "*",
"guzzlehttp/guzzle": "*",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"intervention/image": "*",
"iqcontent/laravel-filemanager": "*",
"jenssegers/date": "*",
"laracasts/flash": "*",
"laravel/framework": "^6.0",
"laravel/helpers": "^1.1",
"laravel/framework": "^8.12",
"laravel/helpers": "*",
"laravel/passport": "*",
"laravel/tinker": "*",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.1",
"laravelcollective/html": "*",
"maatwebsite/excel": "^3.1",
"reliese/laravel": "*",
"yajra/laravel-datatables-oracle": "*"
"rguedes/pdfmerger": "^1.0",
"setasign/fpdf": "*",
"setasign/fpdi": "*",
"yajra/laravel-datatables-oracle": "*",
"iqcontent/laravel-filemanager": "*",
"maatwebsite/excel": "^3.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "*",
"filp/whoops": "*",
"fzaninotto/faker": "*",
"mockery/mockery": "*",
"nunomaduro/collision": "*",
"phpunit/phpunit": "*"
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3",
"barryvdh/laravel-debugbar": "*",
"barryvdh/laravel-ide-helper": "*"
},
"autoload": {
"files": [
@ -87,9 +93,9 @@
]
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true

83
config/google2fa.php Normal file
View file

@ -0,0 +1,83 @@
<?php
return [
/*
* Enable / disable Google2FA.
*/
'enabled' => env('OTP_ENABLED', true),
/*
* Lifetime in minutes.
*
* In case you need your users to be asked for a new one time passwords from time to time.
*/
'lifetime' => env('OTP_LIFETIME', 0), // 0 = eternal
/*
* Renew lifetime at every new request.
*/
'keep_alive' => env('OTP_KEEP_ALIVE', true),
/*
* Auth container binding.
*/
'auth' => 'auth',
/*
* Guard.
*/
'guard' => '',
/*
* 2FA verified session var.
*/
'session_var' => 'google2fa',
/*
* One Time Password request input name.
*/
'otp_input' => 'one_time_password',
/*
* One Time Password Window.
*/
'window' => 1,
/*
* Forbid user to reuse One Time Passwords.
*/
'forbid_old_passwords' => false,
/*
* User's table column for google2fa secret.
*/
'otp_secret_column' => 'secret_key',
/*
* One Time Password View.
*/
'view' => 'auth.google2fa',
/*
* One Time Password error message.
*/
'error_messages' => [
'wrong_otp' => "Das 'One Time Password' ist falsch.",
'cannot_be_empty' => "Das 'One Time Password' kann nicht leer sein.",
'unknown' => "Ein unbekannter Fehler ist aufgetreten. Bitte versuche es erneut.",
],
/*
* Throw exceptions or just fire events?
*/
'throw_exceptions' => env('OTP_THROW_EXCEPTION', true),
/*
* Which image backend to use for generating QR codes?
*
* Supports imagemagick, svg and eps
*/
'qrcode_image_backend' => \PragmaRX\Google2FALaravel\Support\Constants::QRCODE_IMAGE_BACKEND_SVG,
];

View file

@ -18,6 +18,8 @@ class CreateUsersTable extends Migration
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->string('secret_key', 50);
$table->boolean('google2fa')->default(false);
$table->boolean('confirmed')->default(false);
$table->string('confirmation_code', 30)->index()->nullable();

View file

@ -26,8 +26,9 @@ class CreateParticipantTable extends Migration
$table->bigInteger('participant_salutation_id')->nullable();
$table->tinyInteger('participant_child')->nullable()->default(0);
$table->tinyInteger('participant_pass')->nullable()->default(0);
$table->tinyInteger('participant_storno')->nullable()->default(0);
$table->unsignedInteger('nationality_id')->nullable();
$table->index('booking_id', 'participant_booking_id_idx');
$table->index('participant_salutation_id', 'participant_participant_salutation_id_idx');

View file

@ -19,16 +19,17 @@
}
],
"require": {
"php": ">=7.1.3",
"php": ">=7.2.0",
"ext-exif": "*",
"ext-fileinfo": "*",
"intervention/image": "2.*",
"illuminate/config": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0",
"illuminate/filesystem": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0",
"illuminate/support": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0",
"illuminate/http": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0",
"illuminate/container": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0",
"illuminate/config": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0",
"illuminate/filesystem": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0",
"illuminate/support": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0",
"illuminate/http": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0",
"illuminate/container": "5.4.* || 5.5.* || 5.6.* || 5.7.* || 5.8.* || ^6.0 || ^7.0 || ^8.0",
"cviebrock/eloquent-sluggable": "*"
},
"require-dev": {
"phpunit/phpunit": "^6.2",

View file

@ -279,46 +279,6 @@ function ajax_object_action(event, object, callback) {
return false;
}
function update_modal_data_show(e, $ele) {
e.preventDefault();
var ele = $ele,
url = ele.data('url'),
data = {id:ele.data('data')} ,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
/* console.log(data);
console.log(url);*/
$.ajax({
url: url,
data: data,
type: "POST",
dataType: "html",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
success: function(data) {
// do what ever you want here. add content to <div> if it was not 1 .
//console.log(data);
$('#update-modal-content').html(data);
$('.selectpicker').selectpicker(["refresh"]);
$('.input-daterange').datepicker({toggleActive: true,format: 'dd.mm.yyyy'});
// $.Nestable.init();
$('#updateModalShow').modal('show');
},
error: function(xhr, status, errorThrown) {
console.log(xhr);
console.log(xhr.responseText);
console.log(status);
console.log("Sorry, there was a problem!");
}
});
return false;
}
function update_modal_data_load(e, $ele) {
var ele = $ele,
url = ele.data('url'),

View file

@ -0,0 +1,269 @@
(function(factory)
{
/* global define */
if (typeof define === 'function' && define.amd)
{
// AMD. Register as an anonymous module.
define(['jquery'], factory);
}
else if (typeof module === 'object' && module.exports)
{
// Node/CommonJS
module.exports = factory(require('jquery'));
}
else
{
// Browser globals
factory(window.jQuery);
}
}(function($)
{
// Extends plugins for adding gallery.
// - plugin is external module for customizing.
$.extend($.summernote.plugins,
{
/**
* @param {Object} context - context object has status of editor.
*/
'gallery': function(context)
{
var self = this;
// ui has renders to build ui elements.
// - you can create a button with `ui.button`
var ui = $.summernote.ui;
// add gallery button
context.memo('button.gallery', function()
{
// create button
var button = ui.button(
{
contents: '<i class="fa fa-image"></i>',
tooltip: 'Medien',
click: function()
{
self.fillModal();
self.$modal.modal();
}
});
// create jQuery object from button instance.
$gallery = button.render();
return $gallery;
});
// This events will be attached when editor is initialized.
this.events = {
// This will be called after modules are initialized.
'summernote.init': function(we, e)
{
self.editable = context.layoutInfo.editable; //contentEditable element
self.editor = this;
// get summernote onInit set parameters
self.image_dialog_images_url = $(this).data('image_dialog_images_url');
self.image_dialog_images_html = $(this).data('image_dialog_images_html');
self.image_dialog_title = $(this).data('image_dialog_title');
self.image_dialog_close_btn_text = $(this).data('image_dialog_close_btn_text');
self.image_dialog_ok_btn_text = $(this).data('image_dialog_ok_btn_text');
self.fillModal = function()
{
//fill modal with images whether from url or given html
if (typeof self.image_dialog_images_html !== "undefined")
{
self.setModalHtml(self.image_dialog_images_html)
self.setEvents();
}
else if (typeof self.image_dialog_images_url !== "undefined")
{
var next = self.setEvents;
self.getImagesFromUrl(next);
}
else
{
console.error("options image_dialog_images_html or image_dialog_images_url must be set");
}
};
self.setModalHtml = function(html)
{ // set variabl parts to modal html
var title = self.image_dialog_title;
var close = self.image_dialog_close_btn_text;
var ok = self.image_dialog_ok_btn_text;
if (self.image_dialog_title !== "undefined") self.$modal.find('.modal-title').html(title);
if (self.image_dialog_close_btn_text !== "undefined") self.$modal.find('#modal_iq_close').html(close);
if (self.image_dialog_ok_btn_text !== "undefined") self.$modal.find('#modal_iq_save').html(ok);
self.$modal.find('.modal-body').html(html);
LFileManager.initFileManager(true);
};
self.getImagesFromUrl = function(callback)
{
// get images html from url
$.get(self.image_dialog_images_url, function(html)
{
self.setModalHtml(html);
callback();
}).fail(function()
{
console.error("error loading from "+self.image_dialog_images_url);
})
};
self.setEvents = function()
{
// images click event to select image
/*self.$modal.find('img').click(function(event)
{
// $(this).toggleClass(self.select_class);
});*/
};
// set the focus to the last focused element in the editor
self.recoverEditorFocus = function ()
{
var last_focused_el = $(self.editor).data('last_focused_element');
if(typeof last_focused_el !== "undefined")
{
var editor = self.editable;
var range = document.createRange();
var sel = window.getSelection();
var cursor_position = last_focused_el.length;
range.setStart(last_focused_el, cursor_position);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
editor.focus();
}
};
self.saveLastFocusedElement = function()
{
var focused_element = window.getSelection().focusNode;
var parent = $(self.editable).get(0);
if ($.contains(parent, focused_element))
{
$(self.editor).data('last_focused_element', focused_element)
}
};
self.editorEvents = function () {
$(self.editable).on('keypress, mousemove', function()
{
self.saveLastFocusedElement();
})
};
self.editorEvents();
self.fillModal();
},
// This will be called when user releases a key on editable.
'summernote.keyup': function(we, e)
{
self.saveLastFocusedElement();
}
};
// This method will be called when editor is initialized by $('..').summernote();
// You can create elements for plugin
this.initialize = function()
{
var $modal = this.$modal = $('#modal_iq_assets').hide();
// add selected images to summernote editor
$modal.find("button#modal_iq_save").click(function(event)
{
var items = LFileManager.getSelectedItems();
$modal.modal('hide');
self.recoverEditorFocus();
items.forEach(function (item, index) {
var insert = self.insertHTML(item);
if(insert){
context.invoke('editor.pasteHTML', insert);
}
});
});
};
this.insertHTML = function(item){
var title = 'Bildtitel ...';
var description = '';
var author_name = '';
var img_title = '';
if(item.content !== null){
if(item.content.title !== undefined && item.content.title){
title = item.content.title;
img_title = item.content.title;
}
if(item.content.description !== undefined && item.content.description){
description = ' ' + item.content.description;
}
if(item.content.author_name !== undefined && item.content.author_name){
author_name = 'Bildquelle: ' + item.content.author_name;
if(img_title !== ''){
img_title = img_title + " | " + author_name;
}else{
img_title = author_name;
}
}
}
// console.log(item)
var insert = '';
if(item.is_file && item.is_image){
insert += '<div class="mediaA">'+
'<img src="'+item.url+'" alt="'+title+'" class="img-responsive" title="'+img_title+'" data-slug="'+item.slug+'" width="auto" height="auto">' +
'<div class="mediaInfo">\n' +
'<p class="infotext">' + title + '</p>\n' +
'</div>\n' +
'</div>';
return insert;
}
if(item.icon === "fab fa-youtube-square"){
insert += '<div class="mediaA" itemprop="video" itemscope itemtype="http://schema.org/VideoObject">\n' +
'<h2><span itemprop="name">'+ title +'</span></h2>\n' +
'<meta itemprop="duration" content="'+item.content.duration+'" />\n' +
'<meta itemprop="uploadDate" content="'+item.content.uploadDate+'"/>\n' +
'<meta itemprop="thumbnailURL" content="'+item.content.thumbnailURL+'" />\n' +
'<meta itemprop="embedURL" content="https://youtube.googleapis.com/v/'+item.content.id+'" />\n' +
'<div class="video-container">\n' +
'<iframe src="https://www.youtube.com/embed/'+item.content.id+'?rel=0&controls=0&showinfo=0" data-identifier="'+item.identifier+'" data-slug="'+item.slug+'" frameborder="0" allowfullscreen></iframe>\n' +
'</div>\n' +
'<div class="mediaInfo">\n' +
'<p class="infotext" itemprop="description">' + description + '</p>\n' +
'</div>\n' +
'</div>';
return insert;
}
if(item.is_file){
insert += '<a href="'+item.url+'" title="'+title+'" data-identifier="'+item.identifier+'">'+item.name+'</a>';
if(description !== ''){
insert += '<p>'+description+'</p>';
}
return insert;
}
return false;
};
// This methods will be called when editor is destroyed by $('..').summernote('destroy');
// You should remove elements on `initialize`.
this.destroy = function()
{
console.log("destroy");
// this.$panel.remove();
// this.$panel = null;
};
}
});
}));

View file

@ -0,0 +1,112 @@
(function(factory)
{
/* global define */
if (typeof define === 'function' && define.amd)
{
// AMD. Register as an anonymous module.
define(['jquery'], factory);
}
else if (typeof module === 'object' && module.exports)
{
// Node/CommonJS
module.exports = factory(require('jquery'));
}
else
{
// Browser globals
factory(window.jQuery);
}
}(function($)
{
// Extends plugins for adding gallery.
// - plugin is external module for customizing.
$.extend($.summernote.plugins,
{
/**
* @param {Object} context - context object has status of editor.
*/
'placeholders': function(context)
{
var self = this;
var options = context.options.placeholderList;
var defaultOptions = {
label: "Platzhalter",
tooltip: "Platzhalter einfügen",
blockChar : '#',
};
for (var propertyName in defaultOptions) {
if (options && propertyName && options.hasOwnProperty(propertyName) === false) {
options[propertyName] = defaultOptions[propertyName];
}
}
var ui = $.summernote.ui;
// add gallery button
context.memo('button.placeholders', function()
{
var placeholdersButton = ui.buttonGroup([
ui.button({
className: 'dropdown-toggle',
contents: '<span class="template"/> ' + options.label + ' <span class="caret"></span>',
tooltip: options.tooltip,
data: {
toggle: 'dropdown'
},
click: function () {
console.log('placeholders button click');
context.invoke('editor.saveRange');
}
}),
ui.dropdown({
className: 'dropdown-style',
items: options.items,
callback: function($dropdown) {
//console.log('$dropdown callback');
},
click: function (event) {
event.preventDefault();
var $button = $(event.target);
var value = $button.data('value');
var text = options.blockChar + value + options.blockChar;
context.invoke('editor.insertText', text);
//console.log('$dropdown click : ' + options.blockChar + value + options.blockChar);
},
template: function(item)
{
var content = (typeof item === 'string') ? item : (item.content || item.value || '');
return content;
}
})
]).render();
return placeholdersButton;
});
// This events will be attached when editor is initialized.
this.events = {
// This will be called after modules are initialized.
'summernote.init': function(we, e) {
//console.log('summernote initialized', we, e);
},
// This will be called when user releases a key on editable.
'summernote.keyup': function(we, e) {
//console.log('summernote keyup', we, e);
}
};
// This methods will be called when editor is destroyed by $('..').summernote('destroy');
// You should remove elements on `initialize`.
this.destroy = function()
{
console.log("destroy");
// this.$panel.remove();
// this.$panel = null;
};
}
});
}));

View file

@ -113,6 +113,7 @@ return [
'url' => ':attribute muss eine URL sein.',
'old_password' => 'Passwort ist nicht gültig',
'users_update_email' => 'Die E-Mail ist schon zur Änderung eingetragen',
'usernotactive' => 'Konto ist nicht aktiv',
/*
|--------------------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show more