コード例 #1
0
 /**
  * Display account form for new users.
  */
 function account()
 {
     $this->validate();
     $this->setupTemplate(true);
     $conference =& Request::getConference();
     $schedConf =& Request::getSchedConf();
     if ($conference != null && $schedConf != null) {
         // We're trying to create an account for a specific scheduled conference
         import('classes.user.form.CreateAccountForm');
         if (checkPhpVersion('5.0.0')) {
             // WARNING: This form needs $this in constructor
             $regForm = new CreateAccountForm();
         } else {
             $regForm =& new CreateAccountForm();
         }
         if ($regForm->isLocaleResubmit()) {
             $regForm->readInputData();
         } else {
             $regForm->initData();
         }
         $regForm->display();
     } elseif ($conference != null) {
         // We have the conference, but need to select a scheduled conference
         $schedConfDao =& DAORegistry::getDAO('SchedConfDAO');
         $schedConfs =& $schedConfDao->getEnabledSchedConfs($conference->getId());
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('pageHierarchy', array(array(Request::url(null, 'index', 'index'), $conference->getConferenceTitle(), true)));
         $templateMgr->assign('source', Request::getUserVar('source'));
         $templateMgr->assign_by_ref('schedConfs', $schedConfs);
         $templateMgr->display('user/createAccountConference.tpl');
     } else {
         // We have neither conference nor scheduled conference; start by selecting a
         // conference and we'll end up above after a redirect.
         $conferencesDao =& DAORegistry::getDAO('ConferenceDAO');
         $conferences =& $conferencesDao->getConferences(true);
         $templateMgr =& TemplateManager::getManager();
         $templateMgr->assign('source', Request::getUserVar('source'));
         $templateMgr->assign_by_ref('conferences', $conferences);
         $templateMgr->display('user/createAccountSite.tpl');
     }
 }