Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 475a5cbb

Přidáno uživatelem Ondřej Fibich před téměř 9 roky(ů)

refs #1025: Fix issue in redirection reactivation due to old whitelist records

Zobrazit rozdíly:

application/models/member.php
$member_id = $this->id;
$mw = new Members_whitelist_Model();
return $mw->get_member_whitelists($member_id)->count() > 0;
return $mw->is_whitelisted_now($member_id);
}
/**
application/models/members_whitelist.php
ORDER BY permanent DESC, until DESC, since DESC
", $member_id);
}
/**
* Checks whether a member with the specified ID is whitelisted right now.
*
* @param int $member_id
* @return boolean
*/
public function is_whitelisted_now($member_id)
{
return $this->db->query("
SELECT COUNT(mw.id) AS count
FROM members_whitelists mw
WHERE mw.member_id = ? AND mw.since <= CURDATE()
AND mw.until >= CURDATE()
", $member_id)->current()->count > 0;
}
/**
* Checks if the given interval is unique in users whitelists

Také k dispozici: Unified diff