Refactor two-factor authentication logic
Updated two-factor authentication to streamline the time format handling using `time()` instead of `DateTime`, reducing code complexity. Also fixed a potential bug in `MY_Model.php` by checking the query object before accessing `num_rows()`.
This commit is contained in:
@@ -176,7 +176,7 @@ class MY_Model extends CI_Model{
|
||||
|
||||
if ( $fieldname ) $this->db->select( $fieldname );
|
||||
$query = $this->db->get( $this->tablename . ' AS T1' );
|
||||
if ( $query->num_rows() == 0 ) return FALSE;
|
||||
if ( ! $query || $query->num_rows() == 0 ) return FALSE;
|
||||
|
||||
if ( $row ){
|
||||
$row = $query->row();
|
||||
|
||||
Reference in New Issue
Block a user