本文整理匯總了PHP中PilotData::GetPilotByEmail方法的典型用法代碼示例。如果您正苦於以下問題:PHP PilotData::GetPilotByEmail方法的具體用法?PHP PilotData::GetPilotByEmail怎麽用?PHP PilotData::GetPilotByEmail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PilotData
的用法示例。
在下文中一共展示了PilotData::GetPilotByEmail方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ResetPassword
public function ResetPassword()
{
$email = $this->post->email;
if (!$email) {
return false;
} else {
$pilot = PilotData::GetPilotByEmail($email);
if (!$pilot) {
$this->render('login_notfound.tpl');
return;
}
$newpw = substr(md5(date('mdYhs')), 0, 6);
RegistrationData::ChangePassword($pilot->pilotid, $newpw);
$this->set('firstname', $pilot->firstname);
$this->set('lastname', $pilot->lastname);
$this->set('newpw', $newpw);
$message = Template::GetTemplate('email_lostpassword.tpl', true);
Util::SendEmail($pilot->email, 'Password Reset', $message);
$this->render('login_passwordreset.tpl');
}
}
示例2: SiteSetup
public static function SiteSetup()
{
/*$_POST['SITE_NAME'] == '' || $_POST['firstname'] == '' || $_POST['lastname'] == ''
|| $_POST['email'] == '' || $_POST['password'] == '' || $_POST['vaname'] == ''
|| $_POST['vacode'] == ''*/
// first add the airline
$_POST['vacode'] = strtoupper($_POST['vacode']);
if (!OperationsData::AddAirline($_POST['vacode'], $_POST['vaname'])) {
self::$error = DB::$error;
return false;
}
// Add an initial airport/hub, because I love KJFK so much
$data = array('icao' => 'KJFK', 'name' => 'Kennedy International', 'country' => 'USA', 'lat' => '40.6398', 'lng' => '-73.7787', 'hub' => false, 'fuelprice' => 0);
$ret = OperationsData::AddAirport($data);
// Add the user
$data = array('firstname' => $_POST['firstname'], 'lastname' => $_POST['lastname'], 'email' => $_POST['email'], l, 'password' => $_POST['password'], 'code' => $_POST['vacode'], 'location' => 'US', 'hub' => 'KJFK', 'confirm' => true);
if (!RegistrationData::AddUser($data)) {
self::$error = DB::$error;
return false;
}
// Add a rank
RanksData::updateRank(1, 'New Hire', 0, fileurl('/lib/images/ranks/newhire.jpg'), 18.0);
# Add to admin group
$pilotdata = PilotData::GetPilotByEmail($_POST['email']);
if (!PilotGroups::AddUsertoGroup($pilotdata->pilotid, 'Administrators')) {
self::$error = DB::$error;
return false;
}
# Add the final settings in
SettingsData::SaveSetting('SITE_NAME', $_POST['SITE_NAME']);
SettingsData::SaveSetting('ADMIN_EMAIL', $_POST['email']);
SettingsData::SaveSetting('GOOGLE_KEY', $_POST['googlekey']);
return true;
}