1) ; if (($errstr = SaveConfig($configFileName, $tmpcfg)) || ($errstr = (@include $configFileName) ? '' : "Can not include $configFileName")) { echo $errstr ; exit ; } } if (isset($hCfg) && !isset($cfgPars)) $cfgPars = $hCfg ; # compatibility with the version 1.00 $cfgPars['InstallDir'] = $installDir ; # Get the urls $cfgPars = $cfgPars + Urls(); $cfgPars['ProgNameHtml'] = 'asRep MySQL Version '. MYVERSION .' Administration' ; # Get the cgi inputs $cgiPars = getInputs(); # Check for the admin name if (!strlen($cfgPars['AdminName']) || !strlen($cfgPars['AdminPassEnc'])) { if (isset($cgiPars['state']) && $cgiPars['state'] == 'adminname') { $errstr = SaveAdminName($configFileName, $cfgPars, $cgiPars) ; $errstr ? DispAdminName($cfgPars, $errstr) : header("Location: $cfgPars[Url]") ; }else { DispAdminName($cfgPars, '') ; } exit ; } # verify the user if(!VerifyUserLogin($cfgPars, $cgiPars)) exit() ; # Test mysql connection $dbh = DBConnect($cfgPars['DbHost'], $cfgPars['DbPort'], $cfgPars['DbUser'], $cfgPars['DbPass'], true) ; if (!$dbh || !DBSelect($dbh, $cfgPars['DbName'], true)) { if (isset($cgiPars['state']) && $cgiPars['state'] == 'dbsettings') { $errstr = SaveDBSettings($configFileName, $cfgPars, $cgiPars) ; strlen($errstr) ? DispDBSettings($cfgPars, $errstr) : header("Location: $cfgPars[Url]") ; }else { DispDBSettings($cfgPars, mysql_error()) ; } exit ; } # Create tables if (empty($cgiPars['VersionUpgrade'])){ list ($tables) = DBQueryInArrays($dbh, "SHOW TABLES"); $tfields = TableFields() ; while (list($k,$v) = each($cfgPars['Tbl'])) { $isin = in_array($v, $tables) ; if (!$isin) { $isin = in_array(strtolower($v), $tables) ; if (!$isin) DBQuery($dbh, "CREATE TABLE $v ($tfields[$k])") ; } } } # Version upgrade if ($cfgPars['Version'] < MYVERSION) { if ($cfgPars['Version'] == '1.25'){ $errstr = version125Upgrade($dbh, $configFileName, $cfgPars, $cgiPars) ; }elseif ($cfgPars['Version'] == '1.30'){ $errstr = version130Upgrade($dbh, $configFileName, $cfgPars, $cgiPars) ; }else{ $errstr = "This version of asRep (v." . MYVERSION . ") is not compatible with your version (v." . $cfgPars['Version'] . ")" . "

Still you can make a fresh installation by deleting the 'settings.php' file from the install directory.". " However this will forget your current tracking data since it will open new database tables." . "

To upgrade your data tables also, you need a previous version of asRep." . " For this, please contact us via" . " this form.". " Do not forget to mention your registration key, your current version number and your script type (PHP or Perl)" ; } if (strlen($errstr)) { echo ($errstr) ; }else{ $url = SelfUrl($cfgPars, $cgiPars) ; header("Location: $url") ; } exit ; } # do tasks $errorstr = '' ; if(!isset($cgiPars['state'])) $cgiPars['state']='' ; if (empty($cgiPars['state']) || $cgiPars['state'] == 'login') DispSetup($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'dbBackup') $errorstr = DbBackup($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'dbRestore') $errorstr = DbRestore($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'dbRepair') $errorstr = DbRepair($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'dbOptimize') $errorstr = DbOptimize($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'timezone') $errorstr = SaveTimeZone($configFileName, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'email') $errorstr = SaveEmail($configFileName, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'ipcc' && $cgiPars['update']) $errorstr = GetIpCc($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'mapip2cc') $errorstr = MapIp2Cc($dbh, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'cnotify') $errorstr = SaveClickNotify($configFileName, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'blockIPrange') $errorstr = SaveBlockedIPs($configFileName, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'regkey') $errorstr = SaveRegKey($configFileName, $cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'dbmaintenance' || $cgiPars['state'] == 'dbBackup' || $cgiPars['state'] == 'dbRestore' || $cgiPars['state'] == 'dbRepair' || $cgiPars['state'] == 'dbOptimize') DispDbMaintenance($dbh, $cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vtimezone' || $cgiPars['state'] == 'timezone') DispTimeZone($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vemail' || $cgiPars['state'] == 'email') DispEmail($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vipcc' || $cgiPars['state'] == 'ipcc' || $cgiPars['state'] == 'mapip2cc') DispIp2Country($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vcnotify' || $cgiPars['state'] == 'cnotify') DispClickNotify($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vtrackcode' || $cgiPars['state'] == 'trackcode') DispTrackCode($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vblocktracking' || $cgiPars['state'] == 'blockIPrange' || $cgiPars['state'] == 'blocksetcookie' || $cgiPars['state'] == 'blockdelcookie') DispBlockTracking($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'vupdate' || $cgiPars['state'] == 'regkey') DispUpdate($cfgPars, $cgiPars, $errorstr) ; if ($cgiPars['state'] == 'update') DispDownloadUpdates($cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'fview') DispFileView($cfgPars, $cgiPars); if ($cgiPars['state'] == 'factivate') DispFileAct($cfgPars, $cgiPars) ; if ($cgiPars['state'] == 'vlogout') Logout($cfgPars); mysql_close($dbh) ; ###################################################### function SelfUrl(&$cfg, &$pars){ $url = $cfg['Url'] ; $sep = '?' ; foreach ($pars as $k => $v){ $url .= $sep . $k . '=' . urlencode($v) ; $sep = '&' ; } return $url ; } #--------- Escape the string for single quotation mark -------------- function Esc ($str){ return addcslashes($str, '\'\\') ; } ###################################################### #--------- Table fields -------------- function TableFields() { return array( 'Logs' => ' vTime INT UNSIGNED NOT NULL' . ', Id TINYINT UNSIGNED NOT NULL' . ', cTime TINYINT UNSIGNED NOT NULL' . ', auInfo1 TINYINT UNSIGNED NOT NULL' . ', auInfo2 TINYINT UNSIGNED NOT NULL' . ', Ip INT UNSIGNED NOT NULL' . ', cCode CHAR(2) BINARY NOT NULL' . ', piId INT UNSIGNED NOT NULL' . ', rpagId INT UNSIGNED NOT NULL' . ', adId INT UNSIGNED NOT NULL' . ', PRIMARY KEY (vTime, Id)' , 'PageInfo' => 'Id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', pagId INT UNSIGNED NOT NULL' . ', domId SMALLINT UNSIGNED NOT NULL' . ', asId0 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0' . ', asId1 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0' . ', asId2 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0' . ', asId3 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0' . # for Ad Link ', wsChId0 SMALLINT UNSIGNED NOT NULL DEFAULT 0' . ', wsChId1 SMALLINT UNSIGNED NOT NULL DEFAULT 0' . ', INDEX (pagId)' , 'Domains' => 'Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', FP SMALLINT UNSIGNED NOT NULL' . ', Value VARCHAR(255) NOT NULL' . ', INDEX (FP)' , 'Pages' => 'Id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', FP SMALLINT UNSIGNED NOT NULL' . ', Value BLOB NOT NULL' . ', INDEX (FP)' , 'Dirs' => ' pagId INT UNSIGNED NOT NULL' . ', offset TINYINT UNSIGNED NOT NULL' . ', leaf CHAR(0)' . ', INDEX (pagId)' , 'AdSense' => 'Id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', FP SMALLINT UNSIGNED NOT NULL' . ', chId SMALLINT UNSIGNED NOT NULL' . ', format CHAR(16) NOT NULL' . ', fb CHAR(1) NOT NULL' . ', color_bg CHAR(6) NOT NULL' . ', color_text CHAR(6) NOT NULL' . ', color_link CHAR(6) NOT NULL' . ', color_url CHAR(6) NOT NULL' . ', color_border CHAR(6) NOT NULL' . ', color_line CHAR(6) NOT NULL' . ', INDEX (FP)' , 'Channels' => 'Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', ws CHAR(0) DEFAULT NULL' . ', channel CHAR(12) NOT NULL' . ', name CHAR(32) NOT NULL' . ', INDEX (channel)', 'rDomains' => 'Id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', FP SMALLINT UNSIGNED NOT NULL' . ', Value VARCHAR(255) NOT NULL' . ', INDEX (FP)' , 'rPages' => 'Id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', rdomId MEDIUMINT UNSIGNED NOT NULL' . ', FP SMALLINT UNSIGNED NOT NULL' . ', Value BLOB NOT NULL' . ', INDEX (FP)' , 'AdUrls' => 'Id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' . ', FP SMALLINT UNSIGNED NOT NULL' . ', Value VARCHAR(255) NOT NULL' . ', INDEX (FP)' , 'IpRangeNames' => 'Code CHAR(2) BINARY NOT NULL PRIMARY KEY' . ', Name VARCHAR(64) NOT NULL' , 'IpRanges' => 'Type TINYINT UNSIGNED NOT NULL' . ', Code CHAR(2) BINARY NOT NULL' . ', IpSeg SMALLINT UNSIGNED NOT NULL' . ', StartIp INT UNSIGNED NOT NULL' . ', EndIp INT UNSIGNED NOT NULL' . ', INDEX (IpSeg)' , ) ; } #--------- version upgrade tasks -------------- function vuRedir(&$cfg, &$pars) { if (empty($pars['VersionUpgrade'])) { $pars['VersionUpgrade'] = 0; if ($filedesc = @fopen(FullPath("vustep.txt", $cfg['InstallDir']), 'rb')) { $pars['VersionUpgrade'] = 0+fread($filedesc,1024) ; fclose($filedesc) ; } $pars['VersionUpgrade']++ ; $url = SelfUrl($cfg, $pars) ; echo "" . "asRep is going to start a database upgrade procedure (from v.".$cfg['Version']." to v.".MYVERSION.").
" . "This may take several minutes.
" . "

