public function userAction() { require_once 'models/homeModel.php'; $model = new homeModel(); if ($_POST['send'] == "adduser") { # make password $_POST['pass'] = $model->makeApiKey("7"); # make apikey $_POST['apikey'] = $model->makeApiKey("32"); # add user in db $newUser = $model->insertUser($_POST); } if ($_POST['send'] == "edituser") { $editUser = $model->updateUser($_POST); } $users = $model->getAllUsers(); $this->_view->title = TITEL_USER; $this->_view->users = $users; $this->_view->display('user/index.tpl.php'); }