Jump to content

Recommended Posts

Posted

[sOLVED]

Hi, i have updated my pilot list and it worked fine and looked good but i just went on it and its not working??

this is what comes up

pilots.PNG

It was working fine earlyer today and i havent touched and thing the only thing i did today way add the new module

this one

http://forum.phpvms.net/topic/5768-pilotlogins-v10/

i have removed ot for the ftp then placed it back that didnt work i re did it and that didt work it keeps saying its not there

Any ideas ????/

Nathan

  • Like 1
Posted

Then somethin has changed in the pilots.tpl or it no longer exists. Check to see if you actually have a pilots.tpl file

I have got Pilots_list.tpl thats it ent it ?

Nathan

Posted

yeah, that's it. Can you post what is inside? I couldn't post mine because I have changed it so much it isn't recognizable to the original, so it wouldn't be any use to you.

  • Like 1
Posted

Yea

Heres the pilot list tpl

<p><?php echo $title?></p>

<?php

if(!$allpilots)

{

echo 'There are no pilots!';

return;

}

?>

<table border="1">

<thead>

<tr>

<th>Pilot ID</th>

<th>Name</th>

<th>Hours</th>

<th>Flights</th>

<th>Last Flight</th>

<th>Rank</th>

</tr>

</thead>

<tbody>

<?php

foreach($allpilots as $pilot)

{

/*

To include a custom field, use the following example:

<td>

<?php echo PilotData::GetFieldValue($pilot->pilotid, 'VATSIM ID'); ?>

</td>

For instance, if you added a field called "IVAO Callsign":

echo PilotData::GetFieldValue($pilot->pilotid, 'IVAO Callsign');

*/

// To skip a retired pilot, uncomment the next line:

//if($pilot->retired == 1) { continue; }

?>

<tr>

<td width="14%" nowrap><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>">

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a>

</td>

<td>

<img src="<?php echo Countries::getCountryImage($pilot->location);?>"

alt="<?php echo Countries::getCountryName($pilot->location);?>" />

<?php echo $pilot->firstname.' '.$pilot->lastname?>

</td>

<td><center><?php echo Util::AddTime($pilot->totalhours, $pilot->transferhours); ?></center></td>

<td><center><?php echo $pilot->totalflights?></center></td>

<td><center><?php if($pilot->lastpirep == 0) {echo '<font color="#FF0000">No Flights Filed</font>';}else{echo '<font color="669966">'.date('d/m/Y', strtotime($pilot->lastpirep));} ?></center></td>

<td><center><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></center></td>

<?php

}

?>

</tbody>

</table>

and heres the pilot login php

<?php

/**

* phpVMS - Virtual Airline Administration Software

* Copyright © 2008 Nabeel Shahzad

* For more information, visit www.phpvms.net

* Forums: http://www.phpvms.net/forum'>http://www.phpvms.net/forum

* Documentation: http://www.phpvms.net/docs'>http://www.phpvms.net/docs

*

* phpVMS is licenced under the following license:

* Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)

* View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/

*

* @author Nabeel Shahzad

* @copyright Copyright © 2008, Nabeel Shahzad

* @link http://www.phpvms.net

*/

class Login extends CodonModule

{

public function __construct()

{

parent::__construct();

}

public function index()

{

$this->login();

}

public function login($redir='')

{

if(Auth::LoggedIn() == true) {

$this->render('login_already.tpl');

return;

}

$this->set('redir', $redir);

if(isset($this->post->action) && $this->post->action == 'login') {

$this->ProcessLogin();

} else {

$this->render('login_form.tpl');

}

}

public function logout()

{

Auth::LogOut();

$this->set('redir', SITE_URL);

$this->render('login_complete.tpl');

}

public function forgotpassword()

{

if($this->post->action == 'resetpass') {

$this->ResetPassword();

return;

}

$this->render('login_forgotpassword.tpl');

}

public function ResetPassword()

{

$email = $this->post->email;

if(!$email) {

return false;

} else {

$pilot = PilotData::GetPilotByEmail($email);

if(!$pilot) {

$this->render('login_notfound.tpl');

return;

}

$newpw = substr(md5(date('mdYhs')), 0, 6);

RegistrationData::ChangePassword($pilot->pilotid, $newpw);

$this->set('firstname', $pilot->firstname);

$this->set('lastname', $pilot->lastname);

$this->set('newpw', $newpw);

$message = Template::GetTemplate('email_lostpassword.tpl', true);

Util::SendEmail($pilot->email, 'Password Reset', $message);

$this->render('login_passwordreset.tpl');

}

}

public function ProcessLogin()

{

$email = $this->post->email;

$password = $this->post->password;

if($email == '' || $password == '')

{

$this->set('message', 'You must fill out both your username and password');

$this->render('login_form.tpl');

return false;

}

if(!Auth::ProcessLogin($email, $password))

{

$this->set('message', Auth::$error_message);

$this->render('login_form.tpl');

return false;

} else {

if(Auth::$pilot->confirmed == PILOT_PENDING) {

$this->render('login_unconfirmed.tpl');

Auth::LogOut();

// show error

} elseif(Auth::$pilot->confirmed == PILOT_REJECTED) {

$this->render('login_rejected.tpl');

Auth::LogOut();

} else {

$pilotid = Auth::$pilot->pilotid;

$session_id = Auth::$session_id;

# If they choose to be "remembered", then assign a cookie

if($this->post->remember == 'on') {

$cookie = "{$session_id}|{$pilotid}|{$_SERVER['REMOTE_ADDR']}";

$res = setrawcookie(VMS_AUTH_COOKIE, $cookie, time() + Config::Get('SESSION_LOGIN_TIME'), '/');

}

PilotData::updateLogin($pilotid);

CodonEvent::Dispatch('login_success', 'Login');

$this->post->redir = str_replace('index.php/', '', $this->post->redir);

header('Location: '.url('/'.$this->post->redir));

}

return;

}

}

}

Posted

Okay, I found your problem. Inside your Modules/Pilots folder you had a Login.php file in there. You should've had a Pilots.php in there. I left the Login.php (not sure why it is there) but also added the Pilots.php It is now working.

You can mark this topic as [sOLVED] by editing the first topic above.

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...