Пример #1
0
 function control()
 {
     parent::__construct();
     $authkey = md5(UC_KEY . $_SERVER['HTTP_USER_AGENT'] . $this->onlineip);
     $this->time = time();
     $seccodeauth = getgpc('seccodeauth');
     $seccode = $this->authcode($seccodeauth, 'DECODE', $authkey);
     //$seccode = rand(100000, 999999);
     //$this->setcookie('uc_secc', $this->authcode($seccode."\t".$this->time, 'ENCODE'));
     @header("Expires: -1");
     @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
     @header("Pragma: no-cache");
     include_once UC_ROOT . 'lib/seccode.class.php';
     $code = new seccode();
     $code->code = $seccode;
     $code->type = 0;
     $code->width = 70;
     $code->height = 21;
     $code->background = 0;
     $code->adulterate = 1;
     $code->ttf = 1;
     $code->angle = 0;
     $code->color = 1;
     $code->size = 0;
     $code->shadow = 1;
     $code->animator = 0;
     $code->fontpath = UC_ROOT . 'images/fonts/';
     $code->datapath = UC_ROOT . 'images/';
     $code->includepath = '';
     $code->display();
 }
Пример #2
0
 function common()
 {
     global $_G;
     require_once libfile('function/seccode');
     $seccode = make_seccode($_GET['sechash']);
     if (!$_G['setting']['nocacheheaders']) {
         @header("Expires: -1");
         @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
         @header("Pragma: no-cache");
     }
     require_once libfile('class/seccode');
     $type = in_array($_G['setting']['seccodedata']['type'], array(2, 3)) ? 0 : $_G['setting']['seccodedata']['type'];
     $code = new seccode();
     $code->code = $seccode;
     $code->type = $type;
     $code->width = $_G['setting']['seccodedata']['width'];
     $code->height = $_G['setting']['seccodedata']['height'];
     $code->background = $_G['setting']['seccodedata']['background'];
     $code->adulterate = $_G['setting']['seccodedata']['adulterate'];
     $code->ttf = $_G['setting']['seccodedata']['ttf'];
     $code->angle = $_G['setting']['seccodedata']['angle'];
     $code->warping = $_G['setting']['seccodedata']['warping'];
     $code->scatter = $_G['setting']['seccodedata']['scatter'];
     $code->color = $_G['setting']['seccodedata']['color'];
     $code->size = $_G['setting']['seccodedata']['size'];
     $code->shadow = $_G['setting']['seccodedata']['shadow'];
     $code->animator = 0;
     $code->fontpath = DISCUZ_ROOT . './static/image/seccode/font/';
     $code->datapath = DISCUZ_ROOT . './static/image/seccode/';
     $code->includepath = DISCUZ_ROOT . './source/class/';
     $code->display();
 }
Пример #3
0
 function in_seccodelist()
 {
     $seccode = rand(100000, 999999);
     $this->fun->setcookie('ecisp_home_seccode', $this->fun->eccode($seccode . "\t" . time(), 'ENCODE'));
     @header("Expires: -1");
     @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
     @header("Pragma: no-cache");
     include_once admin_ROOT . 'public/class_seccode.php';
     $code = new seccode();
     $code->code = $seccode;
     $code->type = 0;
     $code->width = 70;
     $code->height = 23;
     $code->background = 30;
     $code->adulterate = $this->CON['scode_adulterate'];
     $code->ttf = 0;
     $code->angle = 0;
     $code->color = 0;
     $code->size = 1;
     $code->shadow = $this->CON['scode_shadow'];
     $code->animator = 0;
     $code->bgcolor = $this->CON['scode_bgcolor'];
     $code->fontcolor = $this->CON['scode_fontcolor'];
     $code->datapath = admin_ROOT . 'datacache/';
     $code->includepath = '';
     $code->display();
 }
