Skip to content

Commit

Permalink
[mms] Add Horde_Session#getUniqueId().
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 4, 2014
1 parent 86a85b8 commit fadc016
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
19 changes: 19 additions & 0 deletions framework/Core/lib/Horde/Session.php
Expand Up @@ -47,6 +47,7 @@ class Horde_Session

const NONCE_ID = 'session_nonce'; /* @since 2.11.0 */
const TOKEN_ID = 'session_token';
const UNIQUE_ID = 'unique_id'; /* @since 2.12.0 */

/**
* Maximum size of the pruneable data store.
Expand Down Expand Up @@ -579,6 +580,24 @@ public function checkNonce($nonce)
$this->set('horde', self::NONCE_ID, array_values($nonces));
}

/* Unique ID. */

/**
* Return a unique identifier for this session.
*
* @since 2.12.0
*
* @return string Unique ID.
*/
public function getUniqueId()
{
if (($id = $this->get('horde', self::UNIQUE_ID)) === null) {
$id = strval(new Horde_Support_Randomid());
$this->set('horde', self::UNIQUE_ID, $id);
}

return $id;
}

/* Session object storage. */

Expand Down
2 changes: 2 additions & 0 deletions framework/Core/package.xml
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Add Horde_Session#getUniqueId().
* [mms] Add abstracted web notifications interface to the Horde_Notification system.
* [mms] Upgrade prototype.js to most recent git version (0df1298f807818471209b7e7971c3480e36a4f71).
* [mjr] Fix issue that causes enter to submit the form when inside the pretty autocompleter (Bug #12923).
Expand Down Expand Up @@ -3367,6 +3368,7 @@
<date>2014-04-04</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Add Horde_Session#getUniqueId().
* [mms] Add abstracted web notifications interface to the Horde_Notification system.
* [mms] Upgrade prototype.js to most recent git version (0df1298f807818471209b7e7971c3480e36a4f71).
* [mjr] Fix issue that causes enter to submit the form when inside the pretty autocompleter (Bug #12923).
Expand Down

0 comments on commit fadc016

Please sign in to comment.