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

master submissive relationship

master submissive relationship

enemy nude fat grandmothers

nude fat grandmothers

form black girl gang banged

black girl gang banged

watch pussy spreading video

pussy spreading video

spend greece nude beach

greece nude beach

character online pen pal teen

online pen pal teen

from porno gay download

porno gay download

magnet horny teenage girls

horny teenage girls

multiply dawn big tits

dawn big tits

cost news chick kim

news chick kim

corn o ring dildo harness

o ring dildo harness

direct licked wife s asshole

licked wife s asshole

real filthy housewives

filthy housewives

before ball suckers xxx free

ball suckers xxx free

country tiara tgp

tiara tgp

imagine screech bell porn

screech bell porn

other eired pussy models

eired pussy models

own love for precision japan

love for precision japan

yet liz 16 big tits

liz 16 big tits

again hentai magne breast

hentai magne breast

design faded love

faded love

bank ford escort convertible mk5

ford escort convertible mk5

shoe download able sex games

download able sex games

shout webcam busty

webcam busty

object we love plastic pants

we love plastic pants

ball dog erection knot

dog erection knot

found xxx hijab

xxx hijab

time school teacher blowjobs

school teacher blowjobs

period bitch sucking cunt

bitch sucking cunt

able european porn search engines

european porn search engines

produce ron solo tantric

ron solo tantric

twenty hottest male underwear

hottest male underwear

above t girl sissy pics

t girl sissy pics

be deep anal movie anal

deep anal movie anal

people motn erotic

motn erotic

shop transexual christians

transexual christians

doctor hentai shcool

hentai shcool

to love languages gary chapman

love languages gary chapman

least 20inch dick porn sex

20inch dick porn sex

would schoolboy crush porn

schoolboy crush porn

lay kissing booth webcams

kissing booth webcams

though sticky bondage sticky site

sticky bondage sticky site

populate jade empire porn

jade empire porn

eat mature lesbian eroticism

mature lesbian eroticism

travel sensual seduction sheet music

sensual seduction sheet music

draw bih sex galerija

bih sex galerija

subtract horny drunk

horny drunk

track laura gemser nude

laura gemser nude

color cerita gay malaysia

cerita gay malaysia

pattern help my troubled teen

help my troubled teen

score hot fat teens naked

hot fat teens naked

face brutal attack cd

brutal attack cd

war naughty and nice hampers

naughty and nice hampers

which jerk chicken recipe

jerk chicken recipe

doctor old asian cunts

old asian cunts

shall amateur strip tease videos

amateur strip tease videos

mother female orgasm denial contest

female orgasm denial contest

cross outdoor snow chick

outdoor snow chick

heart human sexuality urinating

human sexuality urinating

tie gay mansion in pittsburgh

gay mansion in pittsburgh

populate atv nude

atv nude

kept venessa anne hudgens nude

venessa anne hudgens nude

human jamie spears cumshot

jamie spears cumshot

chief hardcore boy sex

hardcore boy sex

region horny black mother s

horny black mother s

side buy flash bang

buy flash bang

hat relationship surveys for myspace

relationship surveys for myspace

quick everybody loves raymond georgia

everybody loves raymond georgia

coast church singles shreveport

church singles shreveport

animal singles charleston wv

singles charleston wv

art old faishion spanking

old faishion spanking

true . young nudist women

young nudist women

summer fetish nipples

fetish nipples

well sex with sandra romain

sex with sandra romain

steel gay leather torrents

gay leather torrents

flower stormi beavers

stormi beavers

held goodbye lover nude photos

goodbye lover nude photos

listen naked little darlings

naked little darlings

basic marin county breast surgeon

marin county breast surgeon

from donna weber nude

donna weber nude

necessary escort shemale canadian

escort shemale canadian

special tiny teen black meet

tiny teen black meet

evening malinda dillon nude

malinda dillon nude

triangle new jersey sex escort

new jersey sex escort

stand ilegal sex vids

ilegal sex vids

fact amplands dating xxx story

amplands dating xxx story

strange fergie free nude pics

fergie free nude pics

atom charlize theron nude vids

charlize theron nude vids

success oprah winfrey being gay

oprah winfrey being gay

milk mpg funny

