####################################
# PROFILE MANAGER 1.13
# 
# Aytekin Tank
# email: aytekin@interlogy.com
# http://www.interlogy.com/scripts/pm
# 
####################################
# COPYRIGHT NOTICE:
#
# Copyright 1999-2001 Aytekin Tank.
#
# This program may be used and modified free of charge by anyone, so
# long as this copyright notice and the header above remain intact.
# Selling the code for this program without prior written consent is
# expressly forbidden. Obtain permission before redistributing this
# program over the Internet or in any other medium.  In all cases
# copyright and header must remain intact.
#
# This program is distributed "as is" and without warranty of any
# kind, either express or implied. All responsibility is belong to 
# you if any damage or loss occurs.
####################################
#
# Main Configuration File: 'pm.cfg'
#
# Please send me an email to aytekin@interlogy.com
# about any bugs, problems or critics.  
#



###############################
# Full path of the main database file
# (without "/root/")
#
# you don't need to change this line or create a "pm.dat" file.
# The script will create it for you, if the data folder is writable(766) 
###############################
$database = "data/pm.dat";

###############################
# Database Initilization
#
# To enable a field in the database you need to put it here
# make sure to put comma between fields. 
#
# This will create the database, if you want to add 
# a new field even after database is created, add the field
# at the end of the list, if you add middle, you will mess 
# up the database. Try to spend some time on thinking about 
# fields of your database. 
#
# When you want to use a field in a page, you will use these
# names to retrieve them, for example, %%name%% will retrieve
# the 'name' field of the profile.
#  
# Do not remove the first 5 fields:
# login, ID, password, update_time, register_time
###############################
@base = (
 login, ID, password, update_date, register_date, 
 name, email, address, state, tel, age, status, 
 sex, occupation, quote, hobbies, homepage, news, 
 company, company_url, notes, country
 );


###############################
# not null fields:
#
# if one of these fields are missing, the script will give error 
# on registeration or modification.
# these fields must be in base fields above.
###############################
@not_null = ('login', 'password', 'email');


##############################################
#                                            #
# YOU DON'T HAVE TO MODIFY THESE VARIABLES:  #
#                                            #
##############################################
#
# Most of the fields are disabled. It is done to encapsulate
# the problems if you are not good at debugging script problems,
# Choose one of the options below:
# Option 1: go one at a time and test it..
# Option 2: modify everything and try your luck, 
#           if doesn't work, download the script again 
#           and go to Option 1 :-)
#
# Be careful: if you forget one quatotion mark the whole
# script will not work.
#
###############################
# Should "flocking" option be on(1) or off(0)
#
# File locking only works on UNIX
# To prevent two guys to modify the database file
# at the same time, this will lock the file.
###############################
$flocking = 0;

 ###############################
 # Would you like to have static web pages created.
 # use "yes" or "no"
 ###############################
 $static_pages = "no";

 ###############################
 # in which folder the url going to be?
 # (with the '/' at the end)
 ###############################
 $static_url = "http://www.interlogy.com/profiles/";

 ###############################
 # what is the directory address of the folder?
 # (with the '/' at the end.)
 #
 # you should set permissions for this folder:
 # chmod 766 staticfolder 
 # (makes the folder for static web pages readable and writable)
 # If 766 doesn't show the static files at your browser,
 # try 777.
 ###############################
 $static_dir = "/usr/local/etc/httpd/htdocs/profiles/";

###############################
# Do you want to save information about the users
# in a statistics file? 
#
# Note that if you dont purchase PM Premium or 
# PM Professional you will not have an Admin Control Panel,
# and you will not see these information in a nice format, 
# but you can still open the database with a text editor and 
# check out the last logins/time/Browser/OS/IP of the users
# use "yes" or "no"
###############################
$save_stats = "no";

 ###############################
 # If yes, what will be the full 
 # path to Statistics Data File?
 # (without root/)
 ###############################
 $stat_file = "data/stat.dat";

###############################
# Should it save history files for 
# modifications and deletions?
# use "yes" or "no"
###############################
$save_history = "no";

 ###############################
 # If yes, where should be these files:
 # (without /root/)
 ###############################
 # history deleted accounts:
 $h_delete = "data/pm_deleted.dat";

 # history modified accounts:
 $h_modify = "data/pm_modified.dat";

###############################
# search elements:
#
# Enable to search these fields.
# you can change this list anytime. 
# these fields must be in base fields set above.
#
# The search results will be showed in a table.
# Any field of the table is modifiable below.
# You can even not use a table and make it create 
# a flat list.
# The only thing is, you must know
# how <table> functions.
###############################
@elements = ('login', 'email', 'age', 'state');

