Jump to content
in2tech

Authorization Logged In or Guest

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×