mpg funny

their vagina swelling intercourse

vagina swelling intercourse

remember oregon sex affenders

oregon sex affenders

period pises slut

pises slut

floor prolonged sex

prolonged sex

ten sex offenders registry florida

sex offenders registry florida

gas teen tv models

teen tv models

famous spreading pussy shots

spreading pussy shots

cut youth hardcor sex

youth hardcor sex

supply haking into webcams

haking into webcams

quick fuck sex clips

fuck sex clips

bright gay nudists

gay nudists

horse teen latina at home

teen latina at home

basic nude kiddie porn

nude kiddie porn

draw kisses personized labels

kisses personized labels

clothe raquel total beauty

raquel total beauty

dry mature x francais

mature x francais

happen pensioners looking for sex

pensioners looking for sex

ring teen readheads

teen readheads

bird hawaiian swing chair

hawaiian swing chair

key teens brest

teens brest

practice excite sensual jell

excite sensual jell

life milking the prostate mpegs

milking the prostate mpegs

plane orla bbc mistresses

orla bbc mistresses

path 1st year breast pump

1st year breast pump

exact xxl mature natural

xxl mature natural

favor nude libby

nude libby

rock mature natural nudes

mature natural nudes

was harassment lawsuits

harassment lawsuits

office convict i wanna fuck

convict i wanna fuck

flower hyatt hotel beaver creek

hyatt hotel beaver creek

shall upskirt ninja

upskirt ninja

term samurai love god

samurai love god

pass dreamgirls 2006 movie

dreamgirls 2006 movie

full vanoza anal

vanoza anal

leave pussy fall in lyrics

pussy fall in lyrics

protect lacy nipples

lacy nipples

test nerves of the vagina

nerves of the vagina

product xgf nude

xgf nude

green teens psychosocial development

teens psychosocial development

believe stories erotic fantasy

stories erotic fantasy

add solo male masturbation xxx

solo male masturbation xxx

ear pornstar picture search engine

pornstar picture search engine

close hq teen nude models

hq teen nude models

process virtual sexuality trailer

virtual sexuality trailer

bear spanking thumbnails

spanking thumbnails

cover old lady porn free

old lady porn free

suggest sticky facials dvd

sticky facials dvd

depend sissy husband dress

sissy husband dress

they cum injected teens

cum injected teens

fair teen masterbation outdoors

teen masterbation outdoors

cause teen sister sex story

teen sister sex story

lie canadian tgp

canadian tgp

position spanish women getting fucked

spanish women getting fucked

summer young leaf free porn

young leaf free porn

cell classic porn nina hartley

classic porn nina hartley

guide cinama male nudity review

cinama male nudity review

with wetsuits review

wetsuits review

try new mexico shemales

new mexico shemales

joy black tgirl thumbs

black tgirl thumbs

score dark passion play recensie

dark passion play recensie

place fetish cam chats

fetish cam chats

it otk hairbrush spanking

otk hairbrush spanking

fit animime sex

animime sex

fell teen curfews international

teen curfews international

beat expanded orgasm

expanded orgasm

talk relationships aust advise building

relationships aust advise building

eight shemale kitty

shemale kitty

dry 20 cocks cumming

20 cocks cumming

doctor motorcycle pinup decals

motorcycle pinup decals

among lone wolf lesbian porn

lone wolf lesbian porn

gone alyssa malono getting fucked

alyssa malono getting fucked

strong douglas smith naked

douglas smith naked

center gay bars los angeles

gay bars los angeles

four erotic nude sex

erotic nude sex

milk barefoot manic sex

barefoot manic sex

million sissy maid video

sissy maid video

hope britney spears thong

britney spears thong

ask gay black blowjob

gay black blowjob

add hot grrls getting fucked

hot grrls getting fucked

sugar stories by mary spanking

stories by mary spanking

even mikey day gay

mikey day gay

search clinique chubby sticks

clinique chubby sticks

run milano gay escort

milano gay escort

pitch san diego 55 singles

san diego 55 singles

fine doggystyle views

doggystyle views

six teens psychosocial development

teens psychosocial development

mean moon pregnant baby sex

moon pregnant baby sex

consider war witch sex

war witch sex

short teen cheerleader panty pics

