File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed
Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -275,24 +275,20 @@ public function showCommunity()
275275
276276 public function showInviteForm (Request $ request )
277277 {
278- if ($ request ->hashid == null ) {
279- return 'invalid - 1 ' ;
280- } else {
281- $ id = Hashids::decode ($ request ->hashid );
282- if (empty ($ id )) {
283- return 'invalid - 2 ' ;
284- }
285- $ applicant = Applicant::find ($ id [0 ]);
286- if ($ applicant ->decision == 2 ) {
287- return 'link expired - account already created ' ;
288- }
289-
290- if ($ applicant ->decision != 1 ) {
291- return 'invalid - 3 ' ;
292- }
278+ $ id = Hashids::decode ($ request ->hashid );
279+ if (empty ($ id )) {
280+ return redirect ()->action ('PageController@index ' )->with ('message ' , 'Invalid link ' );
281+ }
282+ $ applicant = Applicant::find ($ id [0 ]);
283+ if ($ applicant ->decision == 2 ) {
284+ return redirect ()->action ('PageController@index ' )->with ('message ' , 'Expired link ' );
285+ }
293286
294- return view ('invite ' , ['applicant ' => $ applicant ]);
287+ if ($ applicant ->decision != 1 ) {
288+ return redirect ()->action ('PageController@index ' )->with ('message ' , 'Invalid link ' );
295289 }
290+
291+ return view ('invite ' , ['applicant ' => $ applicant ]);
296292 }
297293
298294 public function submitInviteForm (Request $ request )
Original file line number Diff line number Diff line change 7474 <div class =" container" >
7575 <div class =" row" >
7676 <div class =" col-md-8 offset-md-2" >
77+ @if (session (' message' ) )
78+ <div class =" alert alert-danger" >{{ session (' message' ) } } </div >
79+ @endif
7780 <img src =" img/logo.png" class =" img-fluid logo" >
7881 <h1 class =" brand-heading" >{{ env (' APP_NAME' ) } } </h1 >
7982 @if (env (' APPLICATIONS_OPEN' ) == false )
Original file line number Diff line number Diff line change 1919 return redirect ('https://www.gitbook.com/@launchpadcs ' );
2020});
2121
22- Route::get ('invite/{hashid? } ' , 'PageController@showInviteForm ' );
22+ Route::get ('invite/{hashid} ' , 'PageController@showInviteForm ' );
2323Route::post ('invite ' , 'PageController@submitInviteForm ' );
2424
2525Route::group (['middleware ' => ['phase:1 ' ]], function () {
You can’t perform that action at this time.
0 commit comments