#!/usr/local/bin/perl # ----------------------------------------------------------------------------- # Realty Manager v2.2 # Copyright (C) 1998-2003 interactivetools.com Inc. All Rights Reserved # http://www.interactivetools.com/ # ----------------------------------------------------------------------------- # This program is protected by Canadian and international copyright laws. Any # use of this program is subject to the the terms of the license agreement # included as part of this distribution archive. Any other uses are stictly # prohibited without the written permission of interactivetools.com and all other # rights are reserved. # ----------------------------------------------------------------------------- # ----------------------------------------------------------------------------- # Warning : Modifying the source code violates your license agreement! # ----------------------------------------------------------------------------- $SIG{__DIE__}=$SIG{__WARN__}=\&sr; my$cgifile=$0;$cgifile=~s/.*[\\\/]//;my@an=($0,$ENV{'SCRIPT_FILENAME'});my$cgidir=(grep(/$cgifile$/i&&s/^(.*)[\\\/].*/$1/,@an))[0]; $cgidir||=(($^O=~/mswin/i?`cd`:`pwd`)=~/(.*)/)[0];$cgidir=~s/\\/\//g;if(!$cgidir){die("Can't determine cgi directory!\n")}%hc=("progVer"=>"2.29","progRel"=>"June 25th,1999","progUpd"=>"May 12,2003","perlOS"=>$^O||"Unknown","perlVer"=>$]||"Unknown","cgidir"=>$cgidir,"cgiurl"=>(split("/",$ENV{'SCRIPT_NAME'}))[-1],"ltime"=>time,"stime"=>time,"prod_id"=>14,"prog_build"=>'1534',"templatedir1"=>'../templates',"templatedir2"=>'../templates/interface',"debug"=>0,); for(0..9){push(@ag,"limage$_")}for(1..75){push(@ag,"lfield$_")}for(0..9){push(@ai,"himage$_")} for(1..50){push(@ai,"hfield$_")}for(1..50){push(@ac,"lfield$_"."_name");push(@ac,"lfield$_"."_type"); push(@ac,"lfield$_"."_active")}for(51..75){push(@ae,"lfield$_"."_name");push(@ae,"lfield$_"."_type"); push(@ae,"lfield$_"."_active")}for(1..50){push(@ac,"hfield$_"."_name");push(@ac,"hfield$_"."_type"); push(@ac,"hfield$_"."_active")}%hl=("datafile"=>"listing.dat","filelock"=>"filelock.lock","fields"=>[qw(num owner created updated),@ag,hidden],"backup"=>"disabled","cgiext"=>".cgi");%hm=("datafile"=>"user.dat","filelock"=>"filelock.lock","fields"=>[qw(num name login_id login_pw access created_mon created_day created_year expires_mon expires_day expires_year expires_date expires_never disabled listings_max listings_unlimited user_listed specify_filename homepage_filename notes),@ai,listings_hidden],"backup"=>"disabled","cgiext"=>".cgi");%hj=("datafile"=>"setup.dat","filelock"=>"filelock.lock","fields"=>["num",@ac,qw(company_name domain_name product_id publish_listing_index publish_homepage_index publish_listing_image0 publish_homepage_image0 upload_maxk login_timeout listing_perpage homepage_perpage userman_perpage db_sorting titlebar footerbar logoff_url image_url listing_dir listing_url homepage_dir homepage_url search_url time_adjh time_adj_hour time_adjm time_adj_min installed),@ae,qw(d prog_ver max_filelock_duration c demo branding publish_ext thumbnail_create thumbnail_width thumbnail_height)],"backup"=>"disabled","cgiext"=>".cgi");%ib=("datafile"=>"help.dat","filelock"=>"filelock.lock","fields"=>[qw(num parent title content)],"backup"=>"disabled","cgiext"=>".cgi");%hd=&ut;%hr=&us;{ my$datafile="$hc{'cgidir'}/../data/$hj{'datafile'}$hj{'cgiext'}";if(open(FILE,"<$datafile")){ my($data_line)=grep{/^\d/};close(FILE);$hb{'max_filelock_duration'}=(split(/¡/,$data_line))[405]} if($hb{'max_filelock_duration'}<5){$hb{'max_filelock_duration'}=5}}&sk(\%hj,\%hb,1);$hc{'titlebar'}=$hb{'titlebar'}; $hc{'footerbar'}=$hb{'footerbar'};$hc{'image_url'}=$hb{'image_url'};$hc{'homepage_url'}=$hb{'homepage_url'}; $hc{'listing_url'}=$hb{'listing_url'};$hc{'search_url'}=$hb{'search_url'};$hc{'search_homepage_url'}=$hb{'search_url'}; $hc{'search_homepage_url'}=~s/search\.(\w+)$/search_homepage.$1/i;$hc{'header_product'}="Realty Manager"; $hc{'header_version'}=$hc{'progVer'};$hc{'header_company_name'}=$hb{'company_name'};$hc{'header_domain_name'}=$hb{'domain_name'}; $hc{'header_license_num'}=&wn($hb{'product_id'});$hc{'upload_maxk'}=$hb{'upload_maxk'};$hc{'publish_ext'}=$hb{'publish_ext'}||"html"; $hc{'thumbnail_width'}=$hb{'thumbnail_width'};$hc{'thumbnail_height'}=$hb{'thumbnail_height'}; if($hb{'time_adjh'}eq"add"){$hc{'ltime'}+=(int($hb{'time_adj_hour'}*60*60))};if($hb{'time_adjh'} eq"minus"){$hc{'ltime'}-=(int($hb{'time_adj_hour'}*60*60))};if($hb{'time_adjm'}eq"add"){$hc{'ltime'}+=(int($hb{'time_adj_min'}*60))}; if($hb{'time_adjm'}eq"minus"){$hc{'ltime'}-=(int($hb{'time_adj_min'}*60))};$hk{'mon'}=(localtime($hc{'ltime'}))[4]+1; $hk{'day'}=(localtime($hc{'ltime'}))[3];$hk{'year'}=(localtime($hc{'ltime'}))[5]+1900;$hk{'date'}=sprintf("%04d%02d%02d",$hk{'year'},$hk{'mon'},$hk{'day'}); $|++;%hn=&ti("$hc{'cgidir'}/config.ini");umask oct($hn{'umask'})if$hn{'umask'};if($hn{'thumbnailing'}{'disable_thumbnails'}){ $hb{'thumbnail_create'}=0;&sm(\%hj,\%hb,1)}sub ti{local(*FILE);my($file)=$_[0];my(@aj,$ref,%hh); $ref=\%hh;if(!$_[0]){die"INI_Load : No ini file was specified!\n"}if(!-e $_[0]){die"INI_Load : The ini file '$_[0]' could not be found!\n"} open(FILE,"<$file")||die("INI_Load : Could open ini file! $!\n");@aj=;close(FILE);foreach(@aj){/^\s*#/m&&next; if(/^\s*\[/m){$ref=\%hh;foreach(/\[(.+?)\]/g){$ref=\%{$ref->{$_}}}next}my$pos=index($_,'='); if($pos>0){my$name=substr($_,0,$pos);my$value=substr($_,$pos+1);foreach($name,$value){s/^\s+//; s/\s+$//}$name=~/[^\w]/&&die("INI_Load : Invalid key '$name' in ini file '$file'!\n"); defined $ref->{$name}&&die("INI_Load : Key '$name' defined twice in ini file '$file'!\n"); $ref->{$name}=$value}elsif($pos==-1){my$name=$_;for($name){s/^\s+//; s/\s+$//}if(!length $name){ next}defined $ref->{$name}&&die("INI_Load : Key '$name' defined twice in ini file '$file'!\n"); $ref->{$name}=1}}return%hh}sub wn{my($w,$x,$y,$z)=split(/-/,shift);my($v)=$w+join("",unpack("C3",$x))+$z; while(length $v>7){$v>>=1}if(!($w%47)&&$w/20.68==(5*20)&&$x=~/^[A-Z]{3}$/&&!($z%47)&&$y==$v){ if($x eq"\x43\x47\x57"){return(($z/47)+6000)}elsif($x eq"\x55\x50\x47"){return(($z/47)+8000)} elsif($x eq"\x45\x44\x49"){return(($z/47))}else{return(0)}}else{return(0)}}$hc{'query'}=$ENV{'QUERY_STRING'}; if($hd{'search'}){&uu()}elsif($hd{'view'}){&wo()}else{&um()}exit;sub um{print"Content-type: text/html\n\n" unless($ContentType++); my$query_template=$hd{'template'}||'_search_query.html';unless(&xh($query_template)){&sr("Invalid template name: $query_template")}$rowcode=sub{ if(!$he{'user_listed'}){return(0)}$ha{'userlist'}.=qq|