Ither Posted March 4, 2020 Report Share Posted March 4, 2020 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'); Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted March 4, 2020 Administrators Report Share Posted March 4, 2020 What are the contents of line 26 in maintenance.php? Quote Link to comment Share on other sites More sharing options...
Ither Posted March 4, 2020 Author Report Share Posted March 4, 2020 (edited) 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 March 4, 2020 by Ither Quote Link to comment Share on other sites More sharing options...
gio1961 Posted March 4, 2020 Report Share Posted March 4, 2020 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; Quote Link to comment Share on other sites More sharing options...
Ither Posted March 4, 2020 Author Report Share Posted March 4, 2020 1 minute ago, gio1961 said: I don't know if I understand correctly, however my code is: Auth::$userinfo->pilotid = 0; That is what my code was too -- but even that throws an error with "Invalid Authorization." Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted March 4, 2020 Administrators Report Share Posted March 4, 2020 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? Quote Link to comment Share on other sites More sharing options...
Ither Posted March 4, 2020 Author Report Share Posted March 4, 2020 (edited) 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 March 4, 2020 by Ither Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted March 4, 2020 Administrators Report Share Posted March 4, 2020 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.