doumiang0597 2012-07-20 12:28
浏览 39
已采纳

symfony fosuserbundle自定义登录

I am considering using symfony2 over flat php for my next project. I am, however, a little bit worried about a few things. One of them is whether this will be a great challenge for me to learn:

I have to set up a system where I access a backend part to create user-accounts.

Each customer has a user account that will work like their admin. Then, within their control panel, they can create users within their company, and set login and password for them. I won't, of course, restrict each company to only use usernames that no one else has used, so there must be one selector for the company and one for the username on the main login screen, alt. They will log in on a route, say site.com/company/.

I have no idea where to start or how complicate this will be to create. I have tested symfony2 around a little bit and for the main part (DB and templating) it seems just what I need.

Would one approach perhaps be to use usergroups, and set up the grouops=companies from my backend part, and let the companies add users to their group only?

There will also be access rights etc. In flat PHP I just control it through an access table user-contentpiece but perhaps symfony offers a smoother way...

Any enlightening comments for me? Is fosUserBundle a good option or should I build from scratch?

  • 写回答

1条回答 默认 最新

  • donglongqiao9595 2012-07-20 12:47
    关注

    I suppose that it isn't a symfony2 problematique or FOSUserBundle one.
    You can take advantage of FOSUserBundle features and make some extra controls (by overwriting or extending existing methods) like i.e. before update or delete a user, is that authenticated user into same company of user that will be updated/deleted?
    Moreover you can modify FOSUserBundle's User entity by adding an extra field that will be an external key with company id and make this plus user id new primary key for User entity.

    So, if you can "study" a little bit of Symfony and FOSUserBundle, that's absolutely a good choice but build it from scratch (if you only need THAT functionlaity) is as much a good choice and exercise

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么