Please do NOT interrupt the upgrade process since it may cause loss of data." . "

If this task fails (displays an error), " . "please note the URL in the browser's address bar and contact www.asrep.com for assistance." . "

Click here once to start the database upgrade.
" . "" ; }elseif ($pars['VersionUpgrade'] == 'end') { $fname = FullPath("vustep.txt", $cfg['InstallDir']) ; if (file_exists($fname)) unlink($fname) ; }else{ if ($filedesc = @fopen(FullPath("vustep.txt", $cfg['InstallDir']), 'wb')) { fwrite($filedesc, $pars['VersionUpgrade']) ; fclose($filedesc) ; } $pars['VersionUpgrade']++; $url = SelfUrl($cfg, $pars) ; echo "" . "". "" . "asRep database upgrade is in progress.
" . "Finished task# " . ($pars['VersionUpgrade']-1) . ".
" . "Requesting task# " . $pars['VersionUpgrade'] . ".
" . "

Some tasks may take long time to complete. Please do not interrupt the upgrade process since it may cause loss of data." . "

If this task fails (displays an error), " . "please note the URL in the browser's address bar and contact www.asrep.com for assistance." . "" ; } } #--------- version upgrade tasks -------------- function version125Upgrade($dbh, $fname, $ocfg, &$pars) { eval(getConfigStr($ocfg)) ; $ncfg = $cfgPars ; $tfields = TableFields() ; if (empty($pars['VersionUpgrade'])) { vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 1){ # change name of the db tables. DBQuery($dbh, "REPAIR TABLE" . " {$ocfg['Tbl']['Logs']}" . ", {$ocfg['Tbl']['PageInfo']}" . ", {$ocfg['Tbl']['Domains']}" . ", {$ocfg['Tbl']['Pages']}" . ", {$ocfg['Tbl']['Dirs']}" . ", {$ocfg['Tbl']['rDomains']}" . ", {$ocfg['Tbl']['rPages']}" . ", {$ocfg['Tbl']['AdUrls']}" . ", {$ocfg['Tbl']['AdSense']}" . ", {$ocfg['Tbl']['ChannelDef']}" . ", {$ocfg['Tbl']['IpRangeNames']}" . ", {$ocfg['Tbl']['IpRanges']}" ) ; DBQuery($dbh, "RENAME TABLE" . " {$ocfg['Tbl']['Logs']} TO {$ncfg['Tbl']['Logs']}" . ", {$ocfg['Tbl']['PageInfo']} TO {$ncfg['Tbl']['PageInfo']}" . ", {$ocfg['Tbl']['Domains']} TO {$ncfg['Tbl']['Domains']}" . ", {$ocfg['Tbl']['Pages']} TO {$ncfg['Tbl']['Pages']}" . ", {$ocfg['Tbl']['Dirs']} TO {$ncfg['Tbl']['Dirs']}" . ", {$ocfg['Tbl']['rDomains']} TO {$ncfg['Tbl']['rDomains']}" . ", {$ocfg['Tbl']['rPages']} TO {$ncfg['Tbl']['rPages']}" . ", {$ocfg['Tbl']['AdUrls']} TO {$ncfg['Tbl']['AdUrls']}" . ", {$ocfg['Tbl']['AdSense']} TO {$ncfg['Tbl']['AdSense']}" . ", {$ocfg['Tbl']['ChannelDef']} TO {$ncfg['Tbl']['Channels']}" . ", {$ocfg['Tbl']['IpRangeNames']} TO {$ncfg['Tbl']['IpRangeNames']}" # ", {$ocfg['Tbl']['IpRanges']} TO {$ncfg['Tbl']['IpRanges']}" ) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Logs']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['PageInfo']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Domains']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Pages']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Dirs']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['rDomains']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['rPages']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['AdUrls']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['AdSense']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['ChannelDef']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['IpRangeNames']}", true) ; # DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['IpRanges']}", true) ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 2){ # Change The Channels table DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['Channels']} DROP PRIMARY KEY") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['Channels']} ADD Id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['Channels']} ADD ws CHAR(0) DEFAULT NULL") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['Channels']} ADD INDEX (channel)") ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 3){ # Insert the channels into Channels table from AdSense table $sth = DBQuery($dbh, "SELECT ast.channel" . " FROM {$ncfg['Tbl']['AdSense']} AS ast LEFT JOIN {$ncfg['Tbl']['Channels']} AS cdt ON ast.channel=cdt.channel" . " WHERE ISNULL(cdt.channel)>0" . " GROUP BY ast.channel") ; while($rec_r = mysql_fetch_row($sth)) { DBQuery($dbh, "INSERT INTO {$ncfg['Tbl']['Channels']} (Id,ws,channel,name) VALUES(NULL,NULL,". DBQuote($rec_r[0]).",'')") ; } mysql_free_result($sth); vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 4){ # Insert the Id's of the channels into AdSense table DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['AdSense']} ADD chId SMALLINT UNSIGNED NOT NULL") ; $sth = DBQuery($dbh, "SELECT Id,channel FROM {$ncfg['Tbl']['Channels']}") ; while($rec_r = mysql_fetch_row($sth)) { DBQuery($dbh, "UPDATE {$ncfg['Tbl']['AdSense']} SET chId=".DBQuote($rec_r[0])." WHERE channel=". DBQuote($rec_r[1])) ; } mysql_free_result($sth); DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['AdSense']} DROP INDEX channel") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['AdSense']} DROP channel") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['AdSense']} DROP hl") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['AdSense']} ADD color_line CHAR(6) NOT NULL") ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 5){ # update the FP field $sth = DBQuery($dbh, "SELECT Id,chId,format,fb,color_bg,color_text,color_link,color_url,color_border,color_line". " FROM {$ncfg['Tbl']['AdSense']}") ; while($rec_r = mysql_fetch_row($sth)) { $fp = FingerPrint($rec_r[1].$rec_r[2].$rec_r[3].$rec_r[4].$rec_r[5].$rec_r[6].$rec_r[7].$rec_r[8].$rec_r[9], 2); DBQuery($dbh, "UPDATE {$ncfg['Tbl']['AdSense']} SET FP=$fp WHERE Id=$rec_r[0]") ; } mysql_free_result($sth); vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 6){ # Add websearch channels to PageInfo DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} CHANGE asId0 asId0 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} CHANGE asId1 asId1 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} CHANGE asId2 asId2 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} ADD wsChId0 SMALLINT UNSIGNED NOT NULL DEFAULT 0") ; DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} ADD wsChId1 SMALLINT UNSIGNED NOT NULL DEFAULT 0") ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 7){ # remove '-' from AdUrls table and set adId in Logs table to 0 for non-clicked records DBQuery($dbh, "UPDATE {$ncfg['Tbl']['Logs']} SET adId=0 WHERE cTime=0") ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 8){ # Insert an Ip Segment into IpRange table DBQuery($dbh, "CREATE TABLE {$ncfg['Tbl']['IpRanges']} ({$tfields['IpRanges']})") ; $sth = DBQuery($dbh, "SELECT Type, Code, StartIp, EndIp FROM {$ocfg['Tbl']['IpRanges']}") ; while($rec_r = mysql_fetch_row($sth)) { $sseg = (int)($rec_r[2] / 65536) ; $eseg = (int)($rec_r[3] / 65536) ; while($sseg <= $eseg) { DBQuery($dbh, "INSERT INTO {$ncfg['Tbl']['IpRanges']} (Type,Code,IpSeg,StartIp,EndIp)". " VALUES($rec_r[0],". DBQuote($rec_r[1]).",$sseg, $rec_r[2], $rec_r[3])") ; $sseg ++ ; } } mysql_free_result($sth); DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['IpRanges']}", true) ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 9){ # v.1.30 # add a new field for AdLinks into PageInfo table DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} ADD asId3 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0") ; vuRedir($ocfg, $pars) ; exit(); } $errstr = SaveConfig($fname, $ocfg) ; $pars['VersionUpgrade'] = 'end' ; vuRedir($ocfg, $pars) ; return $errstr ; } #--------- version upgrade tasks -------------- function version130Upgrade($dbh, $fname, $ocfg, &$pars) { eval(getConfigStr($ocfg)) ; $ncfg = $cfgPars ; $tfields = TableFields() ; if (empty($pars['VersionUpgrade'])) { vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 1){ DBQuery($dbh, "REPAIR TABLE" . " {$ocfg['Tbl']['Logs']}" . ", {$ocfg['Tbl']['PageInfo']}" . ", {$ocfg['Tbl']['Domains']}" . ", {$ocfg['Tbl']['Pages']}" . ", {$ocfg['Tbl']['Dirs']}" . ", {$ocfg['Tbl']['rDomains']}" . ", {$ocfg['Tbl']['rPages']}" . ", {$ocfg['Tbl']['AdUrls']}" . ", {$ocfg['Tbl']['AdSense']}" . ", {$ocfg['Tbl']['Channels']}" . ", {$ocfg['Tbl']['IpRangeNames']}" . ", {$ocfg['Tbl']['IpRanges']}" ) ; # change name of the db tables. DBQuery($dbh, "RENAME TABLE" . " {$ocfg['Tbl']['Logs']} TO {$ncfg['Tbl']['Logs']}" . ", {$ocfg['Tbl']['PageInfo']} TO {$ncfg['Tbl']['PageInfo']}" . ", {$ocfg['Tbl']['Domains']} TO {$ncfg['Tbl']['Domains']}" . ", {$ocfg['Tbl']['Pages']} TO {$ncfg['Tbl']['Pages']}" . ", {$ocfg['Tbl']['Dirs']} TO {$ncfg['Tbl']['Dirs']}" . ", {$ocfg['Tbl']['rDomains']} TO {$ncfg['Tbl']['rDomains']}" . ", {$ocfg['Tbl']['rPages']} TO {$ncfg['Tbl']['rPages']}" . ", {$ocfg['Tbl']['AdUrls']} TO {$ncfg['Tbl']['AdUrls']}" . ", {$ocfg['Tbl']['AdSense']} TO {$ncfg['Tbl']['AdSense']}" . ", {$ocfg['Tbl']['Channels']} TO {$ncfg['Tbl']['Channels']}" . ", {$ocfg['Tbl']['IpRangeNames']} TO {$ncfg['Tbl']['IpRangeNames']}" . ", {$ocfg['Tbl']['IpRanges']} TO {$ncfg['Tbl']['IpRanges']}" ) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Logs']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['PageInfo']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Domains']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Pages']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['Dirs']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['rDomains']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['rPages']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['AdUrls']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['AdSense']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['ChannelDef']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['IpRangeNames']}", true) ; DBQuery($dbh, "DROP TABLE {$ocfg['Tbl']['IpRanges']}", true) ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 2){ # add a new field for AdLinks into PageInfo table DBQuery($dbh, "ALTER TABLE {$ncfg['Tbl']['PageInfo']} ADD asId3 MEDIUMINT UNSIGNED NOT NULL DEFAULT 0") ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 3){ # do we need to shrink Channels table? $sth = DBQuery($dbh, "SELECT COUNT(DISTINCT ISNULL(ws)>0, channel) FROM {$ncfg['Tbl']['Channels']}") ; list($dcc) = mysql_fetch_row($sth) ; mysql_free_result($sth); $sth = DBQuery($dbh, "SELECT COUNT(*) FROM {$ncfg['Tbl']['Channels']}") ; list($cc) = mysql_fetch_row($sth) ; mysql_free_result($sth); if ($cc>$dcc) { # Oops! DBQuery($dbh, "CREATE TABLE {$ncfg['Tbl']['Channels']}tmp ({$tfields['Channels']})") ; DBQuery($dbh, "INSERT INTO {$ncfg['Tbl']['Channels']}tmp (Id,ws,channel,name)" . " SELECT NULL,ws,channel,'' FROM {$ncfg['Tbl']['Channels']}". " GROUP BY IFNULL(ws,1),channel") ; DBQuery($dbh, "REPAIR TABLE {$ncfg['Tbl']['Channels']}, {$ncfg['Tbl']['Channels']}tmp" ) ; DBQuery($dbh, "RENAME TABLE {$ncfg['Tbl']['Channels']} TO orichannels" . ", {$ncfg['Tbl']['Channels']}tmp TO {$ncfg['Tbl']['Channels']}" ) ; $sth = DBQuery($dbh, "SELECT cht.Id, ocht.Id, ISNULL(cht.ws)>0" . " FROM {$ncfg['Tbl']['Channels']} AS cht, orichannels AS ocht". " WHERE cht.channel=ocht.channel AND IFNULL(cht.ws,1)=IFNULL(ocht.ws,1)") ; while($rec = mysql_fetch_row($sth)) { if ($rec[2]) { DBQuery($dbh, "UPDATE {$ncfg['Tbl']['AdSense']} SET chId=$rec[0] WHERE chId=$rec[1]") ; }else{ DBQuery($dbh, "UPDATE {$ncfg['Tbl']['PageInfo']} SET wsChId0=$rec[0] WHERE wsChId0=$rec[1]") ; DBQuery($dbh, "UPDATE {$ncfg['Tbl']['PageInfo']} SET wsChId1=$rec[0] WHERE wsChId1=$rec[1]") ; } } mysql_free_result($sth); DBQuery($dbh, "DROP TABLE orichannels", true) ; vuRedir($ocfg, $pars) ; exit(); } } if ($pars['VersionUpgrade'] == 4){ # shrink AdSense table DBQuery($dbh, "CREATE TABLE {$ncfg['Tbl']['AdSense']}tmp ({$tfields['AdSense']})") ; DBQuery($dbh, "INSERT INTO {$ncfg['Tbl']['AdSense']}tmp (Id,FP,chId,format,fb,color_bg,color_text,color_link,color_url,color_border,color_line)" . " SELECT NULL,FP,chId,format,fb,color_bg,color_text,color_link,color_url,color_border,color_line" . " FROM {$ncfg['Tbl']['AdSense']}". " GROUP BY chId,format,fb,color_bg,color_text,color_link,color_url,color_border,color_line") ; $sth = DBQuery($dbh, " SELECT Id, CONCAT(chId,format,fb,color_bg,color_text,color_link,color_url,color_border,color_line)" . " FROM {$ncfg['Tbl']['AdSense']}tmp") ; while($rec = mysql_fetch_row($sth)) { $fp = FingerPrint($rec[1], 2) ; DBQuery($dbh, "UPDATE {$ncfg['Tbl']['AdSense']}tmp SET FP=$fp WHERE Id=$rec[0]") ; } mysql_free_result($sth); DBQuery($dbh, "REPAIR TABLE {$ncfg['Tbl']['AdSense']}, {$ncfg['Tbl']['AdSense']}tmp" ) ; DBQuery($dbh, "RENAME TABLE {$ncfg['Tbl']['AdSense']} TO oriadsense" . ", {$ncfg['Tbl']['AdSense']}tmp TO {$ncfg['Tbl']['AdSense']}" ) ; $sth = DBQuery($dbh, "SELECT ast.Id, oast.Id" . " FROM {$ncfg['Tbl']['AdSense']} AS ast, oriadsense AS oast". " WHERE ast.chId=oast.chId AND ast.format=oast.format AND ast.fb=oast.fb AND ast.color_bg=oast.color_bg" . " AND ast.color_text=oast.color_text AND ast.color_link=oast.color_link AND ast.color_url=oast.color_url" . " AND ast.color_border=oast.color_border AND ast.color_line=oast.color_line" ) ; while($rec = mysql_fetch_row($sth)) { DBQuery($dbh, "UPDATE {$ncfg['Tbl']['PageInfo']} SET asId0=$rec[0] WHERE asId0=$rec[1]") ; DBQuery($dbh, "UPDATE {$ncfg['Tbl']['PageInfo']} SET asId1=$rec[0] WHERE asId1=$rec[1]") ; DBQuery($dbh, "UPDATE {$ncfg['Tbl']['PageInfo']} SET asId2=$rec[0] WHERE asId2=$rec[1]") ; } mysql_free_result($sth); DBQuery($dbh, "DROP TABLE oriadsense", true) ; vuRedir($ocfg, $pars) ; exit(); } if ($pars['VersionUpgrade'] == 5){ # shrink PageInfo table DBQuery($dbh, "CREATE TABLE {$ncfg['Tbl']['PageInfo']}tmp ({$tfields['PageInfo']})") ; DBQuery($dbh, "INSERT INTO {$ncfg['Tbl']['PageInfo']}tmp (Id,pagId,domId,asId0,asId1,asId2,asId3,wsChId0,wsChId1)" . " SELECT NULL,pagId,domId,asId0,asId1,asId2,asId3,wsChId0,wsChId1" . " FROM {$ncfg['Tbl']['PageInfo']}". " GROUP BY pagId,domId,asId0,asId1,asId2,asId3,wsChId0,wsChId1") ; DBQuery($dbh, "REPAIR TABLE {$ncfg['Tbl']['PageInfo']}, {$ncfg['Tbl']['PageInfo']}tmp" ) ; DBQuery($dbh, "RENAME TABLE {$ncfg['Tbl']['PageInfo']} TO oripageinfo" . ", {$ncfg['Tbl']['PageInfo']}tmp TO {$ncfg['Tbl']['PageInfo']}" ) ; $sth = DBQuery($dbh, "SELECT pit.Id, opit.Id" . " FROM {$ncfg['Tbl']['PageInfo']} AS pit, oripageinfo AS opit". " WHERE pit.pagId=opit.pagId AND pit.domId=opit.domId AND pit.asId0=opit.asId0 AND pit.asId1=opit.asId1" . " AND pit.asId2=opit.asId2 AND pit.asId3=opit.asId3 AND pit.wsChId0=opit.wsChId0 AND pit.wsChId1=opit.wsChId1" ) ; while($rec = mysql_fetch_row($sth)) { DBQuery($dbh, "UPDATE {$ncfg['Tbl']['Logs']} SET piId=$rec[0] WHERE piId=$rec[1]") ; } mysql_free_result($sth); DBQuery($dbh, "DROP TABLE oripageinfo", true) ; vuRedir($ocfg, $pars) ; exit(); } $errstr = SaveConfig($fname, $ocfg) ; $pars['VersionUpgrade'] = 'end' ; vuRedir($ocfg, $pars) ; return $errstr ; } #--------- get Configuration Data -------------- function getConfigStr (&$cfg){ ob_start() ; ?> # Please make all changes to configuration variables via admin program. $cfgPars = array( 'Version' => '', 'rKey' => '', 'DbHost' => '', 'DbPort' => '', 'DbUser' => '', 'DbPass' => '', 'DbName' => '', 'AdminName' => '', 'AdminPassEnc' => '', 'UTZone' => , 'UTName' => '', 'EMailTo' => '', 'EMailFrom' => '', 'crImg' => , 'crPop' => , 'crCookie' => , 'crCookieDur' => , 'Tbl' => array( 'Logs' => 'asrep140Logs', 'PageInfo'=> 'asrep140PageInfo', 'Domains' => 'asrep140Domains', 'Pages' => 'asrep140Pages', 'Dirs' => 'asrep140Dirs', 'rDomains' => 'asrep140rDomains', 'rPages' => 'asrep140rPages', 'AdUrls' => 'asrep140AdUrls', 'AdSense' => 'asrep140AdSense', 'Channels' => 'asrep140Channels', 'IpRangeNames' => 'asrep140IpRangeNames', 'IpRanges' => 'asrep140IpRanges', ), 'blockedIps' => array( array(,), ), ) ; " ; if ($filedesc = @fopen($fname, 'wb')) { fwrite($filedesc, $configstr) ; fclose($filedesc) ; if ($filedesc = @fopen($fname, 'rb')) { $readstr = '' ; while(strlen($line = fread($filedesc,1024))) $readstr .= $line ; fclose($filedesc) ; if ($configstr != $readstr) { return "Can not read just created configuration file $fname" ; } }else{ return "Can not open the just created configuration file $fname" ; } }else{ return "Can not create configuration file $fname" ; } return '' ; } #--------- Save Admin name password -------------- function SaveAdminName ($fname, &$cfg, &$pars){ $cfg['AdminName'] = $pars['name'] ; $cfg['AdminPass'] = $pars['pass'] ; $cfg['AdminPassEnc'] = EncryptPassword($pars['pass']) ; return SaveConfig($fname, $cfg) ; } #------------------------------------ function SaveDBSettings ($fname, &$cfg, &$pars){ $cfg['DbHost'] = $pars['host'] ; $cfg['DbPort'] = $pars['port'] ; $cfg['DbUser'] = $pars['user'] ; $cfg['DbPass'] = $pars['pass'] ; $cfg['DbName'] = $pars['name'] ; return SaveConfig($fname, $cfg) ; } #------------------------------------ function SaveTimeZone ($fname, &$cfg, &$pars){ $cfg['UTZone'] = $pars['UTZone'] * 60*60 ; $cfg['UTName'] = $pars['UTName'] ; return SaveConfig($fname, $cfg) ; } #------------------------------------ function SaveEmail ($fname, &$cfg, &$pars){ $cfg['EMailTo'] = $pars['EMailTo'] ; $cfg['EMailFrom'] = $pars['EMailFrom'] ; $errstr = SaveConfig($fname, $cfg) ; if (!$errstr && isset($pars['EMailTest'])) { if (IsValidEMail($pars['EMailTo'])) { $from = empty($cfg['EMailFrom']) ? 'asrep@asrep.com':$cfg['EMailFrom'] ; $msg = 'If you read this message, then the e-mail interface is working properly.' ; @SendEMail($pars['EMailTo'], $from, 'asRep e-mail Interface Test Message', 0, $msg) ? ($errstr = 'Test message has been sent to '.$pars['EMailTo'].'') : ($errstr = 'function mail did not accept the message for delivery') ; }else { $errstr = 'You must enter a valid e-mail address to send the test message' ; } } return $errstr ; } #------------------------------------ function GetIpCc ($dbh, &$cfg, &$pars){ if (!empty($pars['forceAll'])) { $updates = array() ; WriteRirUpdates($updates, $cfg['InstallDir']) ; } $errstr = UpdateIpCc($dbh, $cfg, $pars) ; return $errstr ? $errstr : "Ip-to-Country database updated" ; } #------------------------------------ function SaveClickNotify ($fname, &$cfg, &$pars){ @$cfg['crImg'] = $pars['crImg'] ; @$cfg['crPop'] = $pars['crPop'] ; @$cfg['crCookie'] = $pars['crCookie'] ; @$cfg['crCookieDur'] = 0+$pars['crCookieDur'] ; return SaveConfig($fname, $cfg) ; } #------------------------------------ function SaveBlockedIPs ($fname, &$cfg, &$pars){ $cfg['blockedIps'] = array() ; $i=0 ; while (isset($pars["blockedIpsStart$i"]) && isset($pars["blockedIpsCount$i"])){ if (strlen($pars["blockedIpsStart$i"]) && strpos($pars["blockedIpsStart$i"],'.')!==false && $pars["blockedIpsCount$i"]>0) { $cfg['blockedIps'][] = array(0+IPstr2num($pars["blockedIpsStart$i"]), 0+$pars["blockedIpsCount$i"]) ; } $i++ ; } return SaveConfig($fname, $cfg) ; } #------------------------------------ function SaveRegKey ($fname, &$cfg, &$pars){ $cfg['rKey'] = $pars['rKey'] ; return SaveConfig($fname, $cfg) ; } #------------------------------------ function VerifyUserLogin (&$cfg, &$pars){ if (isset($pars['state']) && $pars['state'] == 'login') { if (EncryptPassword($pars['pass'], $cfg['AdminPassEnc']) == $cfg['AdminPassEnc'] && $pars['name'] == $cfg['AdminName']) {# True login setcookie ('UserNameEnc', EncryptPassword($cfg['AdminName']), 0, $cfg['PathUrl']) ; return 1 ; }else { DispLogin($cfg, $pars['name'], "Invalid name or password. Please try again.") ; } }else { $une = isset($_COOKIE['UserNameEnc']) ? $_COOKIE['UserNameEnc'] : '' ; if (EncryptPassword($cfg['AdminName'], $une) == $une) { # Yes you are still login return 1 ; }else { DispLogin($cfg, '', "Please enter your user name and password.") ; } } return 0 ; } #------------------------------------ function Logout(&$cfg) { setcookie ('UserNameEnc', 0, 0, $cfg['PathUrl']) ; DispLogin($cfg, '', "Please enter your user name and password.") ; } #--------- Display User settings -------------- function DispAdminName (&$cfg, $msg){ ?> asRep Admin: User Name and Pass

User Name and Password

Please assign a name and password for the user.

Name of the User:
Password of the User:

Please enter a name and password that you can remember later. Both admin and report scripts will ask for the name and password.

If you can not remember your admin name or password, you can reset it by editing the file settings.php in the installation directory. You must assign an empty string to AdminName. Then admin program will display this screen again.


You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Login
Login
User Name:
Password:

Login information is stored in a session cookie in your browser. Please enable cookies.

asRep Admin: Database Settings

Database Connectivity Settings

Status: '.$msg : '')?>

Please enter the info about the MySql database to be used.

MySQL Server (Host) Name: Enter the name or IP of the database host server. Leave blank for the default server name, 'localhost'.
MySQL Server Port: Enter the port number of the database server. Leave blank for the default server port, '3306'.
MySQL Database Name: Enter the name of the MySQL database where the tables will reside. You must create this database by using the database administration program provided by your hosting provider such as via your hosting control panel. Consult to your hosting provider if you do not know how to do it.
MySQL Database User Name: Enter the name of the user having access right to the database server.
MySQL Database User Password: Enter the password of the user accessing the database server

If you see this screen repeatedly, this means that the script can not connect to the database. Please enter correct settings.


You can re-start the setup process, by deleting the file settings.php in the installation directory. Database  |  IP to Country  |  Time Zone  |  E-Mail  |  Click Reporting  |  Tracking Code  |  Block Tracking  |  Updates  |  Reports  |  Exit END_OF_MENU; } #--------- Display Setup Screen -------------- function DispSetup (&$cfg, &$pars, $msg){ ?> asRep Admin: Other Settings
Status: '.$msg : '')?>

