BaRBeR Posted August 15, 2012 Report Share Posted August 15, 2012 hello can someone help with this error i get after logging in... Warning: Cannot modify header information - headers already sent by (output started at /home/ukxpress/public_html/desired-destinations.com/newva/phpvms-2/core/modules/Profile/Profile.php:2) in/home/ukxpress/public_html/desired-destinations.com/newva/phpvms-2/core/modules/Login/Login.php on line 143 Warning: Cannot modify header information - headers already sent by (output started at /home/ukxpress/public_html/desired-destinations.com/newva/phpvms-2/core/modules/Profile/Profile.php:2) in/home/ukxpress/public_html/desired-destinations.com/newva/phpvms-2/core/modules/Login/Login.php on line 154 This is line 143 - $res = setrawcookie(VMS_AUTH_COOKIE, $cookie, time() + Config::Get('SESSION_LOGIN_TIME'), '/'); And this is line 154 - header('Location: '.url('/'.$this->post->redir)); I know its something to do with the header location URL but i don't have a header.tpl Thanks, any help would be appreciated as I'm trying to get open ASAP. Quote Link to comment Share on other sites More sharing options...
Virtualei Posted August 15, 2012 Report Share Posted August 15, 2012 Hi Jordan have a look at this http://forum.phpvms.net/topic/6895-logout-issue-and-a-login-issue/page__hl__+white%20+space#entry46103 Quote Link to comment Share on other sites More sharing options...
BaRBeR Posted August 15, 2012 Author Report Share Posted August 15, 2012 There isn't really a solution on there because the person doesn't fix his error. Quote Link to comment Share on other sites More sharing options...
Virtualei Posted August 15, 2012 Report Share Posted August 15, 2012 Have you been changing anything in your local_config file I had a similar problem and I had to reinstall that file. Quote Link to comment Share on other sites More sharing options...
BaRBeR Posted August 15, 2012 Author Report Share Posted August 15, 2012 no not really done anything with local_config Quote Link to comment Share on other sites More sharing options...
Moderators joeri Posted August 15, 2012 Moderators Report Share Posted August 15, 2012 i belive this has somethign to do wit ha whitespace Quote Link to comment Share on other sites More sharing options...
BaRBeR Posted August 15, 2012 Author Report Share Posted August 15, 2012 there isn't really any white space want me to send/put the login.php file on the post? Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted August 15, 2012 Administrators Report Share Posted August 15, 2012 Look at all the php files that have been edited, especially if they were edited in cpanel. It is most likely a white space at the start of one of them prior to the opening tag as they have mentioned before but can also be a character, cpanel has a habit of inserting a period at the start of the file when it is saved. Quote Link to comment Share on other sites More sharing options...
BaRBeR Posted August 22, 2012 Author Report Share Posted August 22, 2012 This is my login.php anyone see anything - <?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; } } } 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.