Exemplo n.º 1
0
 public function get_by_username($username)
 {
     $tmp = $this->db->select_row('SELECT id, username FROM web_users WHERE username = "******"');
     $entity = null;
     if (!empty($tmp)) {
         $entity = new WebuserEntity();
         $entity->setId($tmp['id']);
         $entity->setUsername($tmp['username']);
     }
     return $entity;
 }
Exemplo n.º 2
0
 public function add()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $users_collection = new WebusersCollection();
         $user = new WebuserEntity();
         $user->setUsername($_POST['username']);
         $user->setPassword($_POST['password']);
         $users_collection->save($user);
         header('Location: index.php?frontcontroller=index');
     }
     $this->loadView('website/users_add');
 }