Jump to content

Authorization Logged In or Guest


in2tech

Recommended Posts

Nabeel provided the code for the authorization Logged In user and I asked on a Laravel forum about adding Guest because I am new to Laravel and basic PHP coding. So if you want to display the Logged In user or show Guest use this code in your phpVMS v7 theme:

[code}

                @if(Auth::check())
                Welcome: <font color="#6D0C1F"> {{ Auth::user()->name }}
                @else
                Welcome: <font color="#6D0C1F"> Guest
                @endif</font>

[/code]

I'll fix the colors with CSS down the road for now I just cheated to make it quick. Hope this is helpful to someone.

 

And it looks like this:

 

2018-10-21_1629

 

2018-10-21_1630

I like seeing my name when logged in! Let's me know at a glance that I am logged in! And if you are an admin and testing stuff what user you are logged in as. Been doing that a lot lately as I learn Laravel basics and phpVMS 7!

Edited by in2tech
Link to comment
Share on other sites

Thanks for sharing that, for those who are using PHPVMS 5.x.xx, here is a simple code to view your members online;

<?php $usersonline = StatsData::UsersOnline();			
	      foreach($usersonline as $pilot)	
	{	    
		echo "{$pilot->firstname} {$pilot->lastname}-{$pilot->rank}-{$pilot->location}<br />";		    
	}
	
	?>

This gives, 3 total viewing options, you may of course weed it down to your choices. 

  • Confused 1
Link to comment
Share on other sites

  • Administrators
On 10/21/2018 at 5:02 PM, Heritage1 said:

Thanks for sharing that, for those who are using PHPVMS 5.x.xx, here is a simple code to view your members online;


<?php $usersonline = StatsData::UsersOnline();			
	      foreach($usersonline as $pilot)	
	{	    
		echo "{$pilot->firstname} {$pilot->lastname}-{$pilot->rank}-{$pilot->location}<br />";		    
	}
	
	?>

This gives, 3 total viewing options, you may of course weed it down to your choices. 

Let's not put the older phpVMS stuff in here, I don't want to confuse people.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...