Skip to content

Commit

Permalink
fixed get_pm() & delete_pm()
Browse files Browse the repository at this point in the history
  • Loading branch information
REJack committed Jun 1, 2016
1 parent 26ea41d commit 2e08204
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion application/libraries/Aauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2027,8 +2027,10 @@ public function get_pm($pm_id, $user_id = NULL, $set_as_read = TRUE){
}

$query = $this->aauth_db->where('id', $pm_id);
$query = $this->aauth_db->group_start();
$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->group_end();
$query = $this->aauth_db->get( $this->config_vars['pms'] );

if ($query->num_rows() < 1) {
Expand Down Expand Up @@ -2068,8 +2070,10 @@ public function delete_pm($pm_id, $user_id = NULL){
}

$query = $this->aauth_db->where('id', $pm_id);
$query = $this->aauth_db->group_start();
$query = $this->aauth_db->where('receiver_id', $user_id);
$query = $this->aauth_db->or_where('sender_id', $user_id);
$query = $this->aauth_db->group_end();
$query = $this->aauth_db->get( $this->config_vars['pms'] );
$result = $query->row();
if ($user_id == $result->sender_id){
Expand Down

0 comments on commit 2e08204

Please sign in to comment.