table_common_member_secwhite.php 767 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_common_seccheck.php 33625 2013-07-19 06:03:49Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_member_secwhite extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_member_secwhite';
  15. $this->_pk = 'uid';
  16. parent::__construct();
  17. }
  18. public function check($uid) {
  19. DB::delete($this->_table, "dateline<".(TIMESTAMP-86400));
  20. return DB::result_first("SELECT COUNT(*) FROM %t WHERE uid=%d", array($this->_table, $uid));
  21. }
  22. public function add($uid) {
  23. DB::insert($this->_table, array('uid' => $uid, 'dateline' => TIMESTAMP), false, true);
  24. }
  25. }
  26. ?>