Select the option from the menu.

















You can re-start the setup process, by deleting the file settings.php in the installation directory. \n" ; } if ($sth2) mysql_free_result($sth2); } mysql_free_result($sth); return $str ; } #--------- Optimize Database Tables -------------- function DbOptimize($dbh, &$cfg, &$pars){ $str = "" ; $sth = DBQuery($dbh, "SHOW TABLE STATUS") ; while($rec = mysql_fetch_assoc($sth)) { $sth2 = DBQuery($dbh, "OPTIMIZE TABLE {$rec['Name']}", true) ; while($sth2 && ($rec = mysql_fetch_row($sth2))) { $str .= implode(' : ', $rec) . "
\n" ; } if ($sth2) mysql_free_result($sth2); } mysql_free_result($sth); return $str ; } #--------- Display DB Maintenance Screen -------------- function DispDbMaintenance($dbh, &$cfg, &$pars, $msg){ ?> asRep Admin: Database Maintenance Settings
Status: '.$msg : '')?>

Database Maintenance

List of tables in the database
TableNumber of RowsAvg. Row SizeData SizeIndex Size

Make a backup of the database in the script directory.
> Create compressed backups to save disk space. (You must have Zlib compression library enabled in your PHP configuration as described here)
This operation takes time! Please click to the button only once.

