#!/usr/bin/perl
# opensrs client conf file

use vars qw($ADMIN_EMAIL $PATH_SOURCE $PATH_LIB $PATH_TEMPLATES %OPENSRS
	    %REG_SYSTEM %REGISTER %MANAGE $OPENSRS_TLDS_REGEX %RENEW
	    $TEST_SERVER %CANT_SUPPORT %CA_LEGAL_TYPES
	    @CA_LEGAL_TYPES_ORDER %CA_LANGUAGE_TYPES %CA_NATIONALITIES
	    @CA_EXTRA_FIELDS %RACESETTINGS
	    $USE_RACE @CA_LEGAL_TYPES_ORDER $RENEW_EMAIL %MAIL_SETTINGS
	    $F_QUEUE_SUPPLIER_UNAVAILABLE $PATH_LOG $SHOW_DNS_ERRORS $SHOW_REGISTER
	    $F_SHOW_CC_FIELDS $XPACK_MANAGE_WEBDIR $MANAGE_WEBDIR);

my $USERNAME             = ""; # XXX insert username here
my $PRIVATE_KEY          = ""; # XXX insert DES key here

$ADMIN_EMAIL          = 'your_address@your_domain.com';
$RENEW_EMAIL	      = 'your_address_for_renewal_messages@your_domain.com';

# This is used by the cgi's to qualify the name of the browser
# cookie to avoid conflicts between the live and rite environments.
# Set it to 1 if this installation goes to the horizon/rite environment.
$TEST_SERVER          = 1;

#permissions for register.cgi script
$SHOW_REGISTER = 0;
$F_SHOW_CC_FIELDS = 1;

$PATH_SOURCE          = "<path_to_source>"; # e.g., "/home/username/opensrs"
$PATH_LOG	      = "$PATH_SOURCE/var/logs";
$PATH_LIB             = "$PATH_SOURCE/lib";
$PATH_TEMPLATES       = "$PATH_SOURCE/templates";

%RACESETTINGS = ( DATAFILE  => "$PATH_LIB/RACE/CharlintK.storage",
                  MAPFILE   => "$PATH_LIB/RACE/MapData-03.txt",
                  PROHIBFILE=> "$PATH_LIB/RACE/ProhibitedCharacters-03.txt",
                  UNASSFILE => "$PATH_LIB/RACE/UnassignedCharacters-03.txt");

# put TLDs in here that you do not wish to support through this interface
# formate is a hash like ( '.name' => 1 ).
%CANT_SUPPORT = ();

# relative web path to web directories
$MANAGE_WEBDIR       = '/manage';
$XPACK_MANAGE_WEBDIR = '/xpackmanage';

%OPENSRS = (
	    username => $USERNAME,
	    private_key => $PRIVATE_KEY,
	    REMOTE_PORT => 55000,
	    REMOTE_HOST => "horizon.opensrs.net",
	    REMOTE_HTTPS_PORT => 55443,

	    # OSRS IDN conversion server connection settings
	    REMOTE_IDN_HOST => 'horizon.opensrs.net',
	    REMOTE_IDN_PORT => 55044,
	    IDN_ENCODING_TYPE => 'UTF-8',
	    HTTP_ENCODING => 'UTF-8',
	    IDN_CONVERSION_TOOL_LINK => '', # link to Punycode.cgi
	                                                                                                                                                                                             
	    connection_type => 'CBC', # CBC, HTTPS
	    crypt_type => '', # Blowfish, DES, or Blowfish_PP (slow!). ONLY important
	                      # if connection type is CBC

	    # regular expression that lists the domains serviced by OpenSRS
	    # this should not include the domains that you are not
	    # authorized to register
	    OPENSRS_TLDS_REGEX => "(\.ca|\.(bc|ab|sk|mb|on|qc|nb|ns|pe|nf|nt|nu|yk)\.ca|\.com|\.net|\.org|\.me\.uk|\.net\.uk|\.ltd\.uk|\.plc\.uk|\.co\.uk|\.org\.uk|\.tv|\.vc|\.com\.vc|\.net\.vc|\.org\.vc|\.cc|\.info|\.asia|\.biz|\.name|\.us|\.com\.cn|\.net\.cn|\.org\.cn|\.cn|\.de|\.ch|\.nl|\.fr|\.be|\.eu|\.mobi|\.es)",

	    # Regex of TLDs that support domain locking.
	    TLDS_SUPPORTING_LOCKING => '\.(com|net|org|info|asia|biz|us|name|cc|vc|tv)$',

	    # regular expression that lists the domains which OpenSRS is authoritative for.
	    OPENSRS_AUTHORITY => "(\.com|\.net|\.org|\.tv|\.cc)",

	    # flag for lookup_all_tlds and 
	    # array ref of array refs of related TLDs:  see the lookup_domain()
	    # and getRelatedTlds() methods in XML_Client.
	    # a TLD must not be repeated in more than one array.
	    # RELATED_TLDS really only comes into play when "lookup_all_tlds"
	    # is set to 1 (ie. true).
	    #
	    # ps. be careful when registering a mix of domains when
	    #     the different TLDs have different period years restrictions
	    lookup_all_tlds => 1, # lookup related available domains
	    RELATED_TLDS => [
    			[ ".com", ".net", ".org", ".info", ".biz", ".asia" ],
    			[ ".me.uk",".co.uk", ".org.uk" ],

    	    	    	# with this array, you can provide suggestions
			# for catchy suffixes to domain names.
    			# [ ".com", ".net", ".org",
			#   "online.com", "wired.com", "plugged.com",
    			#   "online.net", "wired.net", "plugged.net",
    			#   "online.org", "wired.org", "plugged.org" ],

    			],

	    # if the following is set, all data to/from OpenSRS will be logged
	    # to this file.  Note that the logfile will grow quickly under
	    # even moderate activity, so this should not be set, other than
	    #for debugging purposes
	    xml_logfile => '',
	    LIBPATH => $PATH_LIB,
	    );

