Skip to content

Commit

Permalink
3.6.5-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Dec 24, 2018
1 parent 1430c64 commit a841d83
Show file tree
Hide file tree
Showing 21 changed files with 392 additions and 237 deletions.
43 changes: 43 additions & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
CHANGELOG

3.6.5 (24 December 2018)
* NEW: Log, added timestamp to each line
* NEW: Auth, added support for custom compare method, [#116](https://github.com/bcosca/fatfree-core/issues/116)
* NEW: cache tag support for mongo & jig mapper, ref [#166](https://github.com/bcosca/fatfree-core/issues/116)
* NEW: Allow PHP functions as template token filters
* Web: Fix double redirect bug when running cURL with open_basedir disabled
* Web: Cope with responses from HTTP/2 servers
* Web->filler: remove very first space, when $std is false
* Web\OAuth2: Cope with HTTP/2 responses
* Web\OAuth2: take Content-Type header into account for json decoding, [#250](https://github.com/bcosca/fatfree-core/issues/250) [#251](https://github.com/bcosca/fatfree-core/issues/251)
* Web\OAuth2: fixed empty results on some endpoints [#250](https://github.com/bcosca/fatfree-core/issues/250)
* DB\SQL\Mapper: optimize mapper->count memory usage
* DB\SQL\Mapper: New table alias operator
* DB\SQL\Mapper: fix count() performance on non-grouped result sets, [bcosca/fatfree#1114](https://github.com/bcosca/fatfree/issues/1114)
* DB\SQL: Support for CTE in postgreSQL, [bcosca/fatfree#1107](https://github.com/bcosca/fatfree/issues/1107), [bcosca/fatfree#1116](https://github.com/bcosca/fatfree/issues/1116), [bcosca/fatfree#1021](https://github.com/bcosca/fatfree/issues/1021)
* DB\SQL->log: Remove extraneous whitespace
* DB\SQL: Added ability to add inline comments per SQL query
* CLI\WS, Refactoring: Streamline socket server
* CLI\WS: Add option for dropping query in OAuth2 URI
* CLI\WS: Add URL-safe base64 encoding
* CLI\WS: Detect errors in returned JSON values
* CLI\WS: Added support for Sec-WebSocket-Protocol header
* Matrix->calendar: Allow unix timestamp as date argument
* Basket: Access basket item by _id [#260](https://github.com/bcosca/fatfree-core/issues/260)
* SMTP: Added TLS 1.2 support [bcosca/fatfree#1115](https://github.com/bcosca/fatfree/issues/1115)
* SMTP->send: Respect $log argument
* Base->cast: recognize binary and octal numbers in config
* Base->cast: add awareness of hexadecimal literals
* Base->abort: Remove unnecessary Content-Encoding header
* Base->abort: Ensure headers have not been flushed
* Base->format: Differentiate between long- and full-date (with localized weekday) formats
* Base->format: Conform with intl extension's number output
* Enable route handler to override Access-Control headers in response to OPTIONS request, [#257](https://github.com/bcosca/fatfree-core/issues/257)
* Augment filters with a var_export function
* Bug fix php7.3: Fix template parse regex to be compatible with strict PCRE2 rules for hyphen placement in a character class
* Bug fix, Cache->set: update creation time when updating existing cache entries
* Bug fix: incorrect ICU date/time formatting
* Bug fix, Jig: lazy write on empty data
* Bug fix: Method uppercase to avoid route failure [#252](https://github.com/bcosca/fatfree-core/issues/252)
* Fixed error description when (PSR-11) `CONTAINER` fails to resolve a class [#253](https://github.com/bcosca/fatfree-core/issues/253)
* Mitigate CSRF predictability/vulnerability
* Expose Mapper->factory() method

3.6.4 (19 April 2018)
* NEW: Added Dependency Injection support with CONTAINER variable [#221](https://github.com/bcosca/fatfree-core/issues/221)
* NEW: configurable LOGGABLE error codes [#1091](https://github.com/bcosca/fatfree/issues/1091#issuecomment-364674701)
Expand Down
45 changes: 29 additions & 16 deletions lib/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
Copyright (c) 2009-2017 F3::Factory/Bong Cosca, All rights reserved.
Copyright (c) 2009-2018 F3::Factory/Bong Cosca, All rights reserved.
This file is part of the Fat-Free Framework (http://fatfreeframework.com).
Expand Down Expand Up @@ -35,7 +35,9 @@ class Auth {
//! Mapper object
$mapper,
//! Storage options
$args;
$args,
//! Custom compare function
$func;

/**
* Jig storage handler
Expand All @@ -45,22 +47,26 @@ class Auth {
* @param $realm string
**/
protected function _jig($id,$pw,$realm) {
return (bool)
$success = (bool)
call_user_func_array(
[$this->mapper,'load'],
[
array_merge(
[
'@'.$this->args['id'].'==? AND '.
'@'.$this->args['pw'].'==?'.
'@'.$this->args['id'].'==?'.
($this->func?'':' AND @'.$this->args['pw'].'==?').
(isset($this->args['realm'])?
(' AND @'.$this->args['realm'].'==?'):''),
$id,$pw
$id
],
($this->func?[]:[$pw]),
(isset($this->args['realm'])?[$realm]:[])
)
]
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand All @@ -71,15 +77,16 @@ protected function _jig($id,$pw,$realm) {
* @param $realm string
**/
protected function _mongo($id,$pw,$realm) {
return (bool)
$success = (bool)
$this->mapper->load(
[
$this->args['id']=>$id,
$this->args['pw']=>$pw
]+
[$this->args['id']=>$id]+
($this->func?[]:[$this->args['pw']=>$pw])+
(isset($this->args['realm'])?
[$this->args['realm']=>$realm]:[])
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand All @@ -90,22 +97,26 @@ protected function _mongo($id,$pw,$realm) {
* @param $realm string
**/
protected function _sql($id,$pw,$realm) {
return (bool)
$success = (bool)
call_user_func_array(
[$this->mapper,'load'],
[
array_merge(
[
$this->args['id'].'=? AND '.
$this->args['pw'].'=?'.
$this->args['id'].'=?'.
($this->func?'':' AND '.$this->args['pw'].'=?').
(isset($this->args['realm'])?
(' AND '.$this->args['realm'].'=?'):''),
$id,$pw
$id
],
($this->func?[]:[$pw]),
(isset($this->args['realm'])?[$realm]:[])
)
]
);
if ($success && $this->func)
$success = call_user_func($this->func,$pw,$this->mapper->get($this->args['pw']));
return $success;
}

/**
Expand Down Expand Up @@ -234,8 +245,9 @@ function basic($func=NULL) {
* @return object
* @param $storage string|object
* @param $args array
* @param $func callback
**/
function __construct($storage,array $args=NULL) {
function __construct($storage,array $args=NULL,$func=NULL) {
if (is_object($storage) && is_a($storage,'DB\Cursor')) {
$this->storage=$storage->dbtype();
$this->mapper=$storage;
Expand All @@ -244,6 +256,7 @@ function __construct($storage,array $args=NULL) {
else
$this->storage=$storage;
$this->args=$args;
$this->func=$func;
}

}
Loading

0 comments on commit a841d83

Please sign in to comment.