vojtasvoboda/oc-codelogin-plugin
Composer 安装命令:
composer require vojtasvoboda/oc-codelogin-plugin
包简介
Code login plugin for OctoberCMS
README 文档
README
Login only by code or password. Create secret page or protect whole site just in minute. Tested with the latest stable OctoberCMS build 349.
Dependencies
RainLab.User plugin for users management.
How to create secret page
-
Install RainLab.User plugin and then VojtaSvoboda.CodeLogin plugin.
-
Insert RainLab.User Session component to layout which you want to protect by code.
Set Allow property only for Users (means logged users) and then set your login page. All guests will be redirect to login page.
Be sure you have injected JavaScript code and jQuery to your layout:
<script src="{{ [
'assets/javascript/jquery.js',
]|theme }}"></script>
{% framework %}
{% framework extras %}
Framework extras tag is optional and this tag adds a CSS and JavaScript files that contain the loading indicator plugin and CSS classes for styling the loading indicator. The indicator is displayed on the top of the page when an AJAX request runs.
- Create login page with Login layout and insert RainLab.User Session component and Code login form. Session component set to Allow only guest (login allowed only for guests). CodeLogin provide login form and session component will redirect user when already logged.
Set redirect parameter to your secret page and then set if you want to use input type text or input type password (code will not be visible).
- Use default HTML or create own design by extending component template:
- create file
/partials/codeLogin/default.htm - copy content from original component template
/components/codelogin/default.htm - add classes or HTML you needed
-
At RainLab.User plugin create as many users as you want. It's recommanded to use unique password for each user, because first user with matched password will be log!
-
[optional] If you want create logout page, just create logout.htm, insert session component allowed for logged user and with redirect to login page. To the template paste this code:
<a data-request="onLogout" class="btn" data-request-data="redirect: '/login'">Sign out</a>
-
[optional] For logging all user accesses use UserAccessLog plugin.
-
[optional] For creating more user accounts use User import/export plugin - just create simple XLS file with usernames and import it (passwords can be generated by Norton Password Generator).
Events
After successfull login you can use rainlab.user.login event to catch logged user instance:
Event::listen('rainlab.user.login', function ($user) {
dump($user);
});
Troubleshooting
Login button doesn't works.
Be sure you have included jQuery and {% framework extras %} code to your layout (not to page).
AJAX handler 'codeLogin::onCodesignin' was not found.
If form doesn't work, try to insert Code login component to page, not to partial. Login component should be placed beside to Session component.
Future plans
- can change login form input field text
- code preset with GET parameter e.g. /login?code=abcde
- unit test for logging method
Feel free to send pullrequest!
License
Code login plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.
Contributing
Please send Pull Request to master branch.
vojtasvoboda/oc-codelogin-plugin 适用场景与选型建议
vojtasvoboda/oc-codelogin-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 8, 最近一次更新时间为 2016 年 07 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「user」 「code」 「login」 「october」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vojtasvoboda/oc-codelogin-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vojtasvoboda/oc-codelogin-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vojtasvoboda/oc-codelogin-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
CakePHP 4.x AdminLTE Theme.
Promotional Codes Generator for Laravel 5.1
Standalone replacement for php's native get_browser() function
User component for Yii2
Zend Captcha bundle
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-07-14



