Exemplo n.º 1
0
 /**
  * Decodes a base32 string into a binary string.
  */
 static function base32_decode($b32)
 {
     $b32 = strtoupper($b32);
     if (!preg_match('/^[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]+$/', $b32, $match)) {
         Tool_Fnc::showMsg('非法输入');
     }
     $l = strlen($b32);
     $n = 0;
     $j = 0;
     $binary = "";
     for ($i = 0; $i < $l; $i++) {
         $n = $n << 5;
         // Move buffer left by 5 to make room
         $n = $n + self::$lut[$b32[$i]];
         // Add value into buffer
         $j = $j + 5;
         // Keep track of number of bits in buffer
         if ($j >= 8) {
             $j = $j - 8;
             $binary .= chr(($n & 0xff << $j) >> $j);
         }
     }
     return $binary;
 }
Exemplo n.º 2
0
 protected function emailActivate($uid)
 {
     $tMO = new EmailactivateModel();
     $pData = $tMO->fRow('SELECT activate_time FROM email_activate WHERE uid = ' . $uid . ' LIMIT 1');
     if (!isset($pData['activate_time']) || empty($pData['activate_time'])) {
         if (true == strpos(REDIRECT_URL, 'user_emailverify')) {
             return;
         }
         Tool_Fnc::showMsg('', '/user_emailverify');
     }
 }