repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
nextras/forms | src/Controls/DateTimePickerPrototype.php | DateTimePickerPrototype.getControl | public function getControl()
{
$control = parent::getControl();
$control->type = $this->htmlType;
$control->addClass($this->htmlType);
list($min, $max) = $this->extractRangeRule($this->getRules());
if ($min instanceof DateTimeInterface) {
$control->min = $min->format($this->htmlFormat);
}
if ($max in... | php | public function getControl()
{
$control = parent::getControl();
$control->type = $this->htmlType;
$control->addClass($this->htmlType);
list($min, $max) = $this->extractRangeRule($this->getRules());
if ($min instanceof DateTimeInterface) {
$control->min = $min->format($this->htmlFormat);
}
if ($max in... | [
"public",
"function",
"getControl",
"(",
")",
"{",
"$",
"control",
"=",
"parent",
"::",
"getControl",
"(",
")",
";",
"$",
"control",
"->",
"type",
"=",
"$",
"this",
"->",
"htmlType",
";",
"$",
"control",
"->",
"addClass",
"(",
"$",
"this",
"->",
"htm... | Generates control's HTML element.
@return Html | [
"Generates",
"control",
"s",
"HTML",
"element",
"."
] | train | https://github.com/nextras/forms/blob/548f93a0be0f5424b1a418bad3932de125ad31c8/src/Controls/DateTimePickerPrototype.php#L45-L64 |
nextras/forms | src/Controls/DateTimePickerPrototype.php | DateTimePickerPrototype.extractRangeRule | protected function extractRangeRule(Rules $rules)
{
$controlMin = $controlMax = null;
foreach ($rules as $rule) {
$branch = property_exists($rule, 'branch') ? $rule->branch : $rule->subRules;
if (!$branch) {
$validator = property_exists($rule, 'validator') ? $rule->validator : $rule->operation;
if ($... | php | protected function extractRangeRule(Rules $rules)
{
$controlMin = $controlMax = null;
foreach ($rules as $rule) {
$branch = property_exists($rule, 'branch') ? $rule->branch : $rule->subRules;
if (!$branch) {
$validator = property_exists($rule, 'validator') ? $rule->validator : $rule->operation;
if ($... | [
"protected",
"function",
"extractRangeRule",
"(",
"Rules",
"$",
"rules",
")",
"{",
"$",
"controlMin",
"=",
"$",
"controlMax",
"=",
"null",
";",
"foreach",
"(",
"$",
"rules",
"as",
"$",
"rule",
")",
"{",
"$",
"branch",
"=",
"property_exists",
"(",
"$",
... | Finds minimum and maximum allowed dates.
@return array 0 => DateTime|null $minDate, 1 => DateTime|null $maxDate | [
"Finds",
"minimum",
"and",
"maximum",
"allowed",
"dates",
"."
] | train | https://github.com/nextras/forms/blob/548f93a0be0f5424b1a418bad3932de125ad31c8/src/Controls/DateTimePickerPrototype.php#L140-L170 |
nextras/forms | src/Controls/Fragments/TemplateControlTrait.php | TemplateControlTrait.redrawControl | public function redrawControl($snippet = NULL, $redraw = TRUE)
{
if ($redraw) {
$this->invalidSnippets[$snippet === NULL ? "\0" : $snippet] = TRUE;
} elseif ($snippet === NULL) {
$this->invalidSnippets = [];
} else {
$this->invalidSnippets[$snippet] = FALSE;
}
} | php | public function redrawControl($snippet = NULL, $redraw = TRUE)
{
if ($redraw) {
$this->invalidSnippets[$snippet === NULL ? "\0" : $snippet] = TRUE;
} elseif ($snippet === NULL) {
$this->invalidSnippets = [];
} else {
$this->invalidSnippets[$snippet] = FALSE;
}
} | [
"public",
"function",
"redrawControl",
"(",
"$",
"snippet",
"=",
"NULL",
",",
"$",
"redraw",
"=",
"TRUE",
")",
"{",
"if",
"(",
"$",
"redraw",
")",
"{",
"$",
"this",
"->",
"invalidSnippets",
"[",
"$",
"snippet",
"===",
"NULL",
"?",
"\"\\0\"",
":",
"$"... | Forces control or its snippet to repaint.
@return void | [
"Forces",
"control",
"or",
"its",
"snippet",
"to",
"repaint",
"."
] | train | https://github.com/nextras/forms/blob/548f93a0be0f5424b1a418bad3932de125ad31c8/src/Controls/Fragments/TemplateControlTrait.php#L187-L198 |
nextras/forms | src/Controls/Fragments/TemplateControlTrait.php | TemplateControlTrait.isControlInvalid | public function isControlInvalid($snippet = NULL)
{
if ($snippet === NULL) {
if (count($this->invalidSnippets) > 0) {
return TRUE;
} else {
$queue = [$this];
do {
foreach (array_shift($queue)->getComponents() as $component) {
if ($component instanceof IRenderable) {
if ($componen... | php | public function isControlInvalid($snippet = NULL)
{
if ($snippet === NULL) {
if (count($this->invalidSnippets) > 0) {
return TRUE;
} else {
$queue = [$this];
do {
foreach (array_shift($queue)->getComponents() as $component) {
if ($component instanceof IRenderable) {
if ($componen... | [
"public",
"function",
"isControlInvalid",
"(",
"$",
"snippet",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"snippet",
"===",
"NULL",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"invalidSnippets",
")",
">",
"0",
")",
"{",
"return",
"TRUE",
";",
... | Is required to repaint the control or its snippet?
@param string snippet name
@return bool | [
"Is",
"required",
"to",
"repaint",
"the",
"control",
"or",
"its",
"snippet?"
] | train | https://github.com/nextras/forms/blob/548f93a0be0f5424b1a418bad3932de125ad31c8/src/Controls/Fragments/TemplateControlTrait.php#L221-L251 |
nextras/forms | src/Bridges/Latte/Macros/BaseInputMacros.php | BaseInputMacros.macroLabelEnd | public function macroLabelEnd(MacroNode $node, PhpWriter $writer)
{
if ($node->content != null) {
$node->openingCode = rtrim($node->openingCode, '?> ') . '->startTag() ?>';
return $writer->write('if ($_label) echo $_label->endTag()');
}
} | php | public function macroLabelEnd(MacroNode $node, PhpWriter $writer)
{
if ($node->content != null) {
$node->openingCode = rtrim($node->openingCode, '?> ') . '->startTag() ?>';
return $writer->write('if ($_label) echo $_label->endTag()');
}
} | [
"public",
"function",
"macroLabelEnd",
"(",
"MacroNode",
"$",
"node",
",",
"PhpWriter",
"$",
"writer",
")",
"{",
"if",
"(",
"$",
"node",
"->",
"content",
"!=",
"null",
")",
"{",
"$",
"node",
"->",
"openingCode",
"=",
"rtrim",
"(",
"$",
"node",
"->",
... | {/label} | [
"{",
"/",
"label",
"}"
] | train | https://github.com/nextras/forms/blob/548f93a0be0f5424b1a418bad3932de125ad31c8/src/Bridges/Latte/Macros/BaseInputMacros.php#L60-L66 |
openid/php-openid | Auth/OpenID/BigMath.php | Auth_OpenID_MathLibrary.longToBinary | function longToBinary($long)
{
$cmp = $this->cmp($long, 0);
if ($cmp < 0) {
$msg = __FUNCTION__ . " takes only positive integers.";
trigger_error($msg, E_USER_ERROR);
return null;
}
if ($cmp == 0) {
return "\x00";
}
$b... | php | function longToBinary($long)
{
$cmp = $this->cmp($long, 0);
if ($cmp < 0) {
$msg = __FUNCTION__ . " takes only positive integers.";
trigger_error($msg, E_USER_ERROR);
return null;
}
if ($cmp == 0) {
return "\x00";
}
$b... | [
"function",
"longToBinary",
"(",
"$",
"long",
")",
"{",
"$",
"cmp",
"=",
"$",
"this",
"->",
"cmp",
"(",
"$",
"long",
",",
"0",
")",
";",
"if",
"(",
"$",
"cmp",
"<",
"0",
")",
"{",
"$",
"msg",
"=",
"__FUNCTION__",
".",
"\" takes only positive intege... | Given a long integer, returns the number converted to a binary
string. This function accepts long integer values of arbitrary
magnitude and uses the local large-number math library when
available.
@param integer $long The long number (can be a normal PHP
integer or a number created by one of the available long number... | [
"Given",
"a",
"long",
"integer",
"returns",
"the",
"number",
"converted",
"to",
"a",
"binary",
"string",
".",
"This",
"function",
"accepts",
"long",
"integer",
"values",
"of",
"arbitrary",
"magnitude",
"and",
"uses",
"the",
"local",
"large",
"-",
"number",
"... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/BigMath.php#L45-L75 |
openid/php-openid | Auth/OpenID/BigMath.php | Auth_OpenID_MathLibrary.binaryToLong | function binaryToLong($str)
{
if ($str === null) {
return null;
}
// Use array_merge to return a zero-indexed array instead of a
// one-indexed array.
$bytes = array_merge(unpack('C*', $str));
$n = $this->init(0);
if ($bytes && ($bytes[0] > 127)... | php | function binaryToLong($str)
{
if ($str === null) {
return null;
}
// Use array_merge to return a zero-indexed array instead of a
// one-indexed array.
$bytes = array_merge(unpack('C*', $str));
$n = $this->init(0);
if ($bytes && ($bytes[0] > 127)... | [
"function",
"binaryToLong",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"$",
"str",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Use array_merge to return a zero-indexed array instead of a",
"// one-indexed array.",
"$",
"bytes",
"=",
"array_merge",
"(",
"un... | Given a binary string, returns the binary string converted to a
long number.
@param string $str The binary version of a long number,
probably as a result of calling longToBinary
@return integer $long The long number equivalent of the binary
string $str | [
"Given",
"a",
"binary",
"string",
"returns",
"the",
"binary",
"string",
"converted",
"to",
"a",
"long",
"number",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/BigMath.php#L86-L110 |
openid/php-openid | Auth/OpenID/BigMath.php | Auth_OpenID_MathLibrary.rand | function rand($stop)
{
static $duplicate_cache = array();
// Used as the key for the duplicate cache
$rbytes = $this->longToBinary($stop);
if (array_key_exists($rbytes, $duplicate_cache)) {
list($duplicate, $nbytes) = $duplicate_cache[$rbytes];
} else {
... | php | function rand($stop)
{
static $duplicate_cache = array();
// Used as the key for the duplicate cache
$rbytes = $this->longToBinary($stop);
if (array_key_exists($rbytes, $duplicate_cache)) {
list($duplicate, $nbytes) = $duplicate_cache[$rbytes];
} else {
... | [
"function",
"rand",
"(",
"$",
"stop",
")",
"{",
"static",
"$",
"duplicate_cache",
"=",
"array",
"(",
")",
";",
"// Used as the key for the duplicate cache",
"$",
"rbytes",
"=",
"$",
"this",
"->",
"longToBinary",
"(",
"$",
"stop",
")",
";",
"if",
"(",
"arra... | Returns a random number in the specified range. This function
accepts $start, $stop, and $step values of arbitrary magnitude
and will utilize the local large-number math library when
available.
@param integer $stop The end of the range, or the maximum
random number to return
@return integer $result The resulting rand... | [
"Returns",
"a",
"random",
"number",
"in",
"the",
"specified",
"range",
".",
"This",
"function",
"accepts",
"$start",
"$stop",
"and",
"$step",
"values",
"of",
"arbitrary",
"magnitude",
"and",
"will",
"utilize",
"the",
"local",
"large",
"-",
"number",
"math",
... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/BigMath.php#L138-L174 |
openid/php-openid | Auth/OpenID/BigMath.php | Auth_OpenID_BcMathWrapper._powmod | function _powmod($base, $exponent, $modulus)
{
$square = $this->mod($base, $modulus);
$result = 1;
while($this->cmp($exponent, 0) > 0) {
if ($this->mod($exponent, 2)) {
$result = $this->mod($this->mul($result, $square), $modulus);
}
$square... | php | function _powmod($base, $exponent, $modulus)
{
$square = $this->mod($base, $modulus);
$result = 1;
while($this->cmp($exponent, 0) > 0) {
if ($this->mod($exponent, 2)) {
$result = $this->mod($this->mul($result, $square), $modulus);
}
$square... | [
"function",
"_powmod",
"(",
"$",
"base",
",",
"$",
"exponent",
",",
"$",
"modulus",
")",
"{",
"$",
"square",
"=",
"$",
"this",
"->",
"mod",
"(",
"$",
"base",
",",
"$",
"modulus",
")",
";",
"$",
"result",
"=",
"1",
";",
"while",
"(",
"$",
"this"... | Same as bcpowmod when bcpowmod is missing
@access private
@param int $base
@param int $exponent
@param int $modulus
@return int | [
"Same",
"as",
"bcpowmod",
"when",
"bcpowmod",
"is",
"missing"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/BigMath.php#L287-L299 |
openid/php-openid | Auth/OpenID/CryptUtil.php | Auth_OpenID_CryptUtil.getBytes | static function getBytes($num_bytes)
{
static $f = null;
if ($f === null) {
if (Auth_OpenID_RAND_SOURCE === null) {
$f = false;
} else {
$f = @fopen(Auth_OpenID_RAND_SOURCE, "r");
if ($f === false) {
$msg = '... | php | static function getBytes($num_bytes)
{
static $f = null;
if ($f === null) {
if (Auth_OpenID_RAND_SOURCE === null) {
$f = false;
} else {
$f = @fopen(Auth_OpenID_RAND_SOURCE, "r");
if ($f === false) {
$msg = '... | [
"static",
"function",
"getBytes",
"(",
"$",
"num_bytes",
")",
"{",
"static",
"$",
"f",
"=",
"null",
";",
"if",
"(",
"$",
"f",
"===",
"null",
")",
"{",
"if",
"(",
"Auth_OpenID_RAND_SOURCE",
"===",
"null",
")",
"{",
"$",
"f",
"=",
"false",
";",
"}",
... | Get the specified number of random bytes.
Attempts to use a cryptographically secure (not predictable)
source of randomness if available. If there is no high-entropy
randomness source available, it will fail. As a last resort,
for non-critical systems, define
<code>Auth_OpenID_RAND_SOURCE</code> as <code>null</code>, ... | [
"Get",
"the",
"specified",
"number",
"of",
"random",
"bytes",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/CryptUtil.php#L40-L66 |
openid/php-openid | Auth/OpenID/CryptUtil.php | Auth_OpenID_CryptUtil.randomString | static function randomString($length, $population = null)
{
if ($population === null) {
return Auth_OpenID_CryptUtil::getBytes($length);
}
$popsize = strlen($population);
if ($popsize > 256) {
$msg = 'More than 256 characters supplied to ' . __FUNCTION__;
... | php | static function randomString($length, $population = null)
{
if ($population === null) {
return Auth_OpenID_CryptUtil::getBytes($length);
}
$popsize = strlen($population);
if ($popsize > 256) {
$msg = 'More than 256 characters supplied to ' . __FUNCTION__;
... | [
"static",
"function",
"randomString",
"(",
"$",
"length",
",",
"$",
"population",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"population",
"===",
"null",
")",
"{",
"return",
"Auth_OpenID_CryptUtil",
"::",
"getBytes",
"(",
"$",
"length",
")",
";",
"}",
"$",
... | Produce a string of length random bytes, chosen from chrs. If
$chrs is null, the resulting string may contain any characters.
@param integer $length The length of the resulting
randomly-generated string
@param string|null $population A string of characters from which to choose
to build the new string
@return string $... | [
"Produce",
"a",
"string",
"of",
"length",
"random",
"bytes",
"chosen",
"from",
"chrs",
".",
"If",
"$chrs",
"is",
"null",
"the",
"resulting",
"string",
"may",
"contain",
"any",
"characters",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/CryptUtil.php#L79-L105 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.fromExpiresIn | static function fromExpiresIn($expires_in, $handle, $secret, $assoc_type)
{
$issued = time();
$lifetime = $expires_in;
return new Auth_OpenID_Association($handle, $secret,
$issued, $lifetime, $assoc_type);
} | php | static function fromExpiresIn($expires_in, $handle, $secret, $assoc_type)
{
$issued = time();
$lifetime = $expires_in;
return new Auth_OpenID_Association($handle, $secret,
$issued, $lifetime, $assoc_type);
} | [
"static",
"function",
"fromExpiresIn",
"(",
"$",
"expires_in",
",",
"$",
"handle",
",",
"$",
"secret",
",",
"$",
"assoc_type",
")",
"{",
"$",
"issued",
"=",
"time",
"(",
")",
";",
"$",
"lifetime",
"=",
"$",
"expires_in",
";",
"return",
"new",
"Auth_Ope... | This is an alternate constructor (factory method) used by the
OpenID consumer library to create associations. OpenID store
implementations shouldn't use this constructor.
@access private
@param integer $expires_in This is the amount of time this
association is good for, measured in seconds since the
association was ... | [
"This",
"is",
"an",
"alternate",
"constructor",
"(",
"factory",
"method",
")",
"used",
"by",
"the",
"OpenID",
"consumer",
"library",
"to",
"create",
"associations",
".",
"OpenID",
"store",
"implementations",
"shouldn",
"t",
"use",
"this",
"constructor",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L96-L102 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.getExpiresIn | function getExpiresIn($now = null)
{
if ($now == null) {
$now = time();
}
return max(0, $this->issued + $this->lifetime - $now);
} | php | function getExpiresIn($now = null)
{
if ($now == null) {
$now = time();
}
return max(0, $this->issued + $this->lifetime - $now);
} | [
"function",
"getExpiresIn",
"(",
"$",
"now",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"now",
"==",
"null",
")",
"{",
"$",
"now",
"=",
"time",
"(",
")",
";",
"}",
"return",
"max",
"(",
"0",
",",
"$",
"this",
"->",
"issued",
"+",
"$",
"this",
"->... | This returns the number of seconds this association is still
valid for, or 0 if the association is no longer valid.
@param int|null $now
@return int $seconds The number of seconds this association
is still valid for, or 0 if the association is no longer valid. | [
"This",
"returns",
"the",
"number",
"of",
"seconds",
"this",
"association",
"is",
"still",
"valid",
"for",
"or",
"0",
"if",
"the",
"association",
"is",
"no",
"longer",
"valid",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L154-L161 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.equal | function equal($other)
{
return ((gettype($this) == gettype($other))
&& ($this->handle == $other->handle)
&& ($this->secret == $other->secret)
&& ($this->issued == $other->issued)
&& ($this->lifetime == $other->lifetime)
&& ($th... | php | function equal($other)
{
return ((gettype($this) == gettype($other))
&& ($this->handle == $other->handle)
&& ($this->secret == $other->secret)
&& ($this->issued == $other->issued)
&& ($this->lifetime == $other->lifetime)
&& ($th... | [
"function",
"equal",
"(",
"$",
"other",
")",
"{",
"return",
"(",
"(",
"gettype",
"(",
"$",
"this",
")",
"==",
"gettype",
"(",
"$",
"other",
")",
")",
"&&",
"(",
"$",
"this",
"->",
"handle",
"==",
"$",
"other",
"->",
"handle",
")",
"&&",
"(",
"$... | This checks to see if two {@link Auth_OpenID_Association}
instances represent the same association.
@param object $other
@return bool $result true if the two instances represent the
same association, false otherwise. | [
"This",
"checks",
"to",
"see",
"if",
"two",
"{",
"@link",
"Auth_OpenID_Association",
"}",
"instances",
"represent",
"the",
"same",
"association",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L171-L179 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.serialize | function serialize()
{
$data = array(
'version' => '2',
'handle' => $this->handle,
'secret' => base64_encode($this->secret),
'issued' => strval(intval($this->issued)),
'lifetime' => strval(intval($this->... | php | function serialize()
{
$data = array(
'version' => '2',
'handle' => $this->handle,
'secret' => base64_encode($this->secret),
'issued' => strval(intval($this->issued)),
'lifetime' => strval(intval($this->... | [
"function",
"serialize",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
"'version'",
"=>",
"'2'",
",",
"'handle'",
"=>",
"$",
"this",
"->",
"handle",
",",
"'secret'",
"=>",
"base64_encode",
"(",
"$",
"this",
"->",
"secret",
")",
",",
"'issued'",
"=>",
... | Convert an association to KV form.
@return string $result String in KV form suitable for
deserialization by deserialize. | [
"Convert",
"an",
"association",
"to",
"KV",
"form",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L187-L201 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.deserialize | static function deserialize($class_name, $assoc_s)
{
$pairs = Auth_OpenID_KVForm::toArray($assoc_s, $strict = true);
$keys = array();
$values = array();
foreach ($pairs as $key => $value) {
if (is_array($value)) {
list($key, $value) = $value;
}... | php | static function deserialize($class_name, $assoc_s)
{
$pairs = Auth_OpenID_KVForm::toArray($assoc_s, $strict = true);
$keys = array();
$values = array();
foreach ($pairs as $key => $value) {
if (is_array($value)) {
list($key, $value) = $value;
}... | [
"static",
"function",
"deserialize",
"(",
"$",
"class_name",
",",
"$",
"assoc_s",
")",
"{",
"$",
"pairs",
"=",
"Auth_OpenID_KVForm",
"::",
"toArray",
"(",
"$",
"assoc_s",
",",
"$",
"strict",
"=",
"true",
")",
";",
"$",
"keys",
"=",
"array",
"(",
")",
... | Parse an association as stored by serialize(). This is the
inverse of serialize.
@param string $class_name
@param string $assoc_s Association as serialized by serialize()
@return Auth_OpenID_Association $result instance of this class | [
"Parse",
"an",
"association",
"as",
"stored",
"by",
"serialize",
"()",
".",
"This",
"is",
"the",
"inverse",
"of",
"serialize",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L211-L254 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.sign | function sign($pairs)
{
$kv = Auth_OpenID_KVForm::fromArray($pairs);
/* Invalid association types should be caught at constructor */
$callback = $this->_macs[$this->assoc_type];
return call_user_func_array($callback, array($this->secret, $kv));
} | php | function sign($pairs)
{
$kv = Auth_OpenID_KVForm::fromArray($pairs);
/* Invalid association types should be caught at constructor */
$callback = $this->_macs[$this->assoc_type];
return call_user_func_array($callback, array($this->secret, $kv));
} | [
"function",
"sign",
"(",
"$",
"pairs",
")",
"{",
"$",
"kv",
"=",
"Auth_OpenID_KVForm",
"::",
"fromArray",
"(",
"$",
"pairs",
")",
";",
"/* Invalid association types should be caught at constructor */",
"$",
"callback",
"=",
"$",
"this",
"->",
"_macs",
"[",
"$",
... | Generate a signature for a sequence of (key, value) pairs
@access private
@param array $pairs The pairs to sign, in order. This is an
array of two-tuples.
@return string $signature The binary signature of this sequence
of pairs | [
"Generate",
"a",
"signature",
"for",
"a",
"sequence",
"of",
"(",
"key",
"value",
")",
"pairs"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L265-L273 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.signMessage | function signMessage($message)
{
if ($message->hasKey(Auth_OpenID_OPENID_NS, 'sig') ||
$message->hasKey(Auth_OpenID_OPENID_NS, 'signed')) {
// Already has a sig
return null;
}
$extant_handle = $message->getArg(Auth_OpenID_OPENID_NS,
... | php | function signMessage($message)
{
if ($message->hasKey(Auth_OpenID_OPENID_NS, 'sig') ||
$message->hasKey(Auth_OpenID_OPENID_NS, 'signed')) {
// Already has a sig
return null;
}
$extant_handle = $message->getArg(Auth_OpenID_OPENID_NS,
... | [
"function",
"signMessage",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"->",
"hasKey",
"(",
"Auth_OpenID_OPENID_NS",
",",
"'sig'",
")",
"||",
"$",
"message",
"->",
"hasKey",
"(",
"Auth_OpenID_OPENID_NS",
",",
"'signed'",
")",
")",
"{",
"// Al... | Generate a signature for some fields in a dictionary
@access private
@param Auth_OpenID_Message $message
@return string $signature The signature, base64 encoded
@internal param array $fields The fields to sign, in order; this is an
array of strings.
@internal param array $data Dictionary of values to sign (an array of... | [
"Generate",
"a",
"signature",
"for",
"some",
"fields",
"in",
"a",
"dictionary"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L286-L324 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association._makePairs | function _makePairs($message)
{
$signed = $message->getArg(Auth_OpenID_OPENID_NS, 'signed');
if (!$signed || Auth_OpenID::isFailure($signed)) {
// raise ValueError('Message has no signed list: %s' % (message,))
return null;
}
$signed_list = explode(',', $sign... | php | function _makePairs($message)
{
$signed = $message->getArg(Auth_OpenID_OPENID_NS, 'signed');
if (!$signed || Auth_OpenID::isFailure($signed)) {
// raise ValueError('Message has no signed list: %s' % (message,))
return null;
}
$signed_list = explode(',', $sign... | [
"function",
"_makePairs",
"(",
"$",
"message",
")",
"{",
"$",
"signed",
"=",
"$",
"message",
"->",
"getArg",
"(",
"Auth_OpenID_OPENID_NS",
",",
"'signed'",
")",
";",
"if",
"(",
"!",
"$",
"signed",
"||",
"Auth_OpenID",
"::",
"isFailure",
"(",
"$",
"signed... | Given a {@link Auth_OpenID_Message}, return the key/value pairs
to be signed according to the signed list in the message. If
the message lacks a signed list, return null.
@access private
@param Auth_OpenID_Message $message
@return array|null | [
"Given",
"a",
"{",
"@link",
"Auth_OpenID_Message",
"}",
"return",
"the",
"key",
"/",
"value",
"pairs",
"to",
"be",
"signed",
"according",
"to",
"the",
"signed",
"list",
"in",
"the",
"message",
".",
"If",
"the",
"message",
"lacks",
"a",
"signed",
"list",
... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L335-L352 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.getMessageSignature | function getMessageSignature($message)
{
$pairs = $this->_makePairs($message);
return base64_encode($this->sign($pairs));
} | php | function getMessageSignature($message)
{
$pairs = $this->_makePairs($message);
return base64_encode($this->sign($pairs));
} | [
"function",
"getMessageSignature",
"(",
"$",
"message",
")",
"{",
"$",
"pairs",
"=",
"$",
"this",
"->",
"_makePairs",
"(",
"$",
"message",
")",
";",
"return",
"base64_encode",
"(",
"$",
"this",
"->",
"sign",
"(",
"$",
"pairs",
")",
")",
";",
"}"
] | Given an {@link Auth_OpenID_Message}, return the signature for
the signed list in the message.
@access private
@param Auth_OpenID_Message $message
@return string | [
"Given",
"an",
"{",
"@link",
"Auth_OpenID_Message",
"}",
"return",
"the",
"signature",
"for",
"the",
"signed",
"list",
"in",
"the",
"message",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L362-L366 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_Association.checkMessageSignature | function checkMessageSignature($message)
{
$sig = $message->getArg(Auth_OpenID_OPENID_NS,
'sig');
if (!$sig || Auth_OpenID::isFailure($sig)) {
return false;
}
$calculated_sig = $this->getMessageSignature($message);
return Auth_Ope... | php | function checkMessageSignature($message)
{
$sig = $message->getArg(Auth_OpenID_OPENID_NS,
'sig');
if (!$sig || Auth_OpenID::isFailure($sig)) {
return false;
}
$calculated_sig = $this->getMessageSignature($message);
return Auth_Ope... | [
"function",
"checkMessageSignature",
"(",
"$",
"message",
")",
"{",
"$",
"sig",
"=",
"$",
"message",
"->",
"getArg",
"(",
"Auth_OpenID_OPENID_NS",
",",
"'sig'",
")",
";",
"if",
"(",
"!",
"$",
"sig",
"||",
"Auth_OpenID",
"::",
"isFailure",
"(",
"$",
"sig"... | Confirm that the signature of these fields matches the
signature contained in the data.
@access private
@param Auth_OpenID_Message $message
@return bool | [
"Confirm",
"that",
"the",
"signature",
"of",
"these",
"fields",
"matches",
"the",
"signature",
"contained",
"in",
"the",
"data",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L376-L387 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_SessionNegotiator.setAllowedTypes | function setAllowedTypes($allowed_types)
{
foreach ($allowed_types as $pair) {
list($assoc_type, $session_type) = $pair;
if (!Auth_OpenID_checkSessionType($assoc_type, $session_type)) {
return false;
}
}
$this->allowed_types = $allowed_typ... | php | function setAllowedTypes($allowed_types)
{
foreach ($allowed_types as $pair) {
list($assoc_type, $session_type) = $pair;
if (!Auth_OpenID_checkSessionType($assoc_type, $session_type)) {
return false;
}
}
$this->allowed_types = $allowed_typ... | [
"function",
"setAllowedTypes",
"(",
"$",
"allowed_types",
")",
"{",
"foreach",
"(",
"$",
"allowed_types",
"as",
"$",
"pair",
")",
"{",
"list",
"(",
"$",
"assoc_type",
",",
"$",
"session_type",
")",
"=",
"$",
"pair",
";",
"if",
"(",
"!",
"Auth_OpenID_chec... | Set the allowed association types, checking to make sure each
combination is valid.
@access private
@param array $allowed_types
@return bool | [
"Set",
"the",
"allowed",
"association",
"types",
"checking",
"to",
"make",
"sure",
"each",
"combination",
"is",
"valid",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L553-L564 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_SessionNegotiator.addAllowedType | function addAllowedType($assoc_type, $session_type = null)
{
if ($this->allowed_types === null) {
$this->allowed_types = array();
}
if ($session_type === null) {
$available = Auth_OpenID_getSessionTypes($assoc_type);
if (!$available) {
re... | php | function addAllowedType($assoc_type, $session_type = null)
{
if ($this->allowed_types === null) {
$this->allowed_types = array();
}
if ($session_type === null) {
$available = Auth_OpenID_getSessionTypes($assoc_type);
if (!$available) {
re... | [
"function",
"addAllowedType",
"(",
"$",
"assoc_type",
",",
"$",
"session_type",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"allowed_types",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"allowed_types",
"=",
"array",
"(",
")",
";",
"}",
"if",
... | Add an association type and session type to the allowed types
list. The assocation/session pairs are tried in the order that
they are added.
@access private
@param $assoc_type
@param null $session_type
@return bool | [
"Add",
"an",
"association",
"type",
"and",
"session",
"type",
"to",
"the",
"allowed",
"types",
"list",
".",
"The",
"assocation",
"/",
"session",
"pairs",
"are",
"tried",
"in",
"the",
"order",
"that",
"they",
"are",
"added",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L576-L601 |
openid/php-openid | Auth/OpenID/Association.php | Auth_OpenID_SessionNegotiator.isAllowed | function isAllowed($assoc_type, $session_type)
{
$assoc_good = in_array(array($assoc_type, $session_type),
$this->allowed_types);
$matches = in_array($session_type,
Auth_OpenID_getSessionTypes($assoc_type));
return ($assoc_good && ... | php | function isAllowed($assoc_type, $session_type)
{
$assoc_good = in_array(array($assoc_type, $session_type),
$this->allowed_types);
$matches = in_array($session_type,
Auth_OpenID_getSessionTypes($assoc_type));
return ($assoc_good && ... | [
"function",
"isAllowed",
"(",
"$",
"assoc_type",
",",
"$",
"session_type",
")",
"{",
"$",
"assoc_good",
"=",
"in_array",
"(",
"array",
"(",
"$",
"assoc_type",
",",
"$",
"session_type",
")",
",",
"$",
"this",
"->",
"allowed_types",
")",
";",
"$",
"matches... | Is this combination of association type and session type allowed? | [
"Is",
"this",
"combination",
"of",
"association",
"type",
"and",
"session",
"type",
"allowed?"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Association.php#L604-L613 |
openid/php-openid | Auth/OpenID/SQLStore.php | Auth_OpenID_SQLStore.reset | function reset()
{
$this->connection->query(sprintf("DELETE FROM %s",
$this->associations_table_name));
$this->connection->query(sprintf("DELETE FROM %s",
$this->nonces_table_name));
} | php | function reset()
{
$this->connection->query(sprintf("DELETE FROM %s",
$this->associations_table_name));
$this->connection->query(sprintf("DELETE FROM %s",
$this->nonces_table_name));
} | [
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"query",
"(",
"sprintf",
"(",
"\"DELETE FROM %s\"",
",",
"$",
"this",
"->",
"associations_table_name",
")",
")",
";",
"$",
"this",
"->",
"connection",
"->",
"query",
"(",
"sprintf",... | Resets the store by removing all records from the store's
tables. | [
"Resets",
"the",
"store",
"by",
"removing",
"all",
"records",
"from",
"the",
"store",
"s",
"tables",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/SQLStore.php#L212-L219 |
openid/php-openid | Auth/OpenID/SQLStore.php | Auth_OpenID_SQLStore._octify | function _octify($str)
{
$result = "";
for ($i = 0; $i < Auth_OpenID::bytes($str); $i++) {
$ch = substr($str, $i, 1);
if ($ch == "\\") {
$result .= "\\\\\\\\";
} else if (ord($ch) == 0) {
$result .= "\\\\000";
} else {
... | php | function _octify($str)
{
$result = "";
for ($i = 0; $i < Auth_OpenID::bytes($str); $i++) {
$ch = substr($str, $i, 1);
if ($ch == "\\") {
$result .= "\\\\\\\\";
} else if (ord($ch) == 0) {
$result .= "\\\\000";
} else {
... | [
"function",
"_octify",
"(",
"$",
"str",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"Auth_OpenID",
"::",
"bytes",
"(",
"$",
"str",
")",
";",
"$",
"i",
"++",
")",
"{",
"$",
"ch",
"=",
"subst... | "Octifies" a binary string by returning a string with escaped
octal bytes. This is used for preparing binary data for
PostgreSQL BYTEA fields.
@access private
@param string $str
@return string | [
"Octifies",
"a",
"binary",
"string",
"by",
"returning",
"a",
"string",
"with",
"escaped",
"octal",
"bytes",
".",
"This",
"is",
"used",
"for",
"preparing",
"binary",
"data",
"for",
"PostgreSQL",
"BYTEA",
"fields",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/SQLStore.php#L517-L531 |
openid/php-openid | Auth/OpenID/SQLStore.php | Auth_OpenID_SQLStore._unoctify | function _unoctify($str)
{
$result = "";
$i = 0;
while ($i < strlen($str)) {
$char = $str[$i];
if ($char == "\\") {
// Look to see if the next char is a backslash and
// append it.
if ($str[$i + 1] != "\\") {
... | php | function _unoctify($str)
{
$result = "";
$i = 0;
while ($i < strlen($str)) {
$char = $str[$i];
if ($char == "\\") {
// Look to see if the next char is a backslash and
// append it.
if ($str[$i + 1] != "\\") {
... | [
"function",
"_unoctify",
"(",
"$",
"str",
")",
"{",
"$",
"result",
"=",
"\"\"",
";",
"$",
"i",
"=",
"0",
";",
"while",
"(",
"$",
"i",
"<",
"strlen",
"(",
"$",
"str",
")",
")",
"{",
"$",
"char",
"=",
"$",
"str",
"[",
"$",
"i",
"]",
";",
"i... | "Unoctifies" octal-escaped data from PostgreSQL and returns the
resulting ASCII (possibly binary) string.
@access private
@param string $str
@return string | [
"Unoctifies",
"octal",
"-",
"escaped",
"data",
"from",
"PostgreSQL",
"and",
"returns",
"the",
"resulting",
"ASCII",
"(",
"possibly",
"binary",
")",
"string",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/SQLStore.php#L541-L567 |
openid/php-openid | Auth/Yadis/XML.php | Auth_Yadis_XMLParser.init | function init($xml_string, $namespace_map)
{
if (!$this->setXML($xml_string)) {
return false;
}
foreach ($namespace_map as $prefix => $uri) {
if (!$this->registerNamespace($prefix, $uri)) {
return false;
}
}
return true;
... | php | function init($xml_string, $namespace_map)
{
if (!$this->setXML($xml_string)) {
return false;
}
foreach ($namespace_map as $prefix => $uri) {
if (!$this->registerNamespace($prefix, $uri)) {
return false;
}
}
return true;
... | [
"function",
"init",
"(",
"$",
"xml_string",
",",
"$",
"namespace_map",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"setXML",
"(",
"$",
"xml_string",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"namespace_map",
"as",
"$",
"prefix... | Initialize an instance of Auth_Yadis_XMLParser with some
XML and namespaces. This SHOULD NOT be overridden by
subclasses.
@param string $xml_string A string of XML to be parsed.
@param array $namespace_map An array of ($ns_name => $ns_uri)
to be registered with the XML parser. May be empty.
@return boolean $result T... | [
"Initialize",
"an",
"instance",
"of",
"Auth_Yadis_XMLParser",
"with",
"some",
"XML",
"and",
"namespaces",
".",
"This",
"SHOULD",
"NOT",
"be",
"overridden",
"by",
"subclasses",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/Yadis/XML.php#L33-L46 |
openid/php-openid | Auth/OpenID/KVForm.php | Auth_OpenID_KVForm.toArray | static function toArray($kvs, $strict=false)
{
$lines = explode("\n", $kvs);
$last = array_pop($lines);
if ($last !== '') {
array_push($lines, $last);
if ($strict) {
return false;
}
}
$values = array();
for ($line... | php | static function toArray($kvs, $strict=false)
{
$lines = explode("\n", $kvs);
$last = array_pop($lines);
if ($last !== '') {
array_push($lines, $last);
if ($strict) {
return false;
}
}
$values = array();
for ($line... | [
"static",
"function",
"toArray",
"(",
"$",
"kvs",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"$",
"lines",
"=",
"explode",
"(",
"\"\\n\"",
",",
"$",
"kvs",
")",
";",
"$",
"last",
"=",
"array_pop",
"(",
"$",
"lines",
")",
";",
"if",
"(",
"$",
"... | Convert an OpenID colon/newline separated string into an
associative array
@static
@access private
@param string $kvs
@param bool $strict
@return array|bool | [
"Convert",
"an",
"OpenID",
"colon",
"/",
"newline",
"separated",
"string",
"into",
"an",
"associative",
"array"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/KVForm.php#L32-L76 |
openid/php-openid | Auth/OpenID/KVForm.php | Auth_OpenID_KVForm.fromArray | static function fromArray($values)
{
if ($values === null) {
return null;
}
ksort($values);
$serialized = '';
foreach ($values as $key => $value) {
if (is_array($value)) {
list($key, $value) = array($value[0], $value[1]);
... | php | static function fromArray($values)
{
if ($values === null) {
return null;
}
ksort($values);
$serialized = '';
foreach ($values as $key => $value) {
if (is_array($value)) {
list($key, $value) = array($value[0], $value[1]);
... | [
"static",
"function",
"fromArray",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"$",
"values",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ksort",
"(",
"$",
"values",
")",
";",
"$",
"serialized",
"=",
"''",
";",
"foreach",
"(",
"$",
"values",... | Convert an array into an OpenID colon/newline separated string
@static
@access private
@param null|array $values
@return null|string | [
"Convert",
"an",
"array",
"into",
"an",
"OpenID",
"colon",
"/",
"newline",
"separated",
"string"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/KVForm.php#L86-L114 |
openid/php-openid | contrib/signed_assertions/SAML.php | SAML.createSamlAssertion | function createSamlAssertion($authenticatedUser, $notBefore, $notOnOrAfter, $rsadsa, $acsURI,$attribute,$value,$assertionTemplate)
{
$samlResponse = $assertionTemplate;
$samlResponse = str_replace('USERNAME_STRING', $authenticatedUser, $samlResponse);
$samlResponse = str_replace('RESPONSE_ID', $th... | php | function createSamlAssertion($authenticatedUser, $notBefore, $notOnOrAfter, $rsadsa, $acsURI,$attribute,$value,$assertionTemplate)
{
$samlResponse = $assertionTemplate;
$samlResponse = str_replace('USERNAME_STRING', $authenticatedUser, $samlResponse);
$samlResponse = str_replace('RESPONSE_ID', $th... | [
"function",
"createSamlAssertion",
"(",
"$",
"authenticatedUser",
",",
"$",
"notBefore",
",",
"$",
"notOnOrAfter",
",",
"$",
"rsadsa",
",",
"$",
"acsURI",
",",
"$",
"attribute",
",",
"$",
"value",
",",
"$",
"assertionTemplate",
")",
"{",
"$",
"samlResponse",... | Returns a SAML response with various elements filled in.
@param string $authenticatedUser The OpenId of the user
@param string $notBefore The ISO 8601 formatted date before which the
response is invalid
@param string $notOnOrAfter The ISO 8601 formatted data after which the
response is invalid
@param string $rsadsa 'rs... | [
"Returns",
"a",
"SAML",
"response",
"with",
"various",
"elements",
"filled",
"in",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/SAML.php#L43-L57 |
openid/php-openid | contrib/signed_assertions/SAML.php | SAML.signAssertion | function signAssertion($responseXmlString,$privKey,$cert)
{
if (file_exists("/tmp/xml")) {
$tempFileDir="/tmp/xml/";
} else {
mkdir("/tmp/xml",0777);
$tempFileDir="/tmp/xml/";
}
$tempName = 'saml-response-' . $this->samlCreateId() . '.xml';
... | php | function signAssertion($responseXmlString,$privKey,$cert)
{
if (file_exists("/tmp/xml")) {
$tempFileDir="/tmp/xml/";
} else {
mkdir("/tmp/xml",0777);
$tempFileDir="/tmp/xml/";
}
$tempName = 'saml-response-' . $this->samlCreateId() . '.xml';
... | [
"function",
"signAssertion",
"(",
"$",
"responseXmlString",
",",
"$",
"privKey",
",",
"$",
"cert",
")",
"{",
"if",
"(",
"file_exists",
"(",
"\"/tmp/xml\"",
")",
")",
"{",
"$",
"tempFileDir",
"=",
"\"/tmp/xml/\"",
";",
"}",
"else",
"{",
"mkdir",
"(",
"\"/... | Signs a SAML response with the given private key, and embeds the public key.
@param string $responseXmlString The unsigned Assertion which will be signed
@param string $priKey Private key to sign the certificate
@param string $cert Public key certificate of signee
@return string Signed Assertion | [
"Signs",
"a",
"SAML",
"response",
"with",
"the",
"given",
"private",
"key",
"and",
"embeds",
"the",
"public",
"key",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/SAML.php#L66-L100 |
openid/php-openid | contrib/signed_assertions/SAML.php | SAML.verifyAssertion | function verifyAssertion($responseXmlString,$rootcert)
{
date_default_timezone_set("UTC");
if (file_exists("/tmp/xml")) {
$tempFileDir="/tmp/xml/";
} else {
mkdir("/tmp/xml",0777);
$tempFileDir="/tmp/xml/";
}
$tempName = 'saml-r... | php | function verifyAssertion($responseXmlString,$rootcert)
{
date_default_timezone_set("UTC");
if (file_exists("/tmp/xml")) {
$tempFileDir="/tmp/xml/";
} else {
mkdir("/tmp/xml",0777);
$tempFileDir="/tmp/xml/";
}
$tempName = 'saml-r... | [
"function",
"verifyAssertion",
"(",
"$",
"responseXmlString",
",",
"$",
"rootcert",
")",
"{",
"date_default_timezone_set",
"(",
"\"UTC\"",
")",
";",
"if",
"(",
"file_exists",
"(",
"\"/tmp/xml\"",
")",
")",
"{",
"$",
"tempFileDir",
"=",
"\"/tmp/xml/\"",
";",
"}... | Verify a saml response with the given public key.
@param string $responseXmlString Response to sign
@param string $rootcert trusted public key certificate
@return string Signed SAML response | [
"Verify",
"a",
"saml",
"response",
"with",
"the",
"given",
"public",
"key",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/SAML.php#L109-L168 |
openid/php-openid | contrib/signed_assertions/SAML.php | SAML.samlCreateId | function samlCreateId()
{
$rndChars = 'abcdefghijklmnop';
$rndId = '';
for ($i = 0; $i < 40; $i++ ) {
$rndId .= $rndChars[rand(0,strlen($rndChars)-1)];
}
return $rndId;
} | php | function samlCreateId()
{
$rndChars = 'abcdefghijklmnop';
$rndId = '';
for ($i = 0; $i < 40; $i++ ) {
$rndId .= $rndChars[rand(0,strlen($rndChars)-1)];
}
return $rndId;
} | [
"function",
"samlCreateId",
"(",
")",
"{",
"$",
"rndChars",
"=",
"'abcdefghijklmnop'",
";",
"$",
"rndId",
"=",
"''",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"40",
";",
"$",
"i",
"++",
")",
"{",
"$",
"rndId",
".=",
"$",
"rndChar... | Creates a 40-character string containing 160-bits of pseudorandomness.
@return string Containing pseudorandomness of 160 bits | [
"Creates",
"a",
"40",
"-",
"character",
"string",
"containing",
"160",
"-",
"bits",
"of",
"pseudorandomness",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/SAML.php#L175-L183 |
openid/php-openid | contrib/signed_assertions/SAML.php | SAML.validSamlDateFormat | function validSamlDateFormat($samlDate)
{
if ($samlDate == "") return false;
$indexT = strpos($samlDate, 'T');
$indexZ = strpos($samlDate, 'Z');
if (($indexT != 10) || ($indexZ != 19)) {
return false;
}
$dateString = substr($samlDate, 0, 10);
$timeString = substr($... | php | function validSamlDateFormat($samlDate)
{
if ($samlDate == "") return false;
$indexT = strpos($samlDate, 'T');
$indexZ = strpos($samlDate, 'Z');
if (($indexT != 10) || ($indexZ != 19)) {
return false;
}
$dateString = substr($samlDate, 0, 10);
$timeString = substr($... | [
"function",
"validSamlDateFormat",
"(",
"$",
"samlDate",
")",
"{",
"if",
"(",
"$",
"samlDate",
"==",
"\"\"",
")",
"return",
"false",
";",
"$",
"indexT",
"=",
"strpos",
"(",
"$",
"samlDate",
",",
"'T'",
")",
";",
"$",
"indexZ",
"=",
"strpos",
"(",
"$"... | Attempts to check whether a SAML date is valid. Returns true or false.
@param string $samlDate
@return bool | [
"Attempts",
"to",
"check",
"whether",
"a",
"SAML",
"date",
"is",
"valid",
".",
"Returns",
"true",
"or",
"false",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/SAML.php#L201-L217 |
openid/php-openid | Auth/OpenID/MemcachedStore.php | Auth_OpenID_MemcachedStore.storeAssociation | function storeAssociation($server_url, $association)
{
// create memcached keys for association itself
// and list of associations for this server
$associationKey = $this->associationKey($server_url,
$association->handle);
$serverKey = $this->associationServerKey($server_... | php | function storeAssociation($server_url, $association)
{
// create memcached keys for association itself
// and list of associations for this server
$associationKey = $this->associationKey($server_url,
$association->handle);
$serverKey = $this->associationServerKey($server_... | [
"function",
"storeAssociation",
"(",
"$",
"server_url",
",",
"$",
"association",
")",
"{",
"// create memcached keys for association itself",
"// and list of associations for this server",
"$",
"associationKey",
"=",
"$",
"this",
"->",
"associationKey",
"(",
"$",
"server_ur... | Store association until its expiration time in memcached.
Overwrites any existing association with same server_url and
handle. Handles list of associations for every server.
@param string $server_url
@param Auth_OpenID_Association $association | [
"Store",
"association",
"until",
"its",
"expiration",
"time",
"in",
"memcached",
".",
"Overwrites",
"any",
"existing",
"association",
"with",
"same",
"server_url",
"and",
"handle",
".",
"Handles",
"list",
"of",
"associations",
"for",
"every",
"server",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/MemcachedStore.php#L64-L94 |
openid/php-openid | Auth/OpenID/MemcachedStore.php | Auth_OpenID_MemcachedStore.getAssociation | function getAssociation($server_url, $handle = null)
{
// simple case: handle given
if ($handle !== null) {
// get association, return null if failed
$association = $this->connection->get(
$this->associationKey($server_url, $handle));
return $assoc... | php | function getAssociation($server_url, $handle = null)
{
// simple case: handle given
if ($handle !== null) {
// get association, return null if failed
$association = $this->connection->get(
$this->associationKey($server_url, $handle));
return $assoc... | [
"function",
"getAssociation",
"(",
"$",
"server_url",
",",
"$",
"handle",
"=",
"null",
")",
"{",
"// simple case: handle given",
"if",
"(",
"$",
"handle",
"!==",
"null",
")",
"{",
"// get association, return null if failed",
"$",
"association",
"=",
"$",
"this",
... | Read association from memcached. If no handle given
and multiple associations found, returns latest issued
@param string $server_url
@param null $handle
@return Auth_OpenID_Association|null | [
"Read",
"association",
"from",
"memcached",
".",
"If",
"no",
"handle",
"given",
"and",
"multiple",
"associations",
"found",
"returns",
"latest",
"issued"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/MemcachedStore.php#L104-L133 |
openid/php-openid | Auth/OpenID/MemcachedStore.php | Auth_OpenID_MemcachedStore.removeAssociation | function removeAssociation($server_url, $handle)
{
// create memcached keys for association itself
// and list of associations for this server
$serverKey = $this->associationServerKey($server_url);
$associationKey = $this->associationKey($server_url,
$handle);
//... | php | function removeAssociation($server_url, $handle)
{
// create memcached keys for association itself
// and list of associations for this server
$serverKey = $this->associationServerKey($server_url);
$associationKey = $this->associationKey($server_url,
$handle);
//... | [
"function",
"removeAssociation",
"(",
"$",
"server_url",
",",
"$",
"handle",
")",
"{",
"// create memcached keys for association itself",
"// and list of associations for this server",
"$",
"serverKey",
"=",
"$",
"this",
"->",
"associationServerKey",
"(",
"$",
"server_url",... | Immediately delete association from memcache.
@param string $server_url
@param string $handle
@return bool|mixed | [
"Immediately",
"delete",
"association",
"from",
"memcache",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/MemcachedStore.php#L142-L176 |
openid/php-openid | Auth/OpenID/MemcachedStore.php | Auth_OpenID_MemcachedStore.useNonce | function useNonce($server_url, $timestamp, $salt)
{
global $Auth_OpenID_SKEW;
// save one request to memcache when nonce obviously expired
if (abs($timestamp - time()) > $Auth_OpenID_SKEW) {
return false;
}
// returns false when nonce already exists
// o... | php | function useNonce($server_url, $timestamp, $salt)
{
global $Auth_OpenID_SKEW;
// save one request to memcache when nonce obviously expired
if (abs($timestamp - time()) > $Auth_OpenID_SKEW) {
return false;
}
// returns false when nonce already exists
// o... | [
"function",
"useNonce",
"(",
"$",
"server_url",
",",
"$",
"timestamp",
",",
"$",
"salt",
")",
"{",
"global",
"$",
"Auth_OpenID_SKEW",
";",
"// save one request to memcache when nonce obviously expired",
"if",
"(",
"abs",
"(",
"$",
"timestamp",
"-",
"time",
"(",
... | Create nonce for server and salt, expiring after
$Auth_OpenID_SKEW seconds.
@param string $server_url
@param int $timestamp
@param string $salt
@return bool | [
"Create",
"nonce",
"for",
"server",
"and",
"salt",
"expiring",
"after",
"$Auth_OpenID_SKEW",
"seconds",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/MemcachedStore.php#L187-L203 |
openid/php-openid | Auth/OpenID.php | Auth_OpenID.getQuery | static function getQuery($query_str=null)
{
$data = array();
if ($query_str !== null) {
$data = Auth_OpenID::params_from_string($query_str);
} else if (!array_key_exists('REQUEST_METHOD', $_SERVER)) {
// Do nothing.
} else {
// XXX HACK FIXME HORRIB... | php | static function getQuery($query_str=null)
{
$data = array();
if ($query_str !== null) {
$data = Auth_OpenID::params_from_string($query_str);
} else if (!array_key_exists('REQUEST_METHOD', $_SERVER)) {
// Do nothing.
} else {
// XXX HACK FIXME HORRIB... | [
"static",
"function",
"getQuery",
"(",
"$",
"query_str",
"=",
"null",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"query_str",
"!==",
"null",
")",
"{",
"$",
"data",
"=",
"Auth_OpenID",
"::",
"params_from_string",
"(",
"$",
"qu... | Gets the query data from the server environment based on the
request method used. If GET was used, this looks at
$_SERVER['QUERY_STRING'] directly. If POST was used, this
fetches data from the special php://input file stream.
Returns an associative array of the query arguments.
Skips invalid key/value pairs (i.e. k... | [
"Gets",
"the",
"query",
"data",
"from",
"the",
"server",
"environment",
"based",
"on",
"the",
"request",
"method",
"used",
".",
"If",
"GET",
"was",
"used",
"this",
"looks",
"at",
"$_SERVER",
"[",
"QUERY_STRING",
"]",
"directly",
".",
"If",
"POST",
"was",
... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID.php#L149-L183 |
openid/php-openid | Auth/OpenID.php | Auth_OpenID.parse_str | static function parse_str($query)
{
if ($query === null) {
return null;
}
$parts = explode('&', $query);
$new_parts = array();
for ($i = 0; $i < count($parts); $i++) {
$pair = explode('=', $parts[$i]);
if (count($pair) != 2) {
... | php | static function parse_str($query)
{
if ($query === null) {
return null;
}
$parts = explode('&', $query);
$new_parts = array();
for ($i = 0; $i < count($parts); $i++) {
$pair = explode('=', $parts[$i]);
if (count($pair) != 2) {
... | [
"static",
"function",
"parse_str",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"$",
"parts",
"=",
"explode",
"(",
"'&'",
",",
"$",
"query",
")",
";",
"$",
"new_parts",
"=",
"array",
"... | Replacement for PHP's broken parse_str.
@param string|null $query
@return array|null | [
"Replacement",
"for",
"PHP",
"s",
"broken",
"parse_str",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID.php#L281-L302 |
openid/php-openid | Auth/OpenID.php | Auth_OpenID.httpBuildQuery | static function httpBuildQuery($data)
{
$pairs = array();
foreach ($data as $key => $value) {
if (is_array($value)) {
$pairs[] = urlencode($value[0])."=".urlencode($value[1]);
} else {
$pairs[] = urlencode($key)."=".urlencode($value);
... | php | static function httpBuildQuery($data)
{
$pairs = array();
foreach ($data as $key => $value) {
if (is_array($value)) {
$pairs[] = urlencode($value[0])."=".urlencode($value[1]);
} else {
$pairs[] = urlencode($key)."=".urlencode($value);
... | [
"static",
"function",
"httpBuildQuery",
"(",
"$",
"data",
")",
"{",
"$",
"pairs",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
... | Implements the PHP 5 'http_build_query' functionality.
@access private
@param array $data Either an array key/value pairs or an array
of arrays, each of which holding two values: a key and a value,
sequentially.
@return string $result The result of url-encoding the key/value
pairs from $data into a URL query string
(e... | [
"Implements",
"the",
"PHP",
"5",
"http_build_query",
"functionality",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID.php#L315-L326 |
openid/php-openid | Auth/OpenID.php | Auth_OpenID.appendArgs | static function appendArgs($url, $args)
{
if (count($args) == 0) {
return $url;
}
// Non-empty array; if it is an array of arrays, use
// multisort; otherwise use sort.
if (array_key_exists(0, $args) &&
is_array($args[0])) {
// Do nothing ... | php | static function appendArgs($url, $args)
{
if (count($args) == 0) {
return $url;
}
// Non-empty array; if it is an array of arrays, use
// multisort; otherwise use sort.
if (array_key_exists(0, $args) &&
is_array($args[0])) {
// Do nothing ... | [
"static",
"function",
"appendArgs",
"(",
"$",
"url",
",",
"$",
"args",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"0",
")",
"{",
"return",
"$",
"url",
";",
"}",
"// Non-empty array; if it is an array of arrays, use",
"// multisort; otherwise us... | "Appends" query arguments onto a URL. The URL may or may not
already have arguments (following a question mark).
@access private
@param string $url A URL, which may or may not already have
arguments.
@param array $args Either an array key/value pairs or an array of
arrays, each of which holding two values: a key and ... | [
"Appends",
"query",
"arguments",
"onto",
"a",
"URL",
".",
"The",
"URL",
"may",
"or",
"may",
"not",
"already",
"have",
"arguments",
"(",
"following",
"a",
"question",
"mark",
")",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID.php#L343-L370 |
openid/php-openid | Auth/OpenID.php | Auth_OpenID.urlunparse | static function urlunparse($scheme, $host, $port = null, $path = '/',
$query = '', $fragment = '')
{
if (!$scheme) {
$scheme = 'http';
}
if (!$host) {
return false;
}
if (!$path) {
$path = '';
}
$... | php | static function urlunparse($scheme, $host, $port = null, $path = '/',
$query = '', $fragment = '')
{
if (!$scheme) {
$scheme = 'http';
}
if (!$host) {
return false;
}
if (!$path) {
$path = '';
}
$... | [
"static",
"function",
"urlunparse",
"(",
"$",
"scheme",
",",
"$",
"host",
",",
"$",
"port",
"=",
"null",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"query",
"=",
"''",
",",
"$",
"fragment",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"$",
"scheme",
")",
... | Implements python's urlunparse, which is not available in PHP.
Given the specified components of a URL, this function rebuilds
and returns the URL.
@access private
@param string $scheme The scheme (e.g. 'http'). Defaults to 'http'.
@param string $host The host. Required.
@param string $port The port.
@param string $... | [
"Implements",
"python",
"s",
"urlunparse",
"which",
"is",
"not",
"available",
"in",
"PHP",
".",
"Given",
"the",
"specified",
"components",
"of",
"a",
"URL",
"this",
"function",
"rebuilds",
"and",
"returns",
"the",
"URL",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID.php#L387-L420 |
openid/php-openid | Auth/OpenID/Discover.php | Auth_OpenID_ServiceEndpoint.matchTypes | function matchTypes($type_uris)
{
$result = array();
foreach ($type_uris as $test_uri) {
if ($this->supportsType($test_uri)) {
$result[] = $test_uri;
}
}
return $result;
} | php | function matchTypes($type_uris)
{
$result = array();
foreach ($type_uris as $test_uri) {
if ($this->supportsType($test_uri)) {
$result[] = $test_uri;
}
}
return $result;
} | [
"function",
"matchTypes",
"(",
"$",
"type_uris",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"type_uris",
"as",
"$",
"test_uri",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"supportsType",
"(",
"$",
"test_uri",
")",
")",
... | /*
Query this endpoint to see if it has any of the given type
URIs. This is useful for implementing other endpoint classes
that e.g. need to check for the presence of multiple versions
of a single protocol.
@param $type_uris The URIs that you wish to check
@return all types that are in both in type_uris and
$this->ty... | [
"/",
"*",
"Query",
"this",
"endpoint",
"to",
"see",
"if",
"it",
"has",
"any",
"of",
"the",
"given",
"type",
"URIs",
".",
"This",
"is",
"useful",
"for",
"implementing",
"other",
"endpoint",
"classes",
"that",
"e",
".",
"g",
".",
"need",
"to",
"check",
... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Discover.php#L124-L134 |
openid/php-openid | Auth/OpenID/Discover.php | Auth_OpenID_ServiceEndpoint.consumerFromXRDS | function consumerFromXRDS($uri, $xrds_text)
{
$xrds =& Auth_Yadis_XRDS::parseXRDS($xrds_text);
if ($xrds) {
$yadis_services =
$xrds->services(array('filter_MatchesAnyOpenIDConsumerType'));
return Auth_OpenID_makeOpenIDEndpoints($uri, $yadis_services);
}... | php | function consumerFromXRDS($uri, $xrds_text)
{
$xrds =& Auth_Yadis_XRDS::parseXRDS($xrds_text);
if ($xrds) {
$yadis_services =
$xrds->services(array('filter_MatchesAnyOpenIDConsumerType'));
return Auth_OpenID_makeOpenIDEndpoints($uri, $yadis_services);
}... | [
"function",
"consumerFromXRDS",
"(",
"$",
"uri",
",",
"$",
"xrds_text",
")",
"{",
"$",
"xrds",
"=",
"&",
"Auth_Yadis_XRDS",
"::",
"parseXRDS",
"(",
"$",
"xrds_text",
")",
";",
"if",
"(",
"$",
"xrds",
")",
"{",
"$",
"yadis_services",
"=",
"$",
"xrds",
... | /*
Parse the given document as XRDS looking for OpenID consumer services.
@return array of Auth_OpenID_ServiceEndpoint or null if the
document cannot be parsed. | [
"/",
"*",
"Parse",
"the",
"given",
"document",
"as",
"XRDS",
"looking",
"for",
"OpenID",
"consumer",
"services",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Discover.php#L207-L218 |
openid/php-openid | Auth/OpenID/Discover.php | Auth_OpenID_ServiceEndpoint.fromDiscoveryResult | static function fromDiscoveryResult($discoveryResult)
{
if ($discoveryResult->isXRDS()) {
return Auth_OpenID_ServiceEndpoint::fromXRDS(
$discoveryResult->normalized_uri,
$discoveryResult->response_text);
} else {
... | php | static function fromDiscoveryResult($discoveryResult)
{
if ($discoveryResult->isXRDS()) {
return Auth_OpenID_ServiceEndpoint::fromXRDS(
$discoveryResult->normalized_uri,
$discoveryResult->response_text);
} else {
... | [
"static",
"function",
"fromDiscoveryResult",
"(",
"$",
"discoveryResult",
")",
"{",
"if",
"(",
"$",
"discoveryResult",
"->",
"isXRDS",
"(",
")",
")",
"{",
"return",
"Auth_OpenID_ServiceEndpoint",
"::",
"fromXRDS",
"(",
"$",
"discoveryResult",
"->",
"normalized_uri... | Create endpoints from a DiscoveryResult.
@param Auth_Yadis_DiscoveryResult $discoveryResult
@return Auth_OpenID_ServiceEndpoint[]|null null if
endpoints cannot be created. | [
"Create",
"endpoints",
"from",
"a",
"DiscoveryResult",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Discover.php#L246-L257 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_ServerError.encodeToURL | function encodeToURL()
{
if (!$this->message) {
return null;
}
$msg = $this->toMessage();
return $msg->toURL($this->getReturnTo());
} | php | function encodeToURL()
{
if (!$this->message) {
return null;
}
$msg = $this->toMessage();
return $msg->toURL($this->getReturnTo());
} | [
"function",
"encodeToURL",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"message",
")",
"{",
"return",
"null",
";",
"}",
"$",
"msg",
"=",
"$",
"this",
"->",
"toMessage",
"(",
")",
";",
"return",
"$",
"msg",
"->",
"toURL",
"(",
"$",
"this",
... | Encodes this error's response as a URL suitable for
redirection. If the response has no return_to, another
Auth_OpenID_ServerError is returned. | [
"Encodes",
"this",
"error",
"s",
"response",
"as",
"a",
"URL",
"suitable",
"for",
"redirection",
".",
"If",
"the",
"response",
"has",
"no",
"return_to",
"another",
"Auth_OpenID_ServerError",
"is",
"returned",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L206-L214 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_ServerError.whichEncoding | function whichEncoding()
{
global $_Auth_OpenID_Request_Modes;
if ($this->hasReturnTo()) {
if ($this->message->isOpenID2() &&
(strlen($this->encodeToURL()) >
Auth_OpenID_OPENID1_URL_LIMIT)) {
return Auth_OpenID_ENCODE_HTML_FORM;
... | php | function whichEncoding()
{
global $_Auth_OpenID_Request_Modes;
if ($this->hasReturnTo()) {
if ($this->message->isOpenID2() &&
(strlen($this->encodeToURL()) >
Auth_OpenID_OPENID1_URL_LIMIT)) {
return Auth_OpenID_ENCODE_HTML_FORM;
... | [
"function",
"whichEncoding",
"(",
")",
"{",
"global",
"$",
"_Auth_OpenID_Request_Modes",
";",
"if",
"(",
"$",
"this",
"->",
"hasReturnTo",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"message",
"->",
"isOpenID2",
"(",
")",
"&&",
"(",
"strlen",
"(... | Returns one of Auth_OpenID_ENCODE_URL,
Auth_OpenID_ENCODE_KVFORM, or null, depending on the type of
encoding expected for this error's payload. | [
"Returns",
"one",
"of",
"Auth_OpenID_ENCODE_URL",
"Auth_OpenID_ENCODE_KVFORM",
"or",
"null",
"depending",
"on",
"the",
"type",
"of",
"encoding",
"expected",
"for",
"this",
"error",
"s",
"payload",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L267-L294 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_CheckIDRequest.returnToVerified | function returnToVerified()
{
$fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
return call_user_func_array($this->verifyReturnTo,
array($this->trust_root, $this->return_to, $fetcher));
} | php | function returnToVerified()
{
$fetcher = Auth_Yadis_Yadis::getHTTPFetcher();
return call_user_func_array($this->verifyReturnTo,
array($this->trust_root, $this->return_to, $fetcher));
} | [
"function",
"returnToVerified",
"(",
")",
"{",
"$",
"fetcher",
"=",
"Auth_Yadis_Yadis",
"::",
"getHTTPFetcher",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
"$",
"this",
"->",
"verifyReturnTo",
",",
"array",
"(",
"$",
"this",
"->",
"trust_root",
",",
... | /*
Does the relying party publish the return_to URL for this
response under the realm? It is up to the provider to set a
policy for what kinds of realms should be allowed. This
return_to URL verification reduces vulnerability to data-theft
attacks based on open proxies, corss-site-scripting, or open
redirectors.
This ... | [
"/",
"*",
"Does",
"the",
"relying",
"party",
"publish",
"the",
"return_to",
"URL",
"for",
"this",
"response",
"under",
"the",
"realm?",
"It",
"is",
"up",
"to",
"the",
"provider",
"to",
"set",
"a",
"policy",
"for",
"what",
"kinds",
"of",
"realms",
"should... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L924-L929 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_CheckIDRequest.answer | function answer($allow, $server_url = null, $identity = null,
$claimed_id = null)
{
if (!$this->return_to) {
return new Auth_OpenID_NoReturnToError();
}
if (!$server_url) {
if ((!$this->message->isOpenID1()) &&
(!$this->server->op_... | php | function answer($allow, $server_url = null, $identity = null,
$claimed_id = null)
{
if (!$this->return_to) {
return new Auth_OpenID_NoReturnToError();
}
if (!$server_url) {
if ((!$this->message->isOpenID1()) &&
(!$this->server->op_... | [
"function",
"answer",
"(",
"$",
"allow",
",",
"$",
"server_url",
"=",
"null",
",",
"$",
"identity",
"=",
"null",
",",
"$",
"claimed_id",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"return_to",
")",
"{",
"return",
"new",
"Auth_OpenID_No... | Respond to this request. Return either an
{@link Auth_OpenID_ServerResponse} or
{@link Auth_OpenID_ServerError}.
@param bool $allow Allow this user to claim this identity, and
allow the consumer to have this information?
@param string $server_url DEPRECATED. Passing $op_endpoint to
the {@link Auth_OpenID_Server} co... | [
"Respond",
"to",
"this",
"request",
".",
"Return",
"either",
"an",
"{",
"@link",
"Auth_OpenID_ServerResponse",
"}",
"or",
"{",
"@link",
"Auth_OpenID_ServerError",
"}",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1081-L1231 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_ServerResponse.toFormMarkup | function toFormMarkup($form_tag_attrs=null)
{
return $this->fields->toFormMarkup($this->request->return_to,
$form_tag_attrs);
} | php | function toFormMarkup($form_tag_attrs=null)
{
return $this->fields->toFormMarkup($this->request->return_to,
$form_tag_attrs);
} | [
"function",
"toFormMarkup",
"(",
"$",
"form_tag_attrs",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"fields",
"->",
"toFormMarkup",
"(",
"$",
"this",
"->",
"request",
"->",
"return_to",
",",
"$",
"form_tag_attrs",
")",
";",
"}"
] | /*
Returns the form markup for this response.
@return str | [
"/",
"*",
"Returns",
"the",
"form",
"markup",
"for",
"this",
"response",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1330-L1334 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Signatory.verify | function verify($assoc_handle, $message)
{
$assoc = $this->getAssociation($assoc_handle, true);
if (!$assoc) {
// oidutil.log("failed to get assoc with handle %r to verify sig %r"
// % (assoc_handle, sig))
return false;
}
return $assoc... | php | function verify($assoc_handle, $message)
{
$assoc = $this->getAssociation($assoc_handle, true);
if (!$assoc) {
// oidutil.log("failed to get assoc with handle %r to verify sig %r"
// % (assoc_handle, sig))
return false;
}
return $assoc... | [
"function",
"verify",
"(",
"$",
"assoc_handle",
",",
"$",
"message",
")",
"{",
"$",
"assoc",
"=",
"$",
"this",
"->",
"getAssociation",
"(",
"$",
"assoc_handle",
",",
"true",
")",
";",
"if",
"(",
"!",
"$",
"assoc",
")",
"{",
"// oidutil.log(\"failed to ge... | Verify, using a given association handle, a signature with
signed key-value pairs from an HTTP request.
@param string $assoc_handle
@param Auth_OpenID_Message $message
@return bool | [
"Verify",
"using",
"a",
"given",
"association",
"handle",
"a",
"signature",
"with",
"signed",
"key",
"-",
"value",
"pairs",
"from",
"an",
"HTTP",
"request",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1451-L1461 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Signatory.sign | function sign($response)
{
$signed_response = $response;
/** @var Auth_OpenID_CheckIDRequest $request */
$request = $response->request;
$assoc_handle = $request->assoc_handle;
if ($assoc_handle) {
// normal mode
$assoc = $this->getAssociation($assoc_h... | php | function sign($response)
{
$signed_response = $response;
/** @var Auth_OpenID_CheckIDRequest $request */
$request = $response->request;
$assoc_handle = $request->assoc_handle;
if ($assoc_handle) {
// normal mode
$assoc = $this->getAssociation($assoc_h... | [
"function",
"sign",
"(",
"$",
"response",
")",
"{",
"$",
"signed_response",
"=",
"$",
"response",
";",
"/** @var Auth_OpenID_CheckIDRequest $request */",
"$",
"request",
"=",
"$",
"response",
"->",
"request",
";",
"$",
"assoc_handle",
"=",
"$",
"request",
"->",
... | Given a response, sign the fields in the response's 'signed'
list, and insert the signature into the response.
@param Auth_OpenID_ServerResponse $response
@return mixed | [
"Given",
"a",
"response",
"sign",
"the",
"fields",
"in",
"the",
"response",
"s",
"signed",
"list",
"and",
"insert",
"the",
"signature",
"into",
"the",
"response",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1470-L1500 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Signatory.createAssociation | function createAssociation($dumb = true, $assoc_type = 'HMAC-SHA1')
{
$secret = Auth_OpenID_CryptUtil::getBytes(
Auth_OpenID_getSecretSize($assoc_type));
$uniq = base64_encode(Auth_OpenID_CryptUtil::getBytes(4));
$handle = sprintf('{%s}{%x}{%s}', $assoc_type, intval(time... | php | function createAssociation($dumb = true, $assoc_type = 'HMAC-SHA1')
{
$secret = Auth_OpenID_CryptUtil::getBytes(
Auth_OpenID_getSecretSize($assoc_type));
$uniq = base64_encode(Auth_OpenID_CryptUtil::getBytes(4));
$handle = sprintf('{%s}{%x}{%s}', $assoc_type, intval(time... | [
"function",
"createAssociation",
"(",
"$",
"dumb",
"=",
"true",
",",
"$",
"assoc_type",
"=",
"'HMAC-SHA1'",
")",
"{",
"$",
"secret",
"=",
"Auth_OpenID_CryptUtil",
"::",
"getBytes",
"(",
"Auth_OpenID_getSecretSize",
"(",
"$",
"assoc_type",
")",
")",
";",
"$",
... | Make a new association.
@param bool $dumb
@param string $assoc_type
@return Auth_OpenID_Association | [
"Make",
"a",
"new",
"association",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1509-L1528 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Signatory.getAssociation | function getAssociation($assoc_handle, $dumb, $check_expiration=true)
{
if ($assoc_handle === null) {
return new Auth_OpenID_ServerError(null,
"assoc_handle must not be null");
}
if ($dumb) {
$key = $this->dumb_key;
} else... | php | function getAssociation($assoc_handle, $dumb, $check_expiration=true)
{
if ($assoc_handle === null) {
return new Auth_OpenID_ServerError(null,
"assoc_handle must not be null");
}
if ($dumb) {
$key = $this->dumb_key;
} else... | [
"function",
"getAssociation",
"(",
"$",
"assoc_handle",
",",
"$",
"dumb",
",",
"$",
"check_expiration",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"assoc_handle",
"===",
"null",
")",
"{",
"return",
"new",
"Auth_OpenID_ServerError",
"(",
"null",
",",
"\"assoc_han... | Given an association handle, get the association from the
store, or return a ServerError or null if something goes wrong.
@param string $assoc_handle
@param bool $dumb
@param bool $check_expiration
@return Auth_OpenID_Association|Auth_OpenID_ServerError|null | [
"Given",
"an",
"association",
"handle",
"get",
"the",
"association",
"from",
"the",
"store",
"or",
"return",
"a",
"ServerError",
"or",
"null",
"if",
"something",
"goes",
"wrong",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1539-L1562 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Signatory.invalidate | function invalidate($assoc_handle, $dumb)
{
if ($dumb) {
$key = $this->dumb_key;
} else {
$key = $this->normal_key;
}
$this->store->removeAssociation($key, $assoc_handle);
} | php | function invalidate($assoc_handle, $dumb)
{
if ($dumb) {
$key = $this->dumb_key;
} else {
$key = $this->normal_key;
}
$this->store->removeAssociation($key, $assoc_handle);
} | [
"function",
"invalidate",
"(",
"$",
"assoc_handle",
",",
"$",
"dumb",
")",
"{",
"if",
"(",
"$",
"dumb",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"dumb_key",
";",
"}",
"else",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"normal_key",
";",
"}",
... | Invalidate a given association handle.
@param string $assoc_handle
@param bool $dumb | [
"Invalidate",
"a",
"given",
"association",
"handle",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1570-L1578 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Encoder.encode | function encode($response)
{
$cls = $this->responseFactory;
$encode_as = $response->whichEncoding();
if ($encode_as == Auth_OpenID_ENCODE_KVFORM) {
$wr = new $cls(null, null, $response->encodeToKVForm());
if (is_a($response, 'Auth_OpenID_ServerError')) {
... | php | function encode($response)
{
$cls = $this->responseFactory;
$encode_as = $response->whichEncoding();
if ($encode_as == Auth_OpenID_ENCODE_KVFORM) {
$wr = new $cls(null, null, $response->encodeToKVForm());
if (is_a($response, 'Auth_OpenID_ServerError')) {
... | [
"function",
"encode",
"(",
"$",
"response",
")",
"{",
"$",
"cls",
"=",
"$",
"this",
"->",
"responseFactory",
";",
"$",
"encode_as",
"=",
"$",
"response",
"->",
"whichEncoding",
"(",
")",
";",
"if",
"(",
"$",
"encode_as",
"==",
"Auth_OpenID_ENCODE_KVFORM",
... | Encode an {@link Auth_OpenID_ServerResponse} and return an
{@link Auth_OpenID_WebResponse}.
@param Auth_OpenID_ServerResponse $response
@return Auth_OpenID_EncodingError | [
"Encode",
"an",
"{",
"@link",
"Auth_OpenID_ServerResponse",
"}",
"and",
"return",
"an",
"{",
"@link",
"Auth_OpenID_WebResponse",
"}",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1598-L1623 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_SigningEncoder.encode | function encode($response)
{
// the isinstance is a bit of a kludge... it means there isn't
// really an adapter to make the interfaces quite match.
if (!is_a($response, 'Auth_OpenID_ServerError') &&
$response->needsSigning()) {
if (!$this->signatory) {
... | php | function encode($response)
{
// the isinstance is a bit of a kludge... it means there isn't
// really an adapter to make the interfaces quite match.
if (!is_a($response, 'Auth_OpenID_ServerError') &&
$response->needsSigning()) {
if (!$this->signatory) {
... | [
"function",
"encode",
"(",
"$",
"response",
")",
"{",
"// the isinstance is a bit of a kludge... it means there isn't",
"// really an adapter to make the interfaces quite match.",
"if",
"(",
"!",
"is_a",
"(",
"$",
"response",
",",
"'Auth_OpenID_ServerError'",
")",
"&&",
"$",
... | Sign an {@link Auth_OpenID_ServerResponse} and return an
{@link Auth_OpenID_WebResponse}.
@param Auth_OpenID_ServerResponse $response
@return Auth_OpenID_AlreadySigned|Auth_OpenID_EncodingError|Auth_OpenID_ServerError | [
"Sign",
"an",
"{",
"@link",
"Auth_OpenID_ServerResponse",
"}",
"and",
"return",
"an",
"{",
"@link",
"Auth_OpenID_WebResponse",
"}",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1653-L1672 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Decoder.decode | function decode($query)
{
if (!$query) {
return null;
}
$message = Auth_OpenID_Message::fromPostArgs($query);
if ($message === null) {
/*
* It's useful to have a Message attached to a
* ProtocolError, so we override the bad ns value... | php | function decode($query)
{
if (!$query) {
return null;
}
$message = Auth_OpenID_Message::fromPostArgs($query);
if ($message === null) {
/*
* It's useful to have a Message attached to a
* ProtocolError, so we override the bad ns value... | [
"function",
"decode",
"(",
"$",
"query",
")",
"{",
"if",
"(",
"!",
"$",
"query",
")",
"{",
"return",
"null",
";",
"}",
"$",
"message",
"=",
"Auth_OpenID_Message",
"::",
"fromPostArgs",
"(",
"$",
"query",
")",
";",
"if",
"(",
"$",
"message",
"===",
... | Given an HTTP query in an array (key-value pairs), decode it
into an Auth_OpenID_Request object.
@param array $query
@return Auth_OpenID_ServerError|mixed | [
"Given",
"an",
"HTTP",
"query",
"in",
"an",
"array",
"(",
"key",
"-",
"value",
"pairs",
")",
"decode",
"it",
"into",
"an",
"Auth_OpenID_Request",
"object",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1709-L1754 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Server.handleRequest | function handleRequest($request)
{
if (method_exists($this, "openid_" . $request->mode)) {
$handler = array($this, "openid_" . $request->mode);
return call_user_func_array($handler, array($request));
}
return null;
} | php | function handleRequest($request)
{
if (method_exists($this, "openid_" . $request->mode)) {
$handler = array($this, "openid_" . $request->mode);
return call_user_func_array($handler, array($request));
}
return null;
} | [
"function",
"handleRequest",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"\"openid_\"",
".",
"$",
"request",
"->",
"mode",
")",
")",
"{",
"$",
"handler",
"=",
"array",
"(",
"$",
"this",
",",
"\"openid_\"",
".",
"... | Handle a request. Given an {@link Auth_OpenID_Request} object,
call the appropriate {@link Auth_OpenID_Server} method to
process the request and generate a response.
@param Auth_OpenID_Request $request An {@link Auth_OpenID_Request}
returned by {@link Auth_OpenID_Server::decodeRequest()}.
@return Auth_OpenID_ServerR... | [
"Handle",
"a",
"request",
".",
"Given",
"an",
"{",
"@link",
"Auth_OpenID_Request",
"}",
"object",
"call",
"the",
"appropriate",
"{",
"@link",
"Auth_OpenID_Server",
"}",
"method",
"to",
"process",
"the",
"request",
"and",
"generate",
"a",
"response",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1909-L1916 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Server.openid_associate | function openid_associate($request)
{
$assoc_type = $request->assoc_type;
$session_type = $request->session->session_type;
if ($this->negotiator->isAllowed($assoc_type, $session_type)) {
$assoc = $this->signatory->createAssociation(false,
... | php | function openid_associate($request)
{
$assoc_type = $request->assoc_type;
$session_type = $request->session->session_type;
if ($this->negotiator->isAllowed($assoc_type, $session_type)) {
$assoc = $this->signatory->createAssociation(false,
... | [
"function",
"openid_associate",
"(",
"$",
"request",
")",
"{",
"$",
"assoc_type",
"=",
"$",
"request",
"->",
"assoc_type",
";",
"$",
"session_type",
"=",
"$",
"request",
"->",
"session",
"->",
"session_type",
";",
"if",
"(",
"$",
"this",
"->",
"negotiator"... | The callback for 'associate' messages.
@param Auth_OpenID_AssociateRequest $request
@return mixed | [
"The",
"callback",
"for",
"associate",
"messages",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1935-L1952 |
openid/php-openid | Auth/OpenID/Server.php | Auth_OpenID_Server.decodeRequest | function decodeRequest($query=null)
{
if ($query === null) {
$query = Auth_OpenID::getQuery();
}
return $this->decoder->decode($query);
} | php | function decodeRequest($query=null)
{
if ($query === null) {
$query = Auth_OpenID::getQuery();
}
return $this->decoder->decode($query);
} | [
"function",
"decodeRequest",
"(",
"$",
"query",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"query",
"===",
"null",
")",
"{",
"$",
"query",
"=",
"Auth_OpenID",
"::",
"getQuery",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"decoder",
"->",
"decode",
... | Decodes a query args array into the appropriate
{@link Auth_OpenID_Request} object.
@param array|null $query
@return Auth_OpenID_ServerError|mixed | [
"Decodes",
"a",
"query",
"args",
"array",
"into",
"the",
"appropriate",
"{",
"@link",
"Auth_OpenID_Request",
"}",
"object",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Server.php#L1973-L1980 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Request.getExtensionArgs | function getExtensionArgs($request = null)
{
$ns_args = array(
'preferred_auth_policies' =>
implode(' ', $this->preferred_auth_policies)
);
if ($this->max_auth_age !== null) {
$ns_args['max_auth_age'] = strval(... | php | function getExtensionArgs($request = null)
{
$ns_args = array(
'preferred_auth_policies' =>
implode(' ', $this->preferred_auth_policies)
);
if ($this->max_auth_age !== null) {
$ns_args['max_auth_age'] = strval(... | [
"function",
"getExtensionArgs",
"(",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"ns_args",
"=",
"array",
"(",
"'preferred_auth_policies'",
"=>",
"implode",
"(",
"' '",
",",
"$",
"this",
"->",
"preferred_auth_policies",
")",
")",
";",
"if",
"(",
"$",
"this... | Get the string arguments that should be added to an OpenID
message for this extension.
@param Auth_OpenID_Request|null $request
@return null | [
"Get",
"the",
"string",
"arguments",
"that",
"should",
"be",
"added",
"to",
"an",
"OpenID",
"message",
"for",
"this",
"extension",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L79-L91 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Request.fromOpenIDRequest | static function fromOpenIDRequest($request)
{
$obj = new Auth_OpenID_PAPE_Request();
$args = $request->message->getArgs(Auth_OpenID_PAPE_NS_URI);
if ($args === null || $args === array()) {
return null;
}
$obj->parseExtensionArgs($args);
return $obj;
... | php | static function fromOpenIDRequest($request)
{
$obj = new Auth_OpenID_PAPE_Request();
$args = $request->message->getArgs(Auth_OpenID_PAPE_NS_URI);
if ($args === null || $args === array()) {
return null;
}
$obj->parseExtensionArgs($args);
return $obj;
... | [
"static",
"function",
"fromOpenIDRequest",
"(",
"$",
"request",
")",
"{",
"$",
"obj",
"=",
"new",
"Auth_OpenID_PAPE_Request",
"(",
")",
";",
"$",
"args",
"=",
"$",
"request",
"->",
"message",
"->",
"getArgs",
"(",
"Auth_OpenID_PAPE_NS_URI",
")",
";",
"if",
... | Instantiate a Request object from the arguments in a checkid_*
OpenID message
@param Auth_OpenID_Request $request
@return Auth_OpenID_PAPE_Request|null | [
"Instantiate",
"a",
"Request",
"object",
"from",
"the",
"arguments",
"in",
"a",
"checkid_",
"*",
"OpenID",
"message"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L100-L111 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Request.parseExtensionArgs | function parseExtensionArgs($args)
{
// preferred_auth_policies is a space-separated list of policy
// URIs
$this->preferred_auth_policies = array();
$policies_str = Auth_OpenID::arrayGet($args, 'preferred_auth_policies');
if ($policies_str) {
foreach (explode(' ... | php | function parseExtensionArgs($args)
{
// preferred_auth_policies is a space-separated list of policy
// URIs
$this->preferred_auth_policies = array();
$policies_str = Auth_OpenID::arrayGet($args, 'preferred_auth_policies');
if ($policies_str) {
foreach (explode(' ... | [
"function",
"parseExtensionArgs",
"(",
"$",
"args",
")",
"{",
"// preferred_auth_policies is a space-separated list of policy",
"// URIs",
"$",
"this",
"->",
"preferred_auth_policies",
"=",
"array",
"(",
")",
";",
"$",
"policies_str",
"=",
"Auth_OpenID",
"::",
"arrayGet... | Set the state of this request to be that expressed in these
PAPE arguments
@param args: The PAPE arguments without a namespace | [
"Set",
"the",
"state",
"of",
"this",
"request",
"to",
"be",
"that",
"expressed",
"in",
"these",
"PAPE",
"arguments"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L119-L141 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Request.preferredTypes | function preferredTypes($supported_types)
{
$result = array();
foreach ($supported_types as $st) {
if (in_array($st, $this->preferred_auth_policies)) {
$result[] = $st;
}
}
return $result;
} | php | function preferredTypes($supported_types)
{
$result = array();
foreach ($supported_types as $st) {
if (in_array($st, $this->preferred_auth_policies)) {
$result[] = $st;
}
}
return $result;
} | [
"function",
"preferredTypes",
"(",
"$",
"supported_types",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"supported_types",
"as",
"$",
"st",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"st",
",",
"$",
"this",
"->",
"prefer... | Given a list of authentication policy URIs that a provider
supports, this method returns the subsequence of those types
that are preferred by the relying party.
@param supported_types: A sequence of authentication policy
type URIs that are supported by a provider
@return array The sub-sequence of the supported types ... | [
"Given",
"a",
"list",
"of",
"authentication",
"policy",
"URIs",
"that",
"a",
"provider",
"supports",
"this",
"method",
"returns",
"the",
"subsequence",
"of",
"those",
"types",
"that",
"are",
"preferred",
"by",
"the",
"relying",
"party",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L157-L167 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Response.fromSuccessResponse | static function fromSuccessResponse($success_response)
{
$obj = new Auth_OpenID_PAPE_Response();
// PAPE requires that the args be signed.
$args = $success_response->getSignedNS(Auth_OpenID_PAPE_NS_URI);
if ($args === null || $args === array()) {
return null;
}
... | php | static function fromSuccessResponse($success_response)
{
$obj = new Auth_OpenID_PAPE_Response();
// PAPE requires that the args be signed.
$args = $success_response->getSignedNS(Auth_OpenID_PAPE_NS_URI);
if ($args === null || $args === array()) {
return null;
}
... | [
"static",
"function",
"fromSuccessResponse",
"(",
"$",
"success_response",
")",
"{",
"$",
"obj",
"=",
"new",
"Auth_OpenID_PAPE_Response",
"(",
")",
";",
"// PAPE requires that the args be signed.",
"$",
"args",
"=",
"$",
"success_response",
"->",
"getSignedNS",
"(",
... | Create an Auth_OpenID_PAPE_Response object from a successful
OpenID library response.
@param Auth_OpenID_SuccessResponse $success_response A SuccessResponse
from Auth_OpenID_Consumer::complete()
@return Auth_OpenID_PAPE_Response A provider authentication policy response from the
data that was supplied with the id_res... | [
"Create",
"an",
"Auth_OpenID_PAPE_Response",
"object",
"from",
"a",
"successful",
"OpenID",
"library",
"response",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L223-L241 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Response.parseExtensionArgs | function parseExtensionArgs($args, $strict=false)
{
$policies_str = Auth_OpenID::arrayGet($args, 'auth_policies');
if ($policies_str && $policies_str != "none") {
$this->auth_policies = explode(" ", $policies_str);
}
$nist_level_str = Auth_OpenID::arrayGet($args, 'nist_a... | php | function parseExtensionArgs($args, $strict=false)
{
$policies_str = Auth_OpenID::arrayGet($args, 'auth_policies');
if ($policies_str && $policies_str != "none") {
$this->auth_policies = explode(" ", $policies_str);
}
$nist_level_str = Auth_OpenID::arrayGet($args, 'nist_a... | [
"function",
"parseExtensionArgs",
"(",
"$",
"args",
",",
"$",
"strict",
"=",
"false",
")",
"{",
"$",
"policies_str",
"=",
"Auth_OpenID",
"::",
"arrayGet",
"(",
"$",
"args",
",",
"'auth_policies'",
")",
";",
"if",
"(",
"$",
"policies_str",
"&&",
"$",
"pol... | Parse the provider authentication policy arguments into the
internal state of this object
@param array $args unqualified provider authentication policy
arguments
@param bool $strict Whether to return false when bad data is
encountered
@return null|bool The data is parsed into the internal fields of
this object. | [
"Parse",
"the",
"provider",
"authentication",
"policy",
"arguments",
"into",
"the",
"internal",
"state",
"of",
"this",
"object"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L256-L291 |
openid/php-openid | Auth/OpenID/PAPE.php | Auth_OpenID_PAPE_Response.getExtensionArgs | function getExtensionArgs($request = null)
{
$ns_args = array();
if (count($this->auth_policies) > 0) {
$ns_args['auth_policies'] = implode(' ', $this->auth_policies);
} else {
$ns_args['auth_policies'] = 'none';
}
if ($this->nist_auth_level !== null)... | php | function getExtensionArgs($request = null)
{
$ns_args = array();
if (count($this->auth_policies) > 0) {
$ns_args['auth_policies'] = implode(' ', $this->auth_policies);
} else {
$ns_args['auth_policies'] = 'none';
}
if ($this->nist_auth_level !== null)... | [
"function",
"getExtensionArgs",
"(",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"ns_args",
"=",
"array",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"auth_policies",
")",
">",
"0",
")",
"{",
"$",
"ns_args",
"[",
"'auth_policies'",
"]"... | Get the string arguments that should be added to an OpenID
message for this extension.
@param Auth_OpenID_Request|null $request
@return null | [
"Get",
"the",
"string",
"arguments",
"that",
"should",
"be",
"added",
"to",
"an",
"OpenID",
"message",
"for",
"this",
"extension",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/PAPE.php#L300-L325 |
openid/php-openid | Auth/OpenID/TrustRoot.php | Auth_OpenID_TrustRoot.buildDiscoveryURL | static function buildDiscoveryURL($realm)
{
$parsed = Auth_OpenID_TrustRoot::_parse($realm);
if ($parsed === false) {
return false;
}
if ($parsed['wildcard']) {
// Use "www." in place of the star
if ($parsed['host'][0] != '.') {
r... | php | static function buildDiscoveryURL($realm)
{
$parsed = Auth_OpenID_TrustRoot::_parse($realm);
if ($parsed === false) {
return false;
}
if ($parsed['wildcard']) {
// Use "www." in place of the star
if ($parsed['host'][0] != '.') {
r... | [
"static",
"function",
"buildDiscoveryURL",
"(",
"$",
"realm",
")",
"{",
"$",
"parsed",
"=",
"Auth_OpenID_TrustRoot",
"::",
"_parse",
"(",
"$",
"realm",
")",
";",
"if",
"(",
"$",
"parsed",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"if",
"("... | /*
Return a discovery URL for this realm.
Return null if the realm could not be parsed or was not valid.
@param return_to The relying party return URL of the OpenID
authentication request
@return The URL upon which relying party discovery should be
run in order to verify the return_to URL | [
"/",
"*",
"Return",
"a",
"discovery",
"URL",
"for",
"this",
"realm",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/TrustRoot.php#L61-L82 |
openid/php-openid | Auth/OpenID/TrustRoot.php | Auth_OpenID_TrustRoot._parse | static function _parse($trust_root)
{
$trust_root = Auth_OpenID_urinorm($trust_root);
if ($trust_root === null) {
return false;
}
if (preg_match("/:\/\/[^:]+(:\d+){2,}(\/|$)/", $trust_root)) {
return false;
}
$parts = @parse_url($trust_root);... | php | static function _parse($trust_root)
{
$trust_root = Auth_OpenID_urinorm($trust_root);
if ($trust_root === null) {
return false;
}
if (preg_match("/:\/\/[^:]+(:\d+){2,}(\/|$)/", $trust_root)) {
return false;
}
$parts = @parse_url($trust_root);... | [
"static",
"function",
"_parse",
"(",
"$",
"trust_root",
")",
"{",
"$",
"trust_root",
"=",
"Auth_OpenID_urinorm",
"(",
"$",
"trust_root",
")",
";",
"if",
"(",
"$",
"trust_root",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"preg_match"... | Parse a URL into its trust_root parts.
@static
@access private
@param string $trust_root The url to parse
@return mixed $parsed Either an associative array of trust root
parts or false if parsing failed. | [
"Parse",
"a",
"URL",
"into",
"its",
"trust_root",
"parts",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/TrustRoot.php#L96-L175 |
openid/php-openid | Auth/OpenID/TrustRoot.php | Auth_OpenID_TrustRoot.isSane | static function isSane($trust_root)
{
$parts = Auth_OpenID_TrustRoot::_parse($trust_root);
if ($parts === false) {
return false;
}
// Localhost is a special case
if ($parts['host'] == 'localhost') {
return true;
}
$host_parts = explod... | php | static function isSane($trust_root)
{
$parts = Auth_OpenID_TrustRoot::_parse($trust_root);
if ($parts === false) {
return false;
}
// Localhost is a special case
if ($parts['host'] == 'localhost') {
return true;
}
$host_parts = explod... | [
"static",
"function",
"isSane",
"(",
"$",
"trust_root",
")",
"{",
"$",
"parts",
"=",
"Auth_OpenID_TrustRoot",
"::",
"_parse",
"(",
"$",
"trust_root",
")",
";",
"if",
"(",
"$",
"parts",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"// Localhost ... | Is this trust root sane?
A trust root is sane if it is syntactically valid and it has a
reasonable domain name. Specifically, the domain name must be
more than one level below a standard TLD or more than two
levels below a two-letter tld.
For example, '*.com' is not a sane trust root, but '*.foo.com'
is. '*.co.uk' i... | [
"Is",
"this",
"trust",
"root",
"sane?"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/TrustRoot.php#L202-L256 |
openid/php-openid | Auth/OpenID/TrustRoot.php | Auth_OpenID_TrustRoot.match | static function match($trust_root, $url)
{
$trust_root_parsed = Auth_OpenID_TrustRoot::_parse($trust_root);
$url_parsed = Auth_OpenID_TrustRoot::_parse($url);
if (!$trust_root_parsed || !$url_parsed) {
return false;
}
// Check hosts matching
if ($url_pars... | php | static function match($trust_root, $url)
{
$trust_root_parsed = Auth_OpenID_TrustRoot::_parse($trust_root);
$url_parsed = Auth_OpenID_TrustRoot::_parse($url);
if (!$trust_root_parsed || !$url_parsed) {
return false;
}
// Check hosts matching
if ($url_pars... | [
"static",
"function",
"match",
"(",
"$",
"trust_root",
",",
"$",
"url",
")",
"{",
"$",
"trust_root_parsed",
"=",
"Auth_OpenID_TrustRoot",
"::",
"_parse",
"(",
"$",
"trust_root",
")",
";",
"$",
"url_parsed",
"=",
"Auth_OpenID_TrustRoot",
"::",
"_parse",
"(",
... | Does this URL match the given trust root?
Return whether the URL falls under the given trust root. This
does not check whether the trust root is sane. If the URL or
trust root do not parse, this function will return false.
@param string $trust_root The trust root to match against
@param string $url The URL to check
... | [
"Does",
"this",
"URL",
"match",
"the",
"given",
"trust",
"root?"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/TrustRoot.php#L272-L325 |
openid/php-openid | Auth/OpenID/Message.php | Auth_OpenID_Mapping.items | function items()
{
$temp = array();
for ($i = 0; $i < count($this->keys); $i++) {
$temp[] = array($this->keys[$i],
$this->values[$i]);
}
return $temp;
} | php | function items()
{
$temp = array();
for ($i = 0; $i < count($this->keys); $i++) {
$temp[] = array($this->keys[$i],
$this->values[$i]);
}
return $temp;
} | [
"function",
"items",
"(",
")",
"{",
"$",
"temp",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"this",
"->",
"keys",
")",
";",
"$",
"i",
"++",
")",
"{",
"$",
"temp",
"[",
"]",
"=",
"... | Returns an array of (key, value) pairs in the mapping. | [
"Returns",
"an",
"array",
"of",
"(",
"key",
"value",
")",
"pairs",
"in",
"the",
"mapping",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Message.php#L184-L193 |
openid/php-openid | Auth/OpenID/Message.php | Auth_OpenID_Mapping.set | function set($key, $value)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
$this->values[$index] = $value;
} else {
$this->keys[] = $key;
$this->values[] = $value;
}
} | php | function set($key, $value)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
$this->values[$index] = $value;
} else {
$this->keys[] = $key;
$this->values[] = $value;
}
} | [
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"keys",
")",
";",
"if",
"(",
"$",
"index",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"values",
"[",
... | Sets a key-value pair in the mapping. If the key already
exists, its value is replaced with the new value.
@param string $key
@param mixed $value | [
"Sets",
"a",
"key",
"-",
"value",
"pair",
"in",
"the",
"mapping",
".",
"If",
"the",
"key",
"already",
"exists",
"its",
"value",
"is",
"replaced",
"with",
"the",
"new",
"value",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Message.php#L210-L220 |
openid/php-openid | Auth/OpenID/Message.php | Auth_OpenID_Mapping.get | function get($key, $default = null)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
return $this->values[$index];
} else {
return $default;
}
} | php | function get($key, $default = null)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
return $this->values[$index];
} else {
return $default;
}
} | [
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"keys",
")",
";",
"if",
"(",
"$",
"index",
"!==",
"false",
")",
"{",
"return",
"$",
"thi... | Gets a specified value from the mapping, associated with the
specified key. If the key does not exist in the mapping,
$default is returned instead.
@param string $key
@param mixed $default
@return mixed|null | [
"Gets",
"a",
"specified",
"value",
"from",
"the",
"mapping",
"associated",
"with",
"the",
"specified",
"key",
".",
"If",
"the",
"key",
"does",
"not",
"exist",
"in",
"the",
"mapping",
"$default",
"is",
"returned",
"instead",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Message.php#L231-L240 |
openid/php-openid | Auth/OpenID/Message.php | Auth_OpenID_Mapping.del | function del($key)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
unset($this->keys[$index]);
unset($this->values[$index]);
$this->_reflow();
return true;
}
return false;
} | php | function del($key)
{
$index = array_search($key, $this->keys);
if ($index !== false) {
unset($this->keys[$index]);
unset($this->values[$index]);
$this->_reflow();
return true;
}
return false;
} | [
"function",
"del",
"(",
"$",
"key",
")",
"{",
"$",
"index",
"=",
"array_search",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"keys",
")",
";",
"if",
"(",
"$",
"index",
"!==",
"false",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"keys",
"[",
"$",
... | Deletes a key-value pair from the mapping with the specified
key.
@param string $key
@return bool | [
"Deletes",
"a",
"key",
"-",
"value",
"pair",
"from",
"the",
"mapping",
"with",
"the",
"specified",
"key",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/Message.php#L271-L282 |
openid/php-openid | contrib/signed_assertions/AP.php | Attribute_Provider.sign | function sign($openid,$attribute,$value)
{
$samlObj = new SAML();
$responseXmlString = $samlObj->createSamlAssertion($openid,
$this->notBefore,
$this->notOnOrAfter,
... | php | function sign($openid,$attribute,$value)
{
$samlObj = new SAML();
$responseXmlString = $samlObj->createSamlAssertion($openid,
$this->notBefore,
$this->notOnOrAfter,
... | [
"function",
"sign",
"(",
"$",
"openid",
",",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"$",
"samlObj",
"=",
"new",
"SAML",
"(",
")",
";",
"$",
"responseXmlString",
"=",
"$",
"samlObj",
"->",
"createSamlAssertion",
"(",
"$",
"openid",
",",
"$",
"... | Create the signed assertion.
@param string $openid - Openid of the entity being asserted.
@param string $attribute - The attribute name being asserted.
@param string $value - The attribute value being asserted. | [
"Create",
"the",
"signed",
"assertion",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/AP.php#L62-L77 |
openid/php-openid | contrib/signed_assertions/AP.php | Attribute_Verifier.verify | function verify($responseXmlString)
{
$samlObj = new SAML();
$ret = $samlObj->verifyAssertion($responseXmlString,$this->rootcert);
return $ret;
} | php | function verify($responseXmlString)
{
$samlObj = new SAML();
$ret = $samlObj->verifyAssertion($responseXmlString,$this->rootcert);
return $ret;
} | [
"function",
"verify",
"(",
"$",
"responseXmlString",
")",
"{",
"$",
"samlObj",
"=",
"new",
"SAML",
"(",
")",
";",
"$",
"ret",
"=",
"$",
"samlObj",
"->",
"verifyAssertion",
"(",
"$",
"responseXmlString",
",",
"$",
"this",
"->",
"rootcert",
")",
";",
"re... | Verifies the certificate given the SAML document.
@param string - signed SAML assertion
return @boolean - true if verification is successful, false if unsuccessful. | [
"Verifies",
"the",
"certificate",
"given",
"the",
"SAML",
"document",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/AP.php#L101-L106 |
openid/php-openid | contrib/signed_assertions/AP.php | AP_OP_StoreRequest.createStoreRequest | static function createStoreRequest(&$auth_request,&$attributeProvider,
$attribute,$value,$openid)
{
if(!$auth_request){
return null;
}
$signedAssertion=$attributeProvider->sign($openid,$attribute,$value);
$store_request=new Auth_OpenID_A... | php | static function createStoreRequest(&$auth_request,&$attributeProvider,
$attribute,$value,$openid)
{
if(!$auth_request){
return null;
}
$signedAssertion=$attributeProvider->sign($openid,$attribute,$value);
$store_request=new Auth_OpenID_A... | [
"static",
"function",
"createStoreRequest",
"(",
"&",
"$",
"auth_request",
",",
"&",
"$",
"attributeProvider",
",",
"$",
"attribute",
",",
"$",
"value",
",",
"$",
"openid",
")",
"{",
"if",
"(",
"!",
"$",
"auth_request",
")",
"{",
"return",
"null",
";",
... | Creates store request and adds it as an extension to AuthRequest object
passed to it.
@param &Auth_OpenID_AuthRequest &$auth_request - A reference to
the AuthRequest object.
@param &Attribute_Provider &$attributeProvider - A reference to the
Attribute Provider object.
@param string $attribute - The attribute name being... | [
"Creates",
"store",
"request",
"and",
"adds",
"it",
"as",
"an",
"extension",
"to",
"AuthRequest",
"object",
"passed",
"to",
"it",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/AP.php#L127-L142 |
openid/php-openid | contrib/signed_assertions/AP.php | RP_OP_Verify.verifyAssertion | function verifyAssertion(&$attributeVerifier,$response)
{
$ax_resp=Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response);
if($ax_resp instanceof Auth_OpenID_AX_FetchResponse){
$ax_args=$ax_resp->getExtensionArgs();
if($ax_args) {
$value=base64_decode($ax_args['value.e... | php | function verifyAssertion(&$attributeVerifier,$response)
{
$ax_resp=Auth_OpenID_AX_FetchResponse::fromSuccessResponse($response);
if($ax_resp instanceof Auth_OpenID_AX_FetchResponse){
$ax_args=$ax_resp->getExtensionArgs();
if($ax_args) {
$value=base64_decode($ax_args['value.e... | [
"function",
"verifyAssertion",
"(",
"&",
"$",
"attributeVerifier",
",",
"$",
"response",
")",
"{",
"$",
"ax_resp",
"=",
"Auth_OpenID_AX_FetchResponse",
"::",
"fromSuccessResponse",
"(",
"$",
"response",
")",
";",
"if",
"(",
"$",
"ax_resp",
"instanceof",
"Auth_Op... | Verifies a given signed assertion.
@param &Attribute_Verifier &$attributeVerifier - An instance of the class
passed for the verification.
@param Auth_OpenID_Response - Response object for extraction.
@return boolean - true if successful, false if verification fails. | [
"Verifies",
"a",
"given",
"signed",
"assertion",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/contrib/signed_assertions/AP.php#L158-L176 |
openid/php-openid | Auth/Yadis/ParanoidHTTPFetcher.php | Auth_Yadis_ParanoidHTTPFetcher.supportsSSL | function supportsSSL()
{
$v = curl_version();
if(is_array($v)) {
return in_array('https', $v['protocols']);
} elseif (is_string($v)) {
return preg_match('/OpenSSL/i', $v);
} else {
return 0;
}
} | php | function supportsSSL()
{
$v = curl_version();
if(is_array($v)) {
return in_array('https', $v['protocols']);
} elseif (is_string($v)) {
return preg_match('/OpenSSL/i', $v);
} else {
return 0;
}
} | [
"function",
"supportsSSL",
"(",
")",
"{",
"$",
"v",
"=",
"curl_version",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"v",
")",
")",
"{",
"return",
"in_array",
"(",
"'https'",
",",
"$",
"v",
"[",
"'protocols'",
"]",
")",
";",
"}",
"elseif",
"(... | Does this fetcher support SSL URLs? | [
"Does",
"this",
"fetcher",
"support",
"SSL",
"URLs?"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/Yadis/ParanoidHTTPFetcher.php#L76-L86 |
openid/php-openid | Auth/Yadis/HTTPFetcher.php | Auth_Yadis_HTTPFetcher.canFetchURL | function canFetchURL($url)
{
if ($this->isHTTPS($url) && !$this->supportsSSL()) {
Auth_OpenID::log("HTTPS URL unsupported fetching %s",
$url);
return false;
}
if (!$this->allowedURL($url)) {
Auth_OpenID::log("URL fetching not ... | php | function canFetchURL($url)
{
if ($this->isHTTPS($url) && !$this->supportsSSL()) {
Auth_OpenID::log("HTTPS URL unsupported fetching %s",
$url);
return false;
}
if (!$this->allowedURL($url)) {
Auth_OpenID::log("URL fetching not ... | [
"function",
"canFetchURL",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isHTTPS",
"(",
"$",
"url",
")",
"&&",
"!",
"$",
"this",
"->",
"supportsSSL",
"(",
")",
")",
"{",
"Auth_OpenID",
"::",
"log",
"(",
"\"HTTPS URL unsupported fetching %s\""... | Return whether a URL can be fetched. Returns false if the URL
scheme is not allowed or is not supported by this fetcher
implementation; returns true otherwise.
@param string $url
@return bool | [
"Return",
"whether",
"a",
"URL",
"can",
"be",
"fetched",
".",
"Returns",
"false",
"if",
"the",
"URL",
"scheme",
"is",
"not",
"allowed",
"or",
"is",
"not",
"supported",
"by",
"this",
"fetcher",
"implementation",
";",
"returns",
"true",
"otherwise",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/Yadis/HTTPFetcher.php#L62-L77 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore._setup | function _setup()
{
return (Auth_OpenID::ensureDir($this->nonce_dir) &&
Auth_OpenID::ensureDir($this->association_dir) &&
Auth_OpenID::ensureDir($this->temp_dir));
} | php | function _setup()
{
return (Auth_OpenID::ensureDir($this->nonce_dir) &&
Auth_OpenID::ensureDir($this->association_dir) &&
Auth_OpenID::ensureDir($this->temp_dir));
} | [
"function",
"_setup",
"(",
")",
"{",
"return",
"(",
"Auth_OpenID",
"::",
"ensureDir",
"(",
"$",
"this",
"->",
"nonce_dir",
")",
"&&",
"Auth_OpenID",
"::",
"ensureDir",
"(",
"$",
"this",
"->",
"association_dir",
")",
"&&",
"Auth_OpenID",
"::",
"ensureDir",
... | Make sure that the directories in which we store our data
exist.
@access private | [
"Make",
"sure",
"that",
"the",
"directories",
"in",
"which",
"we",
"store",
"our",
"data",
"exist",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L96-L101 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore._mktemp | function _mktemp()
{
$name = Auth_OpenID_FileStore::_mkstemp($dir = $this->temp_dir);
$file_obj = @fopen($name, 'wb');
if ($file_obj !== false) {
return array($file_obj, $name);
} else {
Auth_OpenID_FileStore::_removeIfPresent($name);
}
return ... | php | function _mktemp()
{
$name = Auth_OpenID_FileStore::_mkstemp($dir = $this->temp_dir);
$file_obj = @fopen($name, 'wb');
if ($file_obj !== false) {
return array($file_obj, $name);
} else {
Auth_OpenID_FileStore::_removeIfPresent($name);
}
return ... | [
"function",
"_mktemp",
"(",
")",
"{",
"$",
"name",
"=",
"Auth_OpenID_FileStore",
"::",
"_mkstemp",
"(",
"$",
"dir",
"=",
"$",
"this",
"->",
"temp_dir",
")",
";",
"$",
"file_obj",
"=",
"@",
"fopen",
"(",
"$",
"name",
",",
"'wb'",
")",
";",
"if",
"("... | Create a temporary file on the same filesystem as
$this->association_dir.
The temporary directory should not be cleaned if there are any
processes using the store. If there is no active process using
the store, it is safe to remove all of the files in the
temporary directory.
@return array ($fd, $filename)
@access pr... | [
"Create",
"a",
"temporary",
"file",
"on",
"the",
"same",
"filesystem",
"as",
"$this",
"-",
">",
"association_dir",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L115-L125 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore.getAssociationFilename | function getAssociationFilename($server_url, $handle)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if (strpos($server_url, '://') === false) {
trigger_error(sprintf("Bad server URL: %s", $server_url),
... | php | function getAssociationFilename($server_url, $handle)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if (strpos($server_url, '://') === false) {
trigger_error(sprintf("Bad server URL: %s", $server_url),
... | [
"function",
"getAssociationFilename",
"(",
"$",
"server_url",
",",
"$",
"handle",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"active",
")",
"{",
"trigger_error",
"(",
"\"FileStore no longer active\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"null",
";",
"... | Create a unique filename for a given server url and
handle. This implementation does not assume anything about the
format of the handle. The filename that is returned will
contain the domain name from the server URL for ease of human
inspection of the data directory.
@param string $server_url
@param string $handle
@re... | [
"Create",
"a",
"unique",
"filename",
"for",
"a",
"given",
"server",
"url",
"and",
"handle",
".",
"This",
"implementation",
"does",
"not",
"assume",
"anything",
"about",
"the",
"format",
"of",
"the",
"handle",
".",
"The",
"filename",
"that",
"is",
"returned",... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L160-L187 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore.storeAssociation | function storeAssociation($server_url, $association)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return false;
}
$association_s = $association->serialize();
$filename = $this->getAssociationFilename($server_url,
... | php | function storeAssociation($server_url, $association)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return false;
}
$association_s = $association->serialize();
$filename = $this->getAssociationFilename($server_url,
... | [
"function",
"storeAssociation",
"(",
"$",
"server_url",
",",
"$",
"association",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"active",
")",
"{",
"trigger_error",
"(",
"\"FileStore no longer active\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"false",
";",
"... | Store an association in the association directory.
@param string $server_url
@param Auth_OpenID_Association $association
@return bool | [
"Store",
"an",
"association",
"in",
"the",
"association",
"directory",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L196-L238 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore.getAssociation | function getAssociation($server_url, $handle = null)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if ($handle === null) {
$handle = '';
}
// The filename with the empty handle is a pref... | php | function getAssociation($server_url, $handle = null)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if ($handle === null) {
$handle = '';
}
// The filename with the empty handle is a pref... | [
"function",
"getAssociation",
"(",
"$",
"server_url",
",",
"$",
"handle",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"active",
")",
"{",
"trigger_error",
"(",
"\"FileStore no longer active\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"null",
... | Retrieve an association. If no handle is specified, return the
association with the most recent issue time.
@param string $server_url
@param string|null $handle
@return Auth_OpenID_Association|mixed|null | [
"Retrieve",
"an",
"association",
".",
"If",
"no",
"handle",
"is",
"specified",
"return",
"the",
"association",
"with",
"the",
"most",
"recent",
"issue",
"time",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L248-L307 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore.removeAssociation | function removeAssociation($server_url, $handle)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
$assoc = $this->getAssociation($server_url, $handle);
if ($assoc === null) {
return false;
}... | php | function removeAssociation($server_url, $handle)
{
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
$assoc = $this->getAssociation($server_url, $handle);
if ($assoc === null) {
return false;
}... | [
"function",
"removeAssociation",
"(",
"$",
"server_url",
",",
"$",
"handle",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"active",
")",
"{",
"trigger_error",
"(",
"\"FileStore no longer active\"",
",",
"E_USER_ERROR",
")",
";",
"return",
"null",
";",
"}",
... | Remove an association if it exists. Do nothing if it does not.
@param string $server_url
@param string $handle
@return bool $success | [
"Remove",
"an",
"association",
"if",
"it",
"exists",
".",
"Do",
"nothing",
"if",
"it",
"does",
"not",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L367-L381 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore.useNonce | function useNonce($server_url, $timestamp, $salt)
{
global $Auth_OpenID_SKEW;
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if ( abs($timestamp - time()) > $Auth_OpenID_SKEW ) {
return false;
... | php | function useNonce($server_url, $timestamp, $salt)
{
global $Auth_OpenID_SKEW;
if (!$this->active) {
trigger_error("FileStore no longer active", E_USER_ERROR);
return null;
}
if ( abs($timestamp - time()) > $Auth_OpenID_SKEW ) {
return false;
... | [
"function",
"useNonce",
"(",
"$",
"server_url",
",",
"$",
"timestamp",
",",
"$",
"salt",
")",
"{",
"global",
"$",
"Auth_OpenID_SKEW",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"active",
")",
"{",
"trigger_error",
"(",
"\"FileStore no longer active\"",
",",
"... | Return whether this nonce is present. As a side effect, mark it
as no longer present.
@param string $server_url
@param int $timestamp
@param string $salt
@return bool $present | [
"Return",
"whether",
"this",
"nonce",
"is",
"present",
".",
"As",
"a",
"side",
"effect",
"mark",
"it",
"as",
"no",
"longer",
"present",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L392-L429 |
openid/php-openid | Auth/OpenID/FileStore.php | Auth_OpenID_FileStore._allAssocs | function _allAssocs()
{
$all_associations = array();
$association_filenames =
Auth_OpenID_FileStore::_listdir($this->association_dir);
foreach ($association_filenames as $association_filename) {
$association_file = fopen($association_filename, 'rb');
if... | php | function _allAssocs()
{
$all_associations = array();
$association_filenames =
Auth_OpenID_FileStore::_listdir($this->association_dir);
foreach ($association_filenames as $association_filename) {
$association_file = fopen($association_filename, 'rb');
if... | [
"function",
"_allAssocs",
"(",
")",
"{",
"$",
"all_associations",
"=",
"array",
"(",
")",
";",
"$",
"association_filenames",
"=",
"Auth_OpenID_FileStore",
"::",
"_listdir",
"(",
"$",
"this",
"->",
"association_dir",
")",
";",
"foreach",
"(",
"$",
"association_... | Remove expired entries from the database. This is potentially
expensive, so only run when it is acceptable to take time.
@access private | [
"Remove",
"expired",
"entries",
"from",
"the",
"database",
".",
"This",
"is",
"potentially",
"expensive",
"so",
"only",
"run",
"when",
"it",
"is",
"acceptable",
"to",
"take",
"time",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/FileStore.php#L437-L470 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_Message._checkMode | function _checkMode($ax_args)
{
$mode = Auth_OpenID::arrayGet($ax_args, 'mode');
if ($mode != $this->mode) {
return new Auth_OpenID_AX_Error(
sprintf(
"Expected mode '%s'; got '%s'",
$this... | php | function _checkMode($ax_args)
{
$mode = Auth_OpenID::arrayGet($ax_args, 'mode');
if ($mode != $this->mode) {
return new Auth_OpenID_AX_Error(
sprintf(
"Expected mode '%s'; got '%s'",
$this... | [
"function",
"_checkMode",
"(",
"$",
"ax_args",
")",
"{",
"$",
"mode",
"=",
"Auth_OpenID",
"::",
"arrayGet",
"(",
"$",
"ax_args",
",",
"'mode'",
")",
";",
"if",
"(",
"$",
"mode",
"!=",
"$",
"this",
"->",
"mode",
")",
"{",
"return",
"new",
"Auth_OpenID... | Return Auth_OpenID_AX_Error if the mode in the attribute
exchange arguments does not match what is expected for this
class; true otherwise.
@access private
@param array $ax_args
@return Auth_OpenID_AX_Error|bool | [
"Return",
"Auth_OpenID_AX_Error",
"if",
"the",
"mode",
"in",
"the",
"attribute",
"exchange",
"arguments",
"does",
"not",
"match",
"what",
"is",
"expected",
"for",
"this",
"class",
";",
"true",
"otherwise",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L111-L122 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_AttrInfo.make | static function make($type_uri, $count=1, $required=false,
$alias=null)
{
if ($alias !== null) {
$result = Auth_OpenID_AX_checkAlias($alias);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
}
return new Auth_Op... | php | static function make($type_uri, $count=1, $required=false,
$alias=null)
{
if ($alias !== null) {
$result = Auth_OpenID_AX_checkAlias($alias);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
}
return new Auth_Op... | [
"static",
"function",
"make",
"(",
"$",
"type_uri",
",",
"$",
"count",
"=",
"1",
",",
"$",
"required",
"=",
"false",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"alias",
"!==",
"null",
")",
"{",
"$",
"result",
"=",
"Auth_OpenID_AX_che... | Construct an attribute information object. For parameter
details, see the constructor.
@param string $type_uri
@param int $count
@param bool $required
@param string|null $alias
@return Auth_OpenID_AX_AttrInfo|Auth_OpenID_AX_Error|bool | [
"Construct",
"an",
"attribute",
"information",
"object",
".",
"For",
"parameter",
"details",
"see",
"the",
"constructor",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L205-L218 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_FetchRequest.add | function add($attribute)
{
if ($this->contains($attribute->type_uri)) {
return new Auth_OpenID_AX_Error(
sprintf("The attribute %s has already been requested",
$attribute->type_uri));
}
$this->requested_attributes[$attribute->type_uri] = $attr... | php | function add($attribute)
{
if ($this->contains($attribute->type_uri)) {
return new Auth_OpenID_AX_Error(
sprintf("The attribute %s has already been requested",
$attribute->type_uri));
}
$this->requested_attributes[$attribute->type_uri] = $attr... | [
"function",
"add",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"contains",
"(",
"$",
"attribute",
"->",
"type_uri",
")",
")",
"{",
"return",
"new",
"Auth_OpenID_AX_Error",
"(",
"sprintf",
"(",
"\"The attribute %s has already been requested\"",... | Add an attribute to this attribute exchange request.
@param attribute: The attribute that is being requested
@return bool|Auth_OpenID_AX_Error | [
"Add",
"an",
"attribute",
"to",
"this",
"attribute",
"exchange",
"request",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L311-L322 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_FetchRequest.getExtensionArgs | function getExtensionArgs($request = null)
{
$aliases = new Auth_OpenID_NamespaceMap();
$required = array();
$if_available = array();
$ax_args = $this->_newArgs();
foreach ($this->requested_attributes as $type_uri => $attribute) {
if ($attribute->alias === null... | php | function getExtensionArgs($request = null)
{
$aliases = new Auth_OpenID_NamespaceMap();
$required = array();
$if_available = array();
$ax_args = $this->_newArgs();
foreach ($this->requested_attributes as $type_uri => $attribute) {
if ($attribute->alias === null... | [
"function",
"getExtensionArgs",
"(",
"$",
"request",
"=",
"null",
")",
"{",
"$",
"aliases",
"=",
"new",
"Auth_OpenID_NamespaceMap",
"(",
")",
";",
"$",
"required",
"=",
"array",
"(",
")",
";",
"$",
"if_available",
"=",
"array",
"(",
")",
";",
"$",
"ax_... | Get the serialized form of this attribute fetch request.
@param Auth_OpenID_Request|null $request
@return Auth_OpenID_AX_Error|Auth_OpenID_AX_FetchRequest The fetch request message parameters | [
"Get",
"the",
"serialized",
"form",
"of",
"this",
"attribute",
"fetch",
"request",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L330-L375 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_FetchRequest.getRequiredAttrs | function getRequiredAttrs()
{
$required = array();
foreach ($this->requested_attributes as $type_uri => $attribute) {
if ($attribute->required) {
$required[] = $type_uri;
}
}
return $required;
} | php | function getRequiredAttrs()
{
$required = array();
foreach ($this->requested_attributes as $type_uri => $attribute) {
if ($attribute->required) {
$required[] = $type_uri;
}
}
return $required;
} | [
"function",
"getRequiredAttrs",
"(",
")",
"{",
"$",
"required",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"requested_attributes",
"as",
"$",
"type_uri",
"=>",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"attribute",
"->",
"required"... | Get the type URIs for all attributes that have been marked as
required.
@return array A list of the type URIs for attributes that have been
marked as required. | [
"Get",
"the",
"type",
"URIs",
"for",
"all",
"attributes",
"that",
"have",
"been",
"marked",
"as",
"required",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L384-L394 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_FetchRequest.fromOpenIDRequest | static function fromOpenIDRequest($request)
{
$m = $request->message;
$obj = new Auth_OpenID_AX_FetchRequest();
$ax_args = $m->getArgs($obj->ns_uri);
$result = $obj->parseExtensionArgs($ax_args);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
... | php | static function fromOpenIDRequest($request)
{
$m = $request->message;
$obj = new Auth_OpenID_AX_FetchRequest();
$ax_args = $m->getArgs($obj->ns_uri);
$result = $obj->parseExtensionArgs($ax_args);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
... | [
"static",
"function",
"fromOpenIDRequest",
"(",
"$",
"request",
")",
"{",
"$",
"m",
"=",
"$",
"request",
"->",
"message",
";",
"$",
"obj",
"=",
"new",
"Auth_OpenID_AX_FetchRequest",
"(",
")",
";",
"$",
"ax_args",
"=",
"$",
"m",
"->",
"getArgs",
"(",
"$... | Extract a FetchRequest from an OpenID message
@param Auth_OpenID_Request $request The OpenID request containing the attribute fetch request
@return Auth_OpenID_AX_FetchRequest|Auth_OpenID_AX_Error | [
"Extract",
"a",
"FetchRequest",
"from",
"an",
"OpenID",
"message"
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L403-L436 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_FetchRequest.parseExtensionArgs | function parseExtensionArgs($ax_args)
{
$result = $this->_checkMode($ax_args);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
$aliases = new Auth_OpenID_NamespaceMap();
foreach ($ax_args as $key => $value) {
if (strpos($key, 'type.') === 0... | php | function parseExtensionArgs($ax_args)
{
$result = $this->_checkMode($ax_args);
if (Auth_OpenID_AX::isError($result)) {
return $result;
}
$aliases = new Auth_OpenID_NamespaceMap();
foreach ($ax_args as $key => $value) {
if (strpos($key, 'type.') === 0... | [
"function",
"parseExtensionArgs",
"(",
"$",
"ax_args",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_checkMode",
"(",
"$",
"ax_args",
")",
";",
"if",
"(",
"Auth_OpenID_AX",
"::",
"isError",
"(",
"$",
"result",
")",
")",
"{",
"return",
"$",
"result... | Given attribute exchange arguments, populate this FetchRequest.
@param array $ax_args
@return Auth_OpenID_AX_Error|bool if the data to be parsed
does not follow the attribute exchange specification. At least
when 'if_available' or 'required' is not specified for a
particular attribute type. Returns true otherwise. | [
"Given",
"attribute",
"exchange",
"arguments",
"populate",
"this",
"FetchRequest",
"."
] | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L447-L524 |
openid/php-openid | Auth/OpenID/AX.php | Auth_OpenID_AX_KeyValueMessage.addValue | function addValue($type_uri, $value)
{
if (!array_key_exists($type_uri, $this->data)) {
$this->data[$type_uri] = array();
}
$values =& $this->data[$type_uri];
$values[] = $value;
} | php | function addValue($type_uri, $value)
{
if (!array_key_exists($type_uri, $this->data)) {
$this->data[$type_uri] = array();
}
$values =& $this->data[$type_uri];
$values[] = $value;
} | [
"function",
"addValue",
"(",
"$",
"type_uri",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type_uri",
",",
"$",
"this",
"->",
"data",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"$",
"type_uri",
"]",
"=",
"array",
... | Add a single value for the given attribute type to the
message. If there are already values specified for this type,
this value will be sent in addition to the values already
specified.
@param type_uri: The URI for the attribute
@param value: The value to add to the response to the relying
party for this attribute | [
"Add",
"a",
"single",
"value",
"for",
"the",
"given",
"attribute",
"type",
"to",
"the",
"message",
".",
"If",
"there",
"are",
"already",
"values",
"specified",
"for",
"this",
"type",
"this",
"value",
"will",
"be",
"sent",
"in",
"addition",
"to",
"the",
"... | train | https://github.com/openid/php-openid/blob/99d24177dbad21d13878ac653bbfb1ed18b66114/Auth/OpenID/AX.php#L574-L582 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.