table_common_seccheck.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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_seccheck extends discuz_table
  12. {
  13. private $_uids = array();
  14. public function __construct() {
  15. $this->_table = 'common_seccheck';
  16. $this->_pk = 'ssid';
  17. parent::__construct();
  18. }
  19. public function delete_expiration($ssid = 0) {
  20. if($ssid) {
  21. $ssid = dintval($ssid);
  22. DB::delete($this->_table, "ssid='$ssid'");
  23. }
  24. DB::delete($this->_table, TIMESTAMP."-dateline>600");
  25. DB::delete($this->_table, "verified>4");
  26. DB::delete($this->_table, "succeed>1");
  27. }
  28. public function update_verified($ssid) {
  29. DB::query("UPDATE %t SET verified=verified+1 WHERE ssid=%d", array($this->_table, $ssid));
  30. }
  31. public function update_succeed($ssid) {
  32. DB::query("UPDATE %t SET verified=verified+1,succeed=succeed+1 WHERE ssid=%d", array($this->_table, $ssid));
  33. }
  34. public function truncate() {
  35. DB::query("TRUNCATE %t", array($this->_table));
  36. }
  37. }
  38. ?>