symfony1

symfony - sfDoctrineGuard - restricting user creation based on group credentials

天涯浪子 提交于 2019-12-08 10:34:18
问题 I am currently in the process of developing a fairly large and complex user management system using sfDoctrineGuard I have created 4 groups, editors , moderators , admins and superadmins . What I'm looking to do, is restrict certain users in the admin to be able to create/view/edit other users in the sfGuardUser admin module. So for example a superadmins user can create editors , moderators , admins and other superadmins , but a moderator can only create editors . Is this possible in

Symfony and Doctrine 1.2.2: How can i get the SQL clause of a Doctrine_Query object?

拥有回忆 提交于 2019-12-08 10:23:38
问题 i have this code: $this->lista_miembros = $this->filtro->buildQuery($valores_query); var_dump($this->lista_miembros); var_dump outputs a Doctrine_Query object: object(Doctrine_Query)[121] protected '_subqueryAliases' => array I tried getSql() ... $q = Doctrine_Query::create() ->select('u.id') ->from('User u') ->whereIn('u.id', array(1, 3, 4, 5)); echo $q->getSql(); ..but I dont have that getSql() function! So how can i get the SQL clause of that Doctrine_Query object? Javi 回答1: echo $q-

symfony filter change behaviour from [field=value] to [field LIKE %value%]

随声附和 提交于 2019-12-08 09:45:45
问题 In my filter, a field's behaviour is to search in the DB table for a row that has the value of the field equal to the value provided in filtering form. I'd like to change its behavior to search in DB table for a row/rows that have field value matching to that provided in the form( %LIKE% ). I know it can be done by adding a addFieldnameColumnQuery method to the filter class but What I want to know is, is there another way? The field happens to be a foreign key and I want it to work like a

Symfony sfGuardPlugin password recovery

偶尔善良 提交于 2019-12-08 08:42:57
问题 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

Symfony 1.4 compatible I18N translation system?

我的梦境 提交于 2019-12-08 08:32:12
问题 I am migrating a small app from Symfony into a separate project, and the only Symfony component that it depends on is I18N string translation. By example: action.class.php : $this->culture = 'pt_BR'; templates/search_box.php : <h1><?php echo __('Destination') ?></h1> i18n/pt_BR/messages.xml : <?xml version="1.0" encoding="UTF-8"?> <xliff version="1.0"> <file datatype="plaintext" source-language="en" target-language="pt_BR" original="messages"> <body> <note> SEARCH BOX </note> <trans-unit id=

auth problems (security filters) in sfGuardUser Symfony

巧了我就是萌 提交于 2019-12-08 08:10:20
问题 I'm using Symfony 1.2.7, and sfGuardUser Plugin. I'm able to view all the pages, login and logout. However when I try to edit (just going to the form) or update an object (saving the changes) sometimes I have problems of auth, and symfony redirects me to the edit form page again. I put some emphasys on sometimes because it's what it's driving me crazy :) Users have cookies and the remember_cookie. I'm using the cookie domain ".domain.com" for both cookies because we work with subdomains. On

What's the best way to make small schema updates with Doctrine/Symfony?

隐身守侯 提交于 2019-12-08 07:48:47
问题 What's the best way to make small schema updates to your symfony/doctrine application? My issue is, I'm working on a new side-project and occasionally find myself adding a new column here, a new column there as i find the need. However, my DB already has existing data and I dont want to run a complete rebuild and drop my DB with the changes each time. I also dont want to write fixtures. They're annoying, and it's much easier to use my application to insert data and keep it around while

Creating user roles

三世轮回 提交于 2019-12-08 07:26:45
问题 I am doing new project in symfony1.4. Now this project requires users to log-in and browse, and as any project of this type requires a way of restricting users based on roles. I don't want to implement this in obvious way, i.e to have roles attribute for each user and have pre-defined roles and assign these to users. The problem with this is it's not very flexible as more roles get defined later. I was thinking on the lines of using an EAV model here, (not sure I can do that in symfony). What

contextual caching of templates with components

本小妞迷上赌 提交于 2019-12-08 06:45:44
问题 I have a page with a menu component. The menu marks the active element with a different CSS class. Now I want to cache each menu item page. The different pages come all from the same module/action, the difference is just the ID (foo/bar?item=1) . The problem is that the menu is only cached one time, but I need a cache version for every menu item. I just tried the cache option "contextual: true", but I think this does not work because the main template (barSuccess) is always the same. Do you

Symfony 1.4 embedded form fields at the same indent

◇◆丶佛笑我妖孽 提交于 2019-12-08 06:44:17
问题 I have two models in my Symfony application. First one is Blog: Blog: columns: name: { type: string(20), notnull: true, unique: true } title: { type: string(255), notnull: true } description: { type: string(255), notnull: true } admin_id: { type: bigint, notnull: true } relations: User: class: sfGuardUser local: admin_id ... As you can see this model has a one-to-one relationship with sfGuardUser. I want the registration of these two take place in one form. So I changed the BlogForm class and