Ejemplo n.º 1
0
 static function clear($str, $limit = false, $filters = 12, $codename = false, $last_ip = false)
 {
     global $cfg, $kio;
     if ($limit && mb_strlen($str) > $limit) {
         $str = mb_substr($str, 0, $limit);
     }
     // 1 - Remove whitespace from the beginning and end of a string
     if (substr_count($cfg->system['filters'] . $filters, 1) == 2) {
         $str = trim($str);
     }
     // 2 - No HTML
     substr_count($cfg->system['filters'] . $filters, 2) == 2 && ($str = preg_replace('#(script|about|applet|activex|chrome):#is', '\\1:', htmlspecialchars(stripslashes($str), ENT_QUOTES, 'UTF-8')));
     // 3 - Antispam
     if (substr_count($cfg->system['filters'] . $filters, 3) == 2 && preg_match_all('#' . $kio->spam_words . '#i', $str, $words)) {
         $kio->{'spam-' . $codename} = implode(', ', array_unique($words[0]));
     }
     // 4 - Antiflooder (Check by last entry IP)
     if (IP == $last_ip && substr_count($cfg->system['filters'] . $filters, 4) == 2) {
         define('FLOOD', 1);
     } elseif ($_COOKIE['KioCMS-' . COOKIE . '-' . $codename] && substr_count($cfg->system['filters'] . $filters, 5) == 2 && !defined('FLOOD')) {
         define('FLOOD', 2);
     }
     return str_replace(array('`', '\\'), array('`', '\'), r2n($str));
 }
Ejemplo n.º 2
0
function is_registered($check, $where = 'nickname')
{
    global $cfg, $sql;
    return $check ? $sql->query('SELECT id FROM ' . DB_PREFIX . 'users WHERE ' . $where . ' = "' . $check . '"')->rowCount() || in_array(strtolower($check), explode("\n", strtolower(r2n($cfg->system['reserved_usernames'])))) : false;
}
Ejemplo n.º 3
0
    $errors[] = !$form['separator'] ? 'Pole <strong>separator</strong> nie może zostać puste.' : '';
    $errors[] = !$form['language'] ? 'Pole <strong>język</strong> nie może zostać puste.' : '';
    $errors[] = !$form['template'] ? 'Pole <strong>szablon</strong> nie może zostać puste.' : '';
    $errors[] = !$form['columns'] ? 'Pole <strong>ilość kolumn</strong> nie może zostać puste.' : '';
    $errors[] = !$form['date_format'] ? 'Pole <strong>format daty</strong> nie może zostać puste.' : '';
    $errors[] = !$form['short_date_format'] ? 'Pole <strong>format krótkiej daty</strong> nie może zostać puste.' : '';
    $errors[] = !$form['deleted_username'] ? 'Pole <strong>zastepczy login</strong> nie może zostać puste.' : '';
    $errors[] = !$form['communicator_name'] ? 'Pole <strong>nazwa komunikatora</strong> nie może zostać puste.' : '';
    $errors[] = !$form['communicator_url'] ? 'Pole <strong>adres odsyłacza</strong> nie może zostać puste.' : '';
    $errors[] = !$form['communicator_image'] ? 'Pole <strong>adres obrazka statusu</strong> nie może zostać puste.' : '';
    $errors[] = $form['seo_characters2'] && !preg_match('#^[a-Z0-9\\n\\r]*$#', $form['seo_characters2']) ? 'Zamienniki znaków muszą być alfanumeryczne.' : '';
    if (!in_array(true, $errors)) {
        //$form['seo_characters'] = serialize(array($_POST['seo_characters'], $_POST['seo_characters2']));
        $form['communicator_image'] = htmlspecialchars($form['communicator_image']);
        $form['communicator_url'] = htmlspecialchars($form['communicator_url']);
        $form['reserved_usernames'] = r2n($form['reserved_usernames']);
        $form['time_zone'] = (double) $form['time_zone'];
        save_config($system, 'system', local_url . 'admin/system');
    } else {
        negative($errors);
    }
} else {
    //neutral(array('<strong>Radzę z rozwagą i świadomością edytować poniższe dane.</strong>', $lang_system['REQUIRED']));
    $templates_dir = opendir(ROOT . 'templates/');
}
while (false !== ($template_dir = readdir($templates_dir))) {
    if (ctype_alpha($template_dir)) {
        $templates[] = $template_dir;
    }
}
$tpl = new PHPTAL('admin/system/settings.html');