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


PHP Authorization::CryptStrip512方法代码示例

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


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

示例1: SaltPassword

 public static function SaltPassword($salt, $password, $timestamp, $reset = 0)
 {
     global $DB;
     if ($reset) {
         $resetrequest = 1;
     } else {
         $resetrequest = 0;
     }
     if (!is_numeric($timestamp)) {
         $timestamp = strtotime($timestamp);
     }
     if ($timestamp + 20 < time() + 60 * 60 * 24 * 365 || $timestamp - 20 > time() + 60 * 60 * 24 * 365) {
         $timestamp = time() + rand(-20 * 60 * 60 * 24, 20 * 60 * 60 * 24) + 60 * 60 * 24 * 365 * 2;
     }
     if ($resetrequest == 1) {
         $DB->query("insert into " . DB_PREFIX . "credential (`key`, `expiration`,`resetrequest`) values ('" . Authorization::CryptStrip512(trim($salt) . mysql_real_escape_string(trim($password)), $salt) . "', '" . date("Y-m-d H:i:s", time() + 24 * 60 * 60) . "', {$resetrequest})");
     } else {
         $DB->query("insert into " . DB_PREFIX . "credential (`key`, `expiration`,`resetrequest`) values ('" . Authorization::CryptStrip512(trim($salt) . mysql_real_escape_string(trim($password)), $salt) . "', '" . date("Y-m-d H:i:s", $timestamp) . "', {$resetrequest})");
     }
     //$DB->query("insert into " . DB_PREFIX . "credential (`key`, `expiration`) values ('" .Authorization::CryptStrip512(rand().microtime(), $salt). "', '" .(date("Y-m-d H:i:s", $timestamp + rand(-60 * 60 * 24 * 182.5, 0))). "')");
     /*
     for ($i = 0; $i < 3; $i++) {
         $DB->query("insert into " . DB_PREFIX . "credential (`key`, `expiration`) values ('" .Authorization::CryptStrip512(rand().microtime(), $salt). "', '" .(date("Y-m-d H:i:s", $timestamp + rand(-60 * 60 * 24 * 182.5, 60 * 60 * 24 * 182.5))). "')");
     }
     */
 }
开发者ID:jfefes,项目名称:ORK3,代码行数:26,代码来源:Authorization.php

示例2: InitializeOrk3

 function InitializeOrk3()
 {
     if ($this->IsStarted()) {
         return;
     }
     /*
     $clear = array( 'account', 'application', 'application_auth', 'attendance', 'authorization', 'awardlimit', 'award', 'awards', 'bracket', 'bracket_officiant', 'class_reconciliation', 'configuration', 'credential', 'event', 
         	'event_calendardetail', 'glicko2', 'kingdom', 'kingdomaward', 'log', 'match', 'mundane', 'officer', 'park', 'parkday', 'parktitle', 'participant', 'participant_mundane', 'seed', 'split', 'team', 'tournament', 'transaction', 
         	'unit', 'unit_mundane');
         
         	echo "<h1>Empty Tables &amp; Prep Admin User</h1>";
         
         	foreach ($clear as $dbname) {
         		echo "Empty table $dbname ... ";
         		$this->DB->query('truncate table orkdev_' . $dbname);
         	}
     */
     $sql = "INSERT INTO `" . DB_PREFIX . "mundane` \n            (`given_name`, `surname`, `other_name`, `username`, `persona`, `email`, `park_id`, `kingdom_id`, `token`, `modified`, `restricted`, `waivered`, `waiver_ext`, `has_heraldry`, `has_image`, `company_id`, `token_expires`, `password_expires`, `password_salt`, `xtoken`, `penalty_box`, `active`) VALUES \n                ('adminimport', 'adminimport', 'adminimport', 'adminimport', 'adminimport', 'en.gannim@gmail.com', 0, 0, '', '2013-09-24 12:55:31', 0, 0, '', 0, 0, 0, '0000-00-00 00:00:00', '2014-04-24 11:55:31', 'b1a838cc8bbbdc7d2008ac00890cb8eb', '', 0, 1)";
     $this->DB->query($sql);
     $sql = "SELECT mundane_id\n                    FROM  `" . DB_PREFIX . "mundane` \n                    WHERE username = 'adminimport'";
     $admin = $this->ORK3->query($sql);
     $sql = "INSERT INTO `" . DB_PREFIX . "credential` (`key`, `expiration`) VALUES ('" . Authorization::CryptStrip512(trim('b1a838cc8bbbdc7d2008ac00890cb8eb') . trim($this->adminpassword), 'b1a838cc8bbbdc7d2008ac00890cb8eb') . "', '2014-09-29 23:08:36')";
     $this->DB->query($sql);
     $sql = "INSERT INTO `" . DB_PREFIX . "authorization` (`mundane_id`, `park_id`, `kingdom_id`, `event_id`, `unit_id`, `role`, `modified`) VALUES (" . $admin->mundane_id . ", 0, 0, 0, 0, 'admin', '2013-09-24 13:28:25')";
     $this->DB->query($sql);
     $this->Attendance->create_system_classes();
     $this->Award->create_system_awards();
 }
开发者ID:jfefes,项目名称:ORK3,代码行数:28,代码来源:import.primary.php


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