Exemplo n.º 1
0
 public function updateFromPost(Data_User $user)
 {
     $responseData = array_fill(0, $this->foodle->getNofColumns(), '0');
     $this->user = $user;
     $this->invitation = false;
     if (!empty($_REQUEST['myresponse'])) {
         foreach ($_REQUEST['myresponse'] as $yes) {
             $pn = self::parsePostN($yes);
             $responseData[$pn['key']] = $pn['value'];
         }
     }
     $this->userid = $user->userid;
     $this->username = $user->username;
     if (empty($this->username) && isset($_REQUEST['username'])) {
         $this->username = FoodleUtils::cleanUsername($_REQUEST['username']);
     }
     $this->email = $user->email;
     $this->notes = $_REQUEST['comment'];
     #$this->updated = 'now';
     $this->response = array('type' => 'manual', 'data' => $responseData);
     if (isset($_REQUEST['setconfirm'])) {
         $this->response['confirm'] = strip_tags($_REQUEST['setconfirm']);
     }
     #		print_r($this->response); exit;
 }