当前位置: 首页>>代码示例>>PHP>>正文


PHP PilotData::GetPilotData方法代码示例

本文整理汇总了PHP中PilotData::GetPilotData方法的典型用法代码示例。如果您正苦于以下问题:PHP PilotData::GetPilotData方法的具体用法?PHP PilotData::GetPilotData怎么用?PHP PilotData::GetPilotData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PilotData的用法示例。


在下文中一共展示了PilotData::GetPilotData方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ProcessRegistration

 protected function ProcessRegistration()
 {
     // Yes, there was an error
     if (!$this->VerifyData()) {
         $this->ShowForm();
     } else {
         $data = array('firstname' => $this->post->firstname, 'lastname' => $this->post->lastname, 'email' => $this->post->email, 'password' => $this->post->password1, 'code' => $this->post->code, 'location' => $this->post->location, 'hub' => $this->post->hub, 'confirm' => false);
         if (CodonEvent::Dispatch('registration_precomplete', 'Registration', $_POST) == false) {
             return false;
         }
         $ret = RegistrationData::CheckUserEmail($data['email']);
         if ($ret) {
             $this->set('error', Lang::gs('email.inuse'));
             $this->render('registration_error.tpl');
             return false;
         }
         $val = RegistrationData::AddUser($data);
         if ($val == false) {
             $this->set('error', RegistrationData::$error);
             $this->render('registration_error.tpl');
             return;
         } else {
             $pilotid = RegistrationData::$pilotid;
             /* Automatically confirm them if that option is set */
             if (Config::Get('PILOT_AUTO_CONFIRM') == true) {
                 PilotData::AcceptPilot($pilotid);
                 RanksData::CalculatePilotRanks();
                 $pilot = PilotData::GetPilotData($pilotid);
                 $this->set('pilot', $pilot);
                 $this->render('registration_autoconfirm.tpl');
             } else {
                 RegistrationData::SendEmailConfirm($email, $firstname, $lastname);
                 $this->render('registration_sentconfirmation.tpl');
             }
         }
         CodonEvent::Dispatch('registration_complete', 'Registration', $_POST);
         // Registration email/show user is waiting for confirmation
         $sub = 'A user has registered';
         $message = "The user {$data['firstname']} {$data['lastname']} ({$data['email']}) has registered, and is awaiting confirmation.";
         $email = Config::Get('EMAIL_NEW_REGISTRATION');
         if (empty($email)) {
             $email = ADMIN_EMAIL;
         }
         Util::SendEmail($email, $sub, $message);
         // Send email to user
         $this->set('firstname', $data['firstname']);
         $this->set('lastname', $data['lastname']);
         $this->set('userinfo', $data);
         $message = Template::Get('email_registered.tpl', true);
         Util::SendEmail($data['email'], 'Registration at ' . SITE_NAME, $message);
         $rss = new RSSFeed('Latest Pilot Registrations', SITE_URL, 'The latest pilot registrations');
         $allpilots = PilotData::GetLatestPilots();
         foreach ($allpilots as $pilot) {
             $rss->AddItem('Pilot ' . PilotData::GetPilotCode($pilot->code, $pilot->pilotid) . ' (' . $pilot->firstname . ' ' . $pilot->lastname . ')', SITE_URL . '/admin/index.php?admin=pendingpilots', '', '');
         }
         $rss->BuildFeed(LIB_PATH . '/rss/latestpilots.rss');
     }
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:58,代码来源:Registration.php

示例2: testDeleteUser

 function testDeleteUser()
 {
     $result = PilotData::DeletePilot($this->pilotid);
     $this->assertTrue($result, 'Deleting pilot');
     # Verify deletion
     $data = PilotData::GetPilotData($this->pilotid);
     $this->assertFalse($data, "Pilot still exists");
     # Last test, add a line break
     echo "<br />";
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:10,代码来源:registration_test.php

示例3: StartAuth

 /**
  * Start the "auth engine", see if anyone is logged in and grab their info
  *
  * @return mixed This is the return value description
  *
  */
 public static function StartAuth()
 {
     self::$init = true;
     self::$session_id = SessionManager::Get('session_id');
     $assign_id = false;
     if (self::$session_id == '') {
         if ($_COOKIE[VMS_AUTH_COOKIE] != '') {
             $data = explode('|', $_COOKIE[VMS_AUTH_COOKIE]);
             $session_id = $data[0];
             $pilot_id = $data[1];
             $ip_address = $data[2];
             // TODO: Determine data reliability from IP addresses marked
             $session_info = self::get_session($session_id, $pilot_id, $ip_address);
             if ($session_info) {
                 /* Populate session info */
                 $userinfo = PilotData::GetPilotData($pilot_id);
                 if (!$userinfo) {
                     self::$loggedin = false;
                     return false;
                 }
                 self::$loggedin = true;
                 self::$userinfo = $userinfo;
                 self::$pilot = $userinfo;
                 self::$pilotid = self::$userinfo->pilotid;
                 self::$usergroups = SessionManager::Get('usergroups');
                 self::$session_id = $session_id;
                 if (self::$usergroups == '') {
                     self::$usergroups = PilotGroups::GetUserGroups($userinfo->pilotid);
                 }
                 SessionManager::Set('loggedin', true);
                 SessionManager::Set('userinfo', $userinfo);
                 SessionManager::Set('usergroups', self::$usergroups);
                 PilotData::UpdateLogin($userinfo->pilotid);
                 self::update_session(self::$session_id, self::$userinfo->pilotid);
                 return true;
             }
         }
         // Look for an existing session based on ID
         // No session ID was found anywhere so assign one
         $assign_id = true;
         self::$session_id = self::start_session(0);
         SessionManager::Set('session_id', self::$session_id);
     } else {
         // There's a session ID, so double check that they're logged in
         if (SessionManager::Get('loggedin') == true) {
             self::$loggedin = true;
             self::$userinfo = SessionManager::Get('userinfo');
             self::$pilot = self::$userinfo;
             self::$usergroups = PilotGroups::GetUserGroups(self::$userinfo->pilotid);
             self::$pilotid = self::$userinfo->pilotid;
             # Bugfix, in case user updates their profile info, grab the latest
             self::$userinfo = PilotData::GetPilotData(self::$pilotid);
             self::$pilot = self::$userinfo;
             self::update_session(self::$session_id, self::$userinfo->pilotid);
             return true;
         } else {
             // Already been assigned a session ID, and not signed in...
             self::$loggedin = false;
             self::update_session(self::$session_id, 0);
             $assign_id = false;
         }
     }
     // Empty session so start one up, and they're not logged in
     if ($assign_id == true) {
     }
     return true;
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:73,代码来源:Auth.class.php

示例4: testDeleteUser

 /**
  * UserTest::testDeleteUser()
  * 
  * @return void
  */
 public function testDeleteUser()
 {
     $pilot = PilotData::getPilotByEmail('unittest2@email.com');
     $this->assertObjectHasAttribute('pilotid', $pilot, 'PilotData::getPilotByEmail');
     $result = PilotData::deletePilot($pilot->pilotid);
     $data = PilotData::GetPilotData($pilot->pilotid);
     $this->assertFalse($data, "Pilot still exists");
 }
开发者ID:Galihom,项目名称:phpVMS,代码行数:13,代码来源:UserTest.php

示例5: intval

 case 'pirep':
     Debug::log('PIREP FILE', 'fsacars');
     Debug::log(serialize($_GET), 'fsacars');
     $pilotid = PilotData::parsePilotID($_GET['pilot']);
     /*if(is_numeric($_GET['pilot']))
     		{
     			$pilotid = $_GET['pilot'];
     		}
     		else
     		{
     			# see if they are a valid pilot:
     			preg_match('/^([A-Za-z]*)(\d*)/', $_GET['pilot'], $matches);
     			$code = $matches[1];
     			$pilotid = intval($matches[2]) - Config::Get('PILOTID_OFFSET');
     		}*/
     if (!($pilot = PilotData::GetPilotData($pilotid))) {
         echo 'Invalid Pilot!';
         return;
     }
     #
     # Check if anything was in the log
     #	If not, then it probably wasn't a multi-chunk, so
     #	 just pull it straight from the query string
     #	Otherwise, pull the full-text from the session
     #
     if ($_GET['more'] == '1') {
         #
         # We have more coming to the log
         #
         $report = PIREPData::GetLastReports($pilotid, 1);
         /* Check for any other data which might be in the other
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:31,代码来源:fsacars.php

示例6: calculateUpdatePilotRank

 public static function calculateUpdatePilotRank($pilotid)
 {
     /* Don't calculate a pilot's rank if this is set */
     if (Config::Get('RANKS_AUTOCALCULATE') == false) {
         return;
     }
     $pilotid = intval($pilotid);
     $allranks = self::GetAllRanks();
     $pilot = PilotData::GetPilotData($pilotid);
     $pilothours = $pilot->totalhours;
     if (Config::Get('TRANSFER_HOURS_IN_RANKS') == true) {
         $pilothours += $pilot->transferhours;
     }
     $i = 0;
     foreach ($allranks as $rank) {
         $i++;
         if ($pilothours >= intval($rank->minhours)) {
             $rank_level = $i;
             $last_rank = $rank->rank;
             $last_rankid = $rank->rankid;
         }
     }
     $update = array('rankid' => $last_rankid, 'rank' => $last_rank, 'ranklevel' => $rank_level);
     PilotData::updateProfile($pilot->pilotid, $update);
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:25,代码来源:RanksData.class.php

示例7: intval

    	else
    	{
    		$pilotid = $pilotid = PilotData::parsePilotID($_POST['UserName']);
    		# Check if they entered as XXX###
    		if(preg_match('/^([A-Za-z]*)(.*)(\d*)/', $_POST['UserName'], $matches)>0)
    		{
    			$pilotid = intval(intval(trim($matches[2]))) - Config::Get('PILOTID_OFFSET');
    		}
    		else
    		{
    			# Invalid Pilot
    			echo '#Answer# Error - Invalid pilot ID format;';
    			return;
    		}
    	}*/
    $pilotdata = PilotData::GetPilotData($pilotid);
    if (!$pilotdata) {
        echo '#Answer# Error - Username don\'t exist or wrong password;';
        return;
    }
    # Give it what it wants
    # Derive the config from the main config settings
    echo "#Answer# Ok - connected;";
    echo 'Weight=' . Config::Get('WeightUnit') . ' Dist=' . Config::Get('DistanceUnit') . ' Speed=' . Config::Get('SpeedUnit') . ' Alt=' . Config::Get('AltUnit') . ' Liqu=' . Config::Get('LiquidUnit');
    echo '#welcome#' . Config::Get('WelcomeMessage') . '#endwelcome#';
}
if ($_POST['FsPAskToRegister'] == 'yes') {
    $comment = '';
    # Get the pilot id:
    $pilotid = PilotData::parsePilotID($_POST['UserName']);
    /*if(is_numeric($_POST['UserName']))
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:31,代码来源:fspax.php

示例8: unassign_exam

 public function unassign_exam()
 {
     $pilot_id = $_GET['pilot_id'];
     $exam_id = $_GET['exam_id'];
     ExamsData::unassign_exam($pilot_id, $exam_id);
     $this->set('pilot', PilotData::GetPilotData($pilot_id));
     $this->set('exams', ExamsData::get_exams());
     $this->set('assigned', ExamsData::get_assigned_exams($pilot_id));
     $this->show('exams/exam_assign_list');
 }
开发者ID:web541,项目名称:phpVMS-ExamCenter,代码行数:10,代码来源:Exams.php

示例9: RejectPilot

 protected function RejectPilot()
 {
     $pilot = PilotData::GetPilotData($this->post->id);
     # Send pilot notification
     $subject = Lang::gs('email.register.rejected.subject');
     $this->set('pilot', $pilot);
     $message = Template::Get('email_registrationdenied.tpl', true, true, true);
     Util::SendEmail($pilot->email, $subject, $message);
     # Reject in the end, since it's delted
     PilotData::RejectPilot($this->post->id);
     CodonEvent::Dispatch('pilot_rejected', 'PilotAdmin', $pilot);
     LogData::addLog(Auth::$userinfo->pilotid, 'Approved ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' - ' . $pilot->firstname . ' ' . $pilot->lastname);
 }
开发者ID:rallin,项目名称:phpVMS,代码行数:13,代码来源:PilotAdmin.php

示例10: RejectPilot

 /**
  * PilotAdmin::RejectPilot()
  * 
  * @return
  */
 protected function RejectPilot()
 {
     $this->checkPermission(MODERATE_REGISTRATIONS);
     $pilot = PilotData::GetPilotData($this->post->id);
     # Send pilot notification
     $subject = Lang::gs('email.register.rejected.subject');
     $this->set('pilot', $pilot);
     $oldPath = Template::setTemplatePath(TEMPLATES_PATH);
     $oldSkinPath = Template::setSkinPath(ACTIVE_SKIN_PATH);
     $message = Template::Get('email_registrationdenied.php', true, true, true);
     Template::setTemplatePath($oldPath);
     Template::setSkinPath($oldSkinPath);
     Util::SendEmail($pilot->email, $subject, $message);
     # Reject in the end, since it's delted
     PilotData::RejectPilot($this->post->id);
     CodonEvent::Dispatch('pilot_rejected', 'PilotAdmin', $pilot);
     LogData::addLog(Auth::$userinfo->pilotid, 'Approved ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' - ' . $pilot->firstname . ' ' . $pilot->lastname);
 }
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:23,代码来源:PilotAdmin.php


注:本文中的PilotData::GetPilotData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。