Beispiel #1
0
function gb_nonce_field($context = '', $referrer = true, $id_prefix = '', $name = 'gb-nonce')
{
    $nonce = gb_nonce_make($context);
    $name = h($name);
    $html = '<input type="hidden" id="' . $id_prefix . $name . '" name="' . $name . '" value="' . $nonce . '" />';
    if ($referrer) {
        $html .= '<input type="hidden" name="gb-referrer" value="' . h(gb::url()) . '" />';
    }
    return $html;
}
Beispiel #2
0
 function nonce()
 {
     return gb_nonce_make('digest-auth-' . $this->realm, $this->ttl);
 }