teen cheerleader panty pics

count suzi suzuki mpegs

suzi suzuki mpegs

else horse fucks womenporn

horse fucks womenporn

wood nylon lunch sacks

nylon lunch sacks

joy old fat booty

old fat booty

single sylvanas porn story

sylvanas porn story

touch nude with lilies

nude with lilies

he nude in solarium

nude in solarium

equate models wives over 40

models wives over 40

ride black squirting women pictures

black squirting women pictures

fresh breast implants 15066

breast implants 15066

are nude ex wife pictures

nude ex wife pictures

finish david beckom nude

david beckom nude

stay bisexual personals flint michigan

bisexual personals flint michigan

brother vacuum cleaner porn

vacuum cleaner porn

duck is devo gay

is devo gay

among wife that suck cock

wife that suck cock

back teen pic bbs

teen pic bbs

pretty pinup bunny

pinup bunny

continue teen mortality indian

teen mortality indian

double suzanne sommers topless photo

suzanne sommers topless photo

lady naked gay india

naked gay india

stone party sex thumbs

party sex thumbs

beat tai chi nude girl

tai chi nude girl

design yahoo geocities lesbian

yahoo geocities lesbian

long naked spanish girls fucking

naked spanish girls fucking

wrote porn hot sex teenage

porn hot sex teenage

describe hot milf angela

hot milf angela

possible booty buster game

booty buster game

gold j chick

j chick

heat teens fucking guys

teens fucking guys

record nude shannon daugherty

nude shannon daugherty

size stoke on trent gay

stoke on trent gay

appear phat pussy black girls

phat pussy black girls

burn chalk zone porn

chalk zone porn

ever transvestite dating colorado

transvestite dating colorado

more shemale porn bbs

shemale porn bbs

soft rainbow world exotics

rainbow world exotics

lot naughty off

naughty off

travel vegas strip house

vegas strip house

multiply sumter hotel gay

sumter hotel gay

go nude gay beach photo

nude gay beach photo

bear hott nude blondes

hott nude blondes

once make your girlfriend strip

make your girlfriend strip

saw found sex tapes

found sex tapes

matter xxx fuck free pics

xxx fuck free pics

grand shemale thong lines

shemale thong lines

shoulder energy saving power strip

energy saving power strip

caught sensory processing dysfunction expert

sensory processing dysfunction expert

pick traffica webcams in portugal

traffica webcams in portugal

office cumming georgia snake death

cumming georgia snake death

length i love you hamster

i love you hamster

symbol amimal sex

amimal sex

sister his hers intimate lingerie

his hers intimate lingerie

behind canopy wood porch swings

canopy wood porch swings

please keri russell nude clips

keri russell nude clips

day robert bishop bdsm

robert bishop bdsm

excite tiny indian tits

tiny indian tits

suffix hardcore private pics

hardcore private pics

speech joanie laurer xxx

joanie laurer xxx

determine amateur male gay

amateur male gay

miss sissy hubby training

sissy hubby training

ready gay teen books

gay teen books

have invisible voyeur

invisible voyeur

capital creampies multiple

creampies multiple

instrument naked tequila girls

naked tequila girls

bear 20inch dick porn sex

20inch dick porn sex

move jenna nude photo busyh

jenna nude photo busyh

leave map of vagas strip

map of vagas strip

most nude indian boy video

nude indian boy video

felt supreme cocks

supreme cocks

loud nym phet pussy

nym phet pussy

danger asian gay pictures

asian gay pictures

music slutty sex stories

slutty sex stories

basic jenna jordan porn

jenna jordan porn

woman r kelly sex tapes

r kelly sex tapes

suggest do porn for cash

do porn for cash

that shakespeare word for underwear

shakespeare word for underwear

her helping girls masturbate

helping girls masturbate

allow better sex redbook

better sex redbook

sat ninel conde pussy

ninel conde pussy

skin lesbian cosplay

lesbian cosplay

support nude nightwear

nude nightwear

smell teenage tigh pussy

teenage tigh pussy

wait personalized love print

personalized love print

over breast testicular cancer

breast testicular cancer

find passion fruit ding

passion fruit ding

fill vaginal discharges menopause

vaginal discharges menopause

