public static function sortBy(&$items, $key, $descending = false) { if (is_array($items)) { return usort($items, function ($a, $b) use($key, $descending) { $cmp = strCmp($a[$key], $b[$key]); return $descending ? -$cmp : $cmp; }); } return false; }
function alimir_bootModal_ajax_lostPassword() { check_ajax_referer('ajax-form-nonce', 'security3'); $lost_pass = $_POST['lost_pass']; $lostpass_captcha = ''; if (isset($_POST['lostpass_captcha'])) { $lostpass_captcha = $_POST['lostpass_captcha']; } if ($lost_pass == null || (get_option('enable_lostpass_captcha') == 1 and $lostpass_captcha == null)) { echo json_encode(array('reset' => false, 'message' => __('<p class="alert alert-info" data-alert="alert">Please fill all the fields.</p>', 'alimir'))); } else { if (get_option('enable_lostpass_captcha') == 1 and !strCmp(strToUpper($_SESSION['lostpass_captcha']), strToUpper($lostpass_captcha)) == 0) { echo json_encode(array('reset' => false, 'message' => __('<p class="alert alert-error" data-alert="alert">captcha invalid.</p>', 'alimir'))); } else { if (is_email($lost_pass)) { $username = sanitize_email($lost_pass); } else { $username = sanitize_user($lost_pass); } $user_forgotten = alimir_bootModal_ajax_lostPassword_retrieve($username); if (is_wp_error($user_forgotten)) { $lostpass_error_messages = $user_forgotten->errors; $display_errors = '<div class="alert alert-error" data-alert="alert">'; foreach ($lostpass_error_messages as $error) { $display_errors .= '<div>' . $error[0] . '</div>'; } $display_errors .= '</div>'; echo json_encode(array('reset' => false, 'message' => $display_errors)); } else { echo json_encode(array('reset' => true, 'message' => __('<p class="alert alert-success" data-alert="alert">Password Reset. Please check your email.</p>', 'alimir'))); } } } die; }
function _snomAppCmp($appv1, $appv2) { //$appv1 = _snom_normalize_version( $appv1 ); # we trust it has been normalized! $appv2 = _snom_normalize_version($appv2); return strCmp($appv1, $appv2); }
function _tiptel_fwcmp($fwvers1, $fwvers2) { //$fwvers1 = _tiptel_normalize_version( $fwvers1 ); # we trust it has been normalized! $fwvers2 = _tiptel_normalize_version($fwvers2); return strCmp($fwvers1, $fwvers2); }
function searchresult() { $CI =& get_instance(); $useragent = $CI->input->user_agent(); $is_shiftjis = $this->is_shiftjis($useragent); if ($is_shiftjis) { $input = $this->convertShiftjisToUtf($CI->input->post('searchtext', TRUE)); } else { $input = $CI->input->post('searchtext', TRUE); } $category = (int) $CI->input->post('category', TRUE); // searchtype $searchtype = $CI->input->post('searchtype', TRUE); $isOrSearch = false; if ($searchtype !== null && $searchtype != '' && strCmp(strtolower($searchtype), 'or') == 0) { $isOrSearch = true; } if ($input != '' || $category != '') { if ($input) { $insert = array('searchlog_term' => $input); $CI->db->insert('searchlog', $insert); } $CI->db->from('articles'); $CI->db->join('article2cat', 'articles.article_id = article2cat.article_id', 'left'); $CI->db->join('articles2site', 'articles.article_id = articles2site.article_id', 'left'); if ($this->is_mobile($useragent) == false) { $where = "(site_id in (0,1))"; $CI->db->where($where); } else { $where = "(site_id in (0,2))"; $CI->db->where($where); } if ($category) { $CI->db->where('category_id', $category); } $CI->db->where('article_display', 'Y'); // This is a hack found here: // http://codeigniter.com/forums/viewthread/122223/ // And here: // http://68kb.com/support/topic/better-keyword-handling-in-search-a-solution if ($input) { $keywords = array(); $keywords = explode(" ", $input); $numkeywords = count($keywords); $wherestring = ""; for ($i = 0; $i < $numkeywords; $i++) { if ($i > 0) { if ($isOrSearch == true) { $wherestring .= " OR "; } else { $wherestring .= " AND "; } } $wherestring = $wherestring . " (article_title LIKE '%" . mysql_real_escape_string($keywords[$i]) . "%' OR article_short_desc LIKE '%" . mysql_real_escape_string($keywords[$i]) . "%' OR article_description LIKE '%" . mysql_real_escape_string($keywords[$i]) . "%') "; } $CI->db->where('(' . $wherestring . ')', NULL, FALSE); } $CI->db->orderby('article_order', 'DESC'); $CI->db->orderby('article_hits', 'DESC'); $data['articles'] = $CI->db->get(); $data['searchtext'] = $input; $data['category'] = $category; $data['searchtype'] = $searchtype; } else { $data = array(); } //For topSearch //$data['cat_tree'] = $this->get_cats_for_select_with_site_id(); $data = $this->set_category_tree_info($data); $data = $this->set_siteinfo($useragent, $data); $template = 'search'; // are we caching? if ($CI->init_model->get_setting('cache_time') > 0) { $CI->output->cache($CI->init_model->get_setting('cache_time')); } // set body info $data = $this->set_body_info($template, $data, $useragent, $is_shiftjis); $this->display_composed_page($data, $useragent, $is_shiftjis); // finally show the last hook $CI->core_events->trigger('display_template'); return "done"; }
</body> </html> <?php define("IMPASS_CHECK", true); include "jcr_connect.php"; include "jcr_settings.php"; $action = $_GET['action']; $get_admin_login = sql_param($_POST['admin_login']); $get_admin_pass = sql_param($_POST['admin_pass']); $loc_login = sql_param($_POST['loc_login']); $unloc_login = sql_param($_POST['unloc_login']); $up_status_login = $db->real_escape_string($_POST['up_status_login']); $down_status_login = $db->real_escape_string($_POST['down_status_login']); if ($action != null && strCmp($admin_login, $get_admin_login) != 0 && strCmp($admin_pass, $get_admin_pass) != 0) { die("Неверный логин или пароль администратора"); } if ($action == "block_HWID") { if ($loc_login == null && $unloc_login == null) { die("Поля 'Логин для блокировки' и 'Логин для разблокировки' не могут быть пустыми одновременно"); } if ($loc_login != null) { $query = $db->query("SELECT {$db_colHWID} FROM {$db_table} WHERE {$db_colUser}='{$loc_login}'") or die($db->error); if ($query->num_rows == 1) { $row = $query->fetch_assoc(); $bdHWID = $row[$db_colHWID]; if ($bdHWID != null) { $db->query("UPDATE {$db_table} SET {$db_colBlHWIDs}='{$bdHWID}' WHERE {$db_colUser}='{$loc_login}'") or die($db->error); echo "HWID игрока '{$loc_login}' заблокирован<br />"; } else {
function _grandstream_fwcmp($fwvers1, $fwvers2) { //$fwvers1 = _grandstream_normalize_version( $fwvers1 ); # we trust it has been normalized! $fwvers2 = _grandstream_normalize_version($fwvers2); return strCmp($fwvers1, $fwvers2); }