Re: can i have two login?

2011-11-29 Thread AD7six
On Tuesday, 29 November 2011 06:56:51 UTC+1, Mamdoohi wrote: hi i create my website like joomla so i want two login for admin and registered user? with this i can where change in admin then see that in site. can i do it? Sure, permission granted. AD -- Our newest site for the

Re: can i have two login?

2011-11-29 Thread Mamdoohi
can you more explain? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: can i have two login?

2011-11-29 Thread fadhli
yes you can, you can use two method, admin_login adn login on user controller. On Tue, Nov 29, 2011 at 3:54 PM, Mamdoohi hamid.mamdo...@gmail.com wrote: can you more explain? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

Re: limiting the character length of text I show in the view

2011-11-29 Thread Tomfox Wiranata
thats it!! thaanks!!!1 On 29 Nov., 03:03, dreamingmind dreamingmin...@gmail.com wrote: or even more specific to the problem is the Text Helper's truncate(). Don On Nov 28, 7:43 am, Tomfox Wiranata tomfox.wiran...@gmail.com wrote: Hi, I am loading data in a div, that is often too

Re: using isAuthorized()

2011-11-29 Thread phpMagpie
When I return false from isAuthorized() I simply get returned to the referring page (i.e. the page I was already on). If your app is behaving different then you've probably set a variable that is changing the default behavior. HTH, Paul. -- Our newest site for the community: CakePHP Video

Re: problem when setup

2011-11-29 Thread phpMagpie
The warning tells you exactly what to do to remedy the problem. HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To

Re: adjusting my website to different browser with cake

2011-11-29 Thread phpMagpie
Yip, in some instances, although this should not be heavily relied on, you need to include different CSS declarations in HTML IF statements, which also allow for different CSS for different IE versions, another issue if you supporting older browsers. HTH, Paul. -- Our newest site for the

Re: adjusting my website to different browser with cake

2011-11-29 Thread phpMagpie
Thanks for the heads up on that Jeremy! -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: How Check validate before save

2011-11-29 Thread phpMagpie
CakePHP will do this for you automagically when using Model::saveAll(). HTH, Paul. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To

Re: role-base authentication

2011-11-29 Thread phpMagpie
You do not give any information on what part of authentication you are struggling with. Auth will work with users that are associated to roles, after the user it authenticated you then need to check their level of authorization (two different things). I do this with isAuthorized() methods in

Is there an up to date cakesheet?

2011-11-29 Thread Butch
Hi there, ist there an up to date cakesheet for cakephp v2.0.3 like this one for v1.2: http://cakephp.org/files/Resources/CakePHP-1.2-Cheatsheet.pdf ?!? Thanks, Butch -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site

CakePHP Developer Needed

2011-11-29 Thread Neeraj Kamdar
Hello, We need a CakePHP developer to help us optimize a custom CRM tool. This is an internal company tool that was built on Cake 1.3 and recently upgraded to 2.0.3. Some of the queries have many associations and the queries are quite memory intensive and slow. We are looking for someone to

CakePHP model db joins

2011-11-29 Thread Neil Craig
Hi all My apologies if this has been posted already, i just can't seem to find a solution so i am hoping someone will be kind enough to have a look and make some suggestions for me... I'm an experienced PHP dev and sysadmin and am building a small website, and subsequently hoping to persuade my

AppController loading issue

2011-11-29 Thread Weydson
I have an AppController.php located on /app/Controller and somehow the inherited controllers are not loading it. Instead, it loads the one defined on /lib/Cake/Controller. That's how I am testing: - Create a new controller such as: ?php App::uses('AppController', 'Controller'); class

Date picker for CakePHP 2.0.3

2011-11-29 Thread Florin Trifu
Hi I need to implement a date picker into my application. I have found this tutorial: http://bakery.cakephp.org/articles/agusti/2010/02/02/transparent-datepicker-with-jquery but unfortunately is not working with my version. Did someone succeeded to implement it or can someone guide me to another

Re: can i have two login?

2011-11-29 Thread Jordan
Also you can have only one login method and just redirect the authenticated user to different places depending on his role. On 29 Ноем, 00:56, Mamdoohi hamid.mamdo...@gmail.com wrote: hi i create my website like joomla so i want two login for admin and registered user? with this i can where

Re: can i have two login?

2011-11-29 Thread Jordan
Also you can have one login method and just redirect the authenticated user to different places depending on his role. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with

Re: role-base authentication

2011-11-29 Thread Jordan
If you don't want to keep access information for each record in the database you can just check for the role after authentication (and also you can put it in your AppController beforeFilter): if($this-Session-read('Auth.User.role') == 'admin') { ... } -- Our newest site for the community:

Re: Remember Me with Cookie and Auth Component

2011-11-29 Thread Jordy van Kuijk
Hi Miles, I cannot get the component to work, so I switched back to my own cookie login method. I can successfully login the user with the cookie, however, I only have the email address and password available. Is there anyway that i can initialize the user after he logged in? When i debug

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread Jordan
Hi Florin, You can use http://jqueryui.com/demos/datepicker/. It is really easy to implement no matter if you are using 1.x or 2.x Just use the dateFormat option and configure it to match your database/validation rules. $( .selector ).datepicker( option, dateFormat, 'yy-mm-dd' ); Best, Jordan

Re: CakePHP model db joins

2011-11-29 Thread Andras Kende
Look s like your models are not being used due to invalid file naming... Model name should be singular as: Artist.php , Song.php Also the is a typo, class Post should be Class Artist : Model/Artists.php ?php class Post extends AppModel Probably you don't need the options['joins] as this is

Re: AppController loading issue

2011-11-29 Thread Andras Kende
try toggling the debug = 2 in core.php, it helps sometimes… Andras Kende On Nov 28, 2011, at 12:40 PM, Weydson wrote: I have an AppController.php located on /app/Controller and somehow the inherited controllers are not loading it. Instead, it loads the one defined on /lib/Cake/Controller.

Re: CakePHP model db joins

2011-11-29 Thread Jeremy Burns | Class Outfit
A couple of errors: - Your Artist model has this as the first line: class Post extends AppModel. It should be class Artist extends AppModel. - Your $options['joins'] statement in your index function of the songs_controller is unnecessary (and in fact you are not bringing it into your find

Re: Cake2.0 not recognizing my PHPUnit installation

2011-11-29 Thread euromark
we did it :) Installing PHPUnit was never easier https://github.com/dereuromark/PHPUnit-Cake2 a) Drop our plugin into your /Plugin/ folder b) Run Phpunit.Phpunit install thats it. nothing more to do, no include paths, no strange pear installer (since your Vendor path is already one by default)

ACL schema problem with baking

2011-11-29 Thread Justin Edwards
I have an app that uses the ACL tables, aro, aro_aco, and aco. When using cake bake to generate anything it errors out if those tables aren't on a skiplist. The model skiplist is currently implemented for i18n, so I just added these tables to that to get baking working. I added the skiplist

Conditions in model associations

2011-11-29 Thread Jeremy Burns
I've noticed that if I have conditions on model associations, for example: $hasMany = array( 'ActiveUser' = array( 'className' = 'User', 'foreignKey' = 'group_id', 'conditions' = array( 'ActiveUser.active' = 1

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread Florin Trifu
I have tried this but it doesn't work for me. I have downloaded the jquery-ui, put the js inside /app/webroot/js, included inside my layout, and then create an input like this: $this-Form-input('expire', array('id'='datepicker')) Nothing happens when I click inside the text box... -- Our

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread ecsyle
You also need the jquery library, and will probably need to actually write some javascript. It's easy: script $(function() { $(#datepicker).datepicker(); }); /script If you have done this, and are still getting errors, check your javascript console to see what is going on. On Nov 29,

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread Florin Trifu
I forgot to tell you but jquery is also included. In the javascript console there is no error because the date-picker is not triggered. Can you please tell me where should I put the script you told wrote me? This one: script $(function() { $(#datepicker).datepicker(); }); /script Thank

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread Jordan
You can put the script anywhere on the page. Anyway, better practice is to put it before the closing head tag of your layout view. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help

Migration from one host from another

2011-11-29 Thread Flo
Hi, I would like to know if there are any requirements to follow when migrating a cakePHP website from one host and domain to another ? I am banging my head on the walls for 3 days because I can't manage to duplicate a functionning website to my preproduction server. I know my question is kind

Blog with posts and comments

2011-11-29 Thread joserafael
If anything I could do in cakephp is to relate a table of news with commentary. Yes, that is simple but I can not find the solution. When I make the scaffold I have no problem. The hasMany and belongsTo is created in the model. But when I select a comment post via a dropdown menu and it is not

Re: Migration from one host from another

2011-11-29 Thread Jeremy Burns | Class Outfit
A few starters... - make sure you copy across the .htaccess files (they are often hidden) - clear down all your cache files (tmp/cache) - check the file permissions are right (tmp/) - make sure the database credentials are correct What specific issues are you facing? Jeremy Burns Class Outfit

Access Data in Associations Efficiently

2011-11-29 Thread Jordy van Kuijk
Hi all, I've managed to set up most of my associations and models in CakePHP (I'm a noobie). Now I have a very basic question. Let me explain the situation first. I have got a User, Pet and Post model. The user hasmany pets, the pet hasmany posts. The user can also log in. Now in my

Document management system with CakePHP

2011-11-29 Thread greeg_
Hi! I'm just wondering.. if CakePHP is good choice for developing an DMS. The ACL looks good for it, but is it right to controlling who will have access to specified document? Do you know any example of DMS baked by CakePHP? Thanks in advance, greeg -- Our newest site for the community:

Re: Access Data in Associations Efficiently

2011-11-29 Thread euromark
especially as beginner you should ALWAYS bake your code first using the bake shell cake bake ... it will produce out of the box code you can already use to create/edit/ view/delete records step two then is adjusting the baked code to your needs the advantage: you can easily modify your relations

Re: CakePHP Developer Needed

2011-11-29 Thread Graham Weldon
You could try contacting the Cake Development Corporation: http://cakedc.com Cheers, Graham Weldon http://grahamweldon.com e. gra...@grahamweldon.com p. (+61) 0407 017 293 Skype: grahamweldon On Monday, 28 November 2011 at 10:59 PM, Neeraj Kamdar wrote: Hello, We need a CakePHP developer

Re: Access Data in Associations Efficiently

2011-11-29 Thread Andras Kende
Jordy, You could do something like: 1. get all pets .id of a user $userPets = $this-User-Pet-find('all', array( 'fields' = array('Pet.user_id'), 'conditions' = array( 'Pet.user_id' = $uid ), )); $petIds = Set::combine($userPets, '{n}.Pet.id'); $posts =

Has many problem

2011-11-29 Thread Hugo M
Hi all! I have a problem and I'm not sure about the a solution. I have two options of creating a process table. Option 1: table with 100 or more fields. Ugly, I don't want this. Fields: process1_costtype1_data1 process1_costtype1_data2 process1_costtype1_data3 process1_costtype2_data1 ..etc.

Re: Has many problem

2011-11-29 Thread Hugo M
Ah... an another question, what will happen if I add a new process, will always need to have a bigger index than the previous processes right? There's a way to have an better identifier in the fields with a hasMany? Something like: echo $this-Form-input(Process.process_name.cost_type); echo

Re: CakePHP model db joins

2011-11-29 Thread dw
I think you have your belongsTo/hasMany backwards. An artist hasMany songs, and a song belongsTo an artist. -d On Nov 28, 8:18 am, Neil Craig neil.cr...@thedotproduct.org wrote: Hi all My apologies if this has been posted already, i just can't seem to find a solution so i am hoping someone

Re: Blog with posts and comments

2011-11-29 Thread euromark
you shoudnt use scaffolding but bake your code using the bake shell then you probably discover that all your problems are gone On 29 Nov., 16:55, joserafael josecam...@gmail.com wrote: If anything I could do in cakephp is to relate a table of news with commentary. Yes, that is simple but I can

Form input Automagic on hasAndBelongsToMany when the model is not the model for the form?

2011-11-29 Thread calzone
I have a model (let's called it Sessions) that hasAndBelongsToMany Tags. Each Session belongsTo a Track Each Track belongsTo an Event Each Event belongs to an EventGroup A User may manage several EventGroups. For UX purposes, I have condensed the maintenance of all these into one form. In

Re: Conditions in model associations

2011-11-29 Thread euromark
If I remember right a core member once wrote that this is a known limitation of the current conditions array for relations. Personally, I think this should be addressed in 2.1 as a bugfix to be fixed (if I add a global condition it should always be applied, no matter what). As of right now you

Re: Conditions in model associations

2011-11-29 Thread euromark
and I think this is the ticket: http://cakephp.lighthouseapp.com/projects/42648/tickets/1793-model-conditions-not-recursively-applied On 29 Nov., 22:22, euromark dereurom...@googlemail.com wrote: If I remember right a core member once wrote that this is a known limitation of the current

Re: How to add a fixture to a plugin test?

2011-11-29 Thread Roland
None, that's the problem. I got non error or tips what is not working... but when I do $article-find('all') I get an empty result... thanks Roland On 29 Nov., 04:44, José Lorenzo jose@gmail.com wrote: this should just work, what error are you getting? -- Our newest site for the community:

redirecting to diffrent form

2011-11-29 Thread İNGİLTERE EMRE BEY
Hi all, I am new to cakephp and im building a basic jobseeking site, my problem is, i have two form one for employee and second form is for jobseeker, im saving common data such as firstname, surname, ect.. in one table, after saving this data i want redirect to relative form like for emloyee to

Re: redirecting to diffrent form

2011-11-29 Thread Jordan
Try if($this-data['user_group']=='2') { } else { } -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group,

How to change WHERE statement for SQL Select.

2011-11-29 Thread GG
I know why it's not working, I just cannot figure out how to fix it. These are my errors: 1. Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'where clause' 2. SQL Query: SELECT `Period`.`period_id`, `Period`.`title`, `Period`.`created`, `Period`.`modified`,

Re: Date picker for CakePHP 2.0.3

2011-11-29 Thread Florin Trifu
Thank you very much! Indeed it worked. Just to let the other users know in case they will have the same problem: 1. Download jquery (http://docs.jquery.com/Downloading_jQuery) and put the file in $project/app/webroot/js (e.q: *$project/app/webroot/js/jquery.js*) 2. Download jquery-ui

Unexpected clear of cached elements

2011-11-29 Thread Pierre UNGLAS
Hello, I can see in my app\tmp\cache\views that all the elements that I Have cached create in this folder a cached view. The problem is that these cached views seems to have a very short time of life and even sometimes they disappear. For the moment I couldn't find what happen. The debug level

Re: How to change WHERE statement for SQL Select.

2011-11-29 Thread Graham Weldon
It looks like the issue is with your non-standard database structure, perhaps. On your Model/Period.php model, set the primary key to be 'period_id' since that looks like your primary key: class Period extends AppModel { public $primaryKey = 'period_id'; /// Other code here... }

Re: How to change WHERE statement for SQL Select.

2011-11-29 Thread GG
Let me clarify... private function isActionable($id) { if($this-Session-read('Auth.User.role') == 'admin'){ return true; } $post = $this-Period-find('first', array( 'conditions' = array( 'id' = $id,

Re: How to change WHERE statement for SQL Select.

2011-11-29 Thread GG
Actually, that worked... It's perfect As far as database structure... would this be a standard way of structuring my tables? Table 1 (users) id usernamepassword Table 2 (posts) id postuser_idtype_id Table 3 (types) type_idtype_name On Nov 29, 5:48 pm, Graham Weldon

Re: How to change WHERE statement for SQL Select.

2011-11-29 Thread Graham Weldon
Yeah, so the conventions approach would be to use: Primary Key: id (int 11, or char 36) Foreign Key: name_id (int 11 or char 36) where name is the singular name of a model. Example: CREATE TABLE `posts` ( `id` CHAR(36) NOT NULL PRIMARY KEY, `user_id` CHAR(36) NOT NULL, `name`

Re: How Check validate before save

2011-11-29 Thread andrewperk
Hi Mamdoohi, As others have said when you call your models save() method it will check validation by default. But if for whatever reasons you want to do manual validation, here's a few methods that I found extremely helpful: $this-YourModel-set($this-request-data); You can use your models set

Re: How to add a fixture to a plugin test?

2011-11-29 Thread euromark
i think you just have to use ClassRegistry::init('ModelName); here On 29 Nov., 22:38, Roland kreativestal...@gmail.com wrote: None, that's the problem. I got non error or tips what is not working... but when I do $article-find('all') I get an empty result... thanks Roland On 29 Nov.,

Re: CakeEmail Invalid email

2011-11-29 Thread localhost
No suggestion from anyone! :( Should I modify CakeMail to make mail validation an option and submit this to Cakephp ? OR if I add the To field direct to the mail header (using addheader function), do you think it will work? On Nov 29, 7:23 am, localhost ahm...@gmail.com wrote: Thank you very

Re: can i have two login?

2011-11-29 Thread Mamdoohi
ok. but all users have one row in users table with username and password and role_id fields. so when save my data in session the auth component replace new user with old user. what can i do for this? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check

Re: Conditions in model associations

2011-11-29 Thread Jeremy Burns | Class Outfit
Thanks - this is exactly the issue I am facing. I agree with you; this sort of renders the conditional associations almost useless and I bet it catches a lot of people out. It took me an hour or so to realise what was happening. Jeremy Burns Class Outfit http://www.classoutfit.com On 29 Nov

js/css compression helpers for cakephp 2.0

2011-11-29 Thread mikeottinger
Hi All, I've been looking at cakephp 2.0 and wondered if any of the existing plugins written previously for js/css compression worked with cakephp 2.0. Does anyone have any plugins or techniques in general they can share on this? Thanks! -- Our newest site for the community: CakePHP Video

Re: Migration from one host from another

2011-11-29 Thread Flo
Ok, thank for the check list. I already copied all the files including the 3 htaccess files from the original host, changed the credentials for the database and made writable the tmp folder. What I didn't do and what I just did after reading your message is to clear the cache folder.