Fixed #504

Created a default/ fall back password algorithm.
fixed a minor bug introduced in the last commit.
Add "mail" as default email sending method in scheduled email
Change mysql NOW() to php date

In case of DB and PHP on the different timezone, e.g. different setting
or different server, using NOW() will cause problem.
fixed email schedule's getEmailsToSend function
fixed broken tests

The tests were broken because the due dates set in the sample data
has past which causes the events to be overdue, which was not what
we expected in tests. The sample data now sets the due dates to the
next year. Some of the tests have also been modifed to accomodate
for the more "flexible" due dates.
Fix uninitialized object exceptions
Bump version to 3.0.7
Fixed a timezone bug.

If the the timezone is changed from local time in php.ini,
the event model still uses the machine's local time zone. The reason
is it is still using sql's NOW() function. This has now been fixed.

The same modification was already made in 3.1 / dev.
Modified courses/edit for instructor in no faculties

When instructors are created with no faculties, their list of
available instructors is empty. This causes a problem when the
course is edited (Eg. change the title). Since the list of instructors
would be empty, the list of selected instructors would also be empty.
This will cause the list of instructors in the course to be removed.

I have now fixed the problem by appending the course's instructors
to the beginning of the list of available instructors whether
the instructors are in the same faculties or not.
Added a small event model test

I have added a small test for event model to test the due_in
attribute. The test checks that the model uses the php time zone
instead of the sql time zone when calculating the due_in field.
The test uses assertWithinMargin, because the difference between
the time within the test and time used by the model may be
off by a few seconds depending on the speed of the machine. The
difference is alright since we mostly care that the correct time
zone is used which has differences measure in hours.

The test will have to be modified in version 3.1 to accomodate for
the possibility that the timezone is set in system parameters and
not in php.ini.
Fixed courses edit

A bug was found when user A edits the user B's profile if User A does
not have access to all of the courses user B is enrolled in. The problem
was user B would be unenrolled from the courses User A does not have
access to.

I have also copied the fix from dev for another problem which is
if all the courses are unselected, the user would not be unenrolled
from any of the courses.
Fixed courses edit for instructors and tutors

I have fixed unenrolling all courses for instructors and tutors
from courses edit similar to the fix for students. When tutors
are unenrolled using this method, they are also removed from
the groups they are in.
Fixed survey group member model tests

I have added the missing fixtures
Fixed reported bug in student index

The bug is events that are not released (release dates are in the
future) are placed in the expired section, when they should not be
displayed at all. The reason behind the bug is events in the above
situation are fulfills one of the filters requirements (no submissions
and date is before result_release_date_end.

To fix this bug I have added an extra condition which is the current
date and time has to also be after release_date_end for the event
to be placed in the expired section.

I have added an extra event to test this bug. The event is set to
be released "next" year on July 31st. Using the existing tests, we
can check that the bug is permanently fixed. The new event should not
appear in the expired array or any other events' arrays.
Fixed tests broken from last commit

With the new event added to the sample data, some tests are broken
due to difference in number of events.
ease enter the commit message for your changes. Lines starting
Merge branch 'studentEvalBug' into dev

Conflicts:
	app/config/sql/ipeer_samples_data.sql
	app/controllers/components/password_generator.php
	app/tests/cases/controllers/courses_controller.test.php
	app/tests/cases/controllers/home_controller.test.php
Merge branch 'courseBug' of github.com:ubc/iPeer into dev

Conflicts:
	app/controllers/users_controller.php
	app/models/user.php
	app/tests/cases/models/survey_group_member.test.php
Merge branch 'timezoneBug' into dev

Conflicts:
	app/tests/cases/models/event.test.php