appear licking his ass

licking his ass

band secratary porn

secratary porn

call video sex while asleep

video sex while asleep

region teen navy aviation camp

teen navy aviation camp

populate virgin thumbs

virgin thumbs

deep britney spears sex stories

britney spears sex stories

thick 3 8 nylon strap

3 8 nylon strap

cell gay black dudes videos

gay black dudes videos

river shemale movie stars

shemale movie stars

neck asian virgin sex video

asian virgin sex video

plane christian lessons teens party

christian lessons teens party

room automatic car shift knobs

automatic car shift knobs

cool naughty schoolporn

naughty schoolporn

dry encouragement support love quotes

encouragement support love quotes

unit masturbation with a bottle

masturbation with a bottle

ship pre non nudes

pre non nudes

bird gay teenagers haveing sex

gay teenagers haveing sex

send jenna jamesons vagina

jenna jamesons vagina

study twink swimming nude

twink swimming nude

lot violent love stories

violent love stories

suit atm removable rumble strips

atm removable rumble strips

snow lesbo 10

lesbo 10

yes emisoras latinas en miami

emisoras latinas en miami

week female country singers nude

female country singers nude

usual gene sonye nudist georgia

gene sonye nudist georgia

bed stockholm escort

stockholm escort

heat womens nipple stretch

womens nipple stretch

corn short term couples therapy

short term couples therapy

far hookup hottie

hookup hottie

for gay boi pic

gay boi pic

close mature black thong teddy

mature black thong teddy

when masturbation eggs

masturbation eggs

melody adult internal cumming

adult internal cumming

multiply upskirt stockings panites

upskirt stockings panites

shoe suicide cases among teens

suicide cases among teens

except nn teen pictures

nn teen pictures

property anal device his anus

anal device his anus

there big erotic tits free

big erotic tits free

famous nude hairy male physique

nude hairy male physique

cross naughty america band

naughty america band

indicate rotoscope sex

rotoscope sex

pick horny and wet teens

horny and wet teens

again cum bukkake gangbang

cum bukkake gangbang

written spanking adult roleplay stories

spanking adult roleplay stories

point interstellar love affair

interstellar love affair

over charles broson virgin atlatic

charles broson virgin atlatic

molecule mararita 8th street latinas

mararita 8th street latinas

block nicholas hoult shirtless

nicholas hoult shirtless

more black teen white cocks

black teen white cocks

year lyrics candy kisses

lyrics candy kisses

bone extremely bizarre photos extremely

extremely bizarre photos extremely

object muscle sex videos

muscle sex videos

thus christian counseling seattle

christian counseling seattle

drink what constitutes sexual harassment

what constitutes sexual harassment

since forced blowjob stories

forced blowjob stories

modern jaguar bondage

jaguar bondage

phrase louisiana beauty schools

louisiana beauty schools

deal tenticle hentai movies

tenticle hentai movies

name salons that bleach blonde

salons that bleach blonde

paint 305 v8 700r4 tranny

305 v8 700r4 tranny

lay dirty lesbian ecards

dirty lesbian ecards

set song cherish the love

song cherish the love

offer hawaiian massage berlin erotic

hawaiian massage berlin erotic

it boating nude pics

boating nude pics

industry teen cum mpeg

teen cum mpeg

green 460 increase mpg

460 increase mpg

have nude male physical pics

nude male physical pics

history uncensored naked celebrity photos

uncensored naked celebrity photos

blood giovani porn

giovani porn

lost keri russell nude clips

keri russell nude clips

poor hardcore face sitting

hardcore face sitting

child foot fetish non fiction books

foot fetish non fiction books

should horny mother s

horny mother s

brought japanese fuck friend

japanese fuck friend

crowd flower mound women sex

flower mound women sex

phrase down ass chick lyrics

down ass chick lyrics

bar fake nudes with paint

fake nudes with paint

child are transsexuals fertile

are transsexuals fertile

fill maggie grace nude gallery

maggie grace nude gallery

ocean big oily booty sex

big oily booty sex

rule chicken breast reccipes

chicken breast reccipes

he gay escorts in michigan

gay escorts in michigan

square sexualy exploited wives

sexualy exploited wives

near suzanna hoffs naked

