function check_custom_authentication($username, $password)
 {
     global $wpdb;
     $setting_value = array();
     $date_time = date("Y-m-d H:i:s");
     $ip_Address = getIpAddress();
     $log_data = cpo_get_ip_location($ip_Address);
     $insert = new log_data();
     $setting_value["username"] = isset($_REQUEST["log"]) ? esc_attr($_REQUEST["log"]) : esc_attr($_REQUEST["username"]);
     $setting_value["ip_address"] = $ip_Address;
     if ($log_data->city == "" || $log_data->country_name == "") {
         $setting_value["geo_location"] = $log_data->city . $log_data->country_name;
     } else {
         $setting_value["geo_location"] = $log_data->city . ", " . $log_data->country_name;
     }
     $userdata = get_user_by("login", $username);
     if (wp_check_password($password, $userdata->user_pass)) {
         $setting_value["login_status"] = 1;
     } else {
         $setting_value["login_status"] = 0;
     }
     $setting_value["latitude"] = $log_data->latitude;
     $setting_value["longitude"] = $log_data->longitude;
     $setting_value["date_time"] = $date_time;
     $insert->insert_data(cleanup_optimizer_log(), $setting_value);
 }
Exemple #2
0
<?php

#Database connection:
include '../../config/connection.php';
#Constants:
DEFINE('D_TEMPLATE', 'template');
#Functions:
include '../../functions/data.php';
// It shows up in the browser's page tab
$site_title = 'ITTS "O. Belluzzi - L. da Vinci"';
// if (isset($_GET['page'])) {
// 	$pageid = $_GET['page']; // Set with URL value
// } else {
// 	$pageid = 1; //Set with 1 to reffer the Home default page
// }
// #Page variable setup:
// $page = data_page($dbc, $pageid);
#News card array setup:
$news = data_news($dbc);
#Circolari card array setup:
$circolari = data_circolari($dbc);
#Indirizzi array setup:
$indirizzi = data_indirizzi($dbc);
#User setup:
$user = data_user($dbc, $_SESSION['userid']);
$user['ip'] = getIpAddress();
<?php

/*
	$host = "localhost";
	$username = "******";
	$password = '******';
	$database =  "ecommerce"; 
*/
$host = 'localhost';
$username = '******';
$password = '******';
$database = 'ecommerce';
$ipAddress = getIpAddress();
define("HOST", $host, true);
define("USER", $username, true);
define("PASSWORD", $password, true);
define("DATABASE", $database, true);
$con = new PDO('mysql:host=' . HOST . ';dbname=' . DATABASE . '', USER, PASSWORD);
$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Exemple #4
0
                 $option->addAttribute("value", $iso);
             }
         }
     }
     $xmloutput .= $param->asXML();
     if ((string) $param["mandatory"] == "1" && $req[$name] == "" && $_FILES[$name] == "") {
         $missParam = true;
     }
     if ($_FILES[$name] != "") {
         //if($_FILES[$name]["size"] > 200000 or $_FILES[$name]["error"] > 0)
         if ($_FILES[$name]["error"] > 0) {
             if ($param["mandatory"] == "1") {
                 $missFile = true;
             }
         } else {
             $clientIp = getIpAddress();
             $folder = "../www/upload/" . $clientIp;
             mkdir($folder, 0700);
             #$fileName = date("Ymd-his__") . $clientIp . "__" . $_FILES[$name]["name"];
             $fileName = $folder . "/" . $_FILES[$name]["name"];
             move_uploaded_file($_FILES[$name]["tmp_name"], $fileName);
             $cmd .= $paramSeparator . $name . " '" . realpath($fileName) . "'";
         }
     }
     if ($req[$name] != "") {
         $cmd .= $paramSeparator . $name . " " . urlencode($req[$name]);
         $url .= "&" . $name . "=" . urlencode($req[$name]);
     }
 }
 header("url:" . $url);
 $xmloutput .= '</parameters>';
Exemple #5
0
 if ($timezone < -12 || $timezone > 12) {
     $timezone = 0;
 }
 $date = gmdate('d.m.Y', time() + 3600 * ($timezone + (date('I') == 1 ? 0 : 1)));
 $time = gmdate('H:i', time() + 3600 * ($timezone + (date('I') == 1 ? 0 : 1)));
 //$datetime=date('d.m.Y H:i');
 //if ($liteurl==1) {$comment=preg_replace("#([^\[img\]])(http|https|ftp|goper):\/\/([a-zA-Z0-9\.\?&=\;\-\/_]+)([\W\s<\[]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>\\4", $comment);}
 if ($liteurl == 1) {
     $comment = autolink($comment);
 }
 if ($antimat == 1) {
     $name = removeBadWords($name);
     $email = removeBadWords($email);
     $comment = removeBadWords($comment);
 }
 $ip = getIpAddress();
 if ($ipinfodb == 1) {
     $url = "http://api.ipinfodb.com/v3/ip-city/?key={$key}&ip={$ip}&format=json";
     $data = json_decode(utf8_encode(file_get_contents($url)));
     $country_code = $data->countryCode;
     $country_city = ucwords(strtolower($data->cityName . ', ' . $data->countryName));
     //$image = strtolower($country_code) . ".png";
     $image = strtolower($country_code);
     $country_img = "<div class=\"{$image}\" title=\"{$country_city}\"></div>";
 } else {
     //$ip = $_SERVER['REMOTE_ADDR'];
     //$ip = getIpAddress();
     $host = gethostbyaddr($ip);
     $country = array("localhost" => "Localhost", "ad" => "Andorra", "ae" => "United Arab Emirates", "af" => "Afghanistan", "ag" => "Antigua and Barbuda", "ai" => "Anguilla", "al" => "Albania", "am" => "Armenia", "an" => "Netherlands Antilles", "ao" => "Angola", "aq" => "Antarctica", "ar" => "Argentina", "as" => "American Samoa", "at" => "Austria", "au" => "Australia", "aw" => "Aruba", "az" => "Azerbaijan", "ba" => "Bosnia and Herzegovina", "bb" => "Barbados", "bd" => "Bangladesh", "be" => "Belgium", "bf" => "Burkina faso", "bg" => "Bulgaria", "bh" => "Bahrain", "bi" => "Burundi", "bj" => "Benin", "bm" => "Bermuda", "bn" => "Brunei darussalam", "bo" => "Bolivia", "br" => "Brazil", "bs" => "Bahamas", "bt" => "Bhutan", "bv" => "Bouvet Island", "bw" => "Botswana", "by" => "Belarus", "bz" => "Belize", "ca" => "Canada", "cc" => "Cocos (keeling) islands", "cd" => "Congo the democratic republic of the", "cf" => "Central african republic", "cg" => "Congo", "ch" => "Switzerland", "ci" => "Cote DIvoire", "ck" => "Cook Islands", "cl" => "Chile", "cm" => "Cameroon", "cn" => "China", "co" => "Colombia", "cr" => "Costa Rica", "cu" => "Cuba", "cv" => "Cape Verde", "cx" => "Christmas island", "cy" => "Cyprus", "cz" => "Czech republic", "de" => "Germany", "dj" => "Djibouti", "dk" => "Denmark", "dm" => "Dominica", "do" => "Dominican republic", "dz" => "Algeria", "ec" => "Ecuador", "ee" => "Estonia", "eg" => "Egypt", "eh" => "Western sahara", "er" => "Eritrea", "es" => "Spain", "et" => "Ethiopia", "fi" => "Finland", "fj" => "Fiji", "fk" => "Falkland islands (malvinas)", "fm" => "Micronesia federated states of", "fo" => "Faroe islands", "fr" => "France", "ga" => "Gabon", "gb" => "United Kingdom", "gd" => "Grenada", "ge" => "Georgia", "gf" => "French Guiana", "gh" => "Ghana", "gi" => "Gibraltar", "gl" => "Greenland", "gm" => "Gambia", "gn" => "Guinea", "gp" => "Guadeloupe", "gq" => "Equatorial guinea", "gr" => "Greece", "gs" => "South georgia and the south sandwich islands", "gt" => "Guatemala", "gu" => "Guam", "gw" => "Guinea-Bissau", "gy" => "Guyana", "hk" => "Hong Kong", "hm" => "Heard island and mcdonald islands", "hn" => "Honduras", "hr" => "Croatia", "ht" => "Haiti", "hu" => "Hungary", "id" => "Indonesia", "ie" => "Ireland", "il" => "Israel", "in" => "India", "io" => "British indian ocean territory", "iq" => "Iraq", "ir" => "Iran, islamic republic of", "is" => "Iceland", "it" => "Italy", "jm" => "Jamaica", "jo" => "Jordan", "jp" => "Japan", "ke" => "Kenya", "kg" => "Kyrgyzstan", "kh" => "Cambodia", "ki" => "Kiribati", "km" => "Comoros", "kn" => "Saint kitts and nevis", "kp" => "Korea democratic people's republic of", "kr" => "Korea republic of", "kw" => "Kuwait", "ky" => "Cayman islands", "kz" => "Kazakstan", "la" => "Lao people's democratic republic", "lb" => "Lebanon", "lc" => "Saint Lucia", "li" => "Liechtenstein", "lk" => "Sri Lanka", "lr" => "Liberia", "ls" => "Lesotho", "lt" => "Lithuania", "lu" => "Luxembourg", "lv" => "Latvia", "ly" => "Libyan Arab Jamahiriya", "ma" => "Morocco", "mc" => "Monaco", "md" => "Moldova republic of", "mg" => "Madagascar", "mh" => "Marshall islands", "mk" => "Macedonia the former yugoslav republic of", "ml" => "Mali", "mm" => "Myanmar", "mn" => "Mongolia", "mo" => "Macau", "mp" => "Northern mariana islands", "mq" => "Martinique", "mr" => "Mauritania", "ms" => "Montserrat", "mt" => "Malta", "mu" => "Mauritius", "mv" => "Maldives", "mw" => "Malawi", "mx" => "Mexico", "my" => "Malaysia", "mz" => "Mozambique", "na" => "Namibia", "nc" => "New Caledonia", "ne" => "Niger", "nf" => "Norfolk island", "ng" => "Nigeria", "ni" => "Nicaragua", "nl" => "Netherlands", "no" => "Norway", "np" => "Nepal", "nr" => "Nauru", "nu" => "Niue", "nz" => "New Zealand", "om" => "Oman", "pa" => "Panama", "pe" => "Peru", "pf" => "French Polynesia", "pg" => "Papua New Guinea", "ph" => "Philippines", "pk" => "Pakistan", "pl" => "Poland", "pm" => "Saint pierre and miquelon", "pn" => "Pitcairn", "pr" => "Puerto Rico", "ps" => "Palestinian territory occupied", "pt" => "Portugal", "pw" => "Palau", "py" => "Paraguay", "qa" => "Qatar", "re" => "Reunion", "ro" => "Romania", "ru" => "Russian Federation", "rw" => "Rwanda", "sa" => "Saudi Arabia", "sb" => "Solomon Islands", "sc" => "Seychelles", "sd" => "Sudan", "se" => "Sweden", "sg" => "Singapore", "sh" => "Saint Helena", "si" => "Slovenia", "sj" => "Svalbard and Jan Mayen", "sk" => "Slovakia", "sl" => "Sierra Leone", "sm" => "San Marino", "sn" => "Senegal", "so" => "Somalia", "sr" => "Suriname", "st" => "Sao Tome and principe", "sv" => "EL Salvador", "sy" => "Syrian Arab Republic", "sz" => "Swaziland", "tc" => "Turks and Caicos Islands", "td" => "Chad", "tf" => "French southern territories", "tg" => "Togo", "th" => "Thailand", "tj" => "Tajikistan", "tk" => "Tokelau", "tm" => "Turkmenistan", "tn" => "Tunisia", "to" => "Tonga", "tp" => "East Timor", "tr" => "Turkey", "tt" => "Trinidad and Tobago", "tv" => "Tuvalu", "tw" => "Taiwan province of China", "tz" => "Tanzania united republic of", "ua" => "Ukraine", "ug" => "Uganda", "um" => "United states minor outlying islands", "us" => "United States", "uy" => "Uruguay", "uz" => "Uzbekistan", "va" => "Holy See (Vatican city state)", "vc" => "Saint Vincent and the Grenadines", "ve" => "Venezuela", "vg" => "Virgin islands British", "vi" => "Virgin islands U.S", "vn" => "Viet Nam", "vu" => "Vanuatu", "wf" => "Wallis and Futuna", "ws" => "Samoa", "ye" => "Yemen", "yt" => "Mayotte", "yu" => "Yugoslavia", "za" => "South africa", "zm" => "Zambia", "zw" => "Zimbabwe");
     $array = array_reverse(explode('.', $host));
     $flag_img = strtolower($array[0]);
Exemple #6
0
        echo subTotal();
        ?>
</span></div></div>
<div id="dg_body_background_basket" class="dg_slider"<?php 
        echo checkBasket();
        ?>
>
  <?php 
        echo showBasket();
        ?>
</div>
<?php 
    }
}
if ($ad_showcomment) {
    $cmtip = getIpAddress();
    $and = array_intersect($is_admin, $userGroups) ? '' : ' AND published = 1';
    $db->setQuery('SELECT * FROM #__datsogallery_comments WHERE cmtpic = ' . $obj->id . $and . ' ORDER BY cmtid ASC');
    $rows = $db->loadObjectList();
    echo "<div class=\"dg_head_background\">" . JText::_('COM_DATSOGALLERY_COMMENT1') . ": " . count($rows) . "</div>";
    if (count($rows) != 0) {
        $appruve = '<a class="btn-unapprove">' . JText::_('COM_DATSOGALLERY_UNAPPROVE') . '</a>';
        $unappruve = '<a class="btn-approve">' . JText::_('COM_DATSOGALLERY_APPROVE') . '</a>';
        ?>
<div class="comments_core">
    <?php 
        echo '<ul id="list">';
        foreach ($rows as $row) {
            $db->setQuery("SELECT id FROM #__users WHERE email = '" . $row->cmtmail . "'");
            $user_id = $db->loadResult();
            if ($ad_js || $ad_cb) {
Exemple #7
0
<?php

include 'config.php';
countTraffic(getIpAddress());
?>
<!DOCTYPE HTML>
<html>
	<head>
		<title><?php 
echo $_SITE['title'];
?>
</title>
		<meta charset="utf-8" />
		<meta name="description" content="<?php 
echo $_SITE['description'];
?>
">
		<meta name="keywords" content="<?php 
echo $_SITE['keywords'];
?>
">
		<meta name="author" content="<?php 
echo $_SITE['author'];
?>
">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
		<link rel="stylesheet" href="assets/css/main.css" />
		<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
		<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
		<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
Exemple #8
0
<?php

$link = mysql_connect('db824.perfora.net', 'dbo282224548', '8mp3vWxp');
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db("db282224548") or die('Could not select db: ' . mysql_error());
$IPAddress = getIpAddress();
function getIpAddress()
{
    return empty($_SERVER['HTTP_CLIENT_IP']) ? empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['HTTP_CLIENT_IP'];
}
putenv("TZ=PST8PDT");
$ClickedOn = date("Y/m/d");
$ClickedTime = date("h:i:s");
mysql_query("INSERT INTO Clicks(IPAddress,ClickedOn,ClickedTime)\nVALUES('{$IPAddress}', '{$ClickedOn}', '{$ClickedTime}')");
$query = "SELECT * FROM PrayerTimes";
$result = mysql_query($query) or die('Could not select: ' . mysql_error());
$row = mysql_fetch_array($result);
$query = "SELECT * FROM Ayahs WHERE Date='" . date("Y-m-d") . "'";
$result = mysql_query($query) or die('Could not select: ' . mysql_error());
$ayahRow = mysql_fetch_array($result);
if (strlen($ayahRow['Quran']) < 5) {
    $query = "SELECT * FROM AyahCounter LIMIT 1";
    $result = mysql_query($query) or die('Could not select: ' . mysql_error());
    $acRow = mysql_fetch_array($result);
    if (strtotime($acRow['CounterDate']) != strtotime($ClickedOn)) {
        $increment = $acRow['AyahID'] + 1;
        if ($increment == 28 || $increment == 247 || $increment == 264) {
            $increment = $increment + 1;
        } else {
function adddownload($id)
{
    $db =& JFactory::getDBO();
    $ip = getIpAddress();
    $dld = 'UPDATE #__datsogallery' . ' SET imgdownloaded = ( imgdownloaded + 1 )' . ' WHERE id = ' . (int) $id;
    $db->setQuery($dld);
    $db->query();
    $data = 'INSERT INTO #__datsogallery_downloads' . ' VALUES (' . $db->Quote('') . ', ' . (int) $id . ', ' . $db->Quote($ip) . ', NOW())';
    $db->setQuery($data);
    $db->query();
}
Exemple #10
0
/**
 * @param $sql
 * @param $table
 * @param $event
 * @param $record
 * @param $display
 * @param string $descrip
 * @param string $change_reason
 * @param $userid
 * @return bool|mysqli_result
 *
 * This function should only be used when required, to impersonate another user for the purpose of ensuring data integrity.
 * One example of this purpose is to replicate Survey respondent input so survey functionality is maintained.
 */
function target_proxy_log_event($sql, $table, $event, $record, $display, $descrip = "", $change_reason = "", $userid = "")
{
	global $user_firstactivity, $rc_connection;

	// Pages that do not have authentication that should have USERID set to [non-user]
	$nonAuthPages = array("_cron/cirrhosis_reporting.php", "_cron/push-hcvrna-monitoring.php", "_cron/push_durations.php", "_cron/push_durations_to_repo.php", "_cron/push_svr_actual_to_pivot.php", "push_svr_actual_to_pivot.php", "_cron/update_daa.php");

	// Log the event in the redcap_log_event table
	$ts = str_replace(array("-", ":", " "), array("", "", ""), NOW);
	$page = (defined("PAGE") ? PAGE : "");
	$ip = (isset($userid) && $userid != "[Survey respondent]") ? "" : getIpAddress(); // Don't log IP for survey respondents
	$event = strtoupper($event);
	$event_id = (isset($_GET['event_id']) && is_numeric($_GET['event_id'])) ? $_GET['event_id'] : "NULL";
	$project_id = defined("PROJECT_ID") ? PROJECT_ID : 0;

	// Query
	$sql = "INSERT INTO redcap_log_event
			(project_id, ts, user, ip, page, event, object_type, sql_log, pk, event_id, data_values, description, change_reason)
			VALUES ($project_id, $ts, '" . prep($userid) . "', " . checkNull($ip) . ", '$page', '$event', '$table', " . checkNull($sql) . ",
			" . checkNull($record) . ", $event_id, " . checkNull($display) . ", " . checkNull($descrip) . ", " . checkNull($change_reason) . ")";
	$q = db_query($sql, $rc_connection);

	// FIRST/LAST ACTIVITY TIMESTAMP: Set timestamp of last activity (and first, if applicable)
	if (defined("USERID") && strpos(USERID, "[") === false) {
		// SET FIRST ACTIVITY TIMESTAMP: If this is the user's first activity to be logged in the log_event table, then log the time in the user_information table
		$sql_firstact = "";
		if ((!isset($user_firstactivity) || (isset($user_firstactivity) && empty($user_firstactivity)))) {
			$sql_firstact = ", user_firstactivity = '" . NOW . "'";
		}
		// SET LAST ACTIVITY TIMESTAMP
		$sql = "update redcap_user_information set user_lastactivity = '" . NOW . "' $sql_firstact
				where username = '******' limit 1";
		db_query($sql, $rc_connection);
	}

	// Return true/false success for logged event
	return $q;
}
 /**
  * @param $id
  * @return Throttle
  */
 public function findThrottlerByUserId($id)
 {
     if (DB::table($this->throttle_table)->where("user_id", $id)->count() > 0) {
         //Throttle exists
         return Throttle::where("user_id", $id)->first();
     } else {
         //Create new throttle
         $throttle = new Throttle();
         $throttle->user_id = $id;
         $throttle->ip_address = getIpAddress();
         $throttle->attempts = 0;
         $throttle->suspended = 0;
         $throttle->banned = 0;
         $throttle->last_attempt_at = null;
         $throttle->suspended_at = null;
         $throttle->banned_at = null;
         $throttle->save();
         return $throttle;
     }
 }
<?php

try {
    // ********************************
    // *
    // * I n c l u d e s   h e r e
    // *
    // ********************************
    require_once 'config.inc';
    require_once ENGINE . 'Default/smr.inc';
    require_once get_file_loc('SmrAccount.class.inc');
    // get this user from db
    $login = $_REQUEST['login'];
    // creates a new user account object
    $account =& SmrAccount::getAccountByName($login);
    $email = $_REQUEST['email'];
    if ($account == null || $account->getEmail() != $email) {
        // unknown user
        header('Location: ' . URL . '/error.php?msg=' . rawurlencode('User does not exist'));
        exit;
    }
    $account->generatePasswordReset();
    $resetURL = URL . '/reset_password.php?login='******'&resetcode=' . $account->getPasswordReset();
    // send email with password to user
    mail($email, 'Space Merchant Realms Password', 'A user from ' . getIpAddress() . ' requested to reset your password!' . EOL . EOL . '   Your password reset code is: ' . $account->getPasswordReset() . EOL . '   You can use this url: ' . $resetURL . EOL . EOL . 'The Space Merchant Realms server is on the web at ' . URL . '/', 'From: support@smrealms.de');
    header('Location: ' . URL . '/reset_password.php');
    exit;
} catch (Exception $e) {
    handleException($e);
}
*/
define('INITIALIZE_GLOBAL_ARRAYS', true);
if ($phpversion < 410) {
    $_REQUEST = array();
    $_COOKIE = array();
    $_POST = array();
    $_GET = array();
    $_SERVER = array();
    $_FILES = array();
    get_vars_old();
}
$phpversion = (int) str_replace(".", "", phpversion());
$pagestarttime = microtime();
$query_count = 0;
$disableverify = 0;
$REMOTE_ADDR = getIpAddress();
$HTTP_USER_AGENT = substr($_SERVER['HTTP_USER_AGENT'], 0, 100);
$REMOTE_ADDR = htmlspecialchars($REMOTE_ADDR);
$HTTP_USER_AGENT = htmlspecialchars($HTTP_USER_AGENT);
// remove slashes in get post cookie data...
if (get_magic_quotes_gpc()) {
    if (is_array($_REQUEST)) {
        $_REQUEST = stripslashes_array($_REQUEST);
    }
    if (is_array($_POST)) {
        $_POST = stripslashes_array($_POST);
    }
    if (is_array($_GET)) {
        $_GET = stripslashes_array($_GET);
    }
    if (is_array($_COOKIE)) {