mirror of
https://github.com/Ekokumppanit/ystavakylaecard.git
synced 2026-01-26 03:04:00 +00:00
yllapito/users method now takes 2 arguments $action and $user_id, no need for $section
This commit is contained in:
@@ -125,7 +125,7 @@ class Yllapito extends CI_Controller
|
|||||||
$this->load->view('_footer', $data);
|
$this->load->view('_footer', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function users($section = 'listall', $user_id = null, $action = null)
|
public function users($action = 'listall', $user_id = null)
|
||||||
{
|
{
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
redirect("/yllapito/kirjaudu");
|
redirect("/yllapito/kirjaudu");
|
||||||
@@ -140,12 +140,10 @@ class Yllapito extends CI_Controller
|
|||||||
);
|
);
|
||||||
$page_title = array();
|
$page_title = array();
|
||||||
|
|
||||||
switch ($section) {
|
switch ($action) {
|
||||||
case 'modify':
|
case 'delete':
|
||||||
if ($action == "delete" && is_numeric($user_id)) {
|
$this->user->delete($user_id);
|
||||||
$this->user->delete($user_id);
|
redirect('yllapito/users');
|
||||||
}
|
|
||||||
redirect("yllapito/users");
|
|
||||||
break;
|
break;
|
||||||
case 'show':
|
case 'show':
|
||||||
$data['userid'] = $user_id;
|
$data['userid'] = $user_id;
|
||||||
@@ -159,7 +157,7 @@ class Yllapito extends CI_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data['page_title'] = array_merge($page_title, $data['page_title']);
|
$data['page_title'] = array_merge($page_title, $data['page_title']);
|
||||||
$page = 'yllapito/users_'.$section;
|
$page = 'yllapito/users_'.$action;
|
||||||
|
|
||||||
$this->load->view('_header', $data);
|
$this->load->view('_header', $data);
|
||||||
$this->load->view($page, $data);
|
$this->load->view($page, $data);
|
||||||
|
|||||||
Reference in New Issue
Block a user