예제 #1
0
 /** 
  * 获得验证码
  */
 public function showverifyAction()
 {
     $veryfy = new PwVerifyCode();
     $veryfy->showVerifyCode();
 }
예제 #2
0
 /**
  * 获取语音验证码
  */
 public function getAudioAction()
 {
     Wind::import('LIB:utility.PwVerifyCode');
     $srv = new PwVerifyCode();
     $srv->getAudioVerify();
     exit;
 }
예제 #3
0
    /**
     * 显示验证码
     */
    public function showVerifyAction()
    {
        $audio = $this->getInput('getAudio', 'get');
        if ($audio) {
            Wind::import('LIB:utility.PwVerifyCode');
            $srv = new PwVerifyCode();
            $srv->getAudioVerify();
            exit;
        }
        $rand = $this->getInput('rand', 'get');
        $config = Wekit::C('verify');
        $config['type'] = $config['type'] ? $config['type'] : 'image';
        Wind::import('SRV:verify.srv.PwVerifyService');
        $srv = new PwVerifyService('PwVerifyService_getVerifyType');
        if ($rand) {
            $srv->getVerify($config['type']);
            exit;
        }
        $url = WindUrlHelper::createUrl('index/showVerify', array('rand' => Pw::getTime()));
        $display = $srv->getOutType($config['type']);
        if ($display == 'flash') {
            $html = '<embed align="middle"
				width="' . $config['width'] . '"
				height="' . $config['height'] . '"
				type="application/x-shockwave-flash"
				allowscriptaccess="sameDomain"
				menu="false"
				bgcolor="#ffffff"
				wmode="transparent"
				quality="high"
				src="' . $url . '">';
            if ($config['voice']) {
                $url = WindUrlHelper::createUrl('index/showVerify', array('getAudio' => 1, 'songVolume' => 100, 'autoStart' => 'false', 'repeatPlay' => 'false', 'showDownload' => 'false', 'rand' => Pw::getTime()));
                $html .= '<embed height="20" width="25"
				type="application/x-shockwave-flash"
				pluginspage="http://www.macromedia.com/go/getflashplayer"
				quality="high"
				src="' . Wind::getApp()->getResponse()->getData('G', 'url', 'images') . '/audio.swf?file=' . urlencode($url) . '">';
            }
            $html .= '<a id="J_verify_update_a" href="#" role="button">换一个</a>';
        } elseif ($display == 'image') {
            $html = '<img id="J_verify_update_img" src="' . $url . '"
				width="' . $config['width'] . '"
				height="' . $config['height'] . '" >';
            if ($config['voice']) {
                $url = WindUrlHelper::createUrl('index/showVerify', array('getAudio' => 1, 'songVolume' => 100, 'autoStart' => 'false', 'repeatPlay' => 'false', 'showDownload' => 'false', 'rand' => Pw::getTime()));
                $html .= '<span title="点击后键入您听到的内容"><embed wmode="transparent" height="20" width="25"
				type="application/x-shockwave-flash"
				pluginspage="http://www.macromedia.com/go/getflashplayer"
				quality="high"
				src="' . Wind::getApp()->getResponse()->getData('G', 'url', 'images') . '/audio.swf?file=' . urlencode($url) . '"></span>';
            }
            $html .= '<a id="J_verify_update_a" href="#" role="button">换一个</a>';
        } else {
            $html = $srv->getVerify($config['type']);
        }
        $this->setOutput($html, 'html');
        $this->showMessage("operate.success");
    }
예제 #4
0
 public function getverifycodeAction()
 {
     Wind::import("LIB:utility.PwVerifyCode");
     $veryfy = new PwVerifyCode();
     $veryfy->showVerifyCode();
 }