###############################
# search form size:
###############################
$s_formsize = 15;

###############################
# Seacrh Next and Previous links and characters between them:
###############################
$next_link = "Next";
$prev_link = "Previous";
$between_next_prev = " - ";

###############################
# Maximum number of items in search results
###############################
$max_list = 20;

###############################
# The header of the search result table:
#
# You should use the fields in the "elements" array
# since I used login, email age and state, I put them
# (dont put </table> to the end.)
###############################
$tables = qq~

 <table border=1 width=500 cellspacing=0 cellpadding=0>
 <tr bgcolor=gray>
  <td>
   <font color=white size=2 face=arial>
Login
   </font>
  </td>
  <td>
   <font color=white size=2 face=arial>
Email
   </font>
   </td>
 <td>
  <font color=white size=2 face=arial>
Age 
  </font>
  </td> <td>
    <font color=white size=2 face=arial>
State 
  </font></td>
 </tr>
 ~;
 
###############################
# Table manipulation for search results.
#
# $trs: start of <tr> 
# $tre: end of <tr> 
# $tds: start of <td> 
# $tde: end of <td> 
# $tables: already used in code above.
# $tablee: end of <table>
#
# You probably will not need to change these vars, 
# but you may want to change the background color of the 
# table or remove table with a flat list.
###############################
$trs = "<tr>";
$tre = "</tr>";
$tds = "<td bgcolor=white>";
$tde = "</td>";
$tablee = "</table>";

###############################
# the directory address of the temporary files
# (without "/root/")
#
# if filenames:
# t for template of an action
# s for success page of an action
###############################
%tempz = (
	'display'	=> "templates/t_display.htm",
	'panel'		=>	"templates/t_panel.htm",
	'modify'	=>	"templates/t_modify.htm",
	'search'	=>	"templates/t_search.htm",
	'delete'	=>	"templates/t_delete.htm",
	'error'		=>	"templates/t_error.htm",
	'register_success'	=>	"templates/s_register.htm",
	'modify_success'	=>	"templates/s_modified.htm",
	'delete_success'	=>	"templates/s_delete.htm",
	'send_password'		=>	"templates/t_send_password.txt",
	'lost_password_sent'=>	"templates/s_lost_password_sent.htm",

	);

###############################
# Months: 
# change if you would like to use  
# names in different languages
# or numbers instead of words:
###############################
@monthz = ('January', 'February', 'March', 'April', 'May', 
'June', 'July', 'August', 'September', 'October', 'November', 'December');

###############################
# how should be the date showed above?
###############################
$date_format = "%date% %month%, %year%";

###############################
# error messages
# you can modify the texts at the right side.
###############################
sub init_errors{
 %error_message = (
 'login already exists'		=>	"This login name already exists.",
 	'no login'		=>	"You did not select any login name.",
 	'missing'		=>	"Missing field: $missing",
 	'login not found'		=>	"The login name does not exists.",
 	'no permission'		=>	"You dont have permission to do this.",
 	'passwords not same'		=>	"The passwords are not the same.",
 	'no password'		=>	"The password field was empty.",
 	'default'		=>	"Unkown error."
	);
}

###############################
#
# Confirmation Email After Registeration
#
###############################

 ###############################
 # Send confirmation email?
 #
 # (sorry, this feature will not 
 # work on NT servers)
 # use "yes" or "no"
 ###############################
 $send_confirmation = "no";

 ###############################
 # Is this a UNIX type of server? 
 ###############################
 $unix = "yes";

 ###############################
 # and if yes please configure:
 ###############################

 ###############################
 # where is Sendmail? 
 # (on most servers /bin/sendmail or /usr/sbin/sendmail)
 ###############################
 $sendmail = "/bin/sendmail";

sub confirm
{
 ###############################
 # subject of the mail:
 ###############################
 $sub = "Registeration to PM Profiles!";

 ###############################
 # from address:
 ###############################
 $from = 'contact@interlogy.com';

 ###############################
 # body of the email:
 ###############################
 $letter = qq~
 
 You have succesfully registered to PM Profiles. 
 Please, login to your acount using these login and password:
 
 Login: $input{'login'}
 Password: $input{'password'}
 
 PM Profiles Community Manager.
 
 ~;
 &sendemail($input{'email'}, $from, $sub, $letter);
}

$subject_lost_password = "Your account at Interlogy.com";
