Route cosmetic layout updates, and standardise on using /home to redirect back to the homescreen, and standardise usage of redirect()
This commit is contained in:
@@ -27,7 +27,7 @@ class SocialLoginController extends Controller
|
||||
$openiduser = Socialite::with($provider)->user();
|
||||
|
||||
if (! $openiduser)
|
||||
return redirect('/home')
|
||||
return redirect('home')
|
||||
->with('error','No user details obtained.');
|
||||
|
||||
$oo = ProviderOauth::firstOrCreate(['name'=>$provider,'active'=>TRUE]);
|
||||
@@ -43,7 +43,7 @@ class SocialLoginController extends Controller
|
||||
$user = User::where('email',$openiduser->email)->first();
|
||||
|
||||
if ((! $user) || (! $user->active))
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Invalid account, or account inactive, please contact an admin.');
|
||||
|
||||
return $this->link($provider,$aoo,$user);
|
||||
@@ -54,7 +54,7 @@ class SocialLoginController extends Controller
|
||||
|
||||
// If there are too many users, then we have a problem
|
||||
} elseif ($aoo->count() > 1) {
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Seems you have multiple oauth IDs, please contact an admin.');
|
||||
|
||||
// User is using OAUTH for the first time.
|
||||
@@ -73,11 +73,11 @@ class SocialLoginController extends Controller
|
||||
|
||||
// If there are too many users, then we have a problem
|
||||
} elseif ($uo->count() > 1) {
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Seems you have multiple accounts, please contact an admin.');
|
||||
|
||||
} else {
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Seems you dont have an account with that email, please contact an admin.');
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ class SocialLoginController extends Controller
|
||||
$openiduser = Socialite::with($provider)->user();
|
||||
|
||||
if (! $openiduser)
|
||||
return redirect('/home')
|
||||
return redirect('home')
|
||||
->with('error','No user details obtained.');
|
||||
|
||||
$po = ProviderOauth::where('name',$provider)->singleOrFail();
|
||||
@@ -137,12 +137,12 @@ class SocialLoginController extends Controller
|
||||
|
||||
// Check our email matches
|
||||
if (Arr::get($aoo->oauth_data,'email','invalid') !== $request->post('email'))
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Account details didnt match to make link.');
|
||||
|
||||
// Check our token matches
|
||||
if ($aoo->link_token !== $request->post('token'))
|
||||
return redirect('/login')
|
||||
return redirect('login')
|
||||
->with('error','Token details didnt match to make link.');
|
||||
|
||||
// Load our email.
|
||||
|
@@ -34,8 +34,7 @@ class CheckoutController extends Controller
|
||||
}
|
||||
|
||||
return $o->wasRecentlyCreated
|
||||
? redirect()
|
||||
->to('a/checkout/'.$o->id)
|
||||
? redirect('a/checkout/'.$o->id)
|
||||
->with('success','Checkout added')
|
||||
: redirect()
|
||||
->back()
|
||||
|
@@ -50,7 +50,7 @@ class HomeController extends Controller
|
||||
} catch (ExpiredInviteCode $e) {
|
||||
Log::alert(sprintf('User is using an expired token for invoice [%s] using [%s]',$o->id,$code));
|
||||
|
||||
return redirect()->to('/login');
|
||||
return redirect('login');
|
||||
|
||||
} catch (DoormanException $e) {
|
||||
Log::alert(sprintf('An attempt to read invoice id [%s] using [%s]',$o->id,$code));
|
||||
@@ -72,6 +72,6 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function service_progress(Service $o,string $status)
|
||||
{
|
||||
return redirect()->to($o->action($status) ?: url('u/service',$o->id));
|
||||
return redirect($o->action($status) ?: url('u/service',$o->id));
|
||||
}
|
||||
}
|
@@ -63,8 +63,7 @@ class PaymentController extends Controller
|
||||
}
|
||||
|
||||
return $o->wasRecentlyCreated
|
||||
? redirect()
|
||||
->to('r/payment/'.$o->id)
|
||||
? redirect('r/payment/'.$o->id)
|
||||
->with('success','Payment added')
|
||||
: redirect()
|
||||
->back()
|
||||
|
@@ -34,8 +34,7 @@ class PaypalController extends Controller
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
return redirect()
|
||||
->to(self::cart_url);
|
||||
return redirect(self::cart_url);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,8 +51,7 @@ class PaypalController extends Controller
|
||||
$cart = request()->session()->get('invoice.cart');
|
||||
|
||||
if (! $cart)
|
||||
return redirect()
|
||||
->to('u/home');
|
||||
return redirect('home');
|
||||
|
||||
$invoices = Invoice::find($cart);
|
||||
|
||||
@@ -113,15 +111,13 @@ class PaypalController extends Controller
|
||||
} catch (HttpException $e) {
|
||||
Log::error('Paypal Exception',['request'=>$paypal,'response'=>$e->getMessage()]);
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('Paypal Exception: '.$e->getCode());
|
||||
|
||||
} catch (\HttpException $e) {
|
||||
Log::error('HTTP Exception',['request'=>$this->client,'response'=>$e->getMessage()]);
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('HTTP Exception: '.$e->getCode());
|
||||
}
|
||||
|
||||
@@ -138,8 +134,7 @@ class PaypalController extends Controller
|
||||
return redirect()
|
||||
->away($redirect_url);
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('An error occurred with Paypal?');
|
||||
}
|
||||
|
||||
@@ -192,23 +187,20 @@ class PaypalController extends Controller
|
||||
->away($redirect_url);
|
||||
}
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('An error occurred with Paypal?');
|
||||
|
||||
} catch (\HttpException $e) {
|
||||
Log::error('HTTP Exception',['request'=>$paypal,'response'=>$e->getMessage()]);
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('HTTP Exception: '.$e->getCode());
|
||||
}
|
||||
|
||||
if ((! $response) || (! $response->result->purchase_units)) {
|
||||
Log::error('Paypal Capture: No Purchase Units?');
|
||||
|
||||
return redirect()
|
||||
->to(self::cart_url)
|
||||
return redirect(self::cart_url)
|
||||
->withErrors('Paypal Exception: NPU');
|
||||
}
|
||||
|
||||
@@ -267,8 +259,7 @@ class PaypalController extends Controller
|
||||
|
||||
Log::info('Paypal Payment Recorded',['po'=>$po->id]);
|
||||
|
||||
return redirect()
|
||||
->to('u/home')
|
||||
return redirect('home')
|
||||
->with('success','Payment recorded thank you.');
|
||||
}
|
||||
}
|
@@ -113,7 +113,7 @@ class ServiceController extends Controller
|
||||
$np->pivot->effective_at = Carbon::now();
|
||||
$np->pivot->save();
|
||||
|
||||
return redirect()->to(url('u/service',[$o->id]));
|
||||
return redirect(url('u/service',[$o->id]));
|
||||
}
|
||||
|
||||
return view('theme.backend.adminlte.service.change_pending')
|
||||
@@ -191,7 +191,7 @@ class ServiceController extends Controller
|
||||
|
||||
// An Error Condition
|
||||
if (is_null($result))
|
||||
return redirect()->to('u/service/'.$o->id);
|
||||
return redirect('u/service/'.$o->id);
|
||||
|
||||
elseif ($result instanceof RedirectResponse)
|
||||
return $result;
|
||||
@@ -213,7 +213,7 @@ class ServiceController extends Controller
|
||||
$stage = ''; // @todo this is temporary, we havent written the code to automatically jump to the next stage if wecan
|
||||
}
|
||||
|
||||
return redirect()->to('u/service/'.$o->id);
|
||||
return redirect('u/service/'.$o->id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,7 +30,9 @@ class SupplierController extends Controller
|
||||
$o->save();
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()->withErrors($e->getMessage())->withInput();
|
||||
return redirect()
|
||||
->back()
|
||||
->withErrors($e->getMessage())->withInput();
|
||||
}
|
||||
|
||||
$o->load(['detail']);
|
||||
|
Reference in New Issue
Block a user