Jump to content

Maintenance


Ither

Recommended Posts

I've read every thread on this--still can't find answer. Likely because no answer exists is my best guess -- but here's to trying ...

 

When the maintenance file runs in CRON (I own the VPS I'm on) it throws error about authorization--pilot ID of an admin is 100.

 

Here is error I get (it's formatted just like error if I go to file directly without being logged into the crew center.) If I am logged in and run the admin/maintenance.php it completes with no errors.

 

PHP 5.6.4

 

PHP Warning:  Creating default object from empty value in /var/www/vhosts/walkerair.us/httpdocs/crew/admin/maintenance.php on line 26

Warning: Creating default object from empty value in /var/www/vhosts/walkerair.us/httpdocs/crew/admin/maintenance.php on line 26
		<div id="codon_crit_error" 
			style="font-family: 'Lucida Sans',Verdana;border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;">
			<h1 style="font-family: verdana; font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0;">An Error Was Encountered</h1>
			<p style="font-size: 16px; color: #001B6B">Unauthorized access - Invalid Permissions.</p>
            <p style="font-size: 10px;"><center><a href="https://crew.walkerair.us">Return to Homepage</a></p>
		</div>

 

Here is maintenance.php file

 

<?php
/**
 * phpVMS - Virtual Airline Administration Software
 * Copyright (c) 2008 Nabeel Shahzad
 * For more information, visit www.phpvms.net
 *	Forums: http://www.phpvms.net/forum
 *	Documentation: 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 (c) 2008, Nabeel Shahzad
 * @link http://www.phpvms.net
 * @license http://creativecommons.org/licenses/by-nc-sa/3.0/
 */


/*	This is the maintenance cron file, which can run nightly. 
	You should either point to this file directly in your web-host's control panel
	Or add an entry into the crontab file. I recommend running this maybe 2-3am, 
 */
define('ADMIN_PANEL', true);
include dirname(dirname(__FILE__)).'/core/codon.config.php';
Auth::$userinfo->pilotid = 100;

error_reporting(E_ALL);
ini_set('display_errors', 'on');

set_time_limit(0);
ini_set('memory_limit', '-1');

/* Clear expired sessions */
Auth::clearExpiredSessions();

/* Update any expenses */
FinanceData::updateAllExpenses();

if(Config::Get('PILOT_AUTO_RETIRE') == true) {
	/* Find any retired pilots and set them to retired */
	PilotData::findRetiredPilots();
	CronData::set_lastupdate('find_retired_pilots');
}

if(Config::Get('CLOSE_BIDS_AFTER_EXPIRE') === true) {
	SchedulesData::deleteExpiredBids();
	CronData::set_lastupdate('check_expired_bids');
}

MaintenanceData::optimizeTables();

MainController::Run('Maintenance', 'resetpirepcount');
MainController::Run('Maintenance', 'resethours');

 

Link to comment
Share on other sites

11 minutes ago, ProAvia said:

What are the contents of line 26 in maintenance.php?

 

Line 26 is

 

Auth::$userinfo->pilotid = 100;

 

Also it appears this is still running regardless -- I just made bunch of fake bid's and set date back 5 days -- ran the script and all the bids were wiped out (I have 48 hour hold period).

 

Guess I'll just ignore it.

Edited by Ither
Link to comment
Share on other sites

43 minutes ago, Ither said:

 

Line 26 is

 


Auth::$userinfo->pilotid = 100;

 

Also it appears this is still running regardless -- I just made bunch of fake bid's and set date back 5 days -- ran the script and all the bids were wiped out (I have 48 hour hold period).

 

Guess I'll just ignore it.

 

I don't know if I understand correctly, however my code is:

 

Auth::$userinfo->pilotid = 0;

 

Link to comment
Share on other sites

  • Administrators
4 minutes ago, gio1961 said:

 

I don't know if I understand correctly, however my code is:

 

Auth::$userinfo->pilotid = 0;

 

Yes, that is how my code is also. Chances are that there is no pilotid that equals 100.

 

What happens if you put your pilotid there?

Link to comment
Share on other sites

52 minutes ago, ProAvia said:

Yes, that is how my code is also. Chances are that there is no pilotid that equals 100.

 

What happens if you put your pilotid there?

 

That is my pilot ID.

 

There is no pilot ID 0 in my database--my pilotid start at 100 and increment.

 

Keep in mind I'm referring to the column 'pilotid' in phpvms_pilots table.

Edited by Ither
Link to comment
Share on other sites

  • Administrators

There is no pilotid=0 in mine either. But I never use the cron job anyway. Never had an issue with the expired bids remaining after the set time frame. I go to the admin evey so often and run the last 4 maintenance tasks manually. Never an issue since I've been using phpVMS... over 6 years.

 

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