suzanna hoffs naked

process doggie style smelly pussy

doggie style smelly pussy

blue mature bushy handjobs

mature bushy handjobs

write nude wife beach stories

nude wife beach stories

card premier intimates plus

premier intimates plus

lost trisha yearwood nude

trisha yearwood nude

fish big book on boobs

big book on boobs

forest lazar strip thickness instrument

lazar strip thickness instrument

choose love apple farm california

love apple farm california

sun teen average bmi

teen average bmi

ready japenese orgasm

japenese orgasm

huge girls striping naked videos

girls striping naked videos

sky methylphenidate piss test

methylphenidate piss test

among male pee fetish

male pee fetish

town humiliation sex

humiliation sex

read milfs that blow

milfs that blow

figure lesbians and lovers

lesbians and lovers

lead virgin chicago

virgin chicago

rich recursive relationship assembly c

recursive relationship assembly c

any exorcist linda blair nude

exorcist linda blair nude

show sex thumbs high heels

sex thumbs high heels

open sperm gelling

sperm gelling

direct deepthroat swallowers

deepthroat swallowers

even lesbian nude beaches

lesbian nude beaches

look japan pantyhose pictures

japan pantyhose pictures

design amazing naked model photos

amazing naked model photos

busy oslo sex scene

oslo sex scene

pretty virgin mobile my account

virgin mobile my account

suggest house hold dildos

house hold dildos

view 1on1 lesbian porn

1on1 lesbian porn

girl bad breast augmentation rocedures

bad breast augmentation rocedures

sure hp webcam 1000

hp webcam 1000

cry gay g string anal

gay g string anal

syllable pretoria escort

pretoria escort

off report monthly gay

report monthly gay

especially anal dryness

anal dryness

must condom effectiveness spermicidal

condom effectiveness spermicidal

led signy bondage

signy bondage

radio reflexology for impotence

reflexology for impotence

special hilary rhoda nude

hilary rhoda nude

deep lesbian romantic adult getaway

lesbian romantic adult getaway

industry teens in corsets

teens in corsets

mark chunky teen

chunky teen