Restore database from a backup:

This operation takes time! Please click to the button only once.
Any database backup was not found.
Optimize the tables in the database: This feature will execute "OPTIMIZE TABLE xxx" on the tables to gain free space etc.
This operation takes time! Please click to the button only once.

Repair the tables in the database: It will execute "REPAIR TABLE xxx" on the tables to attempt to fix corrupted tables. Use this feature only if you encounter table errors.
This operation takes time! Please click to the button only once.


You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Time Zone Settings
Status: '.$msg : '')?>

Time Zone Settings

Specify the time zone you prefer the reports should use. The specified time zone is only used when displaying (retrieving) time values to (from) the user. The actual times are always stored in the database as universal GMT time.

Date/Time in GMT:
Date/Time in user time zone:
Time Zone in hours: This value is the time difference between your local time and the Greenwich Mean Time (GMT or UTC). The software saves and uses all time values in terms of GMT. This setting will be used to convert the saved time values into your preferred time zone (and vice versa) while displaying time values. Some sample values are:
Sydney-Australia...+10, Tokyo-Japan...+9, Hong Kong...+8, Moskow-Russia...+3, Istanbul-Turkey...+2, Paris-France...+1, London-England...0, Buenos Aires-Argentina...-3, Atlantic Time-Canada...-4, Eastern Time-US...-5, Central Time-US...-6, Mountain Time-US...-7, Pacific Time-US...-8
Time Zone Name: Please enter a descriptive name for the time zone you entered. This value is displayed on some reports and on admin panel.



You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: E-Mail Settings
Status: '.$msg : '')?>

E-Mail Settings

Set the e-mail interface available on your system. The scipt will use these settings to send report e-mails

To e-mail address: Enter the e-mail address that will receive the report or test e-mails sent by the script.
From e-mail address: Enter the e-mail address that will appear on the From field of the emails sent by the script.
This script uses PHP mail function to send e-mails. If it is not configured properly on your system, plase see your PHP documentation or ask to your hosting provider to configure mail properly.



You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: IP to Country Database Download
Status: '.$msg : '')?>

IP to Country Management

Download IP to Country mapping database. This database is used in reports to identify the country of visitors from IP address.

No database download has been done yet