# flags affecting cgi's behavior
%REG_SYSTEM = (
	       debug => 0,

	       # boolean: 1 is true, 0 is false

	       # allow clients to provide their own custom data
	       custom_tech_contact => 0,
	       custom_nameservers => 0,

               # 
               # ********ATTENTION********
               # A payment system must be implemented before
               # giving your customers access to turn auto renew
               # on for a new domain.

               #allow_auto_renew => 1,

               # ************************

	       F_VERIFY_CC     => 1, # verify credit card number
	       F_SEND_ORDERS   => 1, # send orders to $ADMIN_EMAIL
	       F_SEND_THANKYOU => 1, # send thank you note to customer
	       post_lookup => {
	       },

	       F_SUPPORT_CERTS      => 1, # determines if certificate operations                                          # are displayed/allowed
	       WEB_CERT_CGI	    => 'reg_cert.cgi', #URL for reg_cert.cgi
						       # realtime, not a coupon
);

$REG_SYSTEM{F_VERIFY_CC} = $REG_SYSTEM{F_VERIFY_CC} && $F_SHOW_CC_FIELDS;

%REGISTER = (
	     debug => 0,
	     );

%MANAGE = (
	   debug => 0,
	   notice_days => 60,   # show expire notice when <=60 days before expiry

           # the following will allow domains to be placed on registrar-lock,
	   # which will prevent them from being transferrable.
	   allow_domain_locking => 1,

           # 
           # ********ATTENTION********
           # A payment system must be implemented before
           # giving your customers access to on turn auto renew
           # or to renew their active domains
 
           allow_renewals => 0,
	   show_auto_renew => 0,
           allow_auto_renewal_message => 0,
 
           # ************************
           #
           # setting this will allow your customers to request their username /
           # password be sent to them through main manage.cgi screen.  The
           # password that is sent can be either that for the main user or the
           # subuser of the domain, and it can be sent to either the admin
           # contact, or the owner (registrant) of the domain.  Note that if
           # set to sub-user, and sub-user doesn't exist, an error will be
           # returned.
           allow_password_requests => 0,
           password_send_to_admin =>  0,
	   password_send_to_owner => 0,
	   password_send_subuser => 0,      # 1 to send sub-user password
           enable_cira_email_pwd => 0,
	   
	   #*************************
	   #
	   # setting this will allow your customers to modify nameservers
	   # when the domain is locked
	   allow_ns_change_locked_domain => 0,	   
	   );

@CA_LEGAL_TYPES_ORDER=qw (CCO CCT RES GOV EDU ASS HOP PRT TDM TRD PLT LAM TRS ABO INB LGR OMK MAJ);
%CA_LEGAL_TYPES = (
	'ABO' => 'Aboriginal Peoples (individuals or groups) indigenous to Canada',
	'ASS' => 'Canadian Unincorporated Association',
	'CCO' => 'Corporation (Canada or Canadian province or territory)',
	'CCT' => 'Canadian citizen',
	'EDU' => 'Canadian Educational Institution',
	'GOV' => 'Government or government entity in Canada',
	'HOP' => 'Canadian Hospital',
	'INB' => 'Indian Band recognized by the Indian Act of Canada',
	'LAM' => 'Canadian Library, Archive or Museum',
	'LGR' => 'Legal Representative of a Canadian Citizen or Permanent Resident',
	'MAJ' => 'Her Majesty the Queen',
	'OMK' => 'Official mark registered in Canada',
	'PLT' => 'Canadian Political Party',
	'PRT' => 'Partnership Registered in Canada',
	'RES' => 'Permanent Resident of Canada',
	'TDM' => 'Trade-mark registered in Canada (by a non-Canadian owner)',
	'TRD' => 'Canadian Trade Union',
	'TRS' => 'Trust established in Canada',
);

%CA_LANGUAGE_TYPES = ("EN" => "English", "FR" => "French");

%CA_NATIONALITIES = ("CND"	=> "Canadian citizen",
			"OTH"	=> "Foreign citizenship",
			"RES"	=> "Canadian permanent resident");

@CA_EXTRA_FIELDS = qw (job_title nationality midle_name language legal_type cira_member trademark description addr_corporative addr_street_name addr_street_cat addr_office title addr_address_number addr_orientation description legal_type member cwa);

%RENEW = (
	  F_SEND_EMAIL   => 1,   # send renewal info to $RENEW_EMAIL
	  F_SEND_EU_EMAIL=> 1,   # email thank-you to end user on renewal

	  PROCESS_LIST_IF_QUEUED => 1, 
	    #continue or stop processing renew 
	    #for list of domains when one of the renewal request has 
	    #been queued at OpenSRS server side
	  allow_password_requests => 0,
          password_send_to_admin =>  0,
          password_send_to_owner => 0,

    	  debug => 0,
	  capability => {	
	      '.com' => 1, '.net' => 1, '.org' => 1, '.uk' => 1,
	      '.ca' => 1, '.vc' => 0, '.cc' => 1, '.tv' => 1, '.de' => 1,
	      '.info' => 1, '.biz' => 1,'.us' => 1, '.name' => 1, '.cn' => 1,
	      '.fr' => 1,'.ch' =>1 ,'.nl' => 1, '.eu' => 1, '.be' => 1,
	      '.asia' => 1
	  }
);

################################################################
#### select type of mail delivery and adjust any necessary variables

#### 'sendmail' option is recommended for servers on UNIX based systems
#### if you do not have sendmail on your system, set $MAIL_TYPE to 'smtp'
%MAIL_SETTINGS = (
    MAIL_TYPE	=> "sendmail",	    # valid options: sendmail, smtp
#    MAIL_TYPE	=> "smtp",

    #### define this if you set $MAIL_TYPE = 'sendmail'
    #MAILPROG	=> '/usr/sbin/sendmail -t -oi -oem',
				    # path and args for sendmail
    MAILPROG	=> "cat >>mail.log",#for test system

    #### recommended option for servers on win32 platform
    #### define these values if you set $MAIL_TYPE = 'smtp'
    LOCALHOST	=> '',
    SMTP_SERVER	=> '',
    SMTP_PORT	=> 25,
);
#################################################################

#Flag to change behaviour on a client side only
# lookup - treat 'noservice' as available
# if sw_register/renew has been queued - show nice message
# otherwise
# no changes on a client side for lookup
# for sw_register/renew - error message from server
# even if request has been queued

$F_QUEUE_SUPPLIER_UNAVAILABLE = 1;	

# to queue or not to queue on a OpenSRS server side 
# can be changed via RWI per registry, not TLD.
# it is better to have F_QUEUE_SUPPLIER_UNAVAILABLE as 1 even
# if your OpenSRS settings do not allow queueing. 
# because client
# won't say anything about queueing, if server doesn't 
# queue the request  

#################################################################
# The version number shouldn't be modified, else it may cause inaccuracies in
# support response.
$OpenSRS::VERSION = "3.0.0";

#################################################################
# .de domains are normally disabled for the first 30 days after registration
# and need to be enabled by sending the activate_domain request.
# If you do not wish to show the end user this capability, make sure
# $SHOW_DNS_ERRORS = 0;
$SHOW_DNS_ERRORS = 1;

1;
