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


PHP Utility::GenSecret方法代码示例

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


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

示例1: Create

 public static function Create($user_row, $uc = true)
 {
     if (function_exists('zuitu_uc_register') && $uc) {
         $pp = $user_row['password'];
         $em = $user_row['email'];
         $un = $user_row['username'];
         $ret = zuitu_uc_register($em, $un, $pp);
         if (!$ret) {
             return false;
         }
     }
     $user_row['password'] = self::GenPassword($user_row['password']);
     $user_row['create_time'] = $user_row['login_time'] = time();
     $user_row['ip'] = Utility::GetRemoteIp();
     $user_row['secret'] = md5(Utility::GenSecret(12));
     $user_row['id'] = DB::Insert('user', $user_row);
     $_rid = abs(intval(cookieget('_rid')));
     if ($_rid) {
         $r_user = Table::Fetch('user', $_rid);
         if ($r_user) {
             ZInvite::Create($r_user, $user_row);
         }
     }
     if ($user_row['id'] == 1) {
         Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
     }
     return $user_row['id'];
 }
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:28,代码来源:ZUser.class.php

示例2: PayCardCreate

 public static function PayCardCreate($query)
 {
     $need = $query['quantity'];
     while (true) {
         $id = Utility::GenSecret(16, Utility::CHAR_NUM);
         $paycard = array('id' => $id, 'value' => $query['money'], 'consume' => 'N', 'expire_time' => $query['expire_time']);
         $need -= DB::Insert('paycard', $paycard) ? 1 : 0;
         if ($need <= 0) {
             return true;
         }
     }
     return true;
 }
开发者ID:norain2050,项目名称:zuituware,代码行数:13,代码来源:ZPaycard.class.php

示例3: CardCreate

 public static function CardCreate($query)
 {
     $need = $query['quantity'];
     while (true) {
         $id = Utility::GenSecret(16, Utility::CHAR_NUM);
         $card = array('id' => $id, 'code' => $query['code'], 'partner_id' => $query['partner_id'], 'credit' => $query['money'], 'consume' => 'N', 'begin_time' => $query['begin_time'], 'end_time' => $query['end_time']);
         $need -= DB::Insert('card', $card) ? 1 : 0;
         if ($need <= 0) {
             return true;
         }
     }
     return true;
 }
开发者ID:yunsite,项目名称:hhzuitu,代码行数:13,代码来源:ZCard.class.php

示例4: Create

 public static function Create($user_row)
 {
     $user_row['password'] = self::GenPassword($user_row['password']);
     $user_row['create_time'] = $user_row['login_time'] = time();
     $user_row['ip'] = Utility::GetRemoteIp();
     $user_row['secret'] = md5(Utility::GenSecret(12));
     $user_row['id'] = DB::Insert('user', $user_row);
     if ($_COOKIE['_rid']) {
         $r_user = Table::Fetch('user', $_COOKIE['_rid']);
         if ($r_user) {
             ZInvite::Create($r_user, $user_row);
         }
     }
     if ($user_row['id'] == 1) {
         Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
     }
     return $user_row['id'];
 }
开发者ID:jowino,项目名称:bd786110cact,代码行数:18,代码来源:ZUser.class.php

示例5: Create

 public static function Create($order)
 {
     $team = Table::Fetch('team', $order['team_id']);
     $partner = Table::Fetch('partner', $order['partner_id']);
     $ccon = array('order_id' => $order['id']);
     $count = Table::Count('coupon', $ccon);
     while ($count < $order['quantity']) {
         $id = Utility::GenSecret(8, Utility::CHAR_NUM);
         $cv = Table::Fetch('coupon', $id);
         if ($cv) {
             continue;
         }
         $coupon = array('id' => $id, 'user_id' => $order['user_id'], 'partner_id' => $team['partner_id'], 'order_id' => $order['id'], 'credit' => $team['credit'], 'team_id' => $order['team_id'], 'secret' => Utility::GenSecret(6, Utility::CHAR_WORD), 'expire_time' => $team['expire_time'], 'create_time' => time());
         DB::Insert('coupon', $coupon);
         sms_coupon($coupon);
         $count = Table::Count('coupon', $ccon);
     }
 }
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:18,代码来源:ZCoupon.class.php

