Exemple #1
0
 protected function save_profile_post()
 {
     if (!Auth::LoggedIn()) {
         $this->set('message', 'You must be logged in to access this feature!');
         $this->render('core_error.tpl');
         return;
     }
     $userinfo = Auth::$userinfo;
     //TODO: check email validity
     if ($this->post->email == '') {
         return;
     }
     $params = array('code' => Auth::$userinfo->code, 'email' => $this->post->email, 'location' => $this->post->location, 'hub' => Auth::$userinfo->hub, 'bgimage' => $this->post->bgimage, 'retired' => false);
     PilotData::updateProfile($userinfo->pilotid, $params);
     PilotData::SaveFields($userinfo->pilotid, $_POST);
     # Generate a fresh signature
     PilotData::GenerateSignature($userinfo->pilotid);
     PilotData::SaveAvatar($userinfo->code, $userinfo->pilotid);
     $this->set('message', 'Profile saved!');
     $this->render('core_success.tpl');
 }