Пример #4
0
 function common()
 {
     global $_G;
     if (is_numeric($_G['setting']['seccodedata']['type'])) {
         if (in_array($_G['setting']['seccodedata']['type'], array(2, 3))) {
             exit;
         }
         $seccode = make_seccode();
         if (!$_G['setting']['nocacheheaders']) {
             @header("Expires: -1");
             @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
             @header("Pragma: no-cache");
         }
         require_once libfile('class/seccode');
         $code = new seccode();
         $code->code = $seccode;
         $code->type = $_G['setting']['seccodedata']['type'];
         $code->width = $_G['setting']['seccodedata']['width'];
         $code->height = $_G['setting']['seccodedata']['height'];
         $code->background = $_G['setting']['seccodedata']['background'];
         $code->adulterate = $_G['setting']['seccodedata']['adulterate'];
         $code->ttf = $_G['setting']['seccodedata']['ttf'];
         $code->angle = $_G['setting']['seccodedata']['angle'];
         $code->warping = $_G['setting']['seccodedata']['warping'];
         $code->scatter = $_G['setting']['seccodedata']['scatter'];
         $code->color = $_G['setting']['seccodedata']['color'];
         $code->size = $_G['setting']['seccodedata']['size'];
         $code->shadow = $_G['setting']['seccodedata']['shadow'];
         $code->animator = 0;
         $code->fontpath = DISCUZ_ROOT . './static/image/seccode/font/';
         $code->datapath = DISCUZ_ROOT . './static/image/seccode/';
         $code->includepath = DISCUZ_ROOT . './source/class/';
         $code->display();
     } else {
         $etype = explode(':', $_G['setting']['seccodedata']['type']);
         if (count($etype) > 1) {
             $codefile = DISCUZ_ROOT . './source/plugin/' . $etype[0] . '/seccode/seccode_' . $etype[1] . '.php';
             $class = $etype[1];
         } else {
             $codefile = libfile('seccode/' . $_G['setting']['seccodedata']['type'], 'class');
             $class = $_G['setting']['seccodedata']['type'];
         }
         if (file_exists($codefile)) {
             @(include_once $codefile);
             $class = 'seccode_' . $class;
             if (class_exists($class)) {
                 make_seccode();
                 $code = new $class();
                 $image = $code->image($idhash, $modid);
                 if ($image) {
                     dheader('location: ' . $image);
                 }
             }
         }
     }
 }
Пример #5
0
 /**
  * 产生验证码
  *
  */
 public function makecodeOp()
 {
     $refererhost = parse_url($_SERVER['HTTP_REFERER']);
     $refererhost['host'] .= !empty($refererhost['port']) ? ':' . $refererhost['port'] : '';
     $seccode = makeSeccode($_GET['nchash']);
     @header("Expires: -1");
     @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
     @header("Pragma: no-cache");
     $code = new seccode();
     $code->code = $seccode;
     $code->width = 120;
     $code->height = 50;
     $code->background = 1;
     $code->adulterate = 1;
     $code->scatter = '';
     $code->color = 1;
     $code->size = 0;
     $code->shadow = 1;
     $code->animator = 0;
     $code->datapath = BASE_DATA_PATH . '/resource/seccode/';
     $code->display();
 }
Пример #6
0
    $refererhost['host'] .= !empty($refererhost['port']) ? ':' . $refererhost['port'] : '';
    if ($_G['setting']['seccodedata']['type'] < 2 && ($refererhost['host'] != $_SERVER['HTTP_HOST'] || !$_G['setting']['seccodestatus']) || $_G['setting']['seccodedata']['type'] == 2 && !extension_loaded('ming') && $_POST['fromFlash'] != 1 || $_G['setting']['seccodedata']['type'] == 3 && $_GET['fromFlash'] != 1) {
        exit('Access Denied');
    }
    $seccode = make_seccode($_G['gp_idhash']);
    if (!$_G['setting']['nocacheheaders']) {
        @header("Expires: -1");
        @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
        @header("Pragma: no-cache");
    }
    require_once libfile('class/seccode');
    $code = new seccode();
    $code->code = $seccode;
    $code->type = $_G['setting']['seccodedata']['type'];
    $code->width = $_G['setting']['seccodedata']['width'];
    $code->height = $_G['setting']['seccodedata']['height'];
    $code->background = $_G['setting']['seccodedata']['background'];
    $code->adulterate = $_G['setting']['seccodedata']['adulterate'];
    $code->ttf = $_G['setting']['seccodedata']['ttf'];
    $code->angle = $_G['setting']['seccodedata']['angle'];
    $code->warping = $_G['setting']['seccodedata']['warping'];
    $code->scatter = $_G['setting']['seccodedata']['scatter'];
    $code->color = $_G['setting']['seccodedata']['color'];
    $code->size = $_G['setting']['seccodedata']['size'];
    $code->shadow = $_G['setting']['seccodedata']['shadow'];
    $code->animator = $_G['setting']['seccodedata']['animator'];
    $code->fontpath = DISCUZ_ROOT . './static/image/seccode/font/';
    $code->datapath = DISCUZ_ROOT . './static/image/seccode/';
    $code->includepath = DISCUZ_ROOT . './source/class/';
    $code->display();
}