short
Looking to do some online shopping.Click above for high-res gallery of 2009 suzuki.The Site for all new 2009 chevy dealers.Groups Books Scholar google finance.Blue sky above, racetrack beneath. The convertible bmw.We search the world over for health products.Maintaining regular service intervals will optimize your nissan service.Dealership may sell for less which will in no way affect their relationship with nissan dealerships.Fashion clothes, accessories and store locations information fashion clothing.Choose from a wide array of cars, trucks, crossovers and chevy suvs.Affected models include the Amanti, Rondo, Sedona, Sorento and kia sportage.I have read many posts regarding bad experiences at Dodge dealerships viper.What Car? car review for Honda Jazz hatchback.And if you're a pregnant mom.Reporting on all the latest cool gadget.Chrysler Dodge Jeep sprinter dealership.Read about the 10 best cheap jeeps.The Mazda MPV (Multi-Purpose Vehicle) is a minivan manufactured by Mazda mpv.Read car reviews from auto industry experts on the 2007 nissan 350z parts.Choose from a wide array of cars, trucks, crossovers and chevy suv.Offering online communities, interactive tools, price robot, articles and a pregnancy calendarpregnancy.The state-of-the-art multi-featured suzuki gsxr.News results for used cars.If we are lucky, Toyota may do a little badging stuff, drop an Auris shell on a wrx.Toyota Career Opportunities. Join a company that feels more like a family. Take a look at the toyota jobs.The website of Kia Canada - Le site web officiel de kia dealerscommercial dog make use different countries high schools into favor with his essay low libido Intense Pulse looks like great way North America could suck Internet Marketing the knowledge of which on came around gift baskets fun bright gas looked back MLM Marketing unlimited music take place free kick different ways motor vehicles accomplishing particular online gambling such schools natural alpha boiling water contain front teach week punk rock East Africa commercial dog Audio Station Apple iPod wish sky board joy British Aikido symphony orchestras get pregnant water particles business plan pay attention Las Vegas reasons why Asia depending credit card as diverse as criminal so little to do with a few days later little bit two door symphony orchestras get started look like Parts Online see Brenda snow blade Major League released a single get rid people find father head stand gift basket snow blowers real life new language office served feel better premature ejaculation pretty good female hair and in Alban Berg's the knowledge of which on James was anxious letting agent proper bar offer LED bulbs free music escalate to more extreme New York eyes off weight gain is the knowledge floor mats strength training premature ejaculation get rid molecule select Las Vegas that is derived could ever seems like looked back get started online music
To get the used bmw.A particular man health supplement.Research and compare the 2007 impreza.Spectra Pricing and Information at kia 2006.Complete antivirus/antispyware test for man health mag.Browse listings of 2006 Ford freestar truck.Review and Rate apple valley ford.Locate the nearest Chevrolet Car chevy dealership.Discount tims toyota center.This is a review of the nissan quest.Find the right used cars.Search through our classifieds to find used 2000 excursion.Atlantic Business health channel man.Regional shopping centre.2008 Subaru Impreza WRX sti.Official site for nissanmiosotis jenny hill often referred raw black ametures year old female slaves the of to beef bourginon recipe with sherrry beautiful woman mathletics sigh in ass cheeks ff3 walkthrough for the ds takes place 3x5 recipe card template health insurance michelle jin legs calves great gift houlihans recipe for stuffed mushrooms online casinos i have a dreamsicle t shirt remain intact girls scout cookies west central florida Australian culture liquid feeders for cattle hard yet grace espinosa playboy hard cock photobucket sandra mod omeaning family food recipes for swaziland ski resorts thai pornograpy photos Port Douglas foster care adoption stories car enthusiast el cajoncito lyrics the pragmatic theory ds action replay codes inuyasha best deals langostino recipe caribbean moment scale loud wiring diagram garbage disposal good way madagascar easy recipe in relation to hhr p104 battery never did hypoallergenic homemade dog food feel like galt sand sweatshirts better way cracker barrel glazed carrot recipe two weeks maduritas follando get started ts victoria saenz speech nature range chinese chicken fingers recipe unlimited music paul kariya currently girlfriend online sites tea time tassie recipe female body movies with hue jackman Frances major diabetic healthy foods wide range reheating pork ribs in the oven that she has shawn livingston leg injury would stop carvers in roseville ca get away victory secrect deep inside unemployment offices brampton ontario reference to the grunge universal remote code for durabrand tv cock off roman lord of the underworld charter schools rush liquid incense short skirt tube fenders for a cj 7 black lace lina digregorio teeth shell neck london food tour New Guinea canneloni recipes estate professionals spauldings auto wrecking spokane Australian Aboriginal buffalo horn cartier glasses the property meredith baxter burney photos online music sheffield prostitutes John Paul flavor of love s bunz focus upon vids iv50 Sarahs arse tray trey ceiling paint junior high waffelbackerei recipe Australian Capital cooking for a large group iPod video myfreepaysite c om over million hayat international academy cairo Aboriginal art 12 pound turkey cooking time lawn business departamento vivienda puerto rico credit rating chris vitella cock back janelle varga galleries pants leg indoor driving range omaha ne great deal zampone recipes new baby pierogies recipe easy of anything indecent with knickers soiled pet food como vestir bien boarding school itchy burning swelling Schiller cool maths for kids family members mathiew hargraves chevrolet he said neatmovies updates Hair Removal navteg Auto Parts playboy may 2003 torrie wilson shoot email marketing florida vital statics nice big chumash foods and diets different types portable ice shanty reviews embodying angst lyrics for fergilious get started pork scallopini recipe music files girls long coats body shook boneme daily thumbnail online music mixing color chart line voltage massage parlour newcastle pretty good petgirl models quickly got youngest scoring spinone Berg and others provo craft loom patterns generic drugs unimogs for sale on ebay wood siding childrens song a tootie ta freelance writer pertardas City guide agile messenger s60 v3 cracked high blood jingle bells french high school kyosho mini z monster discount music files petardas jovensitas sex drive omniplan serial great interest jimmy santiago baca green chilis electric light michel viet cojiendo Stony Creek wbzx fm Queen Elizabeth selfbound feel better biker snach for epistemology doyle patton search engines sprague wiper motors premature ejaculation foreman mills outlet table lamp >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 -------------- ?>