mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 06:48:59 +08:00
Added yii\web\Request::getAuthUser() and getAuthPassword()
This commit is contained in:
@@ -150,6 +150,7 @@ Yii Framework 2 Change Log
|
|||||||
- Enh: Added support for reading page size from query parameters by `Pagination` (qiangxue)
|
- Enh: Added support for reading page size from query parameters by `Pagination` (qiangxue)
|
||||||
- Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe)
|
- Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe)
|
||||||
- Enh: Added `yii\web\UrlRuleInterface` and `yii\web\CompositeUrlRule` (qiangxue)
|
- Enh: Added `yii\web\UrlRuleInterface` and `yii\web\CompositeUrlRule` (qiangxue)
|
||||||
|
- Enh: Added `yii\web\Request::getAuthUser()` and `getAuthPassword()` (qiangxue)
|
||||||
- Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue)
|
- Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue)
|
||||||
- Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue)
|
- Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue)
|
||||||
- Chg #1586: `QueryBuilder::buildLikeCondition()` will now escape special characters and use percentage characters by default (qiangxue)
|
- Chg #1586: `QueryBuilder::buildLikeCondition()` will now escape special characters and use percentage characters by default (qiangxue)
|
||||||
|
|||||||
@@ -819,6 +819,22 @@ class Request extends \yii\base\Request
|
|||||||
return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null;
|
return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string the username sent via HTTP authentication, null if the username is not given
|
||||||
|
*/
|
||||||
|
public function getAuthUser()
|
||||||
|
{
|
||||||
|
return isset($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string the password sent via HTTP authentication, null if the username is not given
|
||||||
|
*/
|
||||||
|
public function getAuthPassword()
|
||||||
|
{
|
||||||
|
return isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : null;
|
||||||
|
}
|
||||||
|
|
||||||
private $_port;
|
private $_port;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user