示例6: Create

 public static function Create($order)
 {
     if ($order['state'] == 'unpay') {
         return;
     }
     $team = Table::Fetch('team', $order['team_id']);
     $partner = Table::Fetch('partner', $order['partner_id']);
     $ccon = array('order_id' => $order['id']);
     $count = Table::Count('coupon', $ccon);
     while ($count < $order['quantity']) {
         $id = Utility::GenSecret(12, Utility::CHAR_NUM);
         $cv = Table::Fetch('coupon', $id);
         $coupon = array('id' => Utility::GenSecret(12, Utility::CHAR_NUM), 'user_id' => $order['user_id'], 'partner_id' => $team['partner_id'], 'order_id' => $order['id'], 'credit' => $team['credit'], 'team_id' => $order['team_id'], 'secret' => Utility::GenSecret(8, Utility::CHAR_WORD), 'expire_time' => $team['expire_time'], 'create_time' => time());
         DB::Insert('coupon', $coupon);
         $count = Table::Count('coupon', $ccon);
         $user = Table::Fetch('user', $order['user_id']);
         mail_coupon($team, $partner, $order, $user, $coupon);
     }
 }
开发者ID:jowino,项目名称:bd786110cact,代码行数:19,代码来源:ZCoupon.class.php

示例7: Create

	static public function Create($order) {
		$team = Table::Fetch('team', $order['team_id']);
		$partner = Table::Fetch('partner', $order['partner_id']);
		$ccon = array('order_id' => $order['id']);
		$count = Table::Count('coupon', $ccon);
		while($count<$order['quantity']) {
			/* 配合400验证,ID统一修改为12位伪随机数字,密码为6位数字 */
			$id = (ceil(time()/100)+rand(10000000,20000000));
			$id = Utility::VerifyCode($id);
			$cv = Table::Fetch('coupon', $id);
			if ($cv) continue;
            $coupon = array(
					'id' => $id,
					'user_id' => $order['user_id'],
					'buy_id' => $order['buy_id'],
					'partner_id' => $team['partner_id'],
					'order_id' => $order['id'],
					'credit' => $team['credit'],
					'team_id' => $order['team_id'],
					'secret' => Utility::VerifyCode(Utility::GenSecret(6, Utility::CHAR_NUM)),
					'expire_time' => $team['expire_time'],
					'create_time' => time(),
					);
			DB::Insert('coupon', $coupon);
			$count = Table::Count('coupon', $ccon);
			
			//send_goods_confirm_by_platform
			/**
			if( ($order['service']=='alipay') && ($INI['alipay']['autosendgoods']='Y') && ($INI['alipay']['guarantee']!='Y') ) {
				alipay_send_goods($order['trade_no']);		
			}
			*/
			
		}
		sms_all_coupon($order);
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:36,代码来源:ZCoupon.class.php

示例8: dirname

<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
$id = abs(intval($_GET['id']));
$order = Table::Fetch('order', $id);
if (!$order) {
    Session::Set('error', '订单不存在!');
    redirect('index.php');
}
$team = Table::Fetch('team', $order['team_id']);
$team['state'] = team_state($team);
if ($team['close_time']) {
    redirect("team.php?id={$id}");
}
/* generator unique pay_id */
if (!($order['pay_id'] && (preg_match('#-(\\d+)-(\\d+)-#', $order['pay_id'], $m) && ($m[1] == $order['id'] && $m[2] == $order['quantity'])))) {
    $randid = strtolower(Utility::GenSecret(4, Utility::CHAR_WORD));
    $pay_id = "go-{$order['id']}-{$order['quantity']}-{$randid}";
    Table::UpdateCache('order', $order['id'], array('pay_id' => $pay_id));
}
/* end */
include template('wap_check');
开发者ID:norain2050,项目名称:zuituware,代码行数:22,代码来源:check.php

示例9: _go_reload

             Session::Set('notice', "表-{$table}-数据备份完成");
         } else {
             Session::Set('error', "备份表-{$table}-失败");
         }
         _go_reload();
     }
 } else {
     //分卷备份
     if (!$_POST['filesize']) {
         Session::Set('error', "请填写备份文件分卷大小!");
         _go_reload();
     }
     $sql = null;
     $sql .= backup_make_header($table);
     $p = 1;
     $filenamep = date("Ymd") . Utility::GenSecret(4) . "_{$table}";
     $query = DB::Query("SELECT * FROM `{$table}`");
     while ($r = DB::NextRecord($query)) {
         $sql .= backup_make_record($table, $r);
         if (strlen($sql) >= $_POST['filesize'] * 1024) {
             $filename = $filenamep . ("_v" . $p . ".sql");
             if (true !== backup_write_file($sql, $filename)) {
                 Session::Set('error', "备份表-{$table}-{$p}-失败");
                 _go_reload();
             }
             $p++;
             $sql = null;
         }
     }
     if ($sql) {
         if (true !== backup_write_file($sql, $filename)) {
开发者ID:norain2050,项目名称:zuituware,代码行数:31,代码来源:backup.php

示例10: genInviteCode

 public function genInviteCode()
 {
     $code = Utility::GenSecret(6, 1);
     return $this->where('invite_code="%s"', $code)->find() ? $this->genInviteCode() : $code;
 }
开发者ID:Germey,项目名称:yinxingapply,代码行数:5,代码来源:UserRecommendsModel.class.php

示例11: generateAuthParam

 private function generateAuthParam($is_get = true)
 {
     $stamp = time();
     $token = Utility::GenSecret(30);
     $signature = $this->getSignature($stamp, $token);
     if ($is_get) {
         $auth_param = '?accesskey=' . $this->api_key . '&stamp=' . $stamp . '&token=' . $token . '&signature=' . $signature . '&';
     } else {
         $auth_param['accesskey'] = $this->api_key;
         $auth_param['stamp'] = $stamp;
         $auth_param['token'] = $token;
         $auth_param['signature'] = $signature;
     }
     return $auth_param;
 }
开发者ID:Germey,项目名称:yinxingpm,代码行数:15,代码来源:LingxiApi.class.php

示例12: dirname

<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
need_login();
if (is_post() && isset($_POST['giftpay'])) {
    if (!$_POST['from'] || !$_POST['to'] || !$_POST['amount']) {
        Session::Set('error', 'Please do not submit it untill finished.');
    }
    $table = new Table('gift_card', $_POST);
    $table->code = Utility::GenSecret(8, 'mix');
    $table->email = $_POST['gift_card']['delivery']['email_address'];
    $table->create_time = time();
    $table->user_id = $login_user_id;
    $order_id = $table->Insert(array('user_id', 'from', 'to', 'message', 'amount', 'code', 'email', 'create_time', 'paytype'));
    if (!$order_id || !($order = Table::Fetch('gift_card', $order_id))) {
        die('404 Not Found');
    }
    $randno = rand(1000, 9999);
    $total_money = moneyit($order['amount']);
    /* micdim: paypal support */
    if ($order['paytype'] == 'paypal') {
        /* credit pay 
        	$credit = moneyit($order['origin'] - $total_money);
        	if ($order['credit']!=$credit) {
        		Table::UpdateCache('order', $order_id, array('credit'=>$credit,));
        	}
        	 end */
        $_input_charset = 'utf-8';
        //$service = 'create_direct_pay_by_user'; // what does it mean??
        $partner = $INI['paypal']['mid'];
        $security_code = $INI['paypal']['sec'];
开发者ID:jowino,项目名称:bd786110cact,代码行数:31,代码来源:giftpay.php

示例13: createCardNo

	static public function createCardNo(){
		$id = Utility::GenSecret(12, Utility::CHAR_NUM);
		
		return $id;
	}
开发者ID:noikiy,项目名称:mdwp,代码行数:5,代码来源:MCard.class.php


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