$val) { if ($key != 'country' && $val[0]+0 > 0) { ?>
Downloaded ItemLast updateNumber of Lines
Country List
Region Countries
> Force download of all data


This operation may take time! Please click to the button only once.

Map the IPs to Countries in report database. IP-to-Country mapping is done while saving the records. If you have records saved before downloading the IP-to-Country database, or you simply want to refresh the IP-to-Country associations, you can remap the IPs in the database.

Map only the IPs that are not already assigned a country.
Map all IPs again.


This operation may take time! Please click to the button only once.



You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Click/Search Reporting Settings
Status: '.$msg : '')?>

Click/Search Reporting

Please specify how the clicks and searches will be reported. You can specify multiple methods in order to increase the chance the click/search is reported. Since every click/search is given a unique id, multiple reporting of the same click/search is recorded only once. If you un-check all methods, then there will be no click/search tracking. Impression tracking is not affected from these settings.

> Report clicks/searches via an invisible IMG tag element just before loading the new page.

This method is transparent to the visitor. After a click/search is detected, the image is activated to notify the server about the click/search.

> Report clicks/searches via a hidden pop-under window. The window closes itself automatically.

This method opens a pop-under window to notify the server about the click/search. The pop-under window is closed automatically once the click/search is reported. The window is invisible on some browsers like Internet Explorer. Only an icon in the task bar is displayed.

> Report clicks/searches via cookies. Store the cookies for days.

The click/search information is stored in a cookie on the visitor's browser. Next time the visitor comes to your site, the previous click/search info is reported.





You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Tracking Code
Status: '.$msg : '')?>

AdSense Tracking Code

Copy and paste the following tracking code to your web pages.




You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Tracking Exceptions
Status: '.$msg : '')?>

Block Tracking

Some webmasters request that asRep should not track the impressions, clicks and searches during certain cases. For example, a webmaster visiting his/her site a lot may want that the tracking be blocked for his/her activity on the site, since the extra impressions he/she creates mess up the results in asRep reports by increasing the views and decreasing the CTR.

Block tracking via a cookie

By setting a cookie in your browser, you can block tracking of impressions, clicks and searches from this browser.

A cookie is set in this browser to block tracking. Any activity on your web sites with this browser will not be tracked by asRep.

Erase the cookie to allow tracking from this browser.

No cookie is currently set in this browser to block tracking. All activity with this browser will be tracked by asRep.

Set a cookie to block tracking from this browser.

Block tracking via IP list

By entering a list of IP address ranges, you can block tracking of impressions, clicks and searches from these IPs.

Blocked IP Ranges
Starting IPNumber of IPs
 

Example-1: to ban IP 165.146.254.233, enter 165.146.254.233 into Starting IP and 1 into Number of IPs.
Example-2: to ban all IPs in the range (165.146.254.0, 165.146.254.255) inclusive, enter 165.146.254.0 into Starting IP and 256 into Number of IPs.

To remove an IP range from the list, either delete the Starting IP box or enter 0 (zero) into the corresponding Number of IPs box.



You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Upgrading
Status: '.$msg : '')?>

Registration Key

Obtain your registration key and enter it here

Available Updates

ERROR: Can not verify the integrity of data from asRep update server!

$v) { if (!(isset($su_r[$f]) && ($u_r[$f]['date'] <= $su_r[$f]['date']))) { if (!$anyupdate) { ?>
File NameDescription

When you download the files, they will be saved in the installation directory with a new_ prefix added to the file names.
No file or code will be executed without your control.

No new update is available




You can re-start the setup process, by deleting the file settings.php in the installation directory. $u_r[$f]['desc'], 'date'=>$u_r[$f]['date']) ; $du[$f] = array('desc'=>$u_r[$f]['desc'], 'date'=>$u_r[$f]['date'], 'tf'=>"new_$f") ; } } } WriteUpdates($su_r, $cfg['InstallDir']) ; ?> asRep Admin: Upgrading

Downloaded Updates

No update has been done

has been downloaded as

You must click to the Activate the Downloaded Files button in order to make the new files active. After the activation, the old script files are still available with a .back appended to the file name.
You can inspect the file contents before activating them.

If you like, you can rename the downloaded files by yourself via your shell access client or FTP client.


You can re-start the setup process, by deleting the file settings.php in the installation directory. asRep Admin: Content of <?php echo $pars['file']?>


asRep Admin: file activation

Activated Downloads

The file was renamed as and the old was renamed as .

The file was not found.

Return to the Updates page

