Esempio n. 1
0
     case AMA_TYPE_SUPERTUTOR:
     case AMA_TYPE_TUTOR:
         $userObj = new ADAPractitioner($user_dataAr);
         break;
     case AMA_TYPE_SWITCHER:
         $userObj = new ADASwitcher($user_dataAr);
         break;
     case AMA_TYPE_ADMIN:
         $userObj = new ADAAdmin($user_dataAr);
         break;
 }
 $userObj->setPassword($_POST['user_password']);
 $result = MultiPort::addUser($userObj, array($_POST['user_tester']));
 if ($result > 0) {
     if ($userObj instanceof ADAAuthor) {
         AdminUtils::performCreateAuthorAdditionalSteps($userObj->getId());
     } elseif ($userObj instanceof ADASwitcher || $userObj instanceof ADAPractitioner) {
         AdminUtils::createUploadDirForUser($userObj->getId());
     }
     $message = translateFN("Utente aggiunto con successo");
     header('Location: ' . $userObj->getHomePage($message));
     exit;
 } else {
     /*
      * Qui bisogna ricreare il form per la registrazione passando in $errorsAr['registration_error'] 
      * $result e portando li' dentro lo switch su $result
      */
     $errorsAr['registration_error'] = $result;
     unset($_POST['submit']);
     $user_dataAr = $_POST;
     $testers_dataAr = $common_dh->get_all_testers(array('id_tester', 'nome'));