Re: complex problem

2009-01-22 Thread RoVo
Hi medo, Please read this article in the bakery: http://bakery.cakephp.org/articles/view/using-cake_admin-for-multiple-user-types May be, that helps you... Like websta said, the right way is, to use of 'prefix': 'prefix'='admin' But use it in both routings, like this: Router::connect(

Re: How can TMP be set to some other directory?

2009-01-22 Thread Martin Westin
Thanks RoVo, That's what I was afraid of. I don't like modifying dist-files, but it looks like I have to. Let's just hope nothing changes in index.php for a while :) /Martin On Jan 20, 1:16 pm, RoVo rol...@service-itzehoe.de wrote: Hi Martin, Unfortunately defining TMP in bootstrap.php is

Re: How to sum up the duration time based on the application used?

2009-01-22 Thread Martin Westin
From http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html (first comment) SELECT SEC_TO_TIME( SUM( TIME_TO_SEC( `time` ) ) ) AS total_time FROM time_table; So you should be able to add a fields to your search where you put the above MySQL trick. You may also want to add a GROUP

Re: Anyone built a forum system yet?

2009-01-22 Thread posh beck
It would be great if all coding is given free here. On Sat, Jan 17, 2009 at 11:07 AM, Miles J mileswjohn...@gmail.com wrote: If so, how did you do the following: - Determining if a user has read a thread or leave it unread, also marking all threads as read - Whos online (thinking of using

Re: Anyone built a forum system yet?

2009-01-22 Thread Miles J
What about the other 2 questions? -_- --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Cake debug html code

2009-01-22 Thread Invizibility
Hi all, I'd like to change the location where cake inserts its debug statements (SQL queries, timings) in my layout. The reason is that when my app goes alpha and is sent to QA I would like them to quickly know which queries are being fired and what is happening but in an optional way. Hence

Re: Unable to get Bake working again (1.2)

2009-01-22 Thread designv...@gmail.com
No worries! Thanks anyways! Is there anyone else out there that could maybe shed some light? d. On Jan 20, 4:23 pm, leo ponton@gmail.com wrote: Sorry, I can't offer any more help. I've switched to Mac, I ditched AMP stacks and I bake by hand, not with a machine - somehow it seems

Re: Custom queries test

2009-01-22 Thread Fabio Kreusch
I'm working with no prefixes.. On Jan 21, 10:04 pm, websta* subscripti...@webprogression.co.nz wrote: If you get your database connection details from the ConnectionManager you will at least be able to deduce your table prefix and integrate this into your querries. -Original

Berlin CakePHP Meetup, Next Friday (Jan 30)

2009-01-22 Thread the_undefined
Hey folks, if you are in Berlin or close by, Tim and I are organizing a CakePHP meetup there next week Friday. If you are interested in coming, leave a comment on our blog: http://tinyurl.com/ab5j65 -- Felix Geisendörfer aka the_undefined --~--~-~--~~~---~--~~

Re: Unable to get Bake working again (1.2)

2009-01-22 Thread designv...@gmail.com
Ok, so I have figured one thing out - i wasnt using the CLI version of PHP ?? Anyways, I have bake coming up now, but it wont recognise existing apps, tries to create new ones everytime... Any ideas anyone? TIA d. On Jan 22, 11:21 am, designv...@gmail.com designv...@gmail.com wrote: No

Re: Unable to get Bake working again (1.2)

2009-01-22 Thread designv...@gmail.com
No worries! Thanks anyways! Is there anyone else out there that could maybe shed some light? d. On Jan 20, 4:23 pm, leo ponton@gmail.com wrote: Sorry, I can't offer any more help. I've switched to Mac, I ditched AMP stacks and I bake by hand, not with a machine - somehow it seems

Data from multiple queries in pagination

2009-01-22 Thread Abhishek
Hi, Suppose i have to execute multiple queries .. and display the data together using the pagination helper .. how do i do that .. i ll have to execute multiple queries because its giving me data in order of relevance .. Abhishek --~--~-~--~~~---~--~~ You

Re: Unable to get Bake working again (1.2)

2009-01-22 Thread designv...@gmail.com
FIXXED!! YAY! Ok, I have to navigate to 'D:/Server/cake/' then type 'cake bake -app ../www/app1' and it works!!! Hope this helps someone else! d. On Jan 22, 11:21 am, designv...@gmail.com designv...@gmail.com wrote: No worries! Thanks anyways! Is there anyone else out there that

CLI stopped working - Vista

2009-01-22 Thread Liket
Can't seem to execute the cake.bat. Set all the environment variables correctly, I think. Using xampp server so my environment varaibles is set to C:/xampp/htdocs/cake and C:/xampp/php I make my way to C:/xampp/htdocs/app and type cake. Cake starts listing diffrent options and so on. But half

Re: Cake debug html code

2009-01-22 Thread Martin Westin
You don't really need to change the location in the source to display sql debugging in a pretty way. http://snook.ca/archives/cakephp/debug_styles/ For any debug() statements you put in your code you would have to override that function and save them all until you get to the layout. But the

Re: RC3 file cache trouble

2009-01-22 Thread Gediminas
Hey, Has anyone posted this issue to the bug tracking system? It looks like generated cache file doesn't contain model loading like 1.1 version did. I don't want to rewrite all forms by hand. Gediminas On Jan 21, 11:44 am, chanon chano...@gmail.com wrote: CakePHP 1.2 Final has been released

How can I get the xml encoding using Xml class?

2009-01-22 Thread Martin Westin
Hi, This must be something obvious I am missing, so I thought I'd ask. I load an rss feed: App::import('Core', 'Xml'); $rss = new XML($url_to_an_rss_feed); And thought that these would automatically reflect the encoding (and version for that matter) of the xml loaded: debug( $rss-encoding );

Re: CLI stopped working - Vista

2009-01-22 Thread AD7six
On Jan 22, 12:10 pm, Liket sandell.fred...@gmail.com wrote: Can't seem to execute the cake.bat. Set all the environment variables correctly, I think. Using xampp server so my environment varaibles is set to C:/xampp/htdocs/cake and C:/xampp/php I make my way to C:/xampp/htdocs/app and type

Re: Error when including prototype and scriptaculous in layout template

2009-01-22 Thread mrg
Turns out I had neglected to read the FAQ on scriptaculous requiring all .js files to be available - or specify which ones you need! Hope this helps someone. matt On Jan 21, 3:26 pm, mrg matthew.gill...@gmail.com wrote: On Oct 12 2008, 12:37 am, ORCC oskar...@gmail.com wrote: [..trimmed...]

Is cake good for small project with SOAP calls (no database)

2009-01-22 Thread Deb
Hi there, I'm considering using cakephp for a small project. The only thing is instead of using a database, we use SOAP calls and I couldn't figure out from the docs if this would work ok. Would it? Thanks, Deb --~--~-~--~~~---~--~~ You received this message

Re: How can I get the xml encoding using Xml class?

2009-01-22 Thread RoVo
Hi Martin, the header is stored in: var $__header = null; may be, it's only used in the header-function of xml.php?!? but alternatively you can use the option-param e.g.: $rss = new XML($url_to_an_rss_feed, array('encoding'='ISO-8859-1') ); If you have PHP5, as well you can use SimpleXML -

Re: Is cake good for small project with SOAP calls (no database)

2009-01-22 Thread Samuel DeVore
http://www.google.com/search?q=cakephp%20soap%20model there are some good links hidden in google ;) Really what you are probably looking for is doing a custom datasource. So that might be the key to finding things in the bakery and book. Sometimes the key is figuring out where the heck to

Clarification about HABTM models

2009-01-22 Thread Ernesto
Hello i'm having some troubles with an HABTM relationship. the following code isn't my real app, just a simplified version. my app has 3 models - Customer - Phone_Number - Customer_PhoneNumber in Customer model i defined the HABTM relationship: class Customer extends AppModel { var

Re: validate 'minLength' for 'password' field

2009-01-22 Thread Smelly_Eddie
Adam I created an article for full Validation of User Models. It includes the methods to validate username , email, require special characters, length and matching passwords passwords. It also takes care to ensure that emails and usernames are unique. It also has some logic to ignore these

Auth Redirect

2009-01-22 Thread WidePixels
Does anyone know how to redirect a user once they login succesfully based on their User Group Id? When a user is created they are assigned a User.Group_id in the table. I need to get the group_id and redirect. Using Auth Component. I have 3 groups: Admin - group_id = 0 Manager - group_id = 1

Re: Is cake good for small project with SOAP calls (no database)

2009-01-22 Thread Deb
Hey thanks. I'm just building a simple registration app, it's for work so it won't be on the internet just yet. I am just making SOAP calls, I don't have to invent the services. I thought since the app is simple it would be a good time to try out a new framework. Deb On Jan 22, 10:05 am, Samuel

Migrating to Media Temple DV Server - Path problem

2009-01-22 Thread Tony Thomas
I'm moving my CakePHP app onto to a Media Temple Dedicated Virtual server and my paths are all wrong. There seem to be two issues, one more severe than the other: First, the paths to webroot don't work, so the head of my document links my stylesheet like so: link rel=stylesheet type=text/css

Removing Admin from non-admin pages

2009-01-22 Thread gkc
I am currently using the default admin routing for the few pages that have admin functions. However, for pages that dont have admin functions, the links still display admin in front and thus I get function/ view errors. How can I remove the admin part from the link that does not have any admin

Re: Anyone built a forum system yet?

2009-01-22 Thread brian
Like I said in the first reply here, a who's online feature was discussed in this group very recently. I just found the thread: http://groups.google.com/group/cake-php/browse_frm/thread/50fd37fe850cb31/6e65e7fcc6c0e1bc?lnk=gstq=who%27s+online#6e65e7fcc6c0e1bc There's an older one here:

Re: Removing Admin from non-admin pages

2009-01-22 Thread brian
How are you creating the links? If you're using the HtmlHelper and an array to build the URL, pass 'admin' = 0 as the last param. On Thu, Jan 22, 2009 at 11:56 AM, gkc gerardkco...@gmail.com wrote: I am currently using the default admin routing for the few pages that have admin functions.

Re: Migrating to Media Temple DV Server - Path problem

2009-01-22 Thread Tony Thomas
Aha! After further investigation, the .htaccess from cake's root was missing. Once I created that, all was fixed. On Jan 22, 10:20 am, Tony Thomas truet...@gmail.com wrote: I'm moving my CakePHP app onto to a Media Temple Dedicated Virtual server and my paths are all wrong. There seem to be

Re: Auth Redirect

2009-01-22 Thread jitka (poLK)
AppController extends Controller { ... function beforeFilter() { $this-Auth-autoRedirect = false; ... } UsersController extends AppController { function login() { if ($user = $this-Auth-user()) { $url = ... $this-redirect($url);

Re: How can I get the xml encoding using Xml class?

2009-01-22 Thread Martin Westin
Hi ReVo, $__header contains a string of the first line in the xml. this will usually contain something like xml version=1.0 encoding=UTF-8 since the tag characters are stripped away. But it may also contain the whole of, or part of, the xml since xml files are valid without any whitespace.

Re: complex problem

2009-01-22 Thread mohammad al-ani
websta i try this before but get the same problem, and of course thank you for that tip and RoVo thank you t give me the appropriate knowledge about the use of prefix and now i face a new problem is how to make a custom routing to two dir one for admin and other for the super admin like i enplane

Re: How can I get the xml encoding using Xml class?

2009-01-22 Thread Martin Westin
Got it! { Big sigh } Cake's Xml classes use PHPs Xml Parser. And PHPs parser automatically converts the contents to UTF-8. http://www.php.net/manual/en/xml.encoding.php So no matter what I had in the file (of the three supported charsets at least) I will end up with utf-8 text. Good to know.

Re: XML help

2009-01-22 Thread tjr88
HI, I had already found this post it was most helpful. What i ended up doing is using the sitemap example to create my xml file. I found $xml-serialize gave me attributes instead of elements. Which is not what i would class as xml. On Jan 21, 9:17 pm, Webweave webwe...@gmail.com wrote: Of

Simple auth problem

2009-01-22 Thread neridaj
Hello, I just started using CakePHP and can't get the AuthComponent to accept a valid username and password - I keep getting Login failed. Invalid username or password. I've set up a users table in my db with the login credentials set to: username: username password: password Here is my code:

Sessions not writing whole string

2009-01-22 Thread gkc
As part of my login query, I am writing the user role to the the session with $this-Session-write('User.role',$this-$dbuser['User'] ['role']). However, when I call the $this-Session-read('User.role'), it is only returning the first character of the role. If I place the whole result in the

Re: plugins, SWFs and dispatcher

2009-01-22 Thread snowdog
I had the same problem in my mediaplayer plugin and solved it by using mediaView to serve flash (.swf) files from webroot. It works. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: How can I get the xml encoding using Xml class?

2009-01-22 Thread RoVo
Hi Martin, you are right! Better to search for the '', not for \n My imaginable solution may be like this way - put the attributes to an array... $this-__header = trim( str_replace( a( ''.'?', '?'.'' ), a('', ''), substr(trim($this-__rawData), 0, strpos(trim($this-__rawData), '?'.'') ))); /**

Re: 3 ajax selects

2009-01-22 Thread Pyrite
My site only uses a 2 select, the 2nd select then shows a bunch of form input fields. The code you posted helped a lot! I would just stick with Javascript on the client end to hide things, that's what I am having to do. If Select A changes, I call javascript to just hide the form input fields

Re: Restrict Controllers by Group

2009-01-22 Thread Pyrite
Bump! Anyone ...? On Jan 21, 4:16 pm, Pyrite thelette...@gmail.com wrote: Is there a way I can restrict controllers by group? Like $this-Auth-require('someGroup'); Otherwise, if the user is not a member of that group they don't get access. Also, where does the information in

Re: Localizate Month Names

2009-01-22 Thread Andrea Cardinale
On Thu, Jan 22, 2009 at 2:21 AM, Diego Caro diegoc...@gmail.com wrote: Hi for all. I read [1], but that method doesn't works for me. I want to translate the short name a month (for example: Jan, to Ene in spanish ) using TimeHelper (timeAgoInWords function). How to make it? Thanks, and

Closing $ajax-form()

2009-01-22 Thread Pyrite
How do you put the close tag in a form created by $ajax-form() ?? Why is there not an $ajax-formEnd() similar to the FormHelper's $form-end () ? Also, when I create a form with $ajax-form(), and I add a submit with $ajax-submit(), it does not submit the form. A usage example would be great. I

How to submit form elements that are disabled?

2009-01-22 Thread Pyrite
I want to have a form text input get submitted, but also want it to be disabled on display. Eg. $form-input('frmInputQuantity', array('label'='Quantity:', 'disabled'='disabled')); This does not get submitted into $this-data. How can I change what gets posted to $this-data with the form helper?

Encoding problem with helpers

2009-01-22 Thread ABY
hi, i am currently developing an application with CakePHP, but i have a serious problem with encoding. my database records are in Turkish. when i view a record, there is no problem and i can view Turkish characters. but when i try to edit a record, all fields that contain at least a Turkish

Re: Restrict Controllers by Group

2009-01-22 Thread RoVo
Hi Pyrite, I found a nice tutorial from francky06l on: http://www.cakephpforum.net/ Set authorization according to role Hope that helps RoVo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post

Re: Simple auth problem

2009-01-22 Thread Miles J
Make sure your password in the DB is hashed. Also check your salt: http://www.milesj.me/blog/read/3/debugging-the-cakephp-auth-component --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: Anyone built a forum system yet?

2009-01-22 Thread Miles J
Yes Ive seen them, but id prefer to use a MEMORY table. Anyone done this before, or will it not work since Cake uses InnoDB? Also what about the user groups, I mainly ask because I heard ACL lags a bit with a ton of users. --~--~-~--~~~---~--~~ You received this

Re: Data from multiple queries in pagination

2009-01-22 Thread Miles J
Can you explain what data and how it works? Place extra calls, queries in your afterFind(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: Simple auth problem

2009-01-22 Thread RoVo
Hi Jason, if the password-hash is not the solution, additionally you can go this way. There is a good tutorial with a demo-download on: http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/ Try this and compare the steps with your application and your config. I think, so you can get

Re: Restrict Controllers by Group

2009-01-22 Thread Dardo Sordi Bogado
Bump! Anyone ...? Don't bump, if nobody answers is probably that it has been answered before or you can easily find the answer in google. On Jan 21, 4:16 pm, Pyrite thelette...@gmail.com wrote: Is there a way I can restrict controllers by group? Like $this-Auth-require('someGroup');

Re: How to submit form elements that are disabled?

2009-01-22 Thread Dardo Sordi Bogado
I want to have a form text input get submitted, but also want it to be disabled on display. From http://www.w3.org/TR/html401/interact/forms.html#h-17.12 : ...the INPUT element is disabled. Therefore, it cannot receive user input nor will its value be submitted with the form. you also need

Re: How to submit form elements that are disabled?

2009-01-22 Thread Yusuf Widiyatmono
If the value of disabled form element could changed dynamically (maybe you have some lil process on your view), maybe you need some little javascript script here... script function test(){ document.ItemEdit.getElementById('ItemQuantytyHid').value =

logic after form submition

2009-01-22 Thread kai
When a user submits a form I'm hoping to apply some logic to their choice. The form takes user input and translates their selection into conditions to use in a query. One part of the selection is the choice to choose a genre. I'm hoping to say something like, if user chooses one genre or more

Re: Anyone built a forum system yet?

2009-01-22 Thread brian
Cake isn't limited to MySQL, nor (when using that particular DB) to InnoDB. If you want to use ENGINE=MEMORY for sessions (a perfectly a sound idea) I don't see any reason why that'd be a problem. On Thu, Jan 22, 2009 at 5:49 PM, Miles J mileswjohn...@gmail.com wrote: Yes Ive seen them, but id

Re: Encoding problem with helpers

2009-01-22 Thread brian
First thing is to make sure that the page with the form is being served with the proper encoding. Use $html-charset() in your layout. The form should submit using the character set that it was displayed with. Next, make sure that that's what your browser is using--check page info in the browser.

Re: logic after form submition

2009-01-22 Thread brian
If a user chooses a genre what does the data look like? Before your code does anything. Is it well formed? If you want to set ['Genre']['id'] to some value, what does the data look like before that? It seems like you're trying to override the user's selection, rather than add to it. Do you want

Re: Closing $ajax-form()

2009-01-22 Thread Yusuf Widiyatmono
i use $form-end(); and it does submit trough ajax updater successfully. see the code which is generated by ajax-form(); you will figure out that it just a normal new Ajax.Updater(). sometimes i meet my limitation when use ajax on cake, so i just write normal html and javascript on the view

Re: logic after form submition

2009-01-22 Thread kai
In $this-data: [Genre] = Array ( [id] = Array ( [0] = 2 [1] = 55 ) ) In sql: WHERE `Genre_id` IN ('2', '55') Yeah, I want to add to their selection, not override it. On Jan 22, 5:21 pm,

Re: logic after form submition

2009-01-22 Thread brian
if (isset($this-data['Genre']['id']) is_array($this-data['Genre']['id']) !in_array('51', $this-data['Genre']['id'])) { $this-data['Genre'][] = 51; // or, array_push($this-data['Genre'], 51); } On Thu, Jan 22, 2009 at 8:28 PM, kai k3ho...@gmail.com wrote: In $this-data: [Genre] =

Re: Calendar Helper

2009-01-22 Thread Mike
Thanks John, I'll take a look at it... :) On 15 jan, 17:53, Flipflops johnsv...@googlemail.com wrote: Hi Mike I built a calendar helper about a year ago. It is pretty basic - literally just a shell that lays out the days of the week and a back and forward button. Its up to you to get the

Re: Anyone subscribe to PHP Architect?

2009-01-22 Thread clarkphp
I'm a technical editor for php|architect, and I can vouch for the fact that ZF is appearing recently in articles because those were the articles being submitted. The mag has run articles on CakePHP, symphony, etc., in the past, and will run articles on ZF and other frameworks n the future.

Re: Quote marks in model names and Use of undefined constant notices

2009-01-22 Thread clarkphp
*sigh* - Looked at web site and that is NOT the problem, but this is not over, it seems. I ran into it again on some unit tests, and when using the bake script, I still getting errors on certain tables. Here is some output: Welcome to CakePHP v1.2.1.8004 Console

Re: Is cake good for small project with SOAP calls (no database)

2009-01-22 Thread clarkphp
Deb, I may be sticking my nose in unnecessarily, and if so, please accept my apologies, but when Samuel says custom datasources are accessible he isn't referring to creating the web service. He is referring to some of that Cake vocabulary. DataSource is a class in Cake. Check out the

Re: logic after form submition

2009-01-22 Thread kai
Even if i use array_push($this-data['Genre']['id'], 51); without the conditional statement it still doesn't add 51 to the Genre id array. $this-data['Genre'][] = 51; doesn't work either. I've tried a few variations and can't get it to work. First I need to figure out how to add values to the

weird baking situation

2009-01-22 Thread liaogz82
Hi all, while i was baking cakePHP with a mysql database, I have this situation where I was requested to confirm an association Payment belongsTo Pay? (y/n). I find this weird cos I do not have a database called Pay. Is pay some kind of an attribute in cakePHP that i should associate with it? Is