eleanor asshole eleanor asshole catch sex during third trimester sex during third trimester behind malade du sex malade du sex all amature xxx screentest amature xxx screentest milk margo stilley xxx pics margo stilley xxx pics sent men and emotional relationship men and emotional relationship food models with dirty assholes models with dirty assholes mouth senior tv dating show senior tv dating show only sex offenses and offenders sex offenses and offenders perhaps margaret the virgin said margaret the virgin said do kiss sub kiss sub done cruella femdom and castration cruella femdom and castration dictionary gay telepathy gay telepathy distant naked gun suggestive naked gun suggestive joy naked leperchauns naked leperchauns salt elastic fetish elastic fetish whether extreme virgin pussy extreme virgin pussy die bbw movie galleries bbw movie galleries farm bobs knobs losmandy bobs knobs losmandy hot relationships in organizational behavior relationships in organizational behavior care huge dildo masterbation huge dildo masterbation strong rober dawes sex offender rober dawes sex offender common bang olfson televisions bang olfson televisions is sex offender license plates sex offender license plates best naked average girls naked average girls divide skinny girls having sex skinny girls having sex spring romance writing web sites romance writing web sites still shannon diane poole naked shannon diane poole naked fill pure faces xxx pure faces xxx though black sex in namibia black sex in namibia degree couples at niagra couples at niagra dog cya test strips cya test strips half uni chicks uni chicks hold being sucked being sucked nothing nude melisande nude melisande cool acromioplasty message personals email acromioplasty message personals email home busted isley brother lyrics busted isley brother lyrics nine busty car show girl busty car show girl until dimensional quilt strip patterns dimensional quilt strip patterns wire largest nudist gathering largest nudist gathering force tyra banks upskirt tyra banks upskirt wrote amateur radio mike crumpton amateur radio mike crumpton won't virgin eve virgin eve element small young cocks small young cocks join amateurs gone wild amateurs gone wild hole personals in robinson illinois personals in robinson illinois felt geocaching for sex geocaching for sex during teens for cash yumi teens for cash yumi head gay sex instruction gay sex instruction notice cute teen luggage cute teen luggage afraid treatment of anal fissures treatment of anal fissures good dick van der zwaan dick van der zwaan point hannah montana pantyhose interview hannah montana pantyhose interview shore escorts maryland escorts maryland property hacked gay avs passwords hacked gay avs passwords language deepest deepthroat ever deepest deepthroat ever wall gentle sex gentle sex since monkey love harry harlow monkey love harry harlow out ticklish in pantyhose ticklish in pantyhose plain hot anal licker hot anal licker wall sex videos of actresses sex videos of actresses garden female celebrities nude female celebrities nude miss online counseling degree courses online counseling degree courses cry nasty wom nasty wom level sonic ring cock ring sonic ring cock ring stream pantyhose girls japan pantyhose girls japan paint woodburn drag strip schedule woodburn drag strip schedule she 42 dd breast 42 dd breast sentence hermaphrodite dating site hermaphrodite dating site press virgin superstore vancouver virgin superstore vancouver been hardcore sister seduction hardcore sister seduction broke mommys loves jizz mommys loves jizz create thirteen sex thirteen sex join furcadia roleplay twinks furcadia roleplay twinks finger amature wife pics amature wife pics kind vagina nani seks vagina nani seks garden june wilkinson nude june wilkinson nude show porn tits and ass porn tits and ass neighbor long time jerk long time jerk hard webcam imac webcam imac chair ryan spencer porn ryan spencer porn be baked tortilla strips recipe baked tortilla strips recipe full nude lighter nude lighter color lovely fairy rose lovely fairy rose jump nudist campgrounds pictures nudist campgrounds pictures held beautiful nude busty girls beautiful nude busty girls chance fish lure strip teaser fish lure strip teaser that sex operators sex operators shape online naruto hentai online naruto hentai bat side swoop bangs side swoop bangs morning nipples video amatuer nipples video amatuer control top ten kisses youtube top ten kisses youtube horse teen loft bed desk teen loft bed desk behind flashing schoolgirls flashing schoolgirls how remax realty gay smith remax realty gay smith shell fruit tarts recipes fruit tarts recipes down sex subs sex subs thick jack sucks jack sucks run shemale hardcore porn shemale hardcore porn use 50 s pinup hairstyles 50 s pinup hairstyles double information on dynastic dysfunction information on dynastic dysfunction caught tight ass gay tight ass gay especially teen menstruation pics teen menstruation pics bird cathryn bosley nude cathryn bosley nude wish naked thin girl naked thin girl my mary janes watsons boobs mary janes watsons boobs block girls strapon photos girls strapon photos she bear gay art bear gay art will guys gays guys gays strong lesbian and bisexual women lesbian and bisexual women scale bum fucking whores bum fucking whores correct knoville nudist knoville nudist cold mamoth boobs mamoth boobs brown gay clothing optional travel gay clothing optional travel change thermostat 1999 ford escort thermostat 1999 ford escort prepare highway 50 webcam highway 50 webcam rock grannies forced sex pictures grannies forced sex pictures thousand las vegas bondage las vegas bondage pick i support gays i support gays money sissy surgery sissy surgery power stockings ladies nylons stockings ladies nylons spring flash porn gmes flash porn gmes thick independent thai escort independent thai escort pair herpes outbreak and sex herpes outbreak and sex all atadas galerias bondage atadas galerias bondage written antonella s porn pictures antonella s porn pictures far porn stars christians porn stars christians wheel girls flashing boobs videos girls flashing boobs videos room golf swing timing golf swing timing caught pron samples pron samples crowd pics nuns having sex pics nuns having sex show teen agels teen agels milk young teen vagina young teen vagina neighbor non nude cleavage non nude cleavage garden gay cash tgp gay cash tgp name brigs like the beaver brigs like the beaver continue coed fever cd coed fever cd always virgin mary recent sightings virgin mary recent sightings great naked totos naked totos east reality amateur xxx reality amateur xxx hope nude muscle clips nude muscle clips event cummings family crest cummings family crest visit trimmed light skinned pussy trimmed light skinned pussy quick korean teen questions korean teen questions require apple bottom booty apple bottom booty dear maria scharapova topless maria scharapova topless least largescale sucker largescale sucker symbol history of dick gregory history of dick gregory father female masturbation free pictures female masturbation free pictures material kimora lee upskirt kimora lee upskirt map beautiful transsexual beautiful transsexual save mega cock mega cock cover novick haverford gay novick haverford gay fit cure videos pornstar cure videos pornstar oxygen top celeb butts top celeb butts lost vannessa minnillo sex pics vannessa minnillo sex pics life gay judo gay judo repeat bend oregon singles bend oregon singles rather nudist campgrounds pictures nudist campgrounds pictures finger mystery nude mystery nude every lovely ladies sigs lovely ladies sigs then creamy baked chicken breasts creamy baked chicken breasts where meet brazilian singles meet brazilian singles go hong kong sex spa hong kong sex spa thank teen topless young teen topless young wave aerial beauty supp y aerial beauty supp y crop rabbits review xxx rabbits review xxx had burning sensation when peeing burning sensation when peeing industry colombian gay youth colombian gay youth she ron jeremy fuck pictures ron jeremy fuck pictures pattern beaver county hotels beaver county hotels clothe collector s vodeos xxx collector s vodeos xxx system psp rss free porn psp rss free porn south escort agencies in brazil escort agencies in brazil save upload profiles singles upload profiles singles sand joelle out love joelle out love point celabrity sex celabrity sex company breasts and menopause breasts and menopause else my woman s cunt my woman s cunt wild el dorado xxx el dorado xxx some clitoris closeup shots clitoris closeup shots for erotic models handjobs erotic models handjobs all lusty swinging nude couples lusty swinging nude couples simple gay seduction gay seduction molecule little pictures of pussy little pictures of pussy magnet nurses sex nurses sex arrive modern teen girl hair modern teen girl hair blue sucks off her brother sucks off her brother famous avril lavigne topless photos avril lavigne topless photos clear hooter dreamgirls hooter dreamgirls travel sexy amateur kira pictures sexy amateur kira pictures thank ultra slippery vaginal lubricants ultra slippery vaginal lubricants section gyno sex exams gyno sex exams are sex picture zip file sex picture zip file what erotic painting erotic painting come encouragement support love quotes encouragement support love quotes book forced gay bj forced gay bj suit model trixie teen model trixie teen color wetsuit discount men wetsuit discount men dear swollen nipples female dog swollen nipples female dog sand boobies 2007 thread boobies 2007 thread coast rebecka dee porn rebecka dee porn busy suspended by tits suspended by tits behind oriental industry sex doll oriental industry sex doll life bra busters tgp bra busters tgp mountain sexualised nudity sexualised nudity more teen titans cartoon raven teen titans cartoon raven either pussy wiped pussy wiped point tits perky petite tits perky petite consonant big unusual breasts big unusual breasts course blonde blonde upskirt pussy blonde blonde upskirt pussy rest nude charlotte north carolina nude charlotte north carolina sand teen lesbian film clips teen lesbian film clips basic dog peeing on tree dog peeing on tree table adult costa escort rica adult costa escort rica front sophie b underwear sophie b underwear character wealthy lesbian dating wealthy lesbian dating bone buffett asshole song buffett asshole song pass tight ass pussy vids tight ass pussy vids stone outdoor exhibition sex outdoor exhibition sex front sensory integrations dysfunction sensory integrations dysfunction clock major cumshot major cumshot tool gay frat boy videos gay frat boy videos drop prison sex video review prison sex video review rule esri relationship classes esri relationship classes race jab strip blackjack game jab strip blackjack game go melting glaciers webcams melting glaciers webcams knew lestat louis gay lestat louis gay arrange lindsay lohan semi nude lindsay lohan semi nude segment nylon socks wrangler nylon socks wrangler fact jules busty adventures jules busty adventures boat i m cumming video clip i m cumming video clip us forbidden sex fantasies forbidden sex fantasies consonant porn star macy porn star macy present new amateurs nude new amateurs nude mount pataya beach sex trade pataya beach sex trade multiply bbw feeding video bbw feeding video were bbw fat wet pussy bbw fat wet pussy appear fuck alarms fuck alarms press pictures of kagome naked pictures of kagome naked double 2 babes sucking cock 2 babes sucking cock read german spanking movies german spanking movies forward shay jordan facial shay jordan facial those femdom tgp movies femdom tgp movies populate lesbian masturbation tips lesbian masturbation tips search sarah may nude sarah may nude round virgin islands family resorts virgin islands family resorts noise sweet revenge porn sweet revenge porn book teen boys nude pics teen boys nude pics operate rsvp dating site rsvp dating site column granny porn tgp granny porn tgp operate sylvester stalone nude sylvester stalone nude feet sexual addiction spanking sexual addiction spanking store helen hunt s breasts helen hunt s breasts hurry hottie body tanning hottie body tanning send cartoon peeing in pool cartoon peeing in pool meet horny oyster horny oyster iron the seiji hentai pics the seiji hentai pics require obsession porn actress obsession porn actress go men s lace thongs men s lace thongs piece transsexual apparel transsexual apparel city carmen webcam striptease carmen webcam striptease job private garden hentai private garden hentai reason karashandfull nude karashandfull nude wrong naked women photo s naked women photo s continent agape love video agape love video hard natural blonde puffy nipples natural blonde puffy nipples does christian counseling professional counseling christian counseling professional counseling single private garden hentai private garden hentai garden chubby girls chubby teens chubby girls chubby teens even nude celebrity picks nude celebrity picks thick everybody loves raymond recipes everybody loves raymond recipes seven sex girls pictures sex girls pictures feed amtuer mom sucking cock amtuer mom sucking cock broad pregnancy enducing sex pregnancy enducing sex experiment size 10 big breasts size 10 big breasts few massive breasts milk massive breasts milk law chris jericho sex stories chris jericho sex stories each slutty chicks sex slutty chicks sex left guys go crazy gay guys go crazy gay sudden female body builders mature female body builders mature one eric andell and dating eric andell and dating talk mini pecan custard tarts mini pecan custard tarts still sufuni sex video sufuni sex video modern ferr sex celebreties gallery ferr sex celebreties gallery your florida singles camping trips florida singles camping trips several sex teens girls sex teens girls went lumbar dysfunction lumbar dysfunction I femdom sites by state femdom sites by state decide older womwn sex older womwn sex country portland breast surgeon portland breast surgeon part sarogate sex sarogate sex their nude penis men college nude penis men college gave amanda baynes nipple slip amanda baynes nipple slip arm gay cum party gay cum party meat gay intergenerational gay intergenerational letter japan subway grope mpg japan subway grope mpg rose milfs go crazy milfs go crazy yellow big tit strip big tit strip result spanking channels on irc spanking channels on irc we text message harassment text message harassment two love in lombardy love in lombardy map debra lynne mccabe naked debra lynne mccabe naked sight sluts grinding sluts grinding soil was shirlock homes gay was shirlock homes gay matter latinas cams latinas cams written gay blind date gay blind date farm zodiac signs and relationships zodiac signs and relationships world bizarre sex affiliates bizarre sex affiliates in el dorado xxx el dorado xxx busy chloe nicole bondage pics chloe nicole bondage pics mount teen pourn teen pourn paper dreamstreet true love dreamstreet true love though sex toys ventura county sex toys ventura county tall teen health news teen health news tire mom kisses class mom kisses class join movie naked confessions movie naked confessions wear busty teens vids busty teens vids like sex o matic sex o matic don't lindsay lohan in pantyhose lindsay lohan in pantyhose fell fatty tisue fatty tisue expect riverview counseling michigan riverview counseling michigan key naked pinoy video naked pinoy video climb erotic resort vacation erotic resort vacation control erotik art directory erotik art directory bought jane brand naked jane brand naked wood sluts fucking hours sluts fucking hours every gray sling vagina gray sling vagina three jobs adult porn jobs adult porn had tyson chicken strips tyson chicken strips similar pes electro sex toys pes electro sex toys were online cheap beauty supplies online cheap beauty supplies how keegan naked pics keegan naked pics morning teen chat phnoe line teen chat phnoe line shell strapon anime strapon anime sound adult nudes blow job adult nudes blow job lady cougars and big cocks cougars and big cocks result escort yorkshire escort yorkshire what escort ts gaviota escort ts gaviota friend gay male hypnosis gay male hypnosis though webcam galeras volcano webcam galeras volcano grew colorado and sex education colorado and sex education hour lesbian myspace quotes lesbian myspace quotes cover fancy pants striped sweater fancy pants striped sweater consonant nude guys youtube nude guys youtube press tantric video presentation tantric video presentation decimal boobs cn tower boobs cn tower finger custom wetsuit graphics custom wetsuit graphics above princess diana beauty tips princess diana beauty tips wing photography college nude studies photography college nude studies noun amuter pussy vids amuter pussy vids name amatuer mature blowjobs amatuer mature blowjobs once transexual photo gallery transexual photo gallery die russian porn post russian porn post eye naughty carolyn naughty carolyn these beach nudity pics beach nudity pics told chrysler mpg a833 chrysler mpg a833 meat girl squirt sex girl squirt sex condition tulsa singles line tulsa singles line a bradenton nude beach bradenton nude beach place enumclaw horse sex enumclaw horse sex farm yu ogawa nude pics yu ogawa nude pics continent maggie milf phone sex maggie milf phone sex chief breast agmentation after breast agmentation after from parenting a boy tween parenting a boy tween glass escort webs escort webs drive teen anal mpegs teen anal mpegs tell cleveland gay volleyball cleveland gay volleyball neck love escalator the game love escalator the game many boston lesbian nightlife boston lesbian nightlife west femdom cuckold chastity femdom cuckold chastity huge groud breaking gay characters groud breaking gay characters bird mary alice butts said mary alice butts said full gay greek facials gay greek facials human anal core anal core determine nude elderlies nude elderlies roll erotic animated feature film erotic animated feature film listen interracial anal milf interracial anal milf fresh paige davis nude paige davis nude score 1 knob chrome 1 knob chrome lady catharine mcphee naked catharine mcphee naked dear denial male orgasm cartoons denial male orgasm cartoons though red light fetish hair red light fetish hair sun el paso intimate liaison el paso intimate liaison now amateur info wikipedia amateur info wikipedia trip thick mature chicks thick mature chicks their lansing sex shops lansing sex shops saw quality quiet vibrator quality quiet vibrator left 108 wives 108 wives slave duran duran nude duran duran nude million knot insert orgasm grip knot insert orgasm grip wrong online counseling degree courses online counseling degree courses egg xxx pitures xxx pitures hundred dick piper reiner saddle dick piper reiner saddle among xxx theater xxx theater heard pussy galleries closeup piss pussy galleries closeup piss dream erotic stories website erotic stories website art jenifer aniston nude picture jenifer aniston nude picture doctor tantric massage in nc tantric massage in nc high mother daughter nude site mother daughter nude site they korean singer first love korean singer first love select sex scene video clips sex scene video clips path fake orgasm video fake orgasm video spell crossdress sissy stories crossdress sissy stories nothing sex met grootmoeders sex met grootmoeders sit he sucked her hot he sucked her hot teeth reba macentire naked reba macentire naked reach porn video lesbiein porn video lesbiein chart anne howe porn star anne howe porn star few drug expiration dating drug expiration dating there maidenform ladies underwear maidenform ladies underwear rich ashley massaro nude oictures ashley massaro nude oictures egg camwithher gisele breasts camwithher gisele breasts are nude beach vid nude beach vid than teen hook up games teen hook up games stood rhys wakefield naked rhys wakefield naked an nasty picture oregon nasty picture oregon head olga kurylenko underwear olga kurylenko underwear unit disadvantages of passion disadvantages of passion early vaginal creampie dvds vaginal creampie dvds garden veitnam teen nude veitnam teen nude idea signature beauty salon signature beauty salon blow gay oral sex techniques gay oral sex techniques must dave s a whore game dave s a whore game favor sophia sandobar sex pics sophia sandobar sex pics wood squirt girls cum squirt girls cum expect hentai flash game forum hentai flash game forum danger big tit anal big tit anal include michelle pfeiffer nude scene michelle pfeiffer nude scene draw quotes on work relationships quotes on work relationships spend barefoot sluts barefoot sluts until 5 8 nylon webbing 5 8 nylon webbing mass infant smacking on nipple infant smacking on nipple here nudist familys filand nudist familys filand straight 50ft roof naked 50ft roof naked feet naughty mon free naughty mon free very leigh taylor young nude leigh taylor young nude ten rease nude rease nude deal naked exercises for men naked exercises for men cent
There is a lot of mazda6.Find the best nissan deals.More info 250r.Whether Coupe or Roadster, roof down or closed, the bmw z4.Discover new cars from hyundai.The home of the classic muscle cars.Dodge dealer viper.Use the Organic natural food store.The official Web site for toyota center in houston.In this chapter, we introduce the shopping.Explore the entire hyundai cars.Discover new cars from hundai.Welcome to kia motors.Research new 2008 & 2009 handa.Enter your postcode to find your nearest nissan dealers.Official auto manufacturer site car kia.Search accounting & finance jobs.Official 2009 Dodge ram 1500.Free business finance.What is your favorite shopping mall.The official Web site for toyota center houston texas.This review of the nissan xterra.We sell Jeep wrangler parts.An overview of the hyundai sonata.Ford Motor Company maker of cars, trucks.See the 2009 nissan altima.Beverly Center shopping malls.The 2010 forester.Discover Travel Channel TV shows, travel.Using the book, penny gadget.Britannica online encyclopedia article on toyota center.If you own, admire, or fix-up any model of the Honda crx.Discount Prices on atv parts.This Overview of the bmw x3

