AUZ Posted February 17, 2015 Report Share Posted February 17, 2015 Hello All, Since upgrading, I am getting an error on the maintenience.php, Parse error: syntax error, unexpected 'Auth' (T_STRING) in /home/austral/public_html/dispatch/admin/maintenance.php on line 27 And in the maintenience.php at line 27 is, Auth::$userinfo->pilotid = 0; Does anyone know how I can fix this error please ? Thanks in advance, Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 19, 2015 Author Report Share Posted February 19, 2015 Anyone ? Please ? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 19, 2015 Administrators Report Share Posted February 19, 2015 Have you added a line to the start of the file? The default one has that on line 26 not 27. -> https://github.com/DavidJClark/phpvms_5.5.x/blob/master/admin/maintenance.php Did the file get uploaded during your upgrade? Did the upload fail for that file possibly? Have you tried uploading it again and see if you get the same error? How are you running it? (direct link, cronjob, or?) If you are running it as a direct link, are you logged in when you do it? Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 19, 2015 Report Share Posted February 19, 2015 Looks like you are missing the link to the codon.config.php, or you have edited it and made it invalid. Replace it with this, just to make sure: include dirname(dirname(__FILE__)).'core'.DS.'codon.config.php'; Where you are running it from (like simpilot said) will affect it because of the use of dirname(__FILE__). Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 19, 2015 Author Report Share Posted February 19, 2015 Hello again and thank you very much for your replies, Yes running it as a Cronjob and also try to run it manually ( Direct Link) when logged in as Admin. I re-uploaded the maintenience.php to the server from ( phpvms_5.5.x-master ) folder. It does have at line 24 define('ADMIN_PANEL', true); include dirname(dirname(__FILE__)).'core'.DS.'codon.config.php'; Auth::$userinfo->pilotid = 0; Logged in as administrator and run it manually with the new file uploaded I get the following error messages Warning: include(/home/austral/public_html/dispatchcoreDScodon.config.php): failed to open stream: No such file or directory in /home/austral/public_html/dispatch/admin/maintenance.php on line 25 Warning: include(): Failed opening '/home/austral/public_html/dispatchcoreDScodon.config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/austral/public_html/dispatch/admin/maintenance.php on line 25 Fatal error: Class 'Auth' not found in /home/austral/public_html/dispatch/admin/maintenance.php on line 26 The first warning has no " / " after public_html/ where as I assume it should be /home/austral/public_html/dispatch/core/DS/codon.config.php But there is no folder named "DS" and the file codon.config.php is stored directly in the "core" folder. Oh and I forgot to mention, When I upgraded to this version of phpvms wish I must thank you David for an excellent and stable version, I had to change the Administrator Group ID's from the old version to the new version as I couldn't log into the Admin area, I changed the table `phpvms_groups` -> Permissions to the old Permissions ID number so I could be recognised. Would this have anything to do with it ? Looking forward to your response, Thanks in advance, Adam Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 19, 2015 Report Share Posted February 19, 2015 'DS' is a slash, not a directory. The problem is simply that the path is wrong, because you are not using the file in the root folder. What you could do is replace it with this: include '../core/codon.config.php'; Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 19, 2015 Author Report Share Posted February 19, 2015 Thank you itrobb, I did as you advised and it appears to have worked, I am now getting the following error messages Notice: A non well formed numeric value encountered in /home/austral/public_html/dispatch/core/common/StatsData.class.php on line 171 Fatal error: Using $this when not in object context in /home/austral/public_html/dispatch/admin/modules/Maintenance/Maintenance.php on line 116 Error A non well formed numeric value encountered in /home/austral/public_html/dispatch/core/common/StatsData.class.php on line 171 public static function getMonthsSinceDate($start) { $key_month = date('MY', $start); <------------------------------------------ LINE 171 $key = 'months_since_' . $key_month; $months = CodonCache::read($key); if ($months === false) { if (!is_numeric($start)) { $start = strtotime($start); } $end = date('Ym'); do { # Get the months $month = date('M Y', $start); $months[$month] = $start; # Set the timestamp $start = strtotime('+1 month +1 day', strtotime($month)); # Convert to YYYYMM to compare $check = intval(date('Ym', $start)); } while ($check <= $end); CodonCache::write($key, $months, 'long'); } return $months; } Error /home/austral/public_html/dispatch/admin/modules/Maintenance/Maintenance.php on line 116 From line 115 public static function resetpirepcount() { $this->checkPermission(MAINTENANCE); <------------------- LINE 116 echo '<h3>Reset PIREP Counts</h3>'; $all_pilots = PilotData::findPilots(array()); foreach ($all_pilots as $pilot) { $pireps = PIREPData::getReportsByAcceptStatus($pilot->pilotid, PIREP_ACCEPTED); $total = count($pireps); unset($pireps); $code = PilotData::getPilotCode($pilot->code, $pilot->pilotid); echo "{$code} - {$pilot->firstname} {$pilot->lastname} - {$total} pireps<br />"; # Update the pireps table PilotData::updateProfile($pilot->pilotid, array('totalflights' => $total)); } echo 'Completed!'; } Thanks again, Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 19, 2015 Report Share Posted February 19, 2015 Try replacing line 171 with: $key_month = date('MY', strtotime($start)); For the second error, that was probably due to the change you made to the permissions you described. Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 19, 2015 Author Report Share Posted February 19, 2015 Thank you irtobb, Replacing that line with your code appears to of worked becuase a manual run of the maintenience.php has passed that error and now only leaving the second Fatal error: Using $this when not in object context in /home/austral/public_html/dispatch/admin/modules/Maintenance/Maintenance.php on line 116 There doesn't appear to be a Group ID for MAINTENANCE ( "$this->checkPermission(MAINTENANCE);" ) Any idea on where and which table its checking for permissions ? Sorry to be such a newb Thanks Quote Link to comment Share on other sites More sharing options...
freshJet Posted February 19, 2015 Report Share Posted February 19, 2015 Afraid not, need to ask simpilot about that one. I'm not totally understanding the checkPermission() function as I can't even find it anywhere. Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 19, 2015 Author Report Share Posted February 19, 2015 Ok thanks itrobb, you have been a great help so far and I am mostly appreciated for your time and expertise. I shall wait patiently and hope Simpilot replies with some type of solution. Thanks again, 1 Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 20, 2015 Administrators Report Share Posted February 20, 2015 I messed with this some and frankly I am surprised that this has ever run correctly. When the script is used it is assigning a pilot id of "0" and then flushing any old sessions, which would not mean much to a cronjob but without some type of authorization there is no way the last couple of items will be run as long as they are looking for proper permissions. It needs to be rewritten. The checkPermissions() items are within the PilotGroups class if you are still looking for them. 1 Quote Link to comment Share on other sites More sharing options...
AUZ Posted February 21, 2015 Author Report Share Posted February 21, 2015 Hello simpilot, thanks for your reply but it has left me totally confused as to what your saying .. lol So can I do anything to try and fix this issue so the maintenance can be completed ? 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.