Forum

Today's Messages (ON)  | Unanswered Messages (OFF)

Forum: symfony 1.1
 Topic: Creating my own User Management system?
Creating my own User Management system? [message #59687] Fri, 29 August 2008 03:34
Excel  is currently offline Excel
Messages: 1
Registered: August 2008
Junior Member
Hello there.

I'm brand new to symfony and i'm just now getting the hang of it. I have read tutorial after tutorial and Im becoming more and more familiar with the framework each and every day. One thing I'm stumped on is how I would build my own user management system. The reason for this is twofold. I want to use it to practice and also so that I know my entire project inside and out. I've never been really fond of sfGuard. Yes, I know Im crazy. I don't want people responding to me saying I should just use sfGuard because I've tried using it and it just isn't flexible for what I want to do, and I can't stand the names for the tables "sf_guard_user". I like my tables to be organized and based off of my own database structure. Yeah I know, i sound even crazier, but really I dont want to use the plugin. I'm stubborn and I probably have OCD. I refuse to use something that irks me so much. Now that my little intro is over...onto my problem.

Ive built the database for my website and I have the models built and everything. The login system works fine..It's a cookie and mysql based login system. By that I mean that I have a "user_sessions" database table and my sessions are stored there and then the users have a cookie and my authentication system validates the two and if it returns true then they're considered logged "in".

What I'm stuck on though is how I make the User class/object a "global" function/class. Basically...how do I integrate my own user system into the "$this->getUser()" basic symfony user management system or make my own that is similar to it?

Or is it possible to modify the sfGuardPlugin heavily? I'm some what of a beginner with symfony and I really want my OWN custom user system. I really don't like symfony's reliance on a plugin and like I said I want my own system that I can modify at anytime. So yeah. What do I do?

What would you recommend doing if you wanted to create your own User System in symfony? Where should I start?

[Updated on: Fri, 29 August 2008 03:39]

Forum: General discussion
 Topic: Activating the cache with Doctrine
Re: Activating the cache with Doctrine [message #59682 is a reply to message #59328 ] Fri, 29 August 2008 01:11
colnector  is currently offline colnector
Messages: 36
Registered: July 2008
Member
Pooping this up. Your assistance is welcome. The error of course happens only with pages that execute Doctrine queries.


Colnector @ Colnect collectors community
http://colnect.com
 Topic: User Authentication
Re: User Authentication [message #59683 is a reply to message #59670 ] Fri, 29 August 2008 01:24
JasonTC  is currently offline JasonTC
Messages: 78
Registered: October 2006
Location: Austin, TX
Member
Is there no way to handle this within a config file?

By the way, I've implemented my own solution to this problem by now. It just seems like the preferred symfony way would be to handle it in a config file.

[Updated on: Fri, 29 August 2008 01:24]

 Topic: passing HTML tags in $this->redirect
Re: passing HTML tags in $this->redirect [message #59685 is a reply to message #59628 ] Fri, 29 August 2008 02:59
GaryFx
Messages: 101
Registered: May 2008
Location: Masschusetts
Senior Member
Rich text isn't appropriate for passing in a query string like that. Consider storing it in a flash variable.
 Topic: Using a different model class for Admin Generator
Re: Using a different model class for Admin Generator [message #59686 is a reply to message #59590 ] Fri, 29 August 2008 03:21
GaryFx
Messages: 101
Registered: May 2008
Location: Masschusetts
Senior Member
I'm not surprised by the suggestion that the admin generator is using a different mechanism to find classes than the autoloader. One thought that comes to mind is to move CmsPost up a level, so that it's in apps/cms/lib/CmsPost.php. Another is to rename it to be CmsPost.class.php. Better yet, check the autoloader documentation. I don't recall off the top of my head how it identifies the directories and files to search.

But the entire approach bothers me. One of the premises of symfony is that the model is independent of the application. Extending the model for just one of the applications feels wrong. The model represents the data, the consistency of the data, and the business rules around the data.

Could you elaborate more on this? Perhaps giving an example of something you think belongs in CmsPost.php and not Post.php?
 Topic: Can't save new propel object
Re: Can't save new propel object [message #59688 is a reply to message #59578 ] Fri, 29 August 2008 04:44
GaryFx
Messages: 101
Registered: May 2008
Location: Masschusetts
Senior Member
When you ask Propel to save an object, it checks to see if any of the columns have been modified, and won't bother saving it if there haven't been any changes. However, when you create an object, the autoincrement fields aren't marked modified.

This is often the correct behavior, as it's not frequently useful to have multiple records whose only difference is in the autogenerated primary key. But if you need it, you can override the isModified method, or override the constructor to add a modified column, or even just set a column.
 Topic: How to re-use an action like a component?
Re: How to re-use an action like a component? [message #59689 is a reply to message #59523 ] Fri, 29 August 2008 05:44
GaryFx
Messages: 101
Registered: May 2008
Location: Masschusetts
Senior Member
You don't need to create a component, though it might be a good idea. What you do need to do is to factor our the code that computes the data from the code that renders it for presentation. So you might have one function that's pure controller, collecting the data that you need. Then the Ajax action would call this function and use renderText to return it as JavaScript (presumably). The other action could call the same function and use it within its own templates. Or you could wrap it in a component if that made more sense. It really just depends on how you want to present the data.

 Topic: On update created_at changes
Re: On update created_at changes [message #59690 is a reply to message #59551 ] Fri, 29 August 2008 06:01
GaryFx
Messages: 101
Registered: May 2008
Location: Masschusetts
Senior Member
The problem is that you specified the type TIMESTAMP for these columns.

You shouldn't specify a type when using the special column names created_at or modified_at. The symfony-Propel processing will automatically generate the correct type.

By specifying TIMESTAMP, you've triggered MySQL's special handling for timestamps. See TIMESTAMP Properties in the MySQL manual. (I'm making a big assumption that you're using MySQL, though I wouldn't be surprised if other databases worked similarly.)
 Topic: Money transfers between tables
Re: Money transfers between tables [message #59684 is a reply to message #59662 ] Fri, 29 August 2008 02:00
RR_QQ2  is currently offline RR_QQ2
Messages: 26
Registered: August 2007
Junior Member
anyone else??
Re: Money transfers between tables [message #59691 is a reply to message #59662 ] Fri, 29 August 2008 07:15
cokker  is currently offline cokker
Messages: 133
Registered: January 2007
Location: Germany
Senior Member
I'm not sure but there should be a locking mechanism in mysql.

So a first process locks the tables, make the checks and move the money. When finished the tables are unlocked.

A second process can't interfere because of the lock.

I'm not aware that symfony supports such special case. So you have to look how to do this without symfony. Then you can't think about how to integrate this to your code.

greets
Sven

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software