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


PHP PilotData::GenerateSignature方法代码示例

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


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

示例1: approve_pirep_post

 /**
  * Approve the PIREP, and then update
  * the pilot's data
  */
 protected function approve_pirep_post()
 {
     $pirepid = $this->post->id;
     if ($pirepid == '') {
         return;
     }
     $pirep_details = PIREPData::GetReportDetails($pirepid);
     # See if it's already been accepted
     if (intval($pirep_details->accepted) == PIREP_ACCEPTED) {
         return;
     }
     # Update pilot stats
     SchedulesData::IncrementFlownCount($pirep_details->code, $pirep_details->flightnum);
     PIREPData::ChangePIREPStatus($pirepid, PIREP_ACCEPTED);
     // 1 is accepted
     PilotData::UpdateFlightData($pirep_details->pilotid, $pirep_details->flighttime, 1);
     PilotData::UpdatePilotPay($pirep_details->pilotid, $pirep_details->flighttime);
     RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
     PilotData::GenerateSignature($pirep_details->pilotid);
     StatsData::UpdateTotalHours();
     LogData::addLog(Auth::$userinfo->pilotid, 'Approved PIREP #' . $pirepid);
     # Call the event
     CodonEvent::Dispatch('pirep_accepted', 'PIREPAdmin', $pirep_details);
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:28,代码来源:PIREPAdmin.php

示例2: save_profile_post

 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');
 }
开发者ID:ryanunderwood,项目名称:phpVMS,代码行数:21,代码来源:Profile.php

示例3: addUser

 /**
  * Add a  User
  * 
  * $data = array(
  * 'firstname' => '',
  * 'lastname' => '',
  * 'email' => '',
  * 'password' => '',
  * 'code' => '',
  * 'location' => '',
  * 'hub' => '',
  * 'confirm' => false);
  */
 public static function addUser($data)
 {
     /*$data = array(
       'firstname' => '',
       'lastname' => '',
       'email' => '',
       'password' => '',
       'code' => '',
       'location' => '',
       'hub' => '',
       'confirm' => false);*/
     $exists = self::CheckUserEmail($data['email']);
     if (is_object($exists)) {
         self::$error = 'Email already exists';
         return false;
     }
     //Set the password, add some salt
     $salt = md5(date('His'));
     $password = md5($data['password'] . $salt);
     //Stuff it into here, the confirmation email will use it.
     self::$salt = $salt;
     $code = DB::escape(strtoupper($data['code']));
     $firstname = DB::escape(ucwords($data['firstname']));
     $lastname = DB::escape(ucwords($data['lastname']));
     $location = DB::escape(strtoupper($data['location']));
     //Add this stuff in
     if ($data['confirm'] === true) {
         $confirm = 1;
     } else {
         $confirm = 0;
     }
     $sql = "INSERT INTO " . TABLE_PREFIX . "pilots (firstname, lastname, email,\n\t\t\t\t\tcode, location, hub, password, salt, confirmed, joindate, lastip)\n\t\t\t\t  VALUES ('{$firstname}', '{$lastname}', '{$data['email']}', '{$code}',\n\t\t\t\t\t\t\t'{$location}', '{$data['hub']}', '{$password}', '{$salt}', {$confirm}, NOW(), '{$_SERVER['REMOTE_ADDR']}')";
     $res = DB::query($sql);
     if (DB::errno() != 0) {
         if (DB::errno() == 1062) {
             self::$error = 'This email address is already registered';
             return false;
         }
         self::$error = DB::error();
         return false;
     }
     //Grab the new pilotid, we need it to insert those "custom fields"
     $pilotid = DB::$insert_id;
     RanksData::CalculateUpdatePilotRank($pilotid);
     PilotData::GenerateSignature($pilotid);
     /* Add them to the default group */
     $defaultGroup = SettingsData::getSettingValue('DEFAULT_GROUP');
     PilotGroups::addUsertoGroup($pilotid, $defaultGroup);
     // For later
     self::$pilotid = $pilotid;
     //Get customs fields
     $fields = self::GetCustomFields();
     if (!$fields) {
         return true;
     }
     foreach ($fields as $field) {
         $value = Vars::POST($field->fieldname);
         $value = DB::escape($value);
         if ($value != '') {
             $sql = "INSERT INTO " . TABLE_PREFIX . "fieldvalues (fieldid, pilotid, value)\n\t\t\t\t\t\t\tVALUES ({$field->fieldid}, {$pilotid}, '{$value}')";
             DB::query($sql);
         }
     }
     return true;
 }
