示例#1
0
 public function signupFormCallback($args, $action, $mem_redirect, $mem_resend)
 {
     //$mem_redirect->post = $vars;
     foreach ($args->post as $key => $value) {
         $_SESSION['SignupBWVars'][$key] = $value;
     }
     $StrLog = "Entering signupFormCallback ";
     if (!empty($args->post["Username"])) {
         $StrLog = $StrLog . " Username=[" . $args->post["Username"] . "]";
     }
     if (!empty($args->post["geonameid"])) {
         $StrLog = $StrLog . " geonameid=[" . $args->post["geonameid"] . "]";
     }
     if (!empty($args->post["iso_date"])) {
         $StrLog = $StrLog . " iso_date=[" . $args->post["iso_date"] . "]";
     }
     MOD_log::get()->write($StrLog, "Signup");
     $vars = $_SESSION['SignupBWVars'];
     $request = $args->request;
     if (isset($request[1]) && $request[1] == '4') {
         $model = new SignupModel();
         $errors = $model->checkRegistrationForm($vars);
         if (count($errors) > 0) {
             // show form again
             $_SESSION['SignupBWVars']['errors'] = $errors;
             $mem_redirect->post = $vars;
             return false;
         }
         $model->polishFormValues($vars);
         if (!($idTB = $model->registerTBMember($vars))) {
             // MyTB registration didn't work
         } else {
             // signup on MyTB successful, yeah.
             $id = $model->registerBWMember($vars);
             $_SESSION['IdMember'] = $id;
             $vars['feedback'] .= $model->takeCareForNonUniqueEmailAddress($vars['email']);
             $vars['feedback'] .= $model->takeCareForComputerUsedByBWMember();
             $model->writeFeedback($vars['feedback']);
             $View = new SignupView($model);
             // TODO: BW 2007-08-19: $_SYSHCVOL['EmailDomainName']
             // look at that ... a two years plus old todo :) ... and now four years plus :P
             // finally 6 years and counting...
             define('DOMAIN_MESSAGE_ID', 'bewelcome.org');
             // TODO: config
             $View->registerMail($vars, $id, $idTB);
             $View->signupTeamMail($vars);
             unset($_SESSION['IdMember']);
             return 'signup/finish';
         }
     }
     return false;
 }