Symfony sfGuardPlugin 密码恢复
我支持一个基于 symfony 构建的网站。某种“管理页面”存在问题。
虽然通过阅读日志和比较最近的备份对整个事情了解不多,但我认为我能够解决这个问题(一些开发人员删除了一条路线,但没有修复模板)。
我没有该站点的管理员密码,但具有服务器的 root 访问权限和数据库的超级访问权限(在本例中为 postgres)。
您能帮助我在不知道当前密码的情况下如何创建自己的帐户吗?
免责声明:我对 PHP 的 OOP 接口了解不多,因为我不是程序员,而是系统管理员。
编辑:
symfony version 1.0.16
I am supporting a site built on symfony. There were problems regarding some kind of "admin page".
While not knowing much about the whole thing by reading the logs and comparing recent backups I think I was able to fix the issue (some developer removed a route, but did not fix a template).
I do not have admin password to the site, but have root access to the server and super access to the database (in this case postgres).
Can you help me how to create myself an account without knowing the current passwords?
Disclaimer: I do not have much knowledge with PHP's OOP interface as I am not a programmer, but a sysadmin.
Edit:
symfony version 1.0.16
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试登录服务器并更改为 Symfony 项目的根目录。那里可能有一个“symfony”脚本/链接(详细信息取决于您的操作系统以及 Symfony 的设置方式;您可能只需运行
./symfony
而不需要php symfony
代码>)。运行它来查看这些基础知识是否有效:如果有效,您应该获得可以执行的可能任务的列表。如果您使用 sfGuardPlugin,您应该会看到一些任务,例如
guard:create-user
。要获取有关任务的更多信息,请尝试以下操作:
但基本上,假设有相当现代的 Symfony 安装和插件,请尝试以下操作:(
--env=prod 选项在生产环境中创建用户,这可能就是您想要的.)
如果您想要执行仅限超级用户的任务,请尝试执行以下操作:
这将为新用户授予超级管理员权限。
您可能还会发现一个
guard:change-password
任务,该任务将简单地重置给定用户的密码。Try logging into the server and changing into the Symfony project's root directory. There's probably a "symfony" script/link there (the details depend on your OS and how Symfony's set up; you might be able just to run
./symfony
rather than needingphp symfony
). Run this to see whether this basics are working:If that works, you should get a list of possible tasks you can do. If you're using the sfGuardPlugin, you should see some tasks like
guard:create-user
.To get more information on a task, try something like:
But basically, assuming a fairly modern Symfony installation and plugin, try something like:
(the --env=prod option creates the user in the production environment, which is probably what you want.)
If there are super-user-only tasks you want to do, try also doing this:
That will give the new user super-admin privileges.
You'll probably also find a
guard:change-password
task which will simply reset the password for a given user.文件
我最终编辑了名为:这是进行身份验证的 。
我添加了几行来绕过已创建用户的实际密码检查。
I ended up editing the file named:
this is where the authentication takes place.
I added a few lines to bypass the actual password check for an already created user.