Browse Source

* Fixed PM's not being decrypted with `list_pms()` https://github.com/emreakay/CodeIgniter-Aauth/issues/145

* Fixed `get_pm()` method to fetch correct PM https://github.com/emreakay/CodeIgniter-Aauth/issues/145
develop
Paul Canning 9 years ago
parent
commit
b42202780d
  1. 17
      application/libraries/Aauth.php

17
application/libraries/Aauth.php

@ -1992,7 +1992,20 @@ class Aauth {
$query = $this->aauth_db->order_by('id','DESC'); $query = $this->aauth_db->order_by('id','DESC');
$query = $this->aauth_db->get( $this->config_vars['pms'], $limit, $offset); $query = $this->aauth_db->get( $this->config_vars['pms'], $limit, $offset);
return $query->result();
$result = $query->result();
if ($this->config_vars['pm_encryption']){
$this->CI->load->library('encrypt');
foreach ($result as $k => $r)
{
$result[$k]->title = $this->CI->encrypt->decode($r->title);
$result[$k]->message = $this->CI->encrypt->decode($r->message);
}
}
return $result;
} }
//tested //tested
@ -2015,7 +2028,7 @@ class Aauth {
$query = $this->aauth_db->where('id', $pm_id); $query = $this->aauth_db->where('id', $pm_id);
$query = $this->aauth_db->where('receiver_id', $user_id); $query = $this->aauth_db->where('receiver_id', $user_id);
$query = $this->aauth_db->or_where('sender_id', $user_id); //$query = $this->aauth_db->or_where('sender_id', $user_id);
$query = $this->aauth_db->get( $this->config_vars['pms'] ); $query = $this->aauth_db->get( $this->config_vars['pms'] );
if ($query->num_rows() < 1) { if ($query->num_rows() < 1) {

Loading…
Cancel
Save