I - Environment needed to install this code:
PHP4+ - also to be able to use captchas enable GD extension in php config file (php.ini)
Apache 1.3x or 2.x
mod_rewrite apache URL rewriting module
MySQL 4.1 or greater

You need to have https links (ie SSL) working on your server, so login screens
will be secure.


The code and documentation was written for a unix/linux environment.
However, it probably wouldn't take too much effort to get working in a
windows environment.

II - How to install this application:

Follow the below steps to install this:

1) Copy all the code into the directory you want to install. For
example, if you want the ORRD to be at website www.myorrd.com, then
copy the code into the directory that would be the base directory for
this website.  If you wish to install the files in the standard
location for a user (say orrdAdmin), then go to ~orrdAdmin on
www.myorrd.com, and run: tar xvzf orrdfiles.tgz. This will place the
files in the public_html  directory, and the base URL will be:
www.myorrd.com/~orrdAdmin/. Note: it is imperative that the base URL
you specify in step in 5.e and 5.f ends in a "/".  If not, you'll get
URLs like "www.myorrd.com/~orrdAdminorp" instead of
"www.myorrd.com/~orrdAdmin/orp".  

Note, if you aren't installing to a user account, you will need to
copy the files from the public_html directory that is created to the desired
base directory (make sure you don't miss the hidden ones).

2 - Create an empty database in MySQL. For example db_orrd

3 - In the public_html directory, set the execute and read permission
for the folder "install" so it can be accessed (chmod a+rx install),
and the write permission on the "conf" folder so it can be written to
(chmod a+w conf).  

4 - Assuming that you chose that the base URL for the ORRD will be
http://www.myorrd.com/,  go to the webpage:
http://www.myorrd.com/install/index.php 

This will initialize the database and set config options for the site.

5 - Give the following information: 

a)  database server:  name of the server where the mysql server is running
    e.g. dbserv.myorrd.com/
b) database name: name of the database which you have created in
   MySQL. e.g. db_orrd 
c) database user: database user id
d) database password:  password of the database user.
e) root url:  http://www.myorrd.com/
f) secure url: https://www.myorrd.com/

6 - This script will create all the tables in the database (will list
them as they are created. You may wish to print this off) along with
creating the admin account. Also updates the application config file. 
The admin id is "desorrd@mcmaster.ca" and password is "123456". 

If you make a MISTAKE in entering the information in step 5, you will
need to get your mysql database administrator to delete all the tables 
that were created in your database (this is where the printout comes
in handy) before you can restart the install script.  Otherwise, the
script fails when it tries to create these tables. You also need to
delete the file conf/config.inc.php if it exists.  Once the tables and 
conf/config.inc.php have been deleted, you can restart the install at step 3.

7 - Edit the file .htaccess if necessary to specify the RewriteBase
(ie. if your site is http://www.myorrd.com/site, RewriteBase is /site) 

8 - At the end, please set the permission back to 700 for the
"install" folder so that its not world readable (chmod og-rwx
install), and 755 (or similar) so "conf" folder can be read but not
written to (chmod og-w conf). 

9 - For scheduling (using cron) the weekly and daily weekly
notifications (weekly new resource submission announcements for all
users, and admin log e-mails), follow the steps mentioned in section V. 

10 - Log in as the admin user (use the user id and password from step
     6) and change the e-mail address (the userid) to the e-mail
address that you wish to receive ORRD related admin e-mails
at. Of course, you need to update the password right 
away as well.. Log in, and go to the "my profile" page to do this.
You will also want to change the "name" field to something other than
"DES ORRD Admin" as well (may need to log out of admin account and
back in to see the name change take effect).

One thing to consider: you will want to have a regular Full user
account for regular use plus the admin account for handling
administrative details.  Each will need a separate e-mail address
(user id) for the ORRD.

11 - While logged in as the admin user, go to the "application" page,
and set automatic approval to "ON."  This means that when a resource
it is automatically marked as "approved" and shows up in searches, and
weekly e-mail announces.  If you are finding that you are getting BULK
submissions, set this to OFF, but then FULL users will manually have
to set submissions to "approved," or they will not be visible.

Also, make sure "email confirmation per signup:" is set to
"ON". Setting it to "OFF" may have unexpected effects and is not advised.

You may also wish to check the "not approved resources," "rejected
resources," and "submited resources" if you wish to keep and eye on
these things.

12 - As admin user, go to the "help" page if you wish to interactively
modify the ORRD help page.

13) As admin user, you can go to the "keywords" page if you wish to
    add or delete keywords for your research area.  These will appear
    in the  "keywords: available" selection box for submission/editing
    of resources.

14) As admin user, you can go to the languages pages to add or delete
    languages. These will appear in the languages drop box for
    submission/editing of resources.  If the language requires special
    character sets in order to be displayed properly, there is no
    guarantee that they will be handled properly by the ORRD.

15) You should read the help page yourself (not as admin user),
    including PDF file downloadable from it.  The admin account can do
    many things that a FULL user can't such as manage users, view who
    modified what, and rollback changes (display a resources details,
    then click on the history link).

16) to invite FULL users, log in as admin and go to "send invitations"
    web page.  You can enter one e-mail address per line.

III - Change the application (ORRD) name:

Right now the application name is "ORRD" but to change it to any other
name (ie. to customize it for your research area), you can change it
in the following files.  Be careful to back up first, and not to
accidently change the php code.

WARNING:  I recommend that you back up your entire public_html
    directory before making any chnages, just to be safe.


1 - In file : templates/header.tpl just change the text
    <title>ORRD</title> to the desire name. 
2 - As admin user, you can edit the help page interactively.
3 - In templates/modules/modORMessages/help.tpl, you can edit line
    div class="panelTitleCaption">ORRD Help</div>
4 - In modules/modORMessages/modORMessages.php, you can edit line
    mail($admin['mail'],'ORRD comments',$message,'From:
    desorrd@cas.mcmaster.ca');
5 -  In  modules/modORProfiles/modORProfiles.class.php, you can edit
    lines:  if (mail($mail,'ORRD password recovery',$message,'From:
    desorrd@cas.mcmaster.ca'))  and if (mail($mail,'ORRD user
    registration',$message,'From: desorrd@cas.mcmaster.ca'))  and  
if (mail($mail,'ORRD change in email address',$message,'From:
    desorrd@cas.mcmaster.ca')) and 
if (mail($mail,'ORRD full member invitation',$message,'From:
    desorrd@cas.mcmaster.ca')) and Your account for ORRD appears to
    inactive and is about to be deleted. and 
if (mail($mail,'ORRD account warning',$message,'From:
    desorrd@cas.mcmaster.ca')) 
6 - You can change in the email sent as explained in section IV. We
    may have already covered some of these instances above.
7 - In conf/config.inc.php, you can change line: 
    define ('SITE_NAME',    'ORRD');
8 - images/header.gif contains ORRD. You would have to use a graphics
    program to modify this.  The file images/headerNotxt.gif is the
    same, but with the "ORRD" text removed.  You can use this as a
    starting point.  Just save it as "images/header.gif"  when you are
    done.  You may need to reload the ORRD web page a few times before
    you see the new image.

IV - Change email contents:

If you want to change the email message contents present in the email
sent by the ORRD, then you can change it in the following files. Just open
the file and search the function name and change it there. But you have to
be carefull not to change the php code accidently. 

Right now application is sending following emails. For the folllowing emails, the php file is \modules\modORProfiles\modORProfiles.class.php 
1 - New account registering => function name: send_confirmation
2 - Full member invitation email => function name: send_invitation 
3 - Forget password email => function name: send_recover
4 - Change in email address =>  function name: send_changed_email_confirmation
5 - Warning email =>  function name: send_warning

And for the following emails, the file name is also mentioned:
6 - Weekly email notification => file name : cron.php function name:
send_notification 
7 - Admin daily email notification => file name : cron_day.php
function name: send_admin_notification 
8 - Admin weekly notification => file name : cron.php function name:
send_admin_notification 

V - Scheduling cron jobs:

There are two schedule job files.
1 - public_html/bin/runORRDdaily - should run daily to send the daily
    notifications of new submission to the administrator (if he has
enabled this setting). It calls:  
wget http://www.myorrd.com/cron_day.php.

You will need to edit runORRDdaily to set correct base URL.  Also,
make sure it is only executable and readable by yourself (chmod u+rwx
runORRDdaily; chmod og-rwx runORRDdaily).


2 - public_html/bin/runORRDwkly - should run weekly to send weekly email
 notifications to all the members who have enabled this setting in their
 profile. It also sends adminstrator the weekly notification of "Not 
approved" and "Rejected" resources (if enables). It calls:
 wget http://www.myorrd.com/cron.php

You will need to edit runORRDwkly to set correct base URL. Also,
make sure it is only executable and readable by yourself (chmod u+rwx
runORRDwkly; chmod og-rwx runORRDwkly).


Open your operating system command prompt and open crontab by writing
"crontab -e" (you probably want to set the EDITOR variable to "vi"
first. For BASH shell, use: export EDITOR=vi )

Now add the following two lines:
0 0 * * *  $HOME/public_html/bin/runORRDdaily 2>&1 /dev/null
0 1 * * 1  $HOME/public_html/bin/runORRDwkly 2>&1 /dev/null

Then save and exit file. To test the script any time, just open the
command prompt and execute the script (runORRDdaily or runORRDwkly). 

The cron jobs place output files in the "public_html/output/" directory.  These
should be circular (ie. start overwriting themselves), but you may
wish to check on them now and then just to be safe.  The files in this
directory can be safely deleted (don't confuse them with the php
scripts in public_html directory).


VI - fix return address in some scripts.

Currently, the ORRD software has a bug.  When you change the admin
e-mail address, this does not get automatically updated in some
files.  In step 10, you should have changed the admin e-mail address
(userid) to the one you will be using for your ORRD (or you won't get
your ORRD related e-mails).  You then need to replace every instance
(there may be more than one per file) of "desorrd@cas.mcmaster.ca"
with your new admin e-mail address, in the following files:

public_html/cron_day.php
public_html/cron.php
public_html/modules/modORMessages/modORMessages.php
public_html/modules/modORProfiles/modORProfiles.class.php




