Skip to content

Commit 3932bef

Browse files
committed
Merge pull request #1 from emreakay/2.5-stable
2.5 stable
2 parents a55f9c3 + 35e3a41 commit 3932bef

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

application/libraries/Aauth.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* @copyright 2014-2016 Emre Akay
1515
*
16-
* @version 2.5.0
16+
* @version 2.5.2
1717
*
1818
* @license LGPL
1919
* @license http://opensource.org/licenses/LGPL-3.0 Lesser GNU Public License
@@ -1098,7 +1098,7 @@ public function user_exist_by_username( $name ) {
10981098
* @return bool
10991099
*/
11001100
public function user_exist_by_name( $name ) {
1101-
return $this->user_exist_by_name($name);
1101+
return $this->user_exist_by_username($name);
11021102
}
11031103

11041104
/**
@@ -1992,7 +1992,20 @@ public function list_pms($limit=5, $offset=0, $receiver_id=NULL, $sender_id=NULL
19921992

19931993
$query = $this->aauth_db->order_by('id','DESC');
19941994
$query = $this->aauth_db->get( $this->config_vars['pms'], $limit, $offset);
1995-
return $query->result();
1995+
1996+
$result = $query->result();
1997+
1998+
if ($this->config_vars['pm_encryption']){
1999+
$this->CI->load->library('encrypt');
2000+
2001+
foreach ($result as $k => $r)
2002+
{
2003+
$result[$k]->title = $this->CI->encrypt->decode($r->title);
2004+
$result[$k]->message = $this->CI->encrypt->decode($r->message);
2005+
}
2006+
}
2007+
2008+
return $result;
19962009
}
19972010

19982011
//tested
@@ -2014,8 +2027,10 @@ public function get_pm($pm_id, $user_id = NULL, $set_as_read = TRUE){
20142027
}
20152028

20162029
$query = $this->aauth_db->where('id', $pm_id);
2030+
$query = $this->aauth_db->group_start();
20172031
$query = $this->aauth_db->where('receiver_id', $user_id);
20182032
$query = $this->aauth_db->or_where('sender_id', $user_id);
2033+
$query = $this->aauth_db->group_end();
20192034
$query = $this->aauth_db->get( $this->config_vars['pms'] );
20202035

20212036
if ($query->num_rows() < 1) {
@@ -2055,8 +2070,10 @@ public function delete_pm($pm_id, $user_id = NULL){
20552070
}
20562071

20572072
$query = $this->aauth_db->where('id', $pm_id);
2073+
$query = $this->aauth_db->group_start();
20582074
$query = $this->aauth_db->where('receiver_id', $user_id);
20592075
$query = $this->aauth_db->or_where('sender_id', $user_id);
2076+
$query = $this->aauth_db->group_end();
20602077
$query = $this->aauth_db->get( $this->config_vars['pms'] );
20612078
$result = $query->row();
20622079
if ($user_id == $result->sender_id){

0 commit comments

Comments
 (0)