00001 <?php
00002
00003
00004
00005
00006
00007
00008 class RegisterUsersBaseCommand extends CommandChain {
00009
00010
00011
00012 public function get_name() {
00013 return 'register';
00014 }
00015
00016
00017
00018
00019 protected function do_execute() {
00020 $ret = new Status();
00021
00022 $create_cmd = CommandsFactory::create_command('users', 'create', $this->get_params());
00023 $ret->merge($create_cmd->execute());
00024 if ($ret->is_ok()) {
00025 $user = $create_cmd->get_result();
00026 $this->set_result($user);
00027
00028 $params_double_opt_in = array(
00029 'id_item' => $user->id,
00030 'expirationdate' => time() + 7 * 24 * 60 * 60,
00031 'action' => 'createaccount'
00032 );
00033 $this->append(CommandsFactory::create_command('confirmations', 'create', $params_double_opt_in));
00034 }
00035 return $ret;
00036 }
00037 }