[Gforge-devel] bug in cronjobs/daily_task_email.php?

Andrew C. Uselton acuselton at lbl.gov
Tue Sep 4 17:32:57 EDT 2007


Greetings GForge gang,
  I came across a bug in cronjobs/daily_task_email.php, and thought I'd 
report it here.  If this is not the right forum let me know. 

I am using:  gforge-4.5.16
When the daily_task_email.php script constructs its list of tasks that 
should be mentioned in an email it uses the getTasksForToday() method of 
the ProjectTasksForUser Object.  A task in that list is a ProjectTask 
object which is initialized with a ProjectGroup object amonst other 
things. 
that ProjectGroup object is, in turn, initialized with a Group object, 
and the group_project_id.  the last thing the ProjectGroup constructor 
does before returning to check:

            if (!$this->userCanView()) {
                $this->setPermissionDeniedError();
                $this->data_array = null;
                return false;
            }
Which check is based on the session_logedin() function:

function session_loggedin() {
    global $G_SESSION;

    if ($G_SESSION) {
        return $G_SESSION->isLoggedIn();
    } else {
        return false;
    }
}

In a cron job I'm betting there is no session.  Thus task reminders are 
not sent for any task listed as private.  I am guessing that is not the 
intended result. 

Has this already been resolved?  If not is there a suggested fix?  It 
seems like there ought to be a mechanism for either bypassing login 
checks in cron jobs, or alternatively establishing a session for the 
cron script. 
Cheers,
Andrew


More information about the Gforge-devel mailing list