Skip to content

Commit a67be82

Browse files
committed
admin restrictions on login history
1 parent e14eb8e commit a67be82

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

application/controllers/user.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -335,30 +335,30 @@ function loginHistoy($userId = NULL)
335335
{
336336
if($this->isAdmin() == TRUE)
337337
{
338-
$userId = $this->session->userdata("userId");
338+
$this->loadThis();
339339
}
340340
else
341341
{
342342
$userId = ($userId == NULL ? $this->session->userdata("userId") : $userId);
343-
}
344343

345-
$searchText = $this->input->post('searchText');
344+
$searchText = $this->input->post('searchText');
346345

347-
$data["userInfo"] = $this->user_model->getUserInfoById($userId);
346+
$data["userInfo"] = $this->user_model->getUserInfoById($userId);
348347

349-
$data['searchText'] = $searchText;
350-
351-
$this->load->library('pagination');
352-
353-
$count = $this->user_model->loginHistoryCount($userId);
348+
$data['searchText'] = $searchText;
349+
350+
$this->load->library('pagination');
351+
352+
$count = $this->user_model->loginHistoryCount($userId);
354353

355-
$returns = $this->paginationCompress ( "login-history/".$userId."/", $count, 5, 3);
354+
$returns = $this->paginationCompress ( "login-history/".$userId."/", $count, 5, 3);
356355

357-
$data['userRecords'] = $this->user_model->loginHistory($userId, $returns["page"], $returns["segment"]);
358-
359-
$this->global['pageTitle'] = 'CodeInsect : User Login History';
360-
361-
$this->loadViews("loginHistory", $this->global, $data, NULL);
356+
$data['userRecords'] = $this->user_model->loginHistory($userId, $returns["page"], $returns["segment"]);
357+
358+
$this->global['pageTitle'] = 'CodeInsect : User Login History';
359+
360+
$this->loadViews("loginHistory", $this->global, $data, NULL);
361+
}
362362
}
363363
}
364364

application/views/includes/header.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
<i class="fa fa-history"></i>
5959
</a>
6060
<ul class="dropdown-menu">
61-
<li class="header"> Last Login : <i class="fa fa-clock-o"></i> <?= $last_login ?></li>
61+
<li class="header"> Last Login : <i class="fa fa-clock-o"></i> <?= empty($last_login) ? "First Time Login" : $last_login; ?></li>
6262
</ul>
6363
</li>
6464
<!-- User Account: style can be found in dropdown.less -->

0 commit comments

Comments
 (0)