Свойство | Тип | Описание | |
---|---|---|---|
$defaultLength | integer | ||
$displayField | string | ||
$order | array | ||
$validate | array | ||
$validity | integer |
Метод | Описание | |
---|---|---|
garbageCollector ( ) : boolean | Remove old/invalid keys does not remove recently used ones (for proper feedback)! | |
generateKey ( integer | null $length = null ) : string | Generator of secure random tokens. | |
newKey ( string $type, string | null $key = null, mixed | null $uid = null, string | array | null $content = null ) : string | Stores new key in DB | |
spendKey ( integer $id ) : boolean | Sets Key to "used" (only once!) - directly by ID | |
stats ( ) : array | Get admin stats | |
useKey ( string $type, string $key, mixed | null $uid = null, boolean $treatUsedAsInvalid = false ) : array | false | UsesKey (only once!) - by KEY |
public garbageCollector ( ) : boolean | ||
Результат | boolean | success |
public newKey ( string $type, string | null $key = null, mixed | null $uid = null, string | array | null $content = null ) : string | ||
$type | string | Type: necessary |
$key | string | null | Key: optional key, otherwise a key will be generated |
$uid | mixed | null | Uid: optional (if used, only this user can use this key) |
$content | string | array | null | Content: up to 255 characters of content may be added (optional) NOW: checks if this key is already used (should be unique in table) |
Результат | string | key on SUCCESS, boolean false otherwise |
public useKey ( string $type, string $key, mixed | null $uid = null, boolean $treatUsedAsInvalid = false ) : array | false | ||
$type | string | : necessary |
$key | string | : necessary |
$uid | mixed | null | : needs to be provided if this key has a user_id stored |
$treatUsedAsInvalid | boolean | |
Результат | array | false | Content - if successfully used or if already used (used=1), FALSE else |