コード例 #1
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'admin_default_order_by' => 'name', 'admin_default_nb_per_page' => 16, 'admin_default_order_direction' => 'ASC');
     $this->defaults_params['order_by'] = $this->config->admin_default_order_by;
     $this->defaults_params['order_direction'] = $this->config->admin_default_order_direction;
     parent::setDefaultParams();
 }
コード例 #2
0
ファイル: captcha.php プロジェクト: rezarahimi4861/icmf
 function makeCaptcha()
 {
     $imagelength = $this->Length * 25 + 16;
     $imageheight = 75;
     $image = imagecreate($imagelength, $imageheight);
     //$bgcolor     = imagecolorallocate($image, 222, 222, 222);
     $bgcolor = imagecolorallocate($image, 255, 255, 255);
     $stringcolor = imagecolorallocate($image, 0, 0, 0);
     $filter = new filters();
     $filter->signs($image, $this->getRandFont());
     for ($i = 0; $i < strlen($this->CaptchaString); $i++) {
         imagettftext($image, 25, mt_rand(-15, 15), $i * 25 + 10, mt_rand(30, 70), $stringcolor, $this->getRandFont(), $this->CaptchaString[$i]);
     }
     $filter->noise($image, 10);
     $filter->blur($image, 1);
     imagepng($image);
     imagedestroy($image);
 }
コード例 #3
0
 function __construct()
 {
     self::$baseC = new base();
     /* Populate inner cache of filters */
     $filters_res = self::$baseC->select('filters', '', '*');
     foreach ($filters_res as $filter) {
         self::$filters[$filter['id']] = $filter;
     }
 }
コード例 #4
0
ファイル: main.php プロジェクト: odin3/MoyService
 public function Auth()
 {
     $user = isset($_POST['login']) ? $_POST['login'] : "";
     $pass = isset($_POST['password']) ? $_POST['password'] : "";
     if (!filters::CharsAndDigits($user) or !authModel::tryLogin($user, $pass)) {
         System::$Scope['loginError'] = true;
         return System::Invoke("main");
     }
     header("Location: /");
 }
コード例 #5
0
ファイル: class.faq.filters.php プロジェクト: jewelhuq/okatea
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'keyword_search' => '', 'active' => 2);
     if ($this->part === 'admin') {
         $this->defaults_params['order_by'] = $this->config->admin_default_order_by;
         $this->defaults_params['order_direction'] = $this->config->admin_default_order_direction;
     } else {
         $this->defaults_params['order_by'] = $this->config->public_default_order_by;
         $this->defaults_params['order_direction'] = $this->config->public_default_order_direction;
     }
     parent::setDefaultParams();
 }
コード例 #6
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'active' => -1, 'category_id' => 0);
     if ($this->part === 'admin') {
         $this->defaults_params['language'] = $this->okt->user->language;
         $this->defaults_params['order_by'] = $this->config->admin_default_order_by;
         $this->defaults_params['order_direction'] = $this->config->admin_default_order_direction;
     } else {
         $this->defaults_params['order_by'] = $this->config->public_default_order_by;
         $this->defaults_params['order_direction'] = $this->config->public_default_order_direction;
     }
     parent::setDefaultParams();
 }
コード例 #7
0
ファイル: api.php プロジェクト: angrytoad/ItemFeed
 public function getItems()
 {
     $items = new filters();
     return $items->getSRFilter();
 }
コード例 #8
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'visibility' => 2, 'category_id' => 0, 'promo' => 0, 'nouvo' => 0, 'favo' => 0, 'order_by' => 'id', 'order_direction' => 'desc');
     parent::setDefaultParams();
 }
コード例 #9
0
ファイル: captcha.class.php プロジェクト: NewRoute/glfusion
 function makeCaptcha()
 {
     global $cString, $_CONF, $_TABLES, $LANG_CP00;
     if ($this->session_id != 0) {
         $sql = "UPDATE {$_TABLES['cp_sessions']} SET validation='" . $this->getCaptchaString() . "' WHERE session_id='" . DB_escapeString($this->session_id) . "'";
         DB_query($sql);
     } else {
         CAPTCHA_errorLog("CAPTCHA: No valid session id passed");
         exit;
     }
     switch ($this->driver) {
         case 0:
         case 1:
             if ($this->gfxformat != 'png' && $this->gfxformat != 'jpg') {
                 header('Content-type: image/gif');
                 COM_errorLog("CAPTCHA: No valid gfxFormat specified");
                 $errormgr = new error();
                 $errormgr->addError('');
                 $errormgr->displayError();
                 die;
             }
             $header = 'Content-type: image/' . $this->gfxformat;
             header($header);
             if ($this->driver == 0) {
                 $imagelength = $this->Length * 25 + 16;
                 $imageheight = 75;
                 $image = imagecreate($imagelength, $imageheight);
                 $bgcolor = imagecolorallocate($image, 255, 255, 255);
                 $stringcolor = imagecolorallocate($image, 0, 0, 0);
                 $filter = new filters();
                 $filter->signs($image, $this->getRandFont());
                 for ($i = 0; $i < strlen($this->CaptchaString); $i++) {
                     imagettftext($image, 25, mt_rand(-15, 15), $i * 25 + 10, mt_rand(30, 70), $stringcolor, $this->getRandFont(), $this->CaptchaString[$i]);
                 }
                 switch ($this->gfxformat) {
                     case 'png':
                         imagepng($image);
                         break;
                     case 'jpg':
                         imagejpeg($image);
                         break;
                 }
                 imagedestroy($image);
             } else {
                 // ImageMagick code originally written by
                 // Thom Skrtich  (email : bisohpthom@supertwist.net)
                 // used in SecureImage a CAPTCHA plugin for WordPress.
                 $gravity = 'Center';
                 # modify the image according to the generated settings
                 $size = rand($this->sizemin, $this->sizemax);
                 $blur = rand($this->blurmin, $this->blurmax);
                 $angle = rand($this->anglemin, $this->anglemax);
                 $swirl = rand($this->swirlmin, $this->swirlmax);
                 $wave = rand($this->wavemin, $this->wavemax);
                 $cString = $this->CaptchaString;
                 $i = strlen($cString);
                 $newString = '';
                 for ($x = 0; $x < $i; $x++) {
                     $newString .= $cString[$x];
                     $newString .= ' ';
                 }
                 # prepare our image magick command
                 $cmd = '"' . $this->convertpath . '"';
                 $cmd .= ' -font "' . $this->getRandFont() . '"';
                 $cmd .= ' -pointsize ' . $size;
                 $cmd .= ' -gravity "' . $gravity . '"';
                 $cmd .= ' -annotate 0 "' . $newString . '"';
                 $cmd .= ' -blur ' . $blur;
                 $cmd .= ' -rotate ' . $angle;
                 $cmd .= ' -swirl ' . $swirl;
                 $cmd .= ' -wave ' . $wave . 'x80';
                 $cmd .= ' ' . $this->getRandBackground() . ' - ';
                 if (PHP_OS == "WINNT") {
                     $pcmd = 'cmd /c " ' . $cmd . '"';
                 } else {
                     $pcmd = $cmd;
                 }
                 if ($this->debug) {
                     COM_errorLog("CAPTCHA cmd: " . $pcmd);
                 }
                 passthru($pcmd);
             }
             break;
         case 2:
             header('Content-type: image/jpeg');
             $filename = $cString[$this->CaptchaString] . '.jpg';
             $fp = fopen($_CONF['path'] . 'plugins/captcha/images/static/' . $this->imageset . '/' . $filename, 'rb');
             if ($fp != NULL) {
                 while (!feof($fp)) {
                     $buf = fgets($fp, 8192);
                     echo $buf;
                 }
                 fclose($fp);
             } else {
                 COM_errorLog("CAPTCHA: Unable to open static image file");
             }
             break;
         case 3:
         case 4:
         case 5:
             break;
         case 6:
             /*
                             $output =  $this->first . ' '.$this->operator . ' ' . $this->second . ' = ';
                             $imagelength = $this->Length * 25 + 16;
                             $imageheight = 75;
                             $im = imagecreate($imagelength, $imageheight);
                             // White background and blue text
                             $bg = imagecolorallocate($im, 255, 255, 255);
                             $textcolor = imagecolorallocate($im, 0, 0, 255);
                             // Write the string at the top left
                             imagestring($im, 5, 35, 15, $output, $textcolor);
                             imagestring($im, 25, 5, 45, $LANG_CP00['captcha_help'], $textcolor);
                             // Output the image
                             header('Content-type: image/png');
                             imagepng($im);
                             imagedestroy($im);
             */
             $output = $this->first . '' . $this->operator . '' . $this->second . '=';
             $font = $this->fontpath . 'bluehigl.ttf';
             $imagelength = $this->Length * 25 + 16;
             $imageheight = 75;
             $image = imagecreate($imagelength, $imageheight);
             $bgcolor = imagecolorallocate($image, 255, 255, 255);
             $stringcolor = imagecolorallocate($image, 0, 0, 0);
             for ($i = 0; $i < strlen($output); $i++) {
                 imagettftext($image, 25, mt_rand(-15, 15), $i * 25 + 10, 45, $stringcolor, $font, $output[$i]);
             }
             switch ($this->gfxformat) {
                 case 'png':
                     imagepng($image);
                     break;
                 case 'jpg':
                     imagejpeg($image);
                     break;
             }
             imagedestroy($image);
             break;
         default:
             break;
     }
 }
コード例 #10
0
 function is_filtered($user_filter_arr, $msg_filter = null, $cid = null)
 {
     if ($msg_filter == null) {
         $msg_filter = self::get_filter($cid);
     }
     $msg_filter_arr = filters::parse_filter_string($msg_filter);
     for ($i = 0; $i < count($user_filter_arr); $i++) {
         if (count($user_filter_arr[$i]) > 1 && $user_filter_arr[$i][1] == 1) {
             if ($msg_filter_arr[$i][1] == 1) {
                 return 1;
             }
         }
     }
     return 0;
 }
コード例 #11
0
ファイル: captcha.class.php プロジェクト: ksb1712/pragyan
 function makeCaptcha()
 {
     $imagelength = $this->Length * 25 + 16;
     $imageheight = 75;
     $image = imagecreate($imagelength, $imageheight);
     //$bgcolor     = imagecolorallocate($image, 222, 222, 222);
     $bgcolor = imagecolorallocate($image, 255, 255, 255);
     $stringcolor = imagecolorallocate($image, 0, 0, 0);
     $filter = new filters();
     $funcnumber = rand(0, 1);
     switch ($funcnumber) {
         case 0:
             $randcellno = rand(2, 7);
             $filter->signs($image, $this->getRandFont(), $randcellno);
             break;
         case 1:
             $randruns = rand(10, 30);
             $filter->noise($image, $randruns);
             break;
         case 2:
         default:
             $randblurradius = rand(8, 20);
             $filter->blur($image, 15);
             break;
     }
     for ($i = 0; $i < strlen($this->CaptchaString); $i++) {
         imagettftext($image, 25, mt_rand(-15, 15), $i * 25 + 10, mt_rand(30, 70), $stringcolor, $this->getRandFont(), $this->CaptchaString[$i]);
     }
     //$filter->noise($image, 10);
     //$filter->blur($image, 6);
     $captchaImageFolder = "{$this->sourceFolder}/{$this->uploadFolder}/temp";
     // exec('find "'.$captchaImageFolder.'" -maxdepth 1 -type 5 -mmin +60 | xargs -0 /bin/rm -f');
     $captchaImageFile = scandir($captchaImageFolder, 1);
     if (count($captchaImageFile) <= 1) {
         $captchaImageFile[0] = '000000.png';
     }
     $captchaImageFile = substr($captchaImageFile[0], 0, strrpos($captchaImageFile[0], '.'));
     $captchaImageFile++;
     $captchaImageFile = str_pad($captchaImageFile, 6, '0', STR_PAD_LEFT) . '.png';
     $this->captchaImageUrl = "{$this->urlRequestRoot}/{$this->cmsFolder}/{$this->uploadFolder}/temp/{$captchaImageFile}";
     imagepng($image, $captchaImageFolder . '/' . $captchaImageFile);
     imagedestroy($image);
 }
コード例 #12
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('date_min' => '', 'date_max' => '', 'type' => 1, 'code' => 1, 'order_by' => $this->config->admin_default_order_by, 'order_direction' => $this->config->admin_default_order_direction);
     parent::setDefaultParams();
 }
コード例 #13
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'status' => 2, 'order_by' => 'id', 'order_direction' => 'desc');
     parent::setDefaultParams();
 }
コード例 #14
0
 public function setDefaultParams()
 {
     $this->defaults_params = array('show_filters' => false, 'page' => 1, 'nb_per_page' => 5, 'active' => 2, 'group_id' => -1, 'order_by' => 'registration_date', 'order_direction' => 'desc');
     parent::setDefaultParams();
 }