Admins can now add other users

This commit is contained in:
Ismo Vuorinen
2013-07-18 12:57:43 +03:00
parent b31c50cd77
commit 140dcd21d5
5 changed files with 163 additions and 2 deletions

View File

@@ -142,6 +142,14 @@ class Yllapito extends CI_Controller
$page_title = array();
switch ($action) {
case 'add':
$page_title = array('Lisää uusi käyttäjä', 'Käyttäjät');
break;
case 'create':
$new_id = $this->users->add($this->input->post());
$redir = (! $new_id) ? '' : 'show/'.$new_id;
redirect('yllapito/users/'.$redir);
break;
case 'delete':
$this->user->delete($user_id);
redirect('yllapito/users');