ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ConsumerNonce.php
Go to the documentation of this file.
1<?php
2
4
15{
16
20 const MAX_NONCE_AGE = 30; // in minutes
21
27 public $expires = null;
28
34 private $consumer = null;
40 private $value = null;
41
48 public function __construct($consumer, $value = null)
49 {
50
51 $this->consumer = $consumer;
52 $this->value = $value;
53 $this->expires = time() + (self::MAX_NONCE_AGE * 60);
54
55 }
56
62 public function load()
63 {
64
65 return $this->consumer->getDataConnector()->loadConsumerNonce($this);
66
67 }
68
74 public function save()
75 {
76
77 return $this->consumer->getDataConnector()->saveConsumerNonce($this);
78
79 }
80
86 public function getConsumer()
87 {
88
89 return $this->consumer;
90
91 }
92
98 public function getValue()
99 {
100
101 return $this->value;
102
103 }
104
105}
An exception for terminatinating execution or to throw for unit testing.
Class to represent a tool consumer nonce.
const MAX_NONCE_AGE
Maximum age nonce values will be retained for (in minutes).
save()
Save a nonce value in the database.
__construct($consumer, $value=null)
Class constructor.
$expires
Date/time when the nonce value expires.
load()
Load a nonce value from the database.
$consumer
Tool Consumer to which this nonce applies.