开发者ID:rallin,项目名称:phpVMS,代码行数:78,代码来源:RegistrationData.class.php

示例4: resetsignatures

    /**
     * Maintenance::resetsignatures()
     * 
     * @return
     */
    public function resetsignatures()
    {
        CodonModule::checkPermission(MAINTENANCE);
        $allpilots = PilotData::GetAllPilots();
        echo '<h3>Regenerating signatures</h3>
				<strong>Generating signatures...</strong><br />';
        foreach ($allpilots as $pilot) {
            echo "Generating signature for {$pilot->firstname} {$pilot->lastname}<br />";
            PilotData::GenerateSignature($pilot->pilotid);
        }
        echo "Done";
        LogData::addLog(Auth::$userinfo->pilotid, 'Reset signatures');
    }
开发者ID:phpmods,项目名称:phpvms_5.5.x,代码行数:18,代码来源:Maintenance.php

示例5: approveall

 public function approveall()
 {
     echo '<h3>Approve All</h3>';
     $allpireps = PIREPData::findPIREPS(array('p.accepted' => PIREP_PENDING));
     $total = count($allpireps);
     $count = 0;
     foreach ($allpireps as $pirep_details) {
         if ($pirep_details->aircraft == '') {
             continue;
         }
         # Update pilot stats
         SchedulesData::IncrementFlownCount($pirep_details->code, $pirep_details->flightnum);
         PIREPData::ChangePIREPStatus($pirep_details->pirepid, PIREP_ACCEPTED);
         // 1 is accepted
         //PilotData::UpdateFlightData($pirep_details->pilotid, $pirep_details->flighttime, 1);
         PilotData::UpdatePilotStats($pirep_details->pilotid);
         PilotData::UpdatePilotPay($pirep_details->pilotid, $pirep_details->flighttime);
         RanksData::CalculateUpdatePilotRank($pirep_details->pilotid);
         RanksData::CalculatePilotRanks();
         PilotData::GenerateSignature($pirep_details->pilotid);
         StatsData::UpdateTotalHours();
         $count++;
     }
     $skipped = $total - $count;
     echo "{$count} of {$total} were approved ({$skipped} has errors)";
 }
开发者ID:rallin,项目名称:phpVMS,代码行数:26,代码来源:PIREPAdmin.php

示例6: foreach

}
if ($version < 11441) {
    Installer::sql_file_update(SITE_ROOT . '/install/update_441.sql');
    $version = 11441;
}
if ($version < 11458) {
    Installer::add_to_config('PAGE_ENCODING', 'ISO-8859-1', 'This is the page encoding');
    Installer::add_to_config('PILOTID_LENGTH', 4, 'This is the length of the pilot ID. including leading zeros');
    Installer::add_to_config('SIGNATURE_TEXT_COLOR', '#FFF');
    Installer::add_to_config('SIGNATURE_SHOW_COPYRIGHT', true);
    # Update signatures for everyone
    $allpilots = PilotData::GetAllPilots();
    echo "Generating signatures<br />";
    foreach ($allpilots as $pilot) {
        echo "Generating signature for {$pilot->firstname} {$pilot->lastname}<br />";
        PilotData::GenerateSignature($pilot->pilotid);
    }
    $version = 11458;
}
if ($version < 11628) {
    echo '<p>Adding new options to the core/local.config.php...</p>';
    Installer::add_to_config('LOAD_FACTOR', '72');
    Installer::add_to_config('CARGO_UNITS', 'lbs');
    Installer::add_to_config('COMMENT', 'FSPassengers Settings');
    Installer::add_to_config('COMMENT', 'Units settings');
    Installer::add_to_config('WeightUnit', '1', '0=Kg 1=lbs');
    Installer::add_to_config('DistanceUnit', '2', '0=KM 1= Miles 2=NMiles');
    Installer::add_to_config('SpeedUnit', '1', '0=Km/H 1=Kts');
    Installer::add_to_config('AltUnit', '1', '0=Meter 1=Feet');
    Installer::add_to_config('LiquidUnit', '2', '0=liter 1=gal 2=kg 3=lbs');
    Installer::add_to_config('WelcomeMessage', SITE_NAME . ' ACARS', 'Welcome Message');
开发者ID:deanstalker,项目名称:phpVMS,代码行数:31,代码来源:update.php


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