示例#1
0
文件: gitblog.php 项目: rsms/gitblog
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;
}
示例#2
0
 function nonce()
 {
     return gb_nonce_make('digest-auth-' . $this->realm, $this->ttl);
 }