FlyUnitedVirtual Posted February 12, 2012 Report Share Posted February 12, 2012 When i click on logout i get this Message: Warning: Cannot modify header information - headers already sent by (output started at /home/hawaiian/public_html/www.AlaskaAirVA.org/core/modules/Pilots/Pilots.php:2) in /home/hawaiian/public_html/www.AlaskaAirVA.org/core/common/Auth.class.php on line 341Warning: Cannot modify header information - headers already sent by (output started at /home/hawaiian/public_html/www.AlaskaAirVA.org/core/modules/Pilots/Pilots.php:2) in /home/hawaiian/public_html/www.AlaskaAirVA.org/core/modules/Logout/Logout.php on line 26 And upon logging in i recieve this error message: Warning: Cannot modify header information - headers already sent by (output started at /home/hawaiian/public_html/www.AlaskaAirVA.org/core/modules/Pilots/Pilots.php:2) in /home/hawaiian/public_html/www.AlaskaAirVA.org/core/modules/Login/Login.php on line 154 Any ideas? Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted February 12, 2012 Moderators Report Share Posted February 12, 2012 When i click on logout i get this Message: And upon logging in i recieve this error message: Any ideas? Check you folder and file permission on you server, looks like you have some reading issues on modifying folders and files. Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 12, 2012 Report Share Posted February 12, 2012 I have a similar issue on login this Warning: Cannot modify header information - headers already sent by (output started at /home/canadian/public_html/core/local.config.php:1) in /home/canadian/public_html/core/modules/Login/Login.php on line 143 Warning: Cannot modify header information - headers already sent by (output started at /home/canadian/public_html/core/local.config.php:1) in /home/canadian/public_html/core/modules/Login/Login.php on line 154 Then I click my home and im log in. On log out this Warning: Cannot modify header information - headers already sent by (output started at /home/canadian/public_html/core/local.config.php:1) in /home/canadian/public_html/core/common/Auth.class.php on line 341 Other strange issues cant see my routes, pilots in the Phpvms admin panel. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted February 14, 2012 Administrators Report Share Posted February 14, 2012 Warning: Cannot modify header information - headers already sent by Is commonly caused by whitespace in a php file in the core of the application. If it is only happening during login and logout one of those class files must have been edited and there is some whitespace prior to the opening php tag or an ending php tag has been added and there is whitespace after it. Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 14, 2012 Report Share Posted February 14, 2012 Here is what im seeing in Notepad++ Can you please point me to the whitespace so I can see a visual example. 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 { $pilotdata = PilotData::GetPilotByEmail($email); if(!$pilotdata) { $this->render('login_notfound.tpl'); return; } $newpw = substr(md5(date('mdYhs')), 0, 6); RegistrationData::ChangePassword($pilotdata->pilotid, $newpw); $this->set('firstname', $pilotdata->firstname); $this->set('lastname', $pilotdata->lastname); $this->set('newpw', $newpw); $message = Template::GetTemplate('email_lostpassword.tpl', true); Util::SendEmail($pilotdata->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::$userinfo->confirmed == PILOT_PENDING) { $this->render('login_unconfirmed.tpl'); Auth::LogOut(); // show error } elseif(Auth::$userinfo->confirmed == PILOT_REJECTED) { $this->render('login_rejected.tpl'); Auth::LogOut(); } else { $pilotid = Auth::$userinfo->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); #$this->set('redir', SITE_URL . '/' . $this->post->redir); #$this->render('login_complete.tpl'); CodonEvent::Dispatch('login_success', 'Login'); $this->post->redir = str_replace('index.php/', '', $this->post->redir); header('Location: '.url('/'.$this->post->redir)); } return; } } } Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 14, 2012 Moderators Report Share Posted February 14, 2012 Can you copy all the file and place it in a code tag in the forum? So code "file contents in here" /code Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 14, 2012 Report Share Posted February 14, 2012 "<?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 */ 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 { $pilotdata = PilotData::GetPilotByEmail($email); if(!$pilotdata) { $this->render('login_notfound.tpl'); return; } $newpw = substr(md5(date('mdYhs')), 0, 6); RegistrationData::ChangePassword($pilotdata->pilotid, $newpw); $this->set('firstname', $pilotdata->firstname); $this->set('lastname', $pilotdata->lastname); $this->set('newpw', $newpw); $message = Template::GetTemplate('email_lostpassword.tpl', true); Util::SendEmail($pilotdata->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::$userinfo->confirmed == PILOT_PENDING) { $this->render('login_unconfirmed.tpl'); Auth::LogOut(); // show error } elseif(Auth::$userinfo->confirmed == PILOT_REJECTED) { $this->render('login_rejected.tpl'); Auth::LogOut(); } else { $pilotid = Auth::$userinfo->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); #$this->set('redir', SITE_URL . '/' . $this->post->redir); #$this->render('login_complete.tpl'); CodonEvent::Dispatch('login_success', 'Login'); $this->post->redir = str_replace('index.php/', '', $this->post->redir); header('Location: '.url('/'.$this->post->redir)); } return; } } }" Login.php Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 14, 2012 Moderators Report Share Posted February 14, 2012 Those " should not be there at the start and end of the file Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 14, 2012 Report Share Posted February 14, 2012 "<?php and }" So delete the " at the start and end? Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted February 14, 2012 Moderators Report Share Posted February 14, 2012 yes justr delete the braskets i belive they called (") at hthe beginning and the end Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 14, 2012 Report Share Posted February 14, 2012 post #6 "file contents in here" Those " in post #8 related. I pasted the code between those quotes. In notepad++ I dont see those at the begin or end. Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted February 14, 2012 Moderators Report Share Posted February 14, 2012 then there is a white space at the start off it probably Quote Link to comment Share on other sites More sharing options...
Moderators mark1million Posted February 14, 2012 Moderators Report Share Posted February 14, 2012 Download the files again for what version you are on and upload them to replace the two effected files. Quote Link to comment Share on other sites More sharing options...
MPE001 Posted February 14, 2012 Report Share Posted February 14, 2012 Download the files again for what version you are on and upload them to replace the two effected files. I believe this is base http://www.phpvms.net/downloads Then grab the php affected and upload thru FTP to proper structure folder Hum still getting error. 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.