undkonsorten/typo3-auto-login
Composer 安装命令:
composer require undkonsorten/typo3-auto-login
包简介
Automatically authenticates a TYPO3 CMS backend user for development.
README 文档
README
What does it do?
This package automatically starts a backend user session for the open source CMS TYPO3, configured by an environment variable. You can set a cookie to temporarily disable the automatic login. There‘s a bookmarklet that does the job for you.
It is based on the Daniel Siepmann‘s great work. If you feel like saying "Thank you" or donating please consider him first!
Warning
Be considerate when using this tool. Always have security in mind.
Any usage beyond development on a local machine is strongly discouraged.
Make sure to only require this package with --dev option and check your
deployment for measures to make sure the code is never deployed to a production
system.
By using this package you agree to be responsible for any damages arising from its usage.
Installation
composer require --dev undkonsorten/typo3-auto-login
Usage without composer has not been tested but might be perfectly possible if you take care about class (auto) loading by yourself.
Usage
To configure username for automatic login set the environment variable
$TYPO3_AUTOLOGIN_USERNAME somewhere in your environment.
Add an initialization call in your AdditionalConfiguration.php or in
a file required from there. Make sure to only initialize the service for
Development context by either wrapping it with a condition or putting
it to a file only loaded in Development context.
if (\TYPO3\CMS\Core\Core\Environment::getContext()->isDevelopment()) { \Undkonsorten\TYPO3AutoLogin\Utility\RegisterServiceUtility::registerAutomaticAuthenticationService(); }
Autologin will fail and throw an exception in Production(/*) contexts.
Bookmarklet
There are reasons to temporarily disable the automatic login. For this,
there‘s a bookmarklet that (un)sets the cookie _typo3-auto-login for you
to prevent autologin. Just add a new bookmark with the following "URL"
javascript:(q=>{let n=window.Notification,s='_typo3-auto-login',d='disable',p='TYPO3 auto login',w=document,a=w.cookie.split(';').some(x=>x.trim()===`${s}=${d}`);w.cookie=`${s}=${a?';expires='+new Date(0).toUTCString():d};path=/;`;n&&n.permission!=='denied'&&n.requestPermission().then(q=>new n(p,{body:`(${a?'✓':'✗'}) ${p} is now ${a?'enabled':'disabled'}. Cookie »${s}« has been ${a?'removed':'set'}.`,icon:'https://extensions.typo3.org/fileadmin/user_upload/ext_icon.png'}));})();
and name the file according to your likings.
Q&A
-
Q: My user is not authenticated, what‘s wrong?
A: Either you have a typo in the username or your environment variable hasn‘t taken effect yet. You might need to restart your web server, docker container or the like. Or you‘re running
Productioncontext…
undkonsorten/typo3-auto-login 适用场景与选型建议
undkonsorten/typo3-auto-login 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 134.82k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2018 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 undkonsorten/typo3-auto-login 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 undkonsorten/typo3-auto-login 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 134.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2018-08-21