/**
  * Validate capcha public key/turing key
  *
  * @param array $data
  */
 public function perform($data = FALSE)
 {
     // Captcha privat key!!!
     $captcha_privat_key = md5(implode('', file($data['configPath'] . 'dbConnect.php')));
     // The ttf font to create turing chars images
     $captcha_ttf_font = JAPA_BASE_DIR . 'modules/common/includes/ttf_font/activa.ttf';
     // Relative folder of captcha pictures
     $captcha_pictures_folder = JAPA_PUBLIC_DIR . 'data/common/captcha';
     // Type of turing chars
     $captcha_char_type = 'num';
     // or 'hex'
     $captcha = new captcha($captcha_privat_key, JAPA_BASE_DIR, $captcha_ttf_font, $captcha_pictures_folder, $captcha_char_type);
     if (FALSE == $captcha->check_captcha($data['public_key'], $data['turing_key'])) {
         return FALSE;
     }
     return TRUE;
 }
示例#2
0
    $_arr['h1'] != '' ? $title->h1 = $_arr['h1'] : ($title->h1 = $_arr['title']);
}
/***************************************************************************************
 ***************************************************************************************/
global $_str;
// check for crack!
if (isset($_GET['page'])) {
    system::count_parametr(4);
    system::isset_numeric($_GET['page']);
} else {
    system::count_parametr(3);
    $_GET['page'] = 1;
}
// добавление новости
if (system::IsPost()) {
    if (!captcha::check_captcha()) {
        //выводим сообщение
        Message::GetMessage(0, v::getI18n('message_error_captcha'));
    } else {
        // пишем в базу
        Forms::MultyInsertForm('guestbook', 0);
        // очищаем POST
        unset($_POST);
        // выводим мообщение
        Message::GetMessage(1, v::getI18n('message_add_comment_to_guestbook'));
    }
}
// check for count gallery at page
guestbook::count_guestbook_at_page();
// get limit
$limit = pager::pager_limit(guestbook::count_guestbook(), GUESTBOOK_AT_PAGE);
示例#3
0
            // ищем связанные товары
            $_sql_ass = 'SELECT catalog.id, catalog.name, catalog.cost 
					FROM `catalog_ass` 
					LEFT JOIN catalog ON catalog.id=catalog_ass.id_catalog_with 
					WHERE id_catalog_who=' . $_GET['goods'] . ' or id_catalog_with=' . $_GET['goods'] . ' and catalog.id!=' . $_GET['goods'] . '
					GROUP by catalog.id
					';
            $catalog_ass = mysql::query($_sql_ass, 0);
            if ($catalog_ass) {
                $_str .= system::show_tpl(array('catalog_ass' => $catalog_ass), 'frontend/catalog/show_ass.php');
            }
        }
    } else {
        if (isset($_POST['id'])) {
            if ($_POST) {
                if (!registration::is_Autorize() and !captcha::check_captcha()) {
                    //выводим сообщение
                    Message::GetMessage(0, v::getI18n('message_error_captcha'));
                    echo "<meta http-equiv='refresh' content='2;URL=/catalog/goods/" . $_POST['id'] . "'>";
                } else {
                    //---------------------------------------------------------//
                    //---------- Отправляем мыло админу------------------------//
                    //---------------------------------------------------------//
                    // парсим тело письма
                    $_arr = ___findarray('select * from message where id=7');
                    // елементы для замены
                    $mass_element_for_parsing = array('%fio%', '%email%', '%q%', '%id%', '%link%', '%name_good%');
                    // заменяеміе значения
                    // имя товара
                    $_arr1 = ___findarray('select * from catalog where id=' . intval($_POST['id']));
                    // если неавторизован