/** 
  * Process stored event
  */
 function process()
 {
     /* @var $backendSystem BackendSystem */
     $backendSystem = Backend::instance('System');
     $backendAliases = Backend::instance('Aliases');
     $backendSVN = Backend::instance('SVN');
     $backendCVS = Backend::instance('CVS');
     $backendMailingList = Backend::instance('MailingList');
     //TODO:
     // User: unix_status vs status??
     // Private project: if codeaxadm is not member of the project: check access to SVN (incl. ViewVC), CVS, Web...
     // CVS Watch?
     // TODO: log event in syslog?
     // TODO: check that there is no pending event??? What about lower priority events??
     // First, force NSCD refresh to be sure that uid/gid will exist on next
     // actions
     $backendSystem->flushNscdAndFsCache();
     // remove deleted releases and released files
     if (!$backendSystem->cleanupFRS()) {
         $this->error("An error occured while moving FRS files");
         return false;
     }
     // Force global updates: aliases, CVS roots, SVN roots
     $backendAliases->setNeedUpdateMailAliases();
     // Remove temporary files generated by aborted CVS commits
     $backendCVS->cleanup();
     // Check mailing lists
     // (re-)create missing ML
     $mailinglistdao = new MailingListDao();
     $dar = $mailinglistdao->searchAllActiveML();
     foreach ($dar as $row) {
         $list = new MailingList($row);
         if (!$backendMailingList->listExists($list)) {
             $backendMailingList->createList($list->getId());
         }
         // TODO what about lists that changed their setting (description, public/private) ?
     }
     $project_manager = ProjectManager::instance();
     foreach ($project_manager->getProjectsByStatus(Project::STATUS_ACTIVE) as $project) {
         // Recreate project directories if they were deleted
         if (!$backendSystem->createProjectHome($project->getId())) {
             $this->error("Could not create project home");
             return false;
         }
         if ($project->usesCVS()) {
             $backendCVS->setCVSRootListNeedUpdate();
             if (!$backendCVS->repositoryExists($project)) {
                 if (!$backendCVS->createProjectCVS($project->getId())) {
                     $this->error("Could not create/initialize project CVS repository");
                     return false;
                 }
                 $backendCVS->setCVSPrivacy($project, !$project->isPublic() || $project->isCVSPrivate());
             }
             $backendCVS->createLockDirIfMissing($project);
             // check post-commit hooks
             if (!$backendCVS->updatePostCommit($project)) {
                 return false;
             }
             $backendCVS->updateCVSwriters($project->getID());
             $backendCVS->updateCVSWatchMode($project->getID());
             // Check ownership/mode/access rights
             $backendCVS->checkCVSMode($project);
         }
         if ($project->usesSVN()) {
             if (!$backendSVN->repositoryExists($project)) {
                 if (!$backendSVN->createProjectSVN($project->getId())) {
                     $this->error("Could not create/initialize project SVN repository");
                     return false;
                 }
                 $backendSVN->updateSVNAccess($project->getId());
                 $backendSVN->setSVNPrivacy($project, !$project->isPublic() || $project->isSVNPrivate());
                 $backendSVN->setSVNApacheConfNeedUpdate();
             } else {
                 $backendSVN->checkSVNAccessPresence($project->getId());
             }
             $backendSVN->updateHooks($project);
             // Check ownership/mode/access rights
             $backendSVN->checkSVNMode($project);
         }
     }
     $logger = new BackendLogger();
     if (is_file($logger->getFilepath())) {
         $backendSystem->changeOwnerGroupMode($logger->getFilepath(), ForgeConfig::get('sys_http_user'), ForgeConfig::get('sys_http_user'), 0640);
     }
     // If no codendi_svnroot.conf file, force recreate.
     if (!is_file($GLOBALS['svn_root_file'])) {
         $backendSVN->setSVNApacheConfNeedUpdate();
     }
     try {
         EventManager::instance()->processEvent(Event::PROCCESS_SYSTEM_CHECK, array('logger' => $logger));
     } catch (Exception $exception) {
         $this->error($exception->getMessage());
         return false;
     }
     $this->expireRestTokens(UserManager::instance());
     $this->done();
     return true;
 }