2
What an excellent suggestion some form of user registration info field in profile module. I think I will make a field that records these settings:
if (!function_exists("xortify_getIPData")) {
function xortify_getIPData($ip=false){
$ret = array();
if (is_object($GLOBALS['xoopsUser'])) {
$ret['uid'] = $GLOBALS['xoopsUser']->getVar('uid');
$ret['uname'] = $GLOBALS['xoopsUser']->getVar('uname');
$ret['email'] = $GLOBALS['xoopsUser']->getVar('email');
} else {
$ret['uid'] = 0;
$ret['uname'] = (isset($_REQUEST['uname'])?$_REQUEST['uname']:'');
$ret['email'] = (isset($_REQUEST['email'])?$_REQUEST['email']:'');
}
$ret['agent'] = $_SERVER['HTTP_USER_AGENT'];
if (!$ip) {
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])){
$ip = (string)$_SERVER["HTTP_X_FORWARDED_FOR"];
$ret['is_proxied'] = true;
$proxy_ip = $_SERVER["REMOTE_ADDR"];
$ret['network-addy'] = @gethostbyaddr($ip);
$ret['long'] = @ip2long($ip);
if (is_ipv6($ip)) {
$ret['ip6'] = $ip;
$ret['proxy-ip6'] = $proxy_ip;
} else {
$ret['ip4'] = $ip;
$ret['proxy-ip4'] = $proxy_ip;
}
}else{
$ret['is_proxied'] = false;
$ip = (string)$_SERVER["REMOTE_ADDR"];
$ret['network-addy'] = @gethostbyaddr($ip);
$ret['long'] = @ip2long($ip);
if (is_ipv6($ip)) {
$ret['ip6'] = $ip;
} else {
$ret['ip4'] = $ip;
}
}
} else {
$ret['is_proxied'] = false;
$ret['network-addy'] = @gethostbyaddr($ip);
$ret['long'] = @ip2long($ip);
if (is_ipv6($ip)) {
$ret['ip6'] = $ip;
} else {
$ret['ip4'] = $ip;
}
}
$ret['made'] = time();
return $ret;
}
}
if (!function_exists("is_ipv6")) {
function is_ipv6($ip = "")
{
if ($ip == "")
return false;
if (substr_count($ip,":") > 0){
return true;
} else {
return false;
}
}
}
this is quiet effective code to get
those details when thay are needed. And make it so you can only register from one IP only once. So there is no due spammy indian signup sweat shop that depending on how you set spiders up with xortify, allow for he user information not to go into the bots.