Jump to content

PilotLogins_V1.0 (UN-SUPPORTED)


Kyle
Message added by Kyle

WARNING: This module is no longer supported from the developer as the developer is shifting their focus on phpVMS v4 Addons.

Recommended Posts

  • Moderators

PilotLogins_V1.0

What this module does, it captures every login that your pilots login and it enters into the database table. Even you can view all login in the admin panel with the JSON Table. This module will be handy for all phpVMS users, so you can ban all IP's that the pilots used.

Created Under: http://creativecommo...s/by-nc-sa/3.0/

Completed By: Vansers

Thanks To: lorathon (For Helping to understand, and fixing the SQL Query to grab the pilot's info from another table)

I take no credit from this module, this module is just to help you guys and you are free to expand it, but please respect to whoever completed it.

Screenshot of Module:

How To Install:

1) Download the file that is attached here...

2) Unzip the file...

3) Upload/Import the SQL file called phpvms_pilotlogins.sql into the database that your VMS install sits.

4) Upload the files same as the structure as your phpvms files.

5) Go to "core/modules/Login/Login.php" after the following lines..... (Line 131)

PilotData::updateLogin($pilotid);

After that code, add the following code to Login.php

PilotLoginsData::AddLogin($pilotid);

This function will run and it will grab the login info when they login

6) Then, go to admin/templates/core_navigation.tpl.....

After the line...

<li><a href="<?php echo adminurl('/pilotadmin/viewpilots');?>">View All Pilots</a></li>

Add this...

	<?php
	}
	if(PilotGroups::group_has_perm(Auth::$usergroups, FULL_ADMIN))
	{
	?>
	<li><a href="<?php echo adminurl('/PilotLogins/');?>">View All Pilot Logins</a></li>

Then your done! Login, and then head to Admin, and go to View All Pilot Logins.

Then your done!

-------------------------------------------------------

Also, I have a request, if you could let me know if it really works, if it is capturing your ip address correctly, compare it from yours in the list, to that link. http://www.whatismyip.com/

Let me know if it works.

If you have any questions or requests (sometimes it may be filled or not), let me know!

Enjoy the new tool.

Removed:[attachment=689:PilotLogin_V1.0.zip]

Download Here

  • Like 8
Link to comment
Share on other sites

Everything is working as it should here! Thanks for this ;)

Just to inform you, the .sql file is creating the table at this format:

phpvms_pilotlogins and at your class your calling it with the TABLE_PREFIX so it will not work if someone is using a prefix (like me I corrected it for mine)

Link to comment
Share on other sites

  • Moderators

Everything is working as it should here! Thanks for this ;)

Just to inform you, the .sql file is creating the table at this format:

phpvms_pilotlogins and at your class your calling it with the TABLE_PREFIX so it will not work if someone is using a prefix (like me I corrected it for mine)

Ok, Sounds fine. but if there is no table prefix defined in the install, then it won't use the prefix.

Thanks for letting me know that it works everyone!

  • Like 1
Link to comment
Share on other sites

  • Moderators

Yep, works great. +1

When you delete a member, will it still save the ip logs previously from that member so maybe we can post them in here somewhere (or for our own records)?

When you delete it, it will save the IP, but it won't parse the Pilot ID and the name though. I usally keep the pilots in the system and mark their status as Deleted.

Link to comment
Share on other sites

  • Moderators

A further refinement could be to log when a pilot logs in with kACARS if thats possible and also on the public pilot profile tpl have their last 10 logins but only viewable by admins, as i mentioned earlier i have a loop for that already where only admins can view emails and last ip addresses ect.

Link to comment
Share on other sites

  • Moderators

A further refinement could be to log when a pilot logs in with kACARS if thats possible and also on the public pilot profile tpl have their last 10 logins but only viewable by admins, as i mentioned earlier i have a loop for that already where only admins can view emails and last ip addresses ect.

Sorry Mark, I forgot about your request, I will add that later tonight or tomorrow for the Count of last IP address.

Link to comment
Share on other sites

Hi

The code does not work for me...

As far as i realised, any tables with prefix is having trouble working on my end.

What the codes i need to modify in order to have the table without prefix and working?

Thank you all

The table exisit in the database...

But it does not get updates or read from....

I suspect maybe it is due to the prefix..as such after i recreated the tables without the prefix, what are the areas i need to modify in the code to read from the database now without the prefix?

Thank you all

Link to comment
Share on other sites

  • Moderators

Sorry guys,

I wasn't able to have time to update it, I will able to update it soon and I'll be looking into removing the table prefix with a simple SQL query so you won't lose your data.

I will also still work on the last 5 or any number of pilot logins.

Sorry for the delay but real world comes first. ;).

Hope everyone had an awesome long weekend in the U.S. And Canada.

Link to comment
Share on other sites

  • Moderators

Hey Guys,

Just a update, I have worked on the module, making updates. Here's what I have changed.....

1) I removed the table prefix, it's easy to rename the table without losing your data.

2) On markonemillion's request, I have added the ip logs to the public profile, but you can integrate a paggy thing in it. Plus it has a permission needed, you can modify to which permission you want to.

3) I have added a DataClass where your pilots can know how many times they have logged in. In the profile area.

4) Also, I have added the last ip logged in, so in the profile area, it will get the last ip that the pilot logged in.

Things still to add......

Add the DATE_FORMAT to the datestamp in the ip logs.

========================

Also, if anyone still have any request, please let me know and I'll consider your request and might add in the next version.

Thanks!

Link to comment
Share on other sites

  • 3 weeks later...
  • Moderators

Hi,

I get a:

Fatal error: Class 'PilotLoginsData' not found in /home/futurava/public_html/www.euroscotva.co.uk/core/modules/Login/Login.php on line 147

This happens when I add

PilotLoginsData::AddLogin($pilotid);

after

PilotData::UpdateLogin($pilotid);

Hope you can help

Did you upload the PilotLoginData.class file into your core/common folder?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...