Nonce.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. // This file is part of GNU social - https://www.gnu.org/software/social
  3. //
  4. // GNU social is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // GNU social is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with GNU social. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * Table Definition for nonce
  18. */
  19. defined('GNUSOCIAL') || die();
  20. class Nonce extends Managed_DataObject
  21. {
  22. ###START_AUTOCODE
  23. /* the code below is auto generated do not remove the above tag */
  24. public $__table = 'nonce'; // table name
  25. public $consumer_key; // varchar(191) primary_key not_null not 255 because utf8mb4 takes more space
  26. public $tok; // char(32)
  27. public $nonce; // char(32) primary_key not_null
  28. public $ts; // datetime() primary_key not_null
  29. public $created; // datetime()
  30. public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
  31. /* the code above is auto generated do not remove the tag below */
  32. ###END_AUTOCODE
  33. /**
  34. * Compatibility hack for PHP 5.3
  35. *
  36. * The statusnet.links.ini entry cannot be read because "," is no longer
  37. * allowed in key names when read by parse_ini_file().
  38. *
  39. * @return array
  40. * @access public
  41. */
  42. public function links()
  43. {
  44. return array('consumer_key,token' => 'token:consumer_key,token');
  45. }
  46. public static function schemaDef()
  47. {
  48. return array(
  49. 'description' => 'OAuth nonce record',
  50. 'fields' => array(
  51. 'consumer_key' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'unique identifier, root URL'),
  52. 'tok' => array('type' => 'char', 'length' => 32, 'description' => 'buggy old value, ignored'),
  53. 'nonce' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'nonce'),
  54. 'ts' => array('type' => 'datetime', 'not null' => true, 'description' => 'timestamp sent'),
  55. 'created' => array('type' => 'datetime', 'description' => 'date this record was created'),
  56. 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
  57. ),
  58. 'primary key' => array('consumer_key', 'ts', 'nonce'),
  59. );
  60. }
  61. }