Re: Call static function in bootstrap.php

2009-01-06 Thread gearvOsh
It will work fine in your AppController beforeFilter(). --~--~-~--~~~---~--~~ 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,

Benefits for $html-link

2009-01-05 Thread gearvOsh
Are there any benefits, or behind the scenes magic for doing this: $html-link('Link', array('controller' = 'users', 'action' = 'login', 'var')); Compared to: $html-link('Link', '/users/login/var/'); This also applies to anywhere else you build urls.

Re: Auth Login Component not working :(

2009-01-05 Thread gearvOsh
Leave your login() action empty. CakePHP automatically does all the login magic. http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post

Using the named parameters

2009-01-05 Thread gearvOsh
Is this the only way to access named parameters without throwing a notice? $var = (isset($this-params['named']['var'])) ? $this-params['named'] ['var'] : ''; Is there some sort of function to get named params that im overlooking? --~--~-~--~~~---~--~~ You

Re: Auth Broken.

2009-01-04 Thread gearvOsh
Firstly use PHP 5. Secondly remove $this-Auth-allow('*'). Why are you even using the Auth component if your allowing all pages to be viewable? Perhaps place this in each controller separately. And thirdly, I thought isAuthorized is called after you are logged in. Someone correct me if im wrong.

Re: HABTM retrieving help

2009-01-04 Thread gearvOsh
questions.http://book.cakephp.org/view/164/pagination On Jan 3, 10:30 pm, gearvOsh mileswjohn...@gmail.com wrote: Heres my tables and relations: Team Team-belongsTo: Country, State Team-hasAndBelongsToMany: User (the players on a team, table = teams_players) Team: CREATE TABLE

Re: New Install Does Not Show Graphics

2009-01-04 Thread gearvOsh
Is this a localhost or webserver? Make sure mod_rewrite is enabled. --~--~-~--~~~---~--~~ 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

HABTM naming convention messed up?

2009-01-04 Thread gearvOsh
Ok I have a users and teams system. Users are part of a team. Here is the naming conventions: Model: Team, User DB: teams, users HABTM: teams_users (TeamUser model) But when I set my HABTM relationships I get errors because it says that the model TeamsUser does not exist. Shouldnt it be

Re: HABTM and associations and loading

2009-01-04 Thread gearvOsh
This happens to me when I place a HABTM on another HABTM, I have found no solution to this except to just remove that relation. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group,

Re: HABTM naming convention messed up?

2009-01-04 Thread gearvOsh
This is my team model. Once I change TeamUser to TeamsUser it works correctly, but that shouldnt be. Based on the docs and naming convention it should be TeamUser. class Team extends AppModel { /** * Teams belong to a country, state */ var $belongsTo =

Re: API

2009-01-03 Thread gearvOsh
I usually open the files myself instead of using the API online. I usually have to go through the methods themselves to find out the options. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to

HABTM retrieving help

2009-01-03 Thread gearvOsh
Heres my tables and relations: Team Team-belongsTo: Country, State Team-hasAndBelongsToMany: User (the players on a team, table = teams_players) Team: CREATE TABLE IF NOT EXISTS `teams` ( `id` int(10) NOT NULL auto_increment, `status` enum('approved','pending') NOT NULL default 'pending',

Re: new benchmarks of PHP frameworks

2009-01-02 Thread gearvOsh
These benchmarks dont mean anything. Do a benchmark using a full fledged system (perhaps a whole social community) and see how the work. Simply hello world pages are nothing because no frameworks are used for that. --~--~-~--~~~---~--~~ You received this message

Reverse relations?

2008-12-31 Thread gearvOsh
I know how to do relations for foreign keys, but I cannot figure out how to do this. In my users table, I have a column called state_id and country_id. I tried a hasOne country but that does not work. It looks for a user_id on the Country table that matches the user id, I need it the other way

Re: Reverse relations?

2008-12-31 Thread gearvOsh
I could of sworn I tried that and it didn't work, I must have changed the foreign_key. Anyways that worked. Yeah I was also thinking in my system... is that a user is top level and he has many different parts. A user is not necessarily part of a country, but I guess ill have to do it that way.

Re: How to change data of dropdown box when value of other dropdown box changes

2008-12-30 Thread gearvOsh
Ok you keep asking like 10 questions a day here. 1 - Read the CakePHP manual 2 - What you want to do is JSON/Javascript 3 - Perhaps actually learn PHP or Cake --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP

Re: findCount different then find('count')

2008-12-30 Thread gearvOsh
On Dec 30, 6:45 am, jason m ippatsu.ya...@gmail.com wrote: i think it should be return $this-find('count', array('conditions'=$conditions)); On Dec 30, 2:59 pm, gearvOsh mileswjohn...@gmail.com wrote: All I did was this: return $this-find('count', $conditions); return

Re: buttons in cakephp

2008-12-30 Thread gearvOsh
http://groups.google.com/group/cake-php/browse_thread/thread/48835c8925d3ca7a# You already asked this. There is a search function. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: Problem with auth component

2008-12-30 Thread gearvOsh
What does your AppController beforeFilter() look like? http://www.milesj.me/blog/read/5/using-cakephps-auth-component/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email

Re: show / hide with ajax

2008-12-30 Thread gearvOsh
You mean an accordion? http://docs.jquery.com/UI/Accordion --~--~-~--~~~---~--~~ 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

Re: How to make buttons in cakephp

2008-12-29 Thread gearvOsh
You dont have to build your views with cake code only: button type=button onclick=Name/button Also there is no button in cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group,

Re: Auth Only Showing Logged in on Users Controller

2008-12-29 Thread gearvOsh
Can I see your AppController or another Controller besides User? --~--~-~--~~~---~--~~ 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

Re: Data validation doesn't work

2008-12-29 Thread gearvOsh
You either need to have: required = true Or use the notEmpty rule. http://book.cakephp.org/view/127/One-Rule-Per-Field http://book.cakephp.org/view/740/notEmpty --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Doing pagination without paginate()

2008-12-29 Thread gearvOsh
Im having problems getting pagination working. I have complex custom queries and I just cant get it working correctly. Ive tried building a custom paginate() method within the model that does additional filtering, but then I also feel limited using the $paginate var in the controller. Anyone

Re: Doing pagination without paginate()

2008-12-29 Thread gearvOsh
Ive been messing around with it a bit and got this, is this the right way to do things? class DashboardController extends AppController { var $uses = array('Friend'); // Pagination var $paginate = array( 'Friend' = array( 'limit' =

findCount different then find('count')

2008-12-29 Thread gearvOsh
So I noticed when I used find('count') that the query is wrong: SELECT COUNT(*) AS `count` FROM `friends` AS `Friend` LEFT JOIN `users` AS `User` ON (`Friend`.`user_id` = `User`.`id`) WHERE 1 = 1 But when I use findCount the query and results are correct: SELECT COUNT(*) AS `count` FROM

Re: findCount different then find('count')

2008-12-29 Thread gearvOsh
All I did was this: return $this-find('count', $conditions); return $this-findCount($conditions); $conditions = array('OR' = array( 'Friend.user_id'= $user_id, 'Friend.friend_id' = $user_id )); --~--~-~--~~~---~--~~ You received this message

Re: HTML 4 specific CakePHP?

2008-12-28 Thread gearvOsh
I have not found any option or setting for using HTML or XHTML. All I have seen is that you can set the Doctype, but even if you set the Doctype as HTML, all the tags are in XHTML. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: Newby: Undefined index error

2008-12-28 Thread gearvOsh
You need to be using the User model. Make sure this is in your controller: $uses = array('User'); Perhaps look at these two links also: http://book.cakephp.org/view/171/Access-Control-Lists http://book.cakephp.org/view/172/Authentication --~--~-~--~~~---~--~~ You

Re: HTML 4 specific CakePHP?

2008-12-27 Thread gearvOsh
No thats the thing, XHTML is not supported. You would need to put the content-type as application/xhtml+xml which in most cases breaks the layout and always breaks IE. Everyone usually puts it as text/html which then renders the browser as regular HTML and NOT XHTML. Im not telling you XHTML is

Re: HTML 4 specific CakePHP?

2008-12-27 Thread gearvOsh
@Arthur Pemberton - Yeah but then if I set my Doctype as HTML 4 im riddled with markup errors which isnt good for me or the client. @Marcelo Andrade - Yeah thats what I was hoping was in the system, but I guess not. Ill see if I can extend it in some way.

How would I write this query

2008-12-27 Thread gearvOsh
Im a bit new to the model system, trying to understand how I would do a query like so. SELECT Friend.*, User.username, User.avatar, User.handler FROM friends AS Friend, users AS User WHERE Friend.status = 'approved' AND ((user_id = ':user_id') OR (friend_id = ':user_id')) AND User.id =

Re: How would I write this query

2008-12-27 Thread gearvOsh
Snippets of the code: CREATE TABLE IF NOT EXISTS `friends` ( `user_id` int(10) unsigned NOT NULL, `friend_id` int(10) unsigned NOT NULL, `status` enum('approved','pending') NOT NULL default 'pending', `requestTime` int(10) NOT NULL, KEY `user_id` (`user_id`), KEY `friend_id`

Re: How would I write this query

2008-12-27 Thread gearvOsh
I got something working on this but I ran into a problem. When joining the user table to the friend data, I dont know if its the friend_id or the user_id. So I will have to do some filtering and extra queries after i grab all friends. --~--~-~--~~~---~--~~ You

Re: How would I write this query

2008-12-27 Thread gearvOsh
This is what I came up with, I dont know if theres another solution. Also im completely lost how to paginate this. function getMyFriends($user_id, $status = 'approved', $limit = 5) { $friends = $this-find('all', array( 'fields' = array('Friend.*'),

Re: the Gift of 1.2 Final

2008-12-26 Thread gearvOsh
Ive only been used cake a couple of weeks but have been watching it for years. Ive got to say I love it the most out of the others ive tried, keep up the good work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Upgrade to 1.2 RC4 or 1.2 Final , get a Internal Server Error

2008-12-26 Thread gearvOsh
Your filename should be xxx_controller.php (no capital). If you were just typing it that way. Also why are you changing the controller before submit? This makes no sense. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Honestly I really dislike the xhtml type of tags in CakePHP. There are no reasons for that, I think it would be a better idea to make it html 4 strict. Heres an article on why xhtml is retarded. http://www.webdevout.net/articles/beware-of-xhtml

Re: HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Please explain your cleanliness? HTML 4 can do everything XHTML can except self closing tags /. Also your XHTML is being parsed as HTML and removed, so whats your point? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: HTML 4 specific CakePHP?

2008-12-26 Thread gearvOsh
Most browsers dont support XHTML and most people dont even write XHTML correctly. If this is your site(http://www.pembo13.com/), your DTD is XHTML but its being parsed as HTML. So basically thats kaput, did you read the article I posted earlier? @Graham Weldon - Seems like a lot of work to

Re: I'm not sure how to write this query...

2008-12-26 Thread gearvOsh
How is your database setup? Are tags a column in the blog table or is it its own table? --~--~-~--~~~---~--~~ 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

Re: setlocale

2008-12-23 Thread gearvOsh
Is there a reason why this has not been implemented in the l10n? Im a but curious :p --~--~-~--~~~---~--~~ 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

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
Thanks, also is there a way I can get the parent controller data as well? --~--~-~--~~~---~--~~ 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

Re: Setting Required Validation in a Model

2008-12-22 Thread gearvOsh
I never use allowEmpty or required = true. Simply use the rule notEmpty which means the field cannot be empty, thus required. And if a field doesnt have that rule, its not required, it works perfectly for me. --~--~-~--~~~---~--~~ You received this message because

Re: Using dynamic values in model validation

2008-12-22 Thread gearvOsh
No not that. In the models beforeValidate() is it possible for me to do like $controller-params? UsersController - User Model So in User::beforeValidate() can I get UsersControllers params, is basically what im asking? --~--~-~--~~~---~--~~ You received this

Re: Can someone explain why this happens

2008-12-22 Thread gearvOsh
Ah I came to that assumption last time, but then I had random instances where the hash wasnt being used as the id so I got confused. Anyway, would I just leave it? Or put an ($id = null, $hash = '')? --~--~-~--~~~---~--~~ You received this message because you are

Re: exclude form helper markup?

2008-12-21 Thread gearvOsh
Yes I really dislike that also, you have to do this everytime. ?php echo $form-input('email', array('div' = false, 'label' = false)); ? Div removes the surrounding div, and label removes the label. Then you can create the label manually: ?php echo $form-label('email', 'Email:', array('class'

Re: exclude form helper markup?

2008-12-21 Thread gearvOsh
@Adam - Theres nothing wrong with it, but when you have fancy forms and pre-cssed systems, cakes markup just gets in the way/breaks things. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to

Disabling Auths auto-hashing

2008-12-21 Thread gearvOsh
Is there a setting to disable the AuthComponent from automatically hashing the password index, without having to edit the core files? It really annoys me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP

Can someone explain why this happens

2008-12-21 Thread gearvOsh
So I have an action that verifies an email address after a successful signup. It uses a hash that was given in the email sent out. function verify($hash = '') { } This is my test hash and the url becomes: /users/verify/ eac20adf536b50f9fc0be58550fde763 When I go to that page, and even without

Using dynamic values in model validation

2008-12-21 Thread gearvOsh
Is there a way to use dynamic variables within the Model validation, an example below. 'between' = array( 'rule' = array('between', $passMin, $passMax), 'message' = 'Password must be between '. $passMin .' and '. $passMax ) I have an array of config settings that I would like to

Re: Updating a single database rows field

2008-12-19 Thread gearvOsh
So really weird. This was my previous action in the controller. function verify($hash = NULL) { } That would fail the saveField(), and the saveField would try to do an insert. It would also grab the wrong id for the User model. But once I changed it to the following it works fine. function

Re: how to set session when Auth component is used in login page

2008-12-19 Thread gearvOsh
Its automatic in the Auth component, just do this. if ($this-Auth-user()) { // they are logged in } If user() is null, that means they are not logged in. Hope that helps. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Validate in 1.2RC4

2008-12-19 Thread gearvOsh
Dont you need to call this? if ($this-Task-validates()) { // if no errors, do something } --~--~-~--~~~---~--~~ 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

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I cant use i18n/l10n in models now can I. Please show me how I would add errors to the $this-validationErrors array with a locale. If something works, who cares where it belongs. @grigri - I did updateAll, I just dislike how it doesnt escape and quote the data.

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Also I wish to not import and initiate a locale class in the model everytime I need it, which would be most of the time. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
Like I said, I dont want to Import the locale in every model method. Also saveField fails at this point: if (!empty($this-id)) { if (!$db-update($this, $fields, $values)) { $success = false; } } Because of this, When I know for sure the row exists. if

Re: Updating a single database rows field

2008-12-18 Thread gearvOsh
I even moved all the code into the Model, did what you said, and its still doing an insert instead of an update. Heres the method I call in the controller: function verifyEmailExpiration($username, $password, $hash, $expHours) { $userObj = $this-find('first', array(

Updating a single database rows field

2008-12-17 Thread gearvOsh
Ok, I may be stupid... but how would I update a single field on a single row. Something like the following without having to write a custom query. UPDATE users SET status = 'active' WHERE id = 1 Ive tried doing saveField() but that inserts a new row. Ive also tried using updateAll() but that

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Ive done that also, it still inserted a new row. --~--~-~--~~~---~--~~ 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

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Tried it again that way and heres the error: Warning (512): SQL Error: 1062: Duplicate entry '' for key 2 [CORE\cake \libs\model\datasources\dbo_source.php, line 521] Query: INSERT INTO `users` (`status`) VALUES ('inactive') It keeps inserting, even if I set the id.

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
Nope, still doesn't work. This seems like a lot of hassle/steps in between just to do something simple like update. Heres a snippet of my code: if ($this-User-validates()) { $userObj = $this-User-find('first', array( 'conditions' = array( 'User.username' =

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
I was only doing what the other guy suggested, I usually do not have the create() method. --~--~-~--~~~---~--~~ 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

Re: Overkill for a starter project?

2008-12-17 Thread gearvOsh
Honestly things like that I would just manually code or even use Wordpress just because its so simple. You could use CakePHP simply for the practice and automation, but there are no downsides using Cake. Perhaps just a ton of files the client wouldn't understand what they're for.

Re: AuthComponent Error... Wrong Password all the Time

2008-12-17 Thread gearvOsh
Try this: http://www.milesj.me/blog/read/debugging-cakephp-auth/ Or it could also be your password column in your database is at like 30 varchar... you would at least need 50+ if your hashing passwords. Its possible some of the hashed password got cut off. On Dec 17, 11:29 am, Christian

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
, gearvOsh mileswjohn...@gmail.com wrote: Nope, still doesn't work. This seems like a lot of hassle/steps in between just to do something simple like update. That's a lot of fat controller code for something as simple as that too ;). e.g. You should almost never need to do this in a controller

Re: Updating a single database rows field

2008-12-17 Thread gearvOsh
I still have yet to find a straight forward way to do this, so ill simply do something like this: function update($user_id, $fields) { if (is_array($fields)) { App::import('Sanitize'); Sanitize::clean($fields); $cleanFields = array();

Re: $validate an array

2008-12-15 Thread gearvOsh
Perhaps do something like this if ($this-RequestHandler-isPost()) { $cleanData = array(); foreach ($this-data as $field = $data) { // Rebuild the cleanData array based on your structure for the database } $this-data = NULL;

Re: Changing the Auth User Model

2008-12-14 Thread gearvOsh
Have you tried placing the Auth information in AppControllers beforeFilter()? Try that and see what happens... and if that doesnt help, look in the Auth Component manually. On Dec 14, 11:59 am, DavidH djhollingwo...@gmail.com wrote: Please note that since the above post I've corrected the model

Re: $validate an array

2008-12-14 Thread gearvOsh
Why/How is it a multidimensional array? If you use the FormHelper it builds it into a nicely formatted array in $this-data['ModelName']; --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this

Re: Database design . Beginner having trouble.

2008-12-13 Thread gearvOsh
If I believe what you are saying, something like this would work (not sure what fields you need): // all the tenants tenants - id - name // all the expenses expenses - id - cost // relating a tenant to an expense = multiple tenants possible on an expense tenantExpenseRelation - id - tenant_id

Re: Is CakePHP 1.2 fully backwards compatible with 1.1.16?

2008-12-12 Thread gearvOsh
Also, correct me if im mistaken. Instead of loadModel('ModelName') and other variations, its now App::import('Model', 'ModelName'); On Dec 12, 10:21 am, aranworld arancarli...@gmail.com wrote: The following are the main things I came across during a recent upgrade: -- all the html helper

Re: Debugging Auth: getting the name of teh action I get kicked

2008-12-12 Thread gearvOsh
Or check the $this-params, I believe its $this-params['action']; On Dec 12, 7:06 am, Daniel Hofstetter dhofs...@gmail.com wrote: Hi Anja, I get kicked out of some actions in some controllers. I have alread placed function beforeFilter()     {         parent::beforeFilter();        

Re: Prevent redirect in Auth

2008-12-12 Thread gearvOsh
It seems you will have to remove/comment out that part that redirects in the auth component manually. On Dec 12, 4:41 am, Dav fatsl...@gmail.com wrote: Tried that earlier, still redirects to users/login. I have this in my controller function beforeFilter() {     $this-Auth-autoRedirect =

$form-input with onkeyup, onfocus, etc

2008-12-12 Thread gearvOsh
So I have input fields that need javascript events for onfocus and onkeyup.. here is my code: ?php // Username echo $form-input('username', array('onkeyup' = populateUrl ('username', 'usernameUrl');, 'onfocus'= showSignupHelp ('username');)); ? That works, BUT when you look at the

Getting an array of errors during validation

2008-12-11 Thread gearvOsh
So I understand the Model validation using $validate. I applied snooks multiple validations using http://snook.ca/archives/cakephp/multiple_validation_sets_cakephp/, all that works perfectly. I do however dislike it when a field errors, the error message is shown after the input. Id rather a

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
Ok ill take a look at that. Hopefully I can do something to get an array so I can do a simple loop. On Dec 11, 12:27 am, Marcus [EMAIL PROTECTED] wrote: On Dec 11, 9:14 am, gearvOsh [EMAIL PROTECTED] wrote: So I understand the Model validation using $validate. I applied snooks multiple

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
I figured it out. $validationErrors contains the array, I simply set it in the view. // login.ctp ?php echo $this-element('errors', array('errors' = $form- validationErrors['User'])); ? // elements/errors.ctp ?php if (!empty($errors)) { ? div class=failed h5?php printf(__d('errors',

Re: Getting an array of errors during validation

2008-12-11 Thread gearvOsh
Oh and also stupid me, its basically in the manual: http://book.cakephp.org/view/410/Validating-Data-from-the-Controller My way doesnt require you to set the data to the view though, but either way works. --~--~-~--~~~---~--~~ You received this message because

Re: Newbie question on form validating

2008-12-11 Thread gearvOsh
I just finished doing this today, these two links should help: http://book.cakephp.org/view/125/Data-Validation http://groups.google.com/group/cake-php/browse_thread/thread/d5e98df32a08c5cd# --~--~-~--~~~---~--~~ You received this message because you are

Re: Newbie question on form validating

2008-12-11 Thread gearvOsh
Yes, I was about to to point out that it might be because your model file name is capitalized. On Dec 11, 4:57 am, AJV aapo.vi...@gmail.com wrote: :D Well I guess I just confirmed my newbie status, I had written the names of the model files Capitalized. I noticed that small letters work

Re: Finding Auth'd users Username

2008-12-11 Thread gearvOsh
If your logged in its: $this-Auth-user('username'); Or you can assign a user variable to the view: $this-set('user', $this-Auth-user()); echo $user['username']; Hope that helps. On Dec 11, 11:10 am, bioselem...@gmail.com bioselem...@gmail.com wrote: I've been wacking my head on the wall

Re: Prevent redirect in Auth

2008-12-11 Thread gearvOsh
Perhaps look at this: http://book.cakephp.org/view/395/autoRedirect If that doesnt work, you may have to edit the core files manually. On Dec 11, 9:40 am, Dav fatsl...@gmail.com wrote: Hi, I want to use the Auth component but I don't want it to send out the location: header. (I'm not using

Re: $form-input() helper question

2008-12-11 Thread gearvOsh
Yes most likely, but in my own apps I just write the div manually and only use $html for forms/links and images. On Dec 11, 1:53 pm, maytawn mayt...@gmail.com wrote: gearvOsh - Yeah, your're right.  I don't know what I was thinking... but is does bring up a related question.  If I was using

Re: $form-input() helper question

2008-12-10 Thread gearvOsh
Or you can disable the label on input and build the label yourself: Disables the wrapping div and the label from showing ?php echo $form-input('password', array('maxLength' = '20', 'div' = false, 'label' = false)); ? Build the label manually ?php echo $form-label('password', __('password',

More then 1 .po file for i18n/l10n

2008-12-10 Thread gearvOsh
So I have an existing language system on a site that I am converting to CakePHP. This language system has about 8 files, each with a long list of variables. I noticed in Cake it only has a default.po file, are we able to add more then just the default.po file? If so, what if there are 2 variables

Re: $form-input() helper question

2008-12-10 Thread gearvOsh
You mean like this? label for=inputIdLabel input type=text id=inputId/label ? Thats incorrect syntax. On Dec 10, 8:59 pm, maytawn [EMAIL PROTECTED] wrote: gearvOsh: I like your idea... it sems simple, but how do I call the $form-label () method so that the $form-input() method is wrapped

Re: Auth-login() Not working correctly?

2008-12-09 Thread gearvOsh
I found out the problem after much debugging and stress. I was using an old db that didnt use a salted password HENCE thats why it would not login because it was adding the salt to the passwords. So when I removed the salt it worked. Something like that should be noted in the cookbook. Also, if

Re: $this-Auth-user() is empty from controllers other than user

2008-12-09 Thread gearvOsh
Do all these controllers run the parent::beforeFilter() ? On Dec 9, 12:38 pm, mr_timp [EMAIL PROTECTED] wrote: Well I think I have found the root-cause of the problem.  When navigating to pages generated via the user controller I have one session ID but when browsing to pages generated by

Re: Auth-login() Not working correctly?

2008-12-09 Thread gearvOsh
Ya but my Auth isnt redirecting itself, not sure if its supposed to. I could just do a manual if statement though. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to

Re: Auth-login() Not working correctly?

2008-12-08 Thread gearvOsh
Here is my AppController and my UsersController: class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { Security::setHash('md5'); // Authenticate $this-Auth-sessionKey = 'User';

Auth-login() Not working correctly?

2008-12-07 Thread gearvOsh
So im trying to get the Auth component to work, here is my AppController. function beforeFilter() { // Referer $referer = $this-referer(null, true); if (empty($referer)) { $referer = array('controller' = 'dashboard', 'action' = 'index'); } // Authenticate if (isset($this-Auth)) {

Re: Auth-login() Not working correctly?

2008-12-07 Thread gearvOsh
Also heres a debug of $this-data: Array ( [Form] = Array ( [username] = test123 [password] = pass123 ) ) And the query being run by $this-Auth-login(): SELECT `User`.`id`, `User`.`username`, `User`.`password` FROM `users` AS `User` WHERE

Re: Auth-login() Not working correctly?

2008-12-07 Thread gearvOsh
I tried removing the $this-Auth-login() and now it doesnt do anything. No query is fired. --~--~-~--~~~---~--~~ 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

Re: Auth-login() Not working correctly?

2008-12-07 Thread gearvOsh
Actually nevermind. The $this-data had to be under User, not Form. Now the login is submitting and the query is being fired... BUT now everytime I hit login the password field goes empty and it never works. On Dec 7, 9:50 pm, gearvOsh [EMAIL PROTECTED] wrote: I tried removing the $this-Auth

Re: Handling Multiple Checkbox in Pagination

2008-12-06 Thread gearvOsh
Perhaps you can save them into an array and place the array into a session. On Dec 6, 1:26 am, krishna [EMAIL PROTECTED] wrote: Handling Multiple Checkbox in Pagination Hi Cake Bakers, In my project i am having a users table. In the admin, i have an option for the admin to message to

Re: Custom queries/sql in models/behaviors

2008-12-06 Thread gearvOsh
-contain('TeamMember' = array('User'), 'TeamGame'); Cheers, Adam On Dec 6, 12:51 pm, gearvOsh [EMAIL PROTECTED] wrote: Ok thats weird, I dont have foreign keys really setup but it still works. Im using $hasMany for members and games. But within the TeamMember and TeamGame arrays

SQL error with Auth Component?

2008-12-06 Thread gearvOsh
So Im working with the auth component, heres my AppController. class AppController extends Controller { var $components = array('Auth'); function beforeFilter() { // Authenticate if (isset($this-Auth)) {

Re: Custom Helper not Working

2008-12-06 Thread gearvOsh
Missing php open/close tags? On Dec 6, 1:00 pm, Sapslabs [EMAIL PROTECTED] wrote: I am creating a custom helper like this class ElapsedHelper extends AppHelper {     function test(){              return $this-output('test');     } } Which is save under views/helpers/elapsed.php I am

Re: SQL error with Auth Component?

2008-12-06 Thread gearvOsh
It seems this works below, but my previous code does not. $this-Auth-allowedActions = array('signup', 'reset', 'verify', 'forgot'); Perhaps something wrong with the docs? http://book.cakephp.org/view/247/AuthComponent-Methods#allow-382 --~--~-~--~~~---~--~~ You

  1   2   >