sfdoctrineguard

Migrating Existing Users and Passwords to new Symfony/sfDoctrineGuard User System

陌路散爱 提交于 2020-01-01 17:42:36
问题 I have an existing, non-framework-based PHP/MySQL website. It has a simple security model, with a users table with usernames and hashed (MD5) passwords. I'm currently working on "version 2" of this site, this time using Symfony, with Doctrine. The new version is working fine, and I'm using the sfDoctrineGuard plugin for my user management. I'd like to migrate my existing users into the new app with the minimum of fuss, retaining their existing usernames and passwords. My main problem, though,

get all groups from the Users - sfDoctrineGuardPlugin

喜欢而已 提交于 2019-12-25 02:15:49
问题 In sfDoctrineGuardPlugin is: sfGuardUser: actAs: [Timestampable] columns: first_name: string(255) last_name: string(255) // indexes: is_active_idx: fields: [is_active] relations: Groups: class: sfGuardGroup local: user_id foreign: group_id refClass: sfGuardUserGroup foreignAlias: Users sfGuardGroup: actAs: [Timestampable] columns: name: type: string(255) unique: true description: string(1000) relations: Users: class: sfGuardUser refClass: sfGuardUserGroup local: group_id foreign: user_id

Symfony admin generator : add user id before saving

时光怂恿深爱的人放手 提交于 2019-12-19 10:35:12
问题 I'm creating my own blog engine to learn Symfony, and I have a question : In the generated administration pages for a blog post, I have a drop-down list of authors, to indicate the author_id. I'd like to hide that drop-down list, and set the author_id to the id of the current logged-in user when the post is created (but not when it is edited) How can I accomplish that ? Edit I've tried those : $request->setParameter(sprintf("%s[%s]", $this->form->getName(), "author_id"), $this->getUser()-

Symfony, Doctrine Guard Plugin, generator.yml file, customizing by using another module

点点圈 提交于 2019-12-13 05:13:34
问题 I am using Symfony 1-4 and sfDoctrineGuardPlugin. My question is, on Doctrine Guard Plugin as you know each module came with generator.yml. And i need to customize generator.yml. For example, i need to display another table's (module's) column. // for example i am at X module and need to sort according to another table's/module's column ... config: list: sort: [X, asc] // x is not on my module Same thing with list/display. I need to display some column which is not on my current module... I

sfDoctrineGuard and Forgot Password function

时光毁灭记忆、已成空白 提交于 2019-12-13 03:36:37
问题 I'm pretty new to smyfony and I've been playing around with that sfDoctrineGuard plugin the whole day. it's working for the most part. I'm just having troubles with the forgot_password function. Actually I did everything according to the readme file in the plugin. the problem is: in security.yml i set default: is_secure:true obviously in the module sfGuard there's a security.yml that sais: secure: is_secure: false signin: is_secure: false signout: is_secure: false which makes sense, cause

Restrict choices shown in symfony admin generator edit multi-select

孤街醉人 提交于 2019-12-12 06:04:44
问题 I am using the admin generator for the sfGuardUser module. The edit portion of the generator.yml file looks like this: edit: title: Editing User "%%username%%" display: "User": [first_name, last_name, email_address, username, password, password_again] "Permissions and groups": [is_active, groups_list, sites_list] Now, not every user will have access to this form, only site administrators allowing site administrators to create and update their own users. There is a many-to-many relation

Embed forms in Symfony

霸气de小男生 提交于 2019-12-11 08:53:53
问题 I've added a profile class to sfDoctrineGuard, and in the admin I'm trying to edit the profile part while editing the user, using embed forms as explained here: http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin Editing users works, but when I add "User": [username, password, password_again, Profile ] All I get is an error message : Widget "Profile" does not exist. Any help would be appreciated. Is the blog post out of date ? 回答1: There's a nice

Symfony/sfDoctrineGuard Conditional Permissions

巧了我就是萌 提交于 2019-12-11 05:48:03
问题 I'm contemplating the best way to implement the conditional permissions i.e. Users and Teams are m-to-m. But each Team also has a 1-to-m "Leader" relationship with the User table as well. For simplicity sake, let's say we have two permission levels, "User" and "Admin". Then lets say, only certain Team administration task i.e. group emails, can only be sent by that team's leader. At the moment, every action that is specific to team leaders queries the database to check it the current user is

Backend sfGuardUser module

爷,独闯天下 提交于 2019-12-08 11:22:45
问题 I use symfony 1.4.11 with Doctrine I have sfGuardUser module in backend. I have sfGuardUserProfile table. sfGuardUserProfile: connection: doctrine tableName: sf_guard_user_profile columns: id: { type: integer(4), primary: true, autoincrement: true } user_id: { type: integer(4), notnull: true } salutation: { type: string(10), notnull: true } first_name: { type: string(30), notnull: true } last_name: { type: string(30), notnull: true } country: { type: string(255), notnull: true } postcode: {

Symfony sfDoctrineGuardPlugin custom login query

时光毁灭记忆、已成空白 提交于 2019-12-07 19:18:29
问题 I use symfony sfDoctrineGuardPlugin to manage authentication for both frontend users and backend users. It's fine, except that I don't want frontend users to be able to login to the backend app. I can setup credentials, but credentials are checked after a user gets authenticated. What I want is to have sigin in form to never validate for a user, that is not in a backend group. How can I do this? 回答1: I think I found a better solution. sfDoctrineGuard plugin has its own post validator that