Kegel exercises

Rocks ear

electromagnetic radiation

battery electric

feel like

toll roads

British English

been applied

prostate milking

get married

Web hosting

of members of the family

website visitors

San Diego

water filters

with the subject

literally means

up use

that varies randomly

hair loss

to produce the

of members of the family

Travel Insurance

a science

always better

car part

short term

healthy diet

wide variety

World War

Australian republic

that one's response

United States

video files

former occasions

great way

cum load

Australian cinema

daily basis

ice cube

electric light

eligibility requirements

song measure door

gonna cum

didnt think

National Park

New York

family member

didnt look

in philosophy

Western Australia

training guide

determine electoral

paid off well

richer lives and were

in post compositions

said Kelly

high quality

best way

high quality

slow song

pragmatism about

glazed over

community radio

got back

and epistemology

John Anne

online high

tiny slit

tongue over

prick head

and during

new homes

credit card

should know

vacation rental

long term

applications in

lower interest

Real Estate

fatty acids

graduate students

ugg boots

ask no leading questions
Find and buy toyota park.Official site of the 2009 Jeep wrangler.Visit Subaru of America for reviews, pricing and photos of impreza.2006 Nissan 350Z highlights from Consumer Guide Automotive. Learn about the 2006 nissan 350z.Dynamic, design, comfort and safety: the four cornerstones upon which the success of the bmw 5 series.Find and buy toyota center kennewick.Contact: View company contact information fo protege.What does this mean for legacy.The website of American suzuki motorcycle.The site for all new 2009 chevy.Use the Organic natural food stores.Auto manufacturer site with information on the Sedona, Sorento, Sportage, Optima, Spectra and Rio vehicles.kia.Get more online information on hyundai getz.Find and buy used nissan 350z.Kia cars, commercial vehicles, dealers, news and history in Australia. kia com.Site for Ford's cars and minivans, trucks, and SUVs. Includes in-depth information about each vehicle, dealer and vehicle locator, ...fords dealers.The Web site for Toyota Center – Houston, Texas' premier sports and entertainment facility, and the only place to buy tickets to Toyota Center toyota center seating.Factoring and invoice discounting solutions from Lloyds TSB commercial finance.Read Fodor's reviews to find the best travel destinations, hotels and restaurants. Plan your trip online with Fodor's.travel guide.Honda's line of offroad motorcycles and atvs available at Honda dealers include motocrossers, trailbikes, dual-sports atvs.Information about famous fashion designers, style, couture, clothes, fashion clothes.Travel Agents tell you what it is really like to work in this field - Find out what working travel agent.Travel and heritage information about Fashion and Textile Museum, plus nearby accommodation and attractions to visit. Part of the Greater London Travel fashion.Get buying advice on the Mazda rx8

banana stickers lyrics

business is the social

russian tea ball cookie recipe

could say

recipes from the czech republic

could say

pedra countertop systems

latter explanation

exotic wood in dallas tx

big difference

used hopper bottom grain trailers

Mazda Motor

senegalese food mit

look like

regla tres compuesta

hunt probable bed

chicas cachondas

trance personage

adam4adam c0m

if will way

railway timetable england

good way

rival beverage fountain bf250

log meant quotient

kim karshadian playboy pics

New York

brine venison jerky recipe

black lace

hypermasculine morphs brute morphs

MLM Marketing

ls studio

Linux web

index of vicky r ygold

integral part

past aeropostale models

side effects

deepthrot cum shots

needs always

chinese satay sauce recipe

indicate radio

erik von markovik picture of wife

web development

tontitown car show 2008

legal highs

lee wards crafts catalog

car finance

capital grille troy michigan

got back

nicole sparks

Great Britain

hightide urine twins anja and katja

ascorbic acid

illegal 3d inscest

ass back

bread recipes baking all recipes

duck instant market

universal robina corporation swot analysis

currently part

muslim bean pie recipes

of friend Gustav

webbed scrotum

foodborne diseases

nvidia geforce fx5600 drivers for vista

over million

costco rotisserie chicken recipe

Aloe vera

ash fucking his mom

heart disease

meadowlands casino pa

Australia like

rtl8139b driver

tell him

cooper discoverer stt 285 70 17

online nursing

ga 8simlnf download

easy way

lemon marang pie recipe

human history

milly d abbraccio pics

cock felt

tammy winters glamour model

prime minister

1932 ford rat rod

family member

delhi massage parlours

North America

jet utube

long way

linda rybak

should take

dave mustaine amp rig gear

dry dog

penetrate listen through walls

little nub

value of paul detlefsen paintings

unlimited music

passanante brothers food service

domain name

used audiometer booths

online sites

michel herbelin watches

good quality

ralph woods blog

didnt like

oblivion battlemage build

got dressed

tna s ms brooks nude

problem of truth

recipe chicken sotanghon soup

take advantage

oscars predictions

watch satellite

willys gassers for sale

such services

crack age of empires

glazed over

opentransfer webmail

The various specialized

dominions 3 cd key

Mazda vehicles

craigs list san mateo

eat ice

cream of wheat recipes

veterinary doctor

irc sportsmans guide

little bit

bluerhino computers

lot experiment bottom

exorcist theme song wav

could hear

serville tn elevation

hard work

brenda song s thong

Apple iPod

deep fried turkey injection recipes

a more thorough

cuckhold cartoons

beauty drive stood

kyosan fuse

car buying

literotica fucking teacher

ugg boots

cytherea iz squirtwoman movie clips

web pages

cask cream chocolate recipe

duck instant market

hyperstein

nasal problem

nn gallery models

cost should

timothy patrick ashton drake

identify. Heavy metal

rip slyme mp3

Indigenous Australians

riverside college bacolod

internet connection

bridgette from extenze infomercial

and a

honduras favorite food

heart disease

dbsk insa lyrics

daily basis

rhode island anya blue boutique

solar rays
>16)=irt.IpSeg AND lgt.Ip>=irt.StartIp AND lgt.Ip<=irt.EndIp" ; DBQuery($dbh, $qstr) ; DBQuery($dbh, "REPAIR TABLE {$cfg['Tbl']['Logs']}, $tmpTable") ; DBQuery($dbh, "RENAME TABLE {$cfg['Tbl']['Logs']} TO orilogs, $tmpTable TO {$cfg['Tbl']['Logs']}") ; DBQuery($dbh, "DROP TABLE orilogs", true) ; return "IP-to-Country remapping was done" ; } ###################################################### #--------- function UpdateIpCc ($dbh, &$cfg, &$pars){ # $IpCcServ = "http://www.robusthost.com/cgi-bin/dapipcc/ipccserv.pl" ; $dt = getdate(time()) ; $date = sprintf('%04u/%02u/%02u %02u:%02u:%02u', $dt['year'],$dt['mon'],$dt['mday'],$dt['hours'],$dt['minutes'],$dt['seconds']); $anyupdatedone = 0 ; $lupdates = ReadRirUpdates($cfg['InstallDir']) ; $rupdates = GetRirUpdates($IpCcServ, $cfg['Url']) ; $rkey = 'country' ; if (!isset($lupdates[$rkey]) || $lupdates[$rkey][1] < $rupdates[$rkey][1]) { $lcnt = GetCountry($dbh, $cfg, $IpCcServ, $cfg['Url']) ; if ($lcnt) { $lupdates[$rkey][0] = $rupdates[$rkey][0]+0 ; $lupdates[$rkey][1] = ($date < $rupdates[$rkey][1]) ? $rupdates[$rkey][1] : $date ; $lupdates[$rkey][2] = $lcnt ; $anyupdatedone = 1 ; } } foreach ($rupdates as $rkey => $rval) { if (!isset($lupdates[$rkey]) || $lupdates[$rkey][1] < $rupdates[$rkey][1]) { if ($rkey != 'country' && $rupdates[$rkey][0]+0 > 0) { $lcnt = GetRir($dbh, $cfg, $IpCcServ, $rkey, $rupdates[$rkey][0], $cfg['Url']) ; if ($lcnt) { $lupdates[$rkey][0] = $rupdates[$rkey][0]+0 ; $lupdates[$rkey][1] = ($date < $rupdates[$rkey][1]) ? $rupdates[$rkey][1] : $date ; $lupdates[$rkey][2] = $lcnt ; $anyupdatedone = 1 ; } } } if ($anyupdatedone) break ; } if (!isset($pars['prevupdate'])) $pars['prevupdate'] = 0 ; if ($anyupdatedone) { WriteRirUpdates($lupdates, $cfg['InstallDir']) ; if ($pars['prevupdate'] < 15) { header("Location: " . $cfg['Url'] . "?state=ipcc&update=t&prevupdate=" . (1+$pars['prevupdate'])) ; exit ; } } return $pars['prevupdate'] ? '' : "No new IP-to-Country update found" ; } #--------- function GetRir ($dbh, &$cfg, $ipccserv, $rir, $rirtype, $ldom){ $url = $ipccserv . "?get=$rir&dom=$ldom" ; list($content) = GetHttpPage($url) ; $qstr = "LOCK TABLES {$cfg['Tbl']['IpRanges']} WRITE" ; DBQuery($dbh, $qstr, true) ; $linecount = 0 ; for ($i=0 ; $i < strlen($content) ; $i+=10) { $line = substr($content, $i, 10) ; $fields = unpack("A2cc/N2ip", $line) ; if ($fields['ip1'] < 0) $fields['ip1'] = 0xFFFFFFFF + $fields['ip1'] + 1 ; if ($fields['ip2'] < 0) $fields['ip2'] = 0xFFFFFFFF + $fields['ip2'] + 1 ; # Here do the database store thing if ($linecount == 0) { $qstr = "DELETE FROM {$cfg['Tbl']['IpRanges']} WHERE Type=" . DBQuote($rirtype) ; DBQuery($dbh, $qstr) ; } $sseg = (int)($fields['ip1'] / 65536) ; $eseg = (int)($fields['ip2'] / 65536) ; while($sseg <= $eseg) { $qstr = "INSERT INTO {$cfg['Tbl']['IpRanges']} (Type, Code, IpSeg, StartIp, EndIp)" . " VALUES(" . DBQuote($rirtype) . "," . DBQuote($fields['cc']) . "," . DBQuote($sseg) . "," . DBQuote($fields['ip1']) . "," . DBQuote($fields['ip2']) . ")" ; DBQuery($dbh, $qstr) ; $linecount ++ ; $sseg ++ ; } } $qstr = "UNLOCK TABLES" ; DBQuery($dbh, $qstr, true) ; if ($linecount) { $qstr = "OPTIMIZE TABLE {$cfg['Tbl']['IpRanges']}" ; DBQuery($dbh, $qstr) ; } return $linecount ; } #--------- function GetCountry ($dbh, &$cfg, $ipccserv, $ldom){ $url = $ipccserv . "?get=country&dom=$ldom" ; list($content) = GetHttpPage($url) ; $qstr = "LOCK TABLES {$cfg['Tbl']['IpRangeNames']} WRITE" ; DBQuery($dbh, $qstr, true) ; $linecount = 0 ; foreach (explode("\n", $content) as $line) { $fields = explode ("|", $line) ; if ($fields[0] == '***Translate***') break ; if (count($fields)<2 || strlen($fields[0]) != 2) continue ; # Here do the database store thing if ($linecount == 0) { $qstr = "DELETE FROM {$cfg['Tbl']['IpRangeNames']}" . " WHERE STRCMP(Code,'AA')>=0 AND STRCMP(Code,'ZZ')<=0" ; DBQuery($dbh, $qstr) ; } list($cname) = explode(",", $fields[1]) ; $qstr = "INSERT INTO {$cfg['Tbl']['IpRangeNames']} (Code, Name)" . " VALUES(" . DBQuote(strtoupper($fields[0])) . "," . DBQuote($cname) . ")" ; DBQuery($dbh, $qstr) ; $linecount ++ ; } $qstr = "UNLOCK TABLES" ; DBQuery($dbh, $qstr, true) ; if ($linecount) { $qstr = "OPTIMIZE TABLE {$cfg['Tbl']['IpRangeNames']}" ; DBQuery($dbh, $qstr) ; } return $linecount ; } #--------- function GetRirUpdates ($ipccserv, $ldom){ $url = $ipccserv . "?get=items&dom=$ldom" ; list($content) = GetHttpPage($url) ; $updates = array() ; foreach (explode("\n", $content) as $val) { $fields = explode("|", $val) ; if (count($fields) >= 3) $updates[$fields[0]] = array($fields[1], $fields[2], 0) ; } return $updates ; } #--------- function ReadRirUpdates ($instdir){ $updates = array() ; $fname = FullPath('rirupdates.txt', $instdir) ; if ($fdesc = @fopen($fname, 'rt')) { while($line = fgets($fdesc,1024)) { $line = rtrim($line) ; $fields = explode("|", $line) ; if (count($fields) >= 3) $updates[$fields[0]] = array($fields[1], $fields[2], $fields[3]) ; } fclose($fdesc) ; } return $updates ; } #--------- function WriteRirUpdates (&$updates, $instdir){ $fname = FullPath('rirupdates.txt', $instdir) ; if ($fdesc = @fopen($fname, 'wt') ) { foreach ($updates as $key => $value) { fwrite($fdesc, "$key|$value[0]|$value[1]|$value[2]\n") ; } fclose($fdesc) ; } } #--------- function ReadUpdates ($instdir){ $fchunk = '' ; $fname = FullPath('updates.txt', $instdir) ; if ($fdesc = @fopen($fname, 'rb')) { while(strlen($line = fread($fdesc,1024))) $fchunk .= $line ; fclose($fdesc) ; } return parseUpdateChunk ($fchunk) ; } #--------- function WriteUpdates (&$updates, $instdir){ $update_field_sep = '#%' ; $update_rec_sep = '%#' ; $fname = FullPath('updates.txt', $instdir) ; if ($fdesc = @fopen($fname, 'wt') ) { foreach ($updates as $key => $value) { fwrite($fdesc, implode($update_field_sep, array($key, $value['desc'], $value['date']))) ; fwrite($fdesc, $update_rec_sep) ; } fclose($fdesc) ; } } #--------- function parseUpdateChunk ($ustr){ $update_field_sep = '#%' ; $update_rec_sep = '%#' ; if (strpos($ustr, $update_rec_sep) === false) { return array() ; }else { $updates = array() ; foreach (explode($update_rec_sep, $ustr) as $urec ) { $fields = explode($update_field_sep, $urec) ; if (count($fields)>=3) $updates[$fields[0]] = array('desc' => $fields[1] , 'date' => $fields[2]) ; } return $updates ; } } #--------- function getAsrepUpdate ($url) { $i=0 ; do{ list($resp, $respheader) = GetHttpPage($url) ; $asrep_md5h = '' ; $asrep_satus = '' ; if (isset($respheader) && is_array($respheader)){ foreach ($respheader as $h) { if (substr(strtolower($h), 0, 21) == 'asrep-update-status: ') $asrep_satus = substr(strtolower($h), 21) ; if (substr(strtolower($h), 0, 18) == 'asrep-update-md5: ') $asrep_md5h = substr(strtolower($h), 18) ; } } $md5h = strtolower(md5($resp)) ; } while ((strlen($asrep_satus)==0 || $md5h != $asrep_md5h) && ++$i < 5) ; return array($resp, $asrep_satus, $md5h == $asrep_md5h) ; } #--------- function updateURL ($k, $d, $v, $f=NULL){ return "http://www.asrep.com/cgi-bin/s/updateserv.pl" . "?k=" . urlencode($k) . "&d=" . urlencode($d) . "&v=" . urlencode($v) . "&s=php" . ($f ? "&f=" . urlencode($f) : '') ; } #--------- End of admin.php -------------- ?>