Symfony sfGuardPlugin密码恢复 [英] Symfony sfGuardPlugin password recovery

查看:123
本文介绍了Symfony sfGuardPlugin密码恢复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我支持一个建立在symfony上的网站。有一些关于某种管理页面的问题。



通过阅读日志和比较最近的备份不知道很多东西,我想我能够修复



我没有网站的管理员密码,但拥有对服务器的root访问权限,并且



您能帮我在不知道当前密码的情况下创建自己的帐户吗?



免责声明:我对PHP的OOP接口了解不多,因为我不是程序员,而是系统管理员。



  symfony版本1.0.16 


解决方案

尝试登录到服务器并切换到Symfony项目的根目录。可能有一个symfony脚本/链接(详细信息取决于您的操作系统以及Symfony如何设置;您可能只需运行 ./ symfony ,而不是需要 php symfony )。运行此操作以查看此基本操作是否正常:

  php symfony 

如果有效,你应该得到一个可以执行的任务列表。如果你使用sfGuardPlugin,你应该看到一些任务,如 guard:create-user



更多有关任务的信息,请尝试类似的操作:

  php symfony help guard:create-user 



但基本上,假设一个相当现代的Symfony安装和插件,尝试类似:

  php symfony guard:create-user --env = prod newusername newpassword 


$ b b

(--env = prod选项在生产环境中创建用户,这可能是您想要的。)



如果有超级用户 - 只有你想要做的任务,尝试也这样做:

  php symfony guard:promote newusername 



这将赋予新用户超级管理员权限。



可能还会找到一个 guard:change-password 任务,它将简单地重置给定用户的密码。


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

解决方案

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 needing php symfony). Run this to see whether this basics are working:

php symfony

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:

php symfony help guard:create-user

But basically, assuming a fairly modern Symfony installation and plugin, try something like:

php symfony guard:create-user --env=prod newusername newpassword

(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:

php symfony guard:promote newusername

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.

这篇关于Symfony sfGuardPlugin密码恢复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