Example #1
0
 /**
  * Save user info action
  */
 public function usersaveAction()
 {
     $this->_checkCanEdit();
     $pass = Request::post('pass', 'string', false);
     if ($pass) {
         Request::updatePost('pass', Utils::hash($pass));
     }
     $object = $this->getPostedData($this->_module);
     /*
      * New user
      */
     if (!$object->getId()) {
         $date = date('Y-m-d H:i:s');
         $ip = '127.0.0.1';
         $object->registration_date = $date;
         $object->confirmation_date = $date;
         $object->registration_ip = $ip;
         $object->confirmed = true;
         $object->last_ip = $ip;
     }
     if (!($recId = $object->save())) {
         Response::jsonError($this->_lang->get('CANT_EXEC'));
     }
     Response::jsonSuccess();
 }
Example #2
0
 public function testUpdatePost()
 {
     Request::updatePost('key', 'val');
     $this->assertEquals(Request::post('key', 'string', false), 'val');
     $this->assertEquals(Request::post('key3', 'string', false), false);
 }