How to load SQL views in Fixtures for unit tests in Cakephp 3?

2015-10-02 Thread Gabriel Lau
My application has some sql views to perform complex queries in the 
database and be better able to filter the results based on these values.

One problem I encountered when running the unit tests is that Cake do not 
import sql views, just tables, breaking the application tests.


*- How can I solve this problem?*


*- Is there any other way to replace the SQL Views within the application?*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Controller Integration Testing not catching exceptions in Cake 3.x

2015-09-01 Thread Gabriel Lau
Hi,

I'm having problems with integration tests in my json API in moment of 
catch an exception thrown by the application.

In my *UsersController*:

request->allowMethod('get');

// ...
throw new \Cake\Core\Exception\Exception('catch me');
// ...
}
}

In my *UsersIntegrationTest*:

get('/users');

$this->assertResponseError();
}
}

The *$this->assertResponseError();* throws an Exception during the test run, 
failing all other tests.


I've trying using:

$this->setExpectedException('\Cake\Core\Exception\Exception');

but I can't catch anything.


*How can I solve this?*

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3 - foreign_key - bin/cake bake all --plugin

2015-03-29 Thread gabriel
Hi, 

I have these two tables:

*- Articles*
-- id
-- title
-- body
-- type_id (foreign_key)
 
*- Types*
-- id
-- title


If i generate che scaffold code for the base application all is perfect, 
controller, model and view. 

bin/cake bake all Typesbin/cake bake all Articles

The *foreign key* is properly insert in the code.

*Articles Controller *-* Index example*

...

public function index()
{
$this->paginate = [
'contain' => ['Types']
];
$this->set('articles', $this->paginate($this->Articles));
$this->set('_serialize', ['articles']);
}

...





but if I decide to do the same for a plugin the foreign_key is not 
recognized, 

bin/cake bake all --plugin ExamplePlugin Typesbin/cake bake all --plugin 
ExamplePlugin Articles

*PLUGIN - Articles Controller* - *Index example*

...

public function index()
{
$this->set('articles', $this->paginate($this->Articles));
$this->set('_serialize', ['articles']);
}

...


There is no reference to the foreign_key. It would seem only for the 
*controllers*. 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP 3.X - Creating Reusable Validators

2015-03-22 Thread gabriel
Hi everyone,

I'm studying *CakePHP 3.x.*

I have a form with three fields to change the password:

   - *OLD Password*
   - *NEW Password*
   - *Confirmation NEW Password*
   

I would like to implement a validation for the *Old Password.*

To do this *I think it is necessary to create a custom Validators that 
interacts with the ORM*.


The code on the manual suggests doing so:

*Creating Reusable Validators*

*example:*

// In src/Model/Validation/ContactValidator.phpnamespace App\Model\Validation;
use Cake\Validation\Validator;
class ContactValidator extends Validator{
public function __construct()
{
parent::__construct();
// Add validation rules here.
}}

Is this the procedure to follow?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Online baking tool for CakePHP

2015-03-19 Thread gabriel
Brilliant !! excellent work. Makes my life so much easier as I am only 
developing online and not locally, and don't use the command line...

Thanks

On Wednesday, 10 April 2013 14:19:04 UTC+1, Christian Cadéré wrote:
>
> Petit Four is an online application dedicated to speed up the design and 
> code generation of CakePHP projects.
>
> It allows to design the models of an application: fields, validation rules 
> and relations, with a simple user interface. Then with one clic it 
> generates:
>
>- a SQL database
>- Model files with all validation rules and relations
>- Standard CakePHP Controllers files
>- Standard CakePHP view files
>
> It has just been released so it is still a bit basic and may contain some 
> bugs, but we are working to improve it and would be glad to receive 
> comments and suggestions !
>
> You can use it here : http://patisserie.keensoftware.com/en/cakes
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Access $this->Session from a model

2014-05-28 Thread Henry Gabriel González Montejo

>
> Hi i have the same problem with the 
> plugin https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin, i put the 
> method in my Model (AppModel) so it can be used in others models, my 
> solution was:


function currentUser() 
{
//pr($this->Session->read('Auth.User'));
//pr($this->Auth->user());
//pr(AuthComponent::user());
//die();
 $user=AuthComponent::user();
return $user;
 } 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Exception output issue

2014-03-08 Thread Gabriel Lau
Hello people,

I realized recently that when an exception is triggered through a view 
(calling a nonexistent helper, for example), the error message along with 
the error layout (if customized) are displayed after the contents of the 
view in that the error is being generated (before the DOCTYPE).

Is there any way to display only the error output without this content view?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Displaying error messages without the content of the current view.

2013-10-21 Thread Gabriel Lau
Hi folks,

how can i display error messages without the content of the current view?

For example: If a vendor file throws a PDOException, the error message is 
displayed inside my current view. First, the content of my current view is 
displayed (without any layout, just the content), then the error message 
with the error layout is appended to the output.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Models indirect association, how to retrieve data?

2013-06-07 Thread Lucas Gabriel
How's it going?

I have a problem with cakePHP, I'm new to it and struggling with it. Let me 
pour onto you guys my situation:

I'm developing a system for a University here in Brazil. In this sytem I've 
got the following models: - Country; - State; - City; - University; - Unit; 
- Class;

Ok. and the relations are: - State belongs to Country; - City belongs to 
State; - University belongs to Country (because, in my database, not every 
country has states registered to it and not every state has citys 
registered to it, so I could not demand from the user to register a 
University to a City); - Unit belongsTo university; - Class belongs to 
University (because not every University has Units registered to it);

Ok. I guess now I've set a good background for you guys to understand my 
situation. Now onto the question itself:

In the Views of my Model Class I wanna display the Country and (IF there 
are State City). And I may have the need to display such content in other 
Model views such as Unit and University.

But when I try to do that in my Class model I can only display the 
country_id. The foreign key in my university database table. And why is 
that, that is because my Class model belongs to University, so it's pretty 
easy to access my University's properties. However I do not wish to access 
the id of the Country, I want it's Name. And maybe in the future I might 
want other properties, who knows?

HOW DO I DO THAT? How do I access the properties of the Model Country when 
my Model Class has NO direct relation to it?

many thx hugs and kisses. Hope someone can help me with this one.

p.S: I've managed a kinda loser solution: In my Class Controller I've done 
the following (so I can access variables of the Models Country, State and 
City):

In the View function I've loaded the Models for State and City (the country 
Model I can access by the relation Class->University->Country);
Then I used a find method to find the respective country, state and city 
for the Class in question I wanna display in view.ctp. The code follows:

*CODE*public function view($id = null) {
$this->Class->id = $id; $this->set('class', $this->Class->read());
$this->loadModel('State');
$this->loadModel('City');
$country = $this->Class->Universsity->Country->find('first', 
array('conditions' => array('Country.id' => 
$this->Class->data['University']['country_id']),));
$state = $this->State->find('first', array('conditions' => array('State.id' 
=> $this->Class->data['University']['state_id']),));
$city = $this->City->find('first', array('conditions' => array('City.id' => 
$this->Class->data['University']['city_id']),));
$this->set('country',$country['Country']);$this->set('city',$city);
$this->set('state',$state);
}


And it kinda works...In my Wiew.ctp I get an array for Country data, and 
array for State data and an array for City data. And in the view I check to 
see if the state and city arrays are not length = 0 to display them and 
all...but I think there HAS to be a better way to do This.

CAN ANYONE HELP ME???

P.P.S:

The other question is...what about the Index.ctp? How will I do that if I 
do not know which Class I'm working with? Will I have to have logic and 
find methods in the View? Isin't that just messing up the code?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cake is NOT able to connect to the database. Database connection "Mysql" is missing, or could not be created.

2013-05-19 Thread Gabriel Saulescu
I fixed it. Chenan Patel helped me. Thank you, Chenan :)

On Thursday, May 16, 2013 9:58:37 PM UTC+3, Gabriel Saulescu wrote:
>
> I am trying to install cakephp on my laptop.
> I received this error.
> My SO is a WindowsVista in 32 b.
> I changed this:
> extension=php_mssql.dll.
>
> I need your help, please. What I have to do?
>
> Thank you in advance. Gabriel
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cake is NOT able to connect to the database. Database connection "Mysql" is missing, or could not be created.

2013-05-17 Thread Gabriel Saulescu
Hello again,

I installed XAMP for PHP.
APACHE and MYSQL are working ok.
I installed CAKEPHP. And I changed files required by Cake, php.ini,
database.php. core.php

I received the following message:

"Your version of PHP is 5.2.8 or higher.

Your tmp directory is writable.

The FileEngine is being used for core caching. To change the config
edit APP/Config/core.php

Your database configuration file is present.

Cake is NOT able to connect to the database.

Database connection "Mysql" is missing, or could not be created.

DebugKit plugin is present"


Database.php looks like:
class DATABASE_CONFIG {

public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
    'host' => 'localhost',
'login' => 'gabriel',
'password' => 'gabi62#',
'database' => 'cake',
'prefix' => '',
//'encoding' => 'utf8',
);

public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'gabriel',
'password' => 'gabi62#',
'database' => 'test_cake',
'prefix' => '',
//'encoding' => 'utf8',
);
}

php.ini looks like:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_exif.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=msql.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mssql.dll
;extension=php_mbstring.dll
;extension=php_exif.dll  ; Must be after mbstring as it depends on
it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll  ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
extension=php_pdo.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pdo_sqlite_external.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll

I set up the rights in Mysql for the user gabriel

Please, tell me where I am wrong?

Thank you in advance

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cake is NOT able to connect to the database. Database connection "Mysql" is missing, or could not be created.

2013-05-17 Thread Gabriel Saulescu
Hello again,

I installed XAMP for PHP.
APACHE and MYSQL are working ok.
I installed CAKEPHP. And I changed files required by Cake, php.ini,
database.php. core.php

I received the following message:

"Your version of PHP is 5.2.8 or higher.

Your tmp directory is writable.

The FileEngine is being used for core caching. To change the config
edit APP/Config/core.php

Your database configuration file is present.

Cake is NOT able to connect to the database.

Database connection "Mysql" is missing, or could not be created.

DebugKit plugin is present"


Database.php looks like:
class DATABASE_CONFIG {

public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
    'host' => 'localhost',
'login' => 'gabriel',
'password' => 'gabi62#',
'database' => 'cake',
'prefix' => '',
//'encoding' => 'utf8',
);

public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'gabriel',
'password' => 'gabi62#',
'database' => 'test_cake',
'prefix' => '',
//'encoding' => 'utf8',
);
}

php.ini looks like:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_mbstring.dll
extension=php_exif.dll
;extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=msql.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mssql.dll
;extension=php_mbstring.dll
;extension=php_exif.dll  ; Must be after mbstring as it depends on
it
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll  ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.
dll
extension=php_pdo_mysql.dll
extension=php_pdo.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pdo_sqlite_external.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll
;extension=php_shmop.dll

I set up the rights in Mysql for the user gabriel

Please, tell me where I am wrong?

Thank you in advance


On Thursday, May 16, 2013 9:58:37 PM UTC+3, Gabriel Saulescu wrote:
>
> I am trying to install cakephp on my laptop.
> I received this error.
> My SO is a WindowsVista in 32 b.
> I changed this:
> extension=php_mssql.dll.
>
> I need your help, please. What I have to do?
>
> Thank you in advance. Gabriel
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cake is NOT able to connect to the database. Database connection "Mysql" is missing, or could not be created.

2013-05-17 Thread Gabriel Saulescu


On Thursday, May 16, 2013 9:58:37 PM UTC+3, Gabriel Saulescu wrote:
>
> I am trying to install cakephp on my laptop.
> I received this error.
> My SO is a WindowsVista in 32 b.
> I changed this:
> extension=php_mssql.dll.
>
> I need your help, please. What I have to do?
>
> Thank you in advance. Gabriel
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Doubt regarding sessions in cakephp

2012-03-30 Thread Gabriel Vila Real
Hi Litto

It looks like some php.ini configuration has to be done. Compare your local
php.ini file with production php.ini file, and check the session
configurations.

-- 
Gabriel Vila Real



On Thu, Mar 29, 2012 at 02:39, LITTO CHACKO  wrote:

> hai, buddies iam currently working in a project which contains as
> many forms.. so i have to attach captcha to each form for ensuring
> security... so the problem is that... actually captcha is working with
> help of sessions... u all know.. whwn iam testing it on local server
> it works fine with captcha and submitting form.. but whwn i do the
> same in main server.. i didn't get the value of captcha stored in
> session??? pls anyone clear this doubt by giving effective
> solutions??? beacuse of this pblm by project is in vain
>
> --
> 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
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

-- 
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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cahe Helper: Cached Render Time

2010-11-15 Thread Gabriel
Thanks. Since i'm using jquery to get the json data, solved the
problem using the dataFilter callback to remove that info before
parsing the json.

On 12 nov, 01:25, Amit Badkas  wrote:
> Hi,
>
> If you look at renderCache() method of class View, in file
> cake/libs/view/view.php, it uses following code to append the cache render
> time in HTML comment
>
> if (Configure::read() > 0 && $this->layout != 'xml') {
>     echo "";
>
> }
>
> So, either you need to set the debug level to 0 or need to use your own View
> class by extending CakePHP's built-in and to override the renderCache()
> method to add the code as needed. The non-recommended way is to modify
> CakePHP's built-in View::renderCache() method.
>
> Amit
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Nov 12, 2010 at 12:57 AM, Gabriel  wrote:
> > Hi, i'm having some problems with the Cache Helper, i have some cached
> > json responses, and the cache helper adds at the end of the json data
> > stats like this: "", that screwup
> > the javascript json parser. How i could remove that info?
>
> > Thanks
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related 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-php+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Cahe Helper: Cached Render Time

2010-11-11 Thread Gabriel
Hi, i'm having some problems with the Cache Helper, i have some cached
json responses, and the cache helper adds at the end of the json data
stats like this: "", that screwup
the javascript json parser. How i could remove that info?

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Using multiple domains on one app to create four seperate sites

2010-10-03 Thread Gabriel
Sorry for my previous answer. I misunderstand the question. Maybe you
could use one app and set a value with Configure in bootstrap, and
according to that value, load specifics layous, records, etc.
Even can set conditions in the models class for the model and the
relations and let cake do the "magic".

On 3 oct, 10:16, Gabriel  wrote:
> Yes, it's possible. I do that in a dreamhost's account. With a single
> user i have 2 domains with folders like this:
>
> /home/username/domain1.com (app1)
> /home/username/domain2.com (app2)
> /home/username/cake (CakePHP Core)
>
> There is no need to modify apache config o htaccess files.
>
> On 2 oct, 16:00, Jacob  wrote:
>
> > That is exactly what I thought of. But is this possible on a shared
> > webhost, because thats where the app lives? Is there way to do it
> > without changing any apache settings? Forgive my lack of knowledge
> > about Apache I am not an expert user of it.
>
> > On 1 okt, 14:42, Bernardo Vieira  wrote:
>
> > > You can use apache's namevirtualhost directive plus server aliases to 
> > > point all the domains to the same web root. After that all you have to do 
> > > is inspect the hostname in the $SERVER super global and use that to 
> > > switch the app's theme (this gives you the flexibility to have domain 
> > > specific layouts, views and elements) or just switch the layout. A good 
> > > place to deal with this is the beforefilter callback.
>
> > > On Oct 1, 2010, at 9:26 AM, Jacob  wrote:
>
> > > > Hello all,
>
> > > > I am working on a website for a company, which needs five different
> > > > websites. The five websites use the same database and mostly the same
> > > > records. For site specific records there is a 'company' column in the
> > > > table. With a parameter a function will know what records to get.
>
> > > > The current setup exists of one app on the webroot en 4 others in a
> > > > sub directory. This was the easiest way to solve the problem, but it
> > > > has a down site. As the development is in a final stage, the
> > > > controllers and views are modified a lot. For every change the other
> > > > four apps need to be changed also.
>
> > > > My question is:
> > > > Is there a way to create the illusion of five different websites while
> > > > it is actually one app? For example, based on the domainname used, the
> > > > layout changes? (that would be the best solution I think) But is it
> > > > possible en how should this be done?
>
> > > > Best regards,
>
> > > > Jacob
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers 
> > > > with their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this 
> > > > group athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Using multiple domains on one app to create four seperate sites

2010-10-03 Thread Gabriel
Yes, it's possible. I do that in a dreamhost's account. With a single
user i have 2 domains with folders like this:

/home/username/domain1.com (app1)
/home/username/domain2.com (app2)
/home/username/cake (CakePHP Core)

There is no need to modify apache config o htaccess files.

On 2 oct, 16:00, Jacob  wrote:
> That is exactly what I thought of. But is this possible on a shared
> webhost, because thats where the app lives? Is there way to do it
> without changing any apache settings? Forgive my lack of knowledge
> about Apache I am not an expert user of it.
>
> On 1 okt, 14:42, Bernardo Vieira  wrote:
>
> > You can use apache's namevirtualhost directive plus server aliases to point 
> > all the domains to the same web root. After that all you have to do is 
> > inspect the hostname in the $SERVER super global and use that to switch the 
> > app's theme (this gives you the flexibility to have domain specific 
> > layouts, views and elements) or just switch the layout. A good place to 
> > deal with this is the beforefilter callback.
>
> > On Oct 1, 2010, at 9:26 AM, Jacob  wrote:
>
> > > Hello all,
>
> > > I am working on a website for a company, which needs five different
> > > websites. The five websites use the same database and mostly the same
> > > records. For site specific records there is a 'company' column in the
> > > table. With a parameter a function will know what records to get.
>
> > > The current setup exists of one app on the webroot en 4 others in a
> > > sub directory. This was the easiest way to solve the problem, but it
> > > has a down site. As the development is in a final stage, the
> > > controllers and views are modified a lot. For every change the other
> > > four apps need to be changed also.
>
> > > My question is:
> > > Is there a way to create the illusion of five different websites while
> > > it is actually one app? For example, based on the domainname used, the
> > > layout changes? (that would be the best solution I think) But is it
> > > possible en how should this be done?
>
> > > Best regards,
>
> > > Jacob
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
> > > with their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: how to create forms

2010-07-20 Thread gabriel
Here a good tutorial for a contact form!

http://snook.ca/archives/cakephp/contact_form_cakephp

On Jul 19, 4:14 pm, amr_AJ  wrote:
> how to create forms

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Structure of data returned by $this->Model->find

2010-05-05 Thread gabriel
Hi,

In order to make a node system with a "standard way", check this
ressource :
http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
The exemple is specifique to mysql but you can make change to fit your
needs.


Cheers!

Gabriel

On 4 mai, 10:26, Roland B  wrote:
> Hi,
>
> is there a way to change the structure of data returned by a model's
> find call? Or should I use a different call? IMHO, the default seems
> to be inconsistent in the way it handles associations:
>
> Given this model:
> //---
> class Querycategory extends AppModel
> {
>    var $recursive = 10;
>    var $hasMany = array(
>           'Querycategory' => array('order' => 'name ASC'),
>           'Querygroup'    => array('order' => 'name ASC'));}
>
> //---
>
> A call to $this->Querycategory->find('all') yields something like
> this:
>
> Array
> (
>     [0] => Array
>         (
>             [Querycategory] => Array
>                 (
>                     [id] => 70
>                     [querycategory_id] => 34
>                     [0] => Array
>                         (
>                             [id] => 71
>                             [querycategory_id] => 70
>                             [Querygroup] => Array
>                                 (
>                                     [0] => Array
>                                         (
>                                             [id] => 43
>                                             [querycategory_id] => 71
>                                         )
>                                 )
>                         )
>                 )
>             [Querygroup] => Array
>                 (
>                 )
>         )
> )
>
> A Querygroup belonging to the Root-Querycategory is at the same level
> as the root node and it is called Querygroup.
> A Querygroup belonging to a child category is inside that child node
> and it is called Querygroup.
> A Querycategory belonging to any other category is inside its parent
> and unnamed, unless there is also a Querygroup at the same level: then
> it is called 'Querycategory'
>
> I would prefer:
> Querygroup is always contained in it's "parent", always being called
> 'Querygroup'.
> Querycategory is always contained in its "parent", always being called
> 'Querycategory'.
>
> Is there a "standard way" to achieve this?
>
> Using cake-1.2.
>
> Thank you very much in advance,
>
> Roland
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: PHP CodeSniffer

2010-05-03 Thread gabriel Tessier
Hi,

I want to use coding standards with my cake app too.
The default coding standard is pear. You can change default standard
see the Code Sniffer doc.
If you use netbeans there's a plugin to check your code.
http://www.amaxus.com/cms-blog/coding-standards-netbeans-php-codesniffer
I don't find a coding wich match with cake so i try make my own...
then i give up :-(
If you make one or have more information about, i can be interested.


Thanks.




On 30 avr, 13:34, Braindead  wrote:
> Hi all
>
> is there anybody out there who uses PHP CodeSniffer with his Cake app?
> I tried PHP CodeSniffer for the first time and used the build in
> coding standards to sniff my code. Actually I get warnings because of
> Cake conventions.
>
> Method name "PostsController::admin_edit" is not on camel caps format
>
> Just to mention one warning. So can anybody lead me the way to use PHP
> CodeSniffer with CakePHP?
>
> Cheers,
> Markus
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
> their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group 
> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related 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-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How can I configure the value of CAKE_CORE_INCLUDE_PATH?

2009-05-27 Thread Gabriel

Hi, you can do that in app/webroot/index.php and test.php

This is the code i use to switch the core path depending on the server name:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
$srvname = $_SERVER['SERVER_NAME'];
if( $srvname == 'localhost' || $srvname == '127.0.0.1' || $srvname 
== ''){ // Dev Path
// PATH: D:\sharedlibs\libs\cakephp\1.2.x.x
define('CAKE_CORE_INCLUDE_PATH', 
'D:'.DS.'sharedlibs'.DS.'libs'.DS.'cakephp'.DS.'1.2.x.x');
}else{ // Prod Path
// PATH: /home/sharedlibs/libs/cakephp/1.2.x.x
define('CAKE_CORE_INCLUDE_PATH', 
DS.'home'.DS.'sharedlibs'.DS.'libs'.DS.'cakephp'.DS.'1.2.x.x');
}
}

simon...@gmail.com escribió:
> Hi,
>
> I did a website using CakePHP, I need to configure the
> CAKE_CORE_INCLUDE_PATH (app/webroot/index.php).
>
> How can I do that?
>
> Someone has an example?
>
> I need to know the complete path of my server to be able to do that?
> Using phpinfo()?
>
>
> Regards,
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Add actions to model dinamically in behavior

2009-05-26 Thread Gabriel

I'm working with an image behavior, that stores resized images for the 
specified fields. Thats work fine.
To get the images i have to define an action in the controller for each 
image field... i'm wonder if can i add these actions dinamically in the 
behavior?

Thanks in advance and sorry by mi english.

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Poll: what do you hate about CakePHP?

2009-05-20 Thread Gabriel

Totaly agree with avairet's comment about the site design... Some clients want 
to know what tools we use, and when they search about cakephp thinks that is a 
software for kids.

avairet escribió:
> Thank you for this ironic but serious message Nate!
> To respect your humoristic formulation, here is my "hateful"
> contribution!
> And sorry for my simple English… hope it's understandable. ;)
>
> I "hate" the lack of rigor with relational model and SQL norm. I think
> "compound primary keys", sub-queries, multi-level JOIN should be
> implemented. It will permit to avoid "artificial id" in HABTM for
> example and thus tons of intermediate queries. More data types should
> be available too (like ENUM and SET for MySQL).
>
> I "hate" contributions constraints like: "Make a Unit Test" when I
> report a bug or like: "Fork the project and use Git" when I just want
> to update the .po file for CookBook.
>
> I "hate" the instability of official documentation. Yes CookBook is
> better than ever, but there are still a lot of sections without
> explanations, some with obsolete explanations, others that are
> frequently modified… it's difficult for both newcomers and translators
> to navigate through it and find the good information. A PDF export –
> global or partial - would be useful too
>
> I "hate" translation tool and process for CookBook, it is complex,
> heavy to manipulate, frequently modified and debugged. Ok, there were
> new features recently developed (thanks to AD7six, Gwoo and others for
> this work), but is not enough to attract and motivate new translators…
> Two little suggestions for the moment: give validation rights to
> locale community AND/OR let us write our own documentation, inspired
> by, but not a perfect clone of the original.
>
> I "hate" the multi-communicational channels of community : Bakery,
> official website, Ohloh journal, multiple IRC's chans, multiple
> GoogleGroups, Trac, TheChaw, CakeFest, unofficial forum, core
> developpers and contributors blogs… it's like a puzzle! The
> heterogeneity of designs between those different websites of the
> Cake's galaxy make it even more disorganized.
>
> In the same way, I "hate" Cake's logo (this cake is more like a cheese
> 时 ) and official website design (not clear enough, too funny and not
> enough serious for deciders in comparison to Symfony and ZF designs).
>
> I hate methods with more than 4 parameters or with mixed parameters (a
> string or an array or null).
> I hate Cake's shortcuts that just embbed PHP native functions like "e
> ()", "up()", "low()"… (for the majority of PHP's IDE, autocomplete
> works well for that).
>
> I "hate" the limited internationalisation of core methods like
> Validate::alphanumeric() or Inflector::slug(). Accented and special
> chars should be available and mb_ functions might be used, maybe by
> including localized chars files (setting a var in config/core.php for
> example). More internationalisation for Validate::phone() or
> Validate::ssn() would be great too. We can help you to do that: please
> delegate some responsibilities to the numerous dynamic international
> communities!
>
> Other opinions that I'm supporting too:
> ++ PHP 4 to full PHP5 syntax
> ++ ACL more flexibility (e.g. user attached to two groups)
> ++ Objects instead arrays, especially for find's returns
> ++ GUI for Bake, because we're not all CLI gurus… hmmm, ok, we should
> be! 时
> ++ More complete Bake
> ++ Plugins management
> ++ Form::error messages
> ++ Jquery
> ++ automagic slug field
>
> That's all... for the moment!
>
> OK, I know that a framework can NOT make the coffee and that I can
> create my own logic when needed.
> But I would like to say that in my point of view, the more Cake will
> be professional, industrial and rigorous, the more it will be adopted
> by PHP users and deciders who currently look at Symfony or Zend
> Framework side, even if Cake is more fun and easy to use.
>
> I like Cake and its philosophy, I want to develop its usage and
> recognition around the World, so let’s work together to make a better
> Cake! ;)
>
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: losing action parameters after submit

2009-05-19 Thread Gabriel
O creo que podria simplificarse mas usando:

create('Local',array('action'=>'agregar/'.$empresa['Empresa']['id']));?>

Ya que en la accion del formulario no pones el parametro.

Y olvide las comillas en el mensaje anterior, seria: 

y
this->redirect(array('action' => 'lista', *$this->data['Empresa']['id']*));



Frannie escribió:
> Hello. I want to thank you in advance for your time.
> I am trying to make a form and the action that uses has a parameter,
> but when I submit the form the parameter disappears
>
> *this is my form:
>
> create('Local',array('action'=>'agregar'));?>
> 
>   
>   Nombre
>   input('Local.nombre', 
> array('label'=>'')); ?> td>
>   
>   
>   Tipo
>   input('Local.tipo', array
> ('label'=>'','type'=>'select')); ?>
>   
>   
>   Región
>   input('region', 
> array('label'=>'','options'=>
> $regiones)); ?>
>   
>   
>   Comuna
>   input('Local.comuna_id', array
> ('label'=>'','type'=>'select')); ?>
>   
>   
>   Dirección
>   input('Local.direccion', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
>   
>   Teléfono
>   input('Local.telefono', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
>   
>   E-mail
>   input('Local.email', array('label'=>'')); 
> ?> td>
>   
>   
>   Patente
>   input('Local.patente', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
> 
> end('Guardar');?>
>
> ***this is the action:
> function agregar($empresa_id){
>
>   $this->set('CSS','estilo');
>   $this->set('empresas_list',$this->Nav->showEmpresas());
>   $this->set('empresa',$this->Empresa->find('first', array
> ('conditions' => array('Empresa.id' => $empresa_id;
>
>   $this->set('comunas', $this->Local->Comuna->find('list'));
>   $this->set('regiones', 
> $this->Local->Comuna->Region->find('list'));
>   $this->set('tipos', $this->Local->Catalogo->find('list', array
> ('conditions'=> array('Catalogo.grupo'=>'tipo_local';
>
>   if (!empty($this->data)) {
>   if ($this->Local->save($this->data)) {
>   $this->Session->setFlash('Un nuevo local ha 
> sido agregado al
> sistema.');
>   $this->redirect(array('action' => 'lista', 
> $empresa_id));
>   }
>   }
>   }
>
> I load the view with an url like this: localhost/myroot/mycontroller/
> agregar/1
> then I fill the fields of the form and I submit, and then I lose my
> parameter. Does anybody know why this could be?
> I'm sorry, english is not my first language, if you have any questions
> about my problem just tell me.
> I really will appreciate your help.
>
> Francisca.
>
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: losing action parameters after submit

2009-05-19 Thread Gabriel
Hola, creo que hablas español.
En realidad funciona como es de esperarse. Llamas a la accion pasando el 
id de la empresa que la accion lo utiliza para obtener los datos pero 
luego al generar la vista y enviar el formulario es logico que se pierda 
el id de la empresa ya que no figura en ningun lado y vuelves a mandar 
al controlador solo los datos del formulario... Deberias hacer algo asi:

Agregar al formulario el siguiente campo oculto con el id de la empresa:

create('Local',array('action'=>'agregar'));?>

...
...

Y luego en la accion usar:

if (!empty($this->data)) {
if ($this->Local->save($this->data)) {
$this->Session->setFlash('Un nuevo local ha sido agregado al 
sistema.');
$this->redirect(array('action' => 'lista', 
*$this->data[Empresa][id]*));
}
}

Espero que te sirva.




Frannie escribió:
> Hello. I want to thank you in advance for your time.
> I am trying to make a form and the action that uses has a parameter,
> but when I submit the form the parameter disappears
>
> *this is my form:
>
> create('Local',array('action'=>'agregar'));?>
> 
>   
>   Nombre
>   input('Local.nombre', 
> array('label'=>'')); ?> td>
>   
>   
>   Tipo
>   input('Local.tipo', array
> ('label'=>'','type'=>'select')); ?>
>   
>   
>   Región
>   input('region', 
> array('label'=>'','options'=>
> $regiones)); ?>
>   
>   
>   Comuna
>   input('Local.comuna_id', array
> ('label'=>'','type'=>'select')); ?>
>   
>   
>   Dirección
>   input('Local.direccion', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
>   
>   Teléfono
>   input('Local.telefono', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
>   
>   E-mail
>   input('Local.email', array('label'=>'')); 
> ?> td>
>   
>   
>   Patente
>   input('Local.patente', 
> array('label'=>'')); ?
>   
>> 
>> 
>   
> 
> end('Guardar');?>
>
> ***this is the action:
> function agregar($empresa_id){
>
>   $this->set('CSS','estilo');
>   $this->set('empresas_list',$this->Nav->showEmpresas());
>   $this->set('empresa',$this->Empresa->find('first', array
> ('conditions' => array('Empresa.id' => $empresa_id;
>
>   $this->set('comunas', $this->Local->Comuna->find('list'));
>   $this->set('regiones', 
> $this->Local->Comuna->Region->find('list'));
>   $this->set('tipos', $this->Local->Catalogo->find('list', array
> ('conditions'=> array('Catalogo.grupo'=>'tipo_local';
>
>   if (!empty($this->data)) {
>   if ($this->Local->save($this->data)) {
>   $this->Session->setFlash('Un nuevo local ha 
> sido agregado al
> sistema.');
>   $this->redirect(array('action' => 'lista', 
> $empresa_id));
>   }
>   }
>   }
>
> I load the view with an url like this: localhost/myroot/mycontroller/
> agregar/1
> then I fill the fields of the form and I submit, and then I lose my
> parameter. Does anybody know why this could be?
> I'm sorry, english is not my first language, if you have any questions
> about my problem just tell me.
> I really will appreciate your help.
>
> Francisca.
>
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Submit/Cancel problem

2009-05-18 Thread Gabriel A. Gonzalez

Use "reset" or "button" NOT "submit" type for the cancel button.

 or 

Nancy escribió:
> So, I added a submit and a cancel button to my ajax form and it
> doesn't matter which you press, it always returns the submit button,
> not the cancel.
>
> The view code has this at the bottom (I stopped using helpers to see
> if raw HTML would help, it didn't):
> 
> 
>
> In the controller (admin_edit) function, I'm dumping out the contents
> of $this->params['form'] and it always shows
>
> Array
> (
> [Submit] => submit
> )
>
> Even if you press the cancel button.  Am I doing something wrong?
>
> Thanks!
>
> Nancy
>
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Datetime difference

2009-05-18 Thread Gabriel A. Gonzalez

You could calculate the time difference on the fly with mysql TIMEDIFF 
function 
[http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff]
 
instead of store it in the db
And this [http://www.gidnetwork.com/b-16.html] may help to store the 
time difference.

Céryl escribió:
> Hej all!
>
> Since my good advice just ago, I got to another bottleneck.
>
> I have a form in which the user selects two times (a start- and an end-
> time). The form works perfectly and the times get stored in the table
> as hh:mm:ss.
>
> However, I have a 3th row in the database that must hold the elapsed
> time between the two form-inputted times. I want the computer to
> calculate this. I figured I must do this in in the controller, I can
> of course even do after the $this->Model->save() action with a
> saveField, just before the redirect.
>
> However, I cannot seem to find a good example of making that function.
> I'm not sure how i get my timestamp back from the form, if they are
> simply substractable and how to store it back in the table.
>
> If it makes matters easier, elapsed time can be stored as an integer
> holding seconds between times in the table, I can probably calculate
> those back in elapsed minutes/hours in a later view of the table.
>
> Any idea's or links to examples of working with Timestamps? It always
> boggles me!
>
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Forcing user to access her data only

2009-05-18 Thread Gabriel A. Gonzalez

Hi Brian, i assume that each course have an user_id right? so when you 
list, edit or view the courses just use a condition to search all the 
courses of the current user... ex:

$cond = array('Course.user_id' => $Current_user_id);
$this->set('courses', $this->paginate('Course', $cond));

Brian Lee escribió:
> So, here is how my application works:
>
> 1. I have users (just like any other apps)
> 2. I have courses that each user can create
>
> Upon login, user will view the list of courses that she created.
> I got that to work.
>
> However, now the problem is, I don't know the simple, neat way to
> block user from accessing classes that she did not create. For
> instance, Bob created courses that have IDs of 1, 2, 3. Jane has
> courses with IDs of 4, 5, 6. How do I stop Bob from doing something
> like localhost/courses/view/4 (trying to view Jane's course)? and
> prevent Jane from doing the same for Bob's courses?
>
> I am sure that there is very neat way to do it, because this is a
> problem often comes up when developing web applications. I just want
> to know the CakePHP way of doing this.
>
> Thanks!
> >
>
>   


--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Custom php.ini and .htaccess

2009-05-18 Thread Gabriel A. Gonzalez

Hi guys!
I using a custom php configuration on dreamhost and works fine with 
standalone php files.
But i can't get it working with cakephp(Cakephp works fine without the 
custom php.ini but i need it to increase te max upload size)

The thing is when i try to use the custom config with mod_rewrite I get 
a internal error.

in my .htaccess i have:

---

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]


Options ExecCGI
AddHandler php5-cgi .php
Action php5-cgi /php5/php5.cgi
---

And the errors is:

--
Internal Server Error

The server encountered an internal error or misconfiguration and was 
unable to complete your request.

Please contact the server administrator, webmas...@domain.com and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while 
trying to use an ErrorDocument to handle the request.
--

And in the log get:

--
Request exceeded the limit of 10 internal redirects due to probable 
configuration error. Use 'LimitInternalRecursion' to increase the limit 
if necessary. Use 'LogLevel debug' to get a backtrace.
--

Probably is an error in the .htaccess config, but I can't solved it... 
any ideas?
Thanks a lot and sorry by mi english...

--~--~-~--~~~---~--~~
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-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Calling a Cake Shell Script from controller

2008-11-21 Thread Gabriel Gilini
Nevermind, I got it.

I just threw the output to /dev/null and added the & to run in background.
ie
exec('cake scriptname > /dev/null &');

But I'd still like to have a non-exec way to do this.

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Nov 21, 2008 at 6:06 PM, Gabriel Gilini <[EMAIL PROTECTED]>wrote:

>
> Hi list,
>
> I'm having a little trouble here trying to call a script from the
> controller, and keep it running in background while flush the output
> to the client.
>
> Dreamhost inhibits the use o flush() and alikes by turning mod_deflate
> on by default. I obviously don't want to turn gzipping off in my site,
> so I'm looking for a workaround.
>
> So, what I would like to know is if there's a Cake-way of calling a
> Shell script, and if not, whether there is a way to exec it and keep
> it running on the server-side when the client goes away from that
> page.
>
> Thanks in advance.
>
> Cheers
>
> --
> Gabriel Gilini
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Calling a Cake Shell Script from controller

2008-11-21 Thread Gabriel Gilini

Hi list,

I'm having a little trouble here trying to call a script from the
controller, and keep it running in background while flush the output
to the client.

Dreamhost inhibits the use o flush() and alikes by turning mod_deflate
on by default. I obviously don't want to turn gzipping off in my site,
so I'm looking for a workaround.

So, what I would like to know is if there's a Cake-way of calling a
Shell script, and if not, whether there is a way to exec it and keep
it running on the server-side when the client goes away from that
page.

Thanks in advance.

Cheers

--
Gabriel Gilini
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Jquery or Scriptalicious?

2008-11-04 Thread Gabriel Gilini
>
> the lesser the codes the lesser the debugging time


oh, that's so not true

[snip]

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Jquery or Scriptalicious?

2008-11-02 Thread Gabriel Gilini
I mean that there is a hell lot of people learning jQuery, not JavaScript
these days. Every allegedly javascript developer should, at least, read the
ECMA-262.
Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Sun, Nov 2, 2008 at 10:08 PM, 703designs <[EMAIL PROTECTED]> wrote:

>
> I'm not sure what you mean by that. jQuery is written in JavaScript
> (not like MochiKit, which tries to make JavaScript look like Python).
>
> On Oct 31, 2:43 pm, "Gabriel Gilini" <[EMAIL PROTECTED]> wrote:
> > The right answers is: learn real javascript
> > Yes, the learning curve with jQuery is way lower, but when you really
> know
> > javascript, take a look in proto ;)
> >
> > Gabriel Gilini
> >
> > www.usosim.com.br
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
> > On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]>
> wrote:
> >
> > > Here's my take for what little it's worth (note I use scripa/proto)
> > > if you want to use the ajax helper at this point you are tied to
> > > scripta/proto.  now given that the stated plans in unofficial channels
> > > is that the helper is either being migrated to jQuery or being driving
> > > to a javascript _framwork_ agnostic place, it really doesn't matter.
> >
> > > If on the otherhand you see yourself not feeling like the helper as it
> > > exists now will meet your needs and you will be wanting insight and
> > > help from people on this list on integrating javascript _framework_
> > > into your project, then I would say that the responses to your
> > > question indicate, to me, that jQuery is a more of the current
> > > 'hotness' and you are likely to get more help from people jazzed up on
> > > jQuery.
> >
> > > To me it is a question of who is going to help you if you need it and
> > > what do you think your projected needs are.
> >
> > > See totally unhelpful answer ;)
> >
> > > Sam D
> >
> > > On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <
> [EMAIL PROTECTED]>
> > > wrote:
> > > > Sorry, mate, but prototype also supports all CSS3 selectors.
> >
> > > > ps: I never use cakephp's ajax helpers, and I love writing javascript
> >
> > > > Cheers
> >
> > > > Gabriel Gilini
> >
> > > >www.usosim.com.br
> > > > [EMAIL PROTECTED]
> > > > [EMAIL PROTECTED]
> >
> > > > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]>
> wrote:
> >
> > > >> I perfer jQuery as well.
> > > >> Many Bakers like prototype due to the javascript and ajax helpers
> that
> > > >> come with CakePHP.
> > > >> These make baking with JS quite a bit easier, not to mention faster
> > > >> however many Javascript experts would cringe to think that
> developers
> > > >> are using php helpers for the behavioral portion of their sites
> > > >> because the scripts are no longer unobtrusive.
> >
> > > >> jQuery is very easy to learn and uses many of the same selectors
> that
> > > >> CSS 2 and 3 use making it incredibly easy to develop around.
> > > >> However, if you require a JS helper there is a jQuery helper for
> > > >> CakePHP called pQuery.
> > > >>http://www.ngcoders.com/php/pquery-php-and-jquery
> >
> > > >> If not then spend some time at the jQuery API and read through the
> > > >> tutorials.
> > > >>http://docs.jquery.com/Main_Page
> >
> > > >> I love jQuery.
> >
> > > >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > > >> > Hello,
> >
> > > >> > I'm gonna create a web app using CakePHP but I'm confused about
> > > >> > chosing between Jquery or Scriptalious? Which one should I choose?
> > > >> > Does it really matter? What's the differences between them?
> >
> > > >> > tks
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Jquery or Scriptalicious?

2008-10-31 Thread Gabriel Gilini
The right answers is: learn real javascript
Yes, the learning curve with jQuery is way lower, but when you really know
javascript, take a look in proto ;)

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Oct 31, 2008 at 4:37 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:

>
> Here's my take for what little it's worth (note I use scripa/proto)
> if you want to use the ajax helper at this point you are tied to
> scripta/proto.  now given that the stated plans in unofficial channels
> is that the helper is either being migrated to jQuery or being driving
> to a javascript _framwork_ agnostic place, it really doesn't matter.
>
> If on the otherhand you see yourself not feeling like the helper as it
> exists now will meet your needs and you will be wanting insight and
> help from people on this list on integrating javascript _framework_
> into your project, then I would say that the responses to your
> question indicate, to me, that jQuery is a more of the current
> 'hotness' and you are likely to get more help from people jazzed up on
> jQuery.
>
> To me it is a question of who is going to help you if you need it and
> what do you think your projected needs are.
>
> See totally unhelpful answer ;)
>
> Sam D
>
>
> On Fri, Oct 31, 2008 at 12:16 PM, Gabriel Gilini <[EMAIL PROTECTED]>
> wrote:
> > Sorry, mate, but prototype also supports all CSS3 selectors.
> >
> > ps: I never use cakephp's ajax helpers, and I love writing javascript
> >
> > Cheers
> >
> > Gabriel Gilini
> >
> > www.usosim.com.br
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
> >
> > On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]> wrote:
> >>
> >> I perfer jQuery as well.
> >> Many Bakers like prototype due to the javascript and ajax helpers that
> >> come with CakePHP.
> >> These make baking with JS quite a bit easier, not to mention faster
> >> however many Javascript experts would cringe to think that developers
> >> are using php helpers for the behavioral portion of their sites
> >> because the scripts are no longer unobtrusive.
> >>
> >> jQuery is very easy to learn and uses many of the same selectors that
> >> CSS 2 and 3 use making it incredibly easy to develop around.
> >> However, if you require a JS helper there is a jQuery helper for
> >> CakePHP called pQuery.
> >> http://www.ngcoders.com/php/pquery-php-and-jquery
> >>
> >> If not then spend some time at the jQuery API and read through the
> >> tutorials.
> >> http://docs.jquery.com/Main_Page
> >>
> >> I love jQuery.
> >>
> >> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> >> > Hello,
> >> >
> >> > I'm gonna create a web app using CakePHP but I'm confused about
> >> > chosing between Jquery or Scriptalious? Which one should I choose?
> >> > Does it really matter? What's the differences between them?
> >> >
> >> > tks
> >>
> >
> >
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Jquery or Scriptalicious?

2008-10-31 Thread Gabriel Gilini
Sorry, mate, but prototype also supports all CSS3 selectors.

ps: I never use cakephp's ajax helpers, and I love writing javascript

Cheers

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Oct 31, 2008 at 10:45 AM, Josey <[EMAIL PROTECTED]> wrote:

>
> I perfer jQuery as well.
> Many Bakers like prototype due to the javascript and ajax helpers that
> come with CakePHP.
> These make baking with JS quite a bit easier, not to mention faster
> however many Javascript experts would cringe to think that developers
> are using php helpers for the behavioral portion of their sites
> because the scripts are no longer unobtrusive.
>
> jQuery is very easy to learn and uses many of the same selectors that
> CSS 2 and 3 use making it incredibly easy to develop around.
> However, if you require a JS helper there is a jQuery helper for
> CakePHP called pQuery.
> http://www.ngcoders.com/php/pquery-php-and-jquery
>
> If not then spend some time at the jQuery API and read through the
> tutorials.
> http://docs.jquery.com/Main_Page
>
> I love jQuery.
>
> On Oct 30, 5:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I'm gonna create a web app using CakePHP but I'm confused about
> > chosing between Jquery or Scriptalious? Which one should I choose?
> > Does it really matter? What's the differences between them?
> >
> > tks
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Jquery or Scriptalicious?

2008-10-31 Thread Gabriel Gilini
Looks like I'm the only one who loves prototype here :)

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Oct 31, 2008 at 10:27 AM, Marcelius <[EMAIL PROTECTED]> wrote:

>
> @Anupom: Any arguments?
>
> Anupom schreef:
> > I think PHP helper for writing Javascript is a very bad idea.
> >
> > On Fri, Oct 31, 2008 at 3:23 PM, martinp <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > Despite the fact that CakePHP comes with a Scriptaculous-powered AJAX
> > > Helper, I find JQuery so much easier to use that you don't really need
> > > a helper.
> > >
> > > On Oct 31, 9:30 am, Gianluca Gentile <[EMAIL PROTECTED]>
> > > wrote:
> > > > jQuery .
> > > >
> > > > On Oct 30, 11:49 pm, Matthieu <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > Hello,
> > > >
> > > > > I'm gonna create a web app using CakePHP but I'm confused about
> > > > > chosing between Jquery or Scriptalious? Which one should I choose?
> > > > > Does it really matter? What's the differences between them?
> > > >
> > > > > tks
> > > >
> > >
> >
> >
> > --
> > Anupom Syam
> > http://syamantics.com/
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Post Data

2008-10-31 Thread Gabriel Gilini
Are you building your form with the Form Helper? Because it seems to me that
there are no naming conventions at all there.

Cheers

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Fri, Oct 31, 2008 at 9:46 AM, MDB <[EMAIL PROTECTED]> wrote:

>
> The form values do not show up when I do that, they do when I do a
> debug($this) and appear like this:
>
> [form] => Array
>(
>[Test1] => 04
>[Test2] => 05
>)
>
> How do I access these values?
> I have tried $this->form and $_POST['Test1'] however I always get an
> undefined index or property error.
>
>
>
>
> On Oct 30, 9:21 pm, thatsgreat2345 <[EMAIL PROTECTED]> wrote:
> > add debug($this->data); to your controller that is receiving the
> > submitted data. It will display the structure of $this->data
> >
> > On Oct 30, 6:59 am, MDB <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > How do you get form data that is not part of a controller?  I have a
> > > select / drop down box called dobDay, then in the controller, I have
> > > tried $this->data['dobDay'], $_POST['dobDay'] and
> $this->data['Customer']['dobDay'] (customer = name of form) and nothing
> >
> > > works.  Can someone please help? TIA- Hide quoted text -
> >
> > - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Few errors I found so far.

2008-10-27 Thread Gabriel Gilini
"Try to set 'model' => 'comments' in the options array."
Sorry, I meant 'model' => 'Comment'.

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Mon, Oct 27, 2008 at 12:50 PM, Gabriel Gilini <[EMAIL PROTECTED]>wrote:

> On Mon, Oct 27, 2008 at 11:36 AM, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]> wrote:
>
>>
>> hi all,
>>
>
> Hi.
>
>
>>
>> Just a few errors I found so far, if anyone can help, it would be much
>> appreciated.
>>
>> 1. Having multiple conditions on find:
>>
>> post.php Model
>> $this->find('all', array('conditions' => array('DATE(Post.date)' => '>
>> '.$date, 'Date(Post.date)' => '< '.$end_date)));
>>
>> SQL generated:
>> SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`,
>> `Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`,
>> `User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN
>> `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
>> DATE(`Post`.`date`) = '> 2008-01-01 00:00:00' AND Date(`Post`.`date`)
>> = '< 2008-12-31 23:59:59'
>>
>> Results:
>> None, but I know there are 2 results.
>>
>
> That's because the < and > signs should be in the array key, not value. Try
> changing your conditions to something like this
>
> array(
>'conditions' => array(
>   'DATE(Post.date) >' => $date,
>   'DATE(Post.date) >' => $end_date
>    )
> )
>
>
>>
>>
>> 2. Htaccess issue?
>>
>> view.ctp for posts:
>> form('/comments/add', 'post', array('update'=>'comments')); ?
>> >
>>
>> Code generated for the form:
>> action="/workspace/cake/posts/comments/add"
>>
>> Results:
>> Should this not be:
>> action="/workspace/cake/comments/add" ?
>>
>
> Try to set 'model' => 'comments' in the options array.
>
>
>>
>> Kind Regards,
>> Martin
>>
>> >>
>
> Cheers,
>
> Gabriel Gilini
>
> www.usosim.com.br
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Few errors I found so far.

2008-10-27 Thread Gabriel Gilini
On Mon, Oct 27, 2008 at 11:36 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]
> wrote:

>
> hi all,
>

Hi.


>
> Just a few errors I found so far, if anyone can help, it would be much
> appreciated.
>
> 1. Having multiple conditions on find:
>
> post.php Model
> $this->find('all', array('conditions' => array('DATE(Post.date)' => '>
> '.$date, 'Date(Post.date)' => '< '.$end_date)));
>
> SQL generated:
> SELECT `Post`.`id`, `Post`.`name`, `Post`.`date`, `Post`.`content`,
> `Post`.`user_id`, `User`.`id`, `User`.`name`, `User`.`email`,
> `User`.`firstname`, `User`.`lastname` FROM `posts` AS `Post` LEFT JOIN
> `users` AS `User` ON (`Post`.`user_id` = `User`.`id`) WHERE
> DATE(`Post`.`date`) = '> 2008-01-01 00:00:00' AND Date(`Post`.`date`)
> = '< 2008-12-31 23:59:59'
>
> Results:
> None, but I know there are 2 results.
>

That's because the < and > signs should be in the array key, not value. Try
changing your conditions to something like this

array(
   'conditions' => array(
  'DATE(Post.date) >' => $date,
  'DATE(Post.date) >' => $end_date
   )
)


>
>
> 2. Htaccess issue?
>
> view.ctp for posts:
> form('/comments/add', 'post', array('update'=>'comments')); ?
> >
>
> Code generated for the form:
> action="/workspace/cake/posts/comments/add"
>
> Results:
> Should this not be:
> action="/workspace/cake/comments/add" ?
>

Try to set 'model' => 'comments' in the options array.


>
> Kind Regards,
> Martin
>
> >

Cheers,

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakeapp.com

2008-10-21 Thread Gabriel Gilini
Hi,

Nice app, keep up the good job!
That SQL Designer, did you develop it? I found it very interesting.

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Mon, Oct 20, 2008 at 1:13 PM, teknoid <[EMAIL PROTECTED]> wrote:

>
> I've posted the reply on the blog, but wanted to add here as well...
> It would be nice to provide an option of working with models (as well
> as tables) to setup validation rules per field and model association
> types.
>
> Are you planning to open source this project?
>
> On Oct 20, 10:44 am, powtac <[EMAIL PROTECTED]> wrote:
> > Thank you.
> > - Download will come
> > - I will remove "updated"
> > - SQL editor will come in english by default...
> >
> > On 20 Okt., 16:33, Daniel Hofstetter <[EMAIL PROTECTED]> wrote:
> >
> > > Hi,
> >
> > > > I just started to build a WYSIWYG cake application builder:
> http://cakeapp.com.
> > > > Here you find a screencast how it works:
> http://cakeapp.com/pages/screencast/
> >
> > > > If you want, give me some feedback, here at this message/thread or by
> > > > email: powtac at gmx dot de.
> >
> > > Nice app.
> >
> > > Here some feedback:
> > > - When creating a new table it is redundant to have both columns
> > > "modified" and "updated"
> > > - I would load the SQL designer in English by default
> > > - It would be useful if you could download the generated files/app
> >
> > > Hope that's useful for you!
> >
> > > --
> > > Daniel Hofstetterhttp://cakebaker.42dh.com
> >
> >
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakeapp.com

2008-10-21 Thread Gabriel Gilini
Nevermind, I found it. http://ondras.zarovi.cz/sql/

Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Tue, Oct 21, 2008 at 10:32 AM, Gabriel Gilini <[EMAIL PROTECTED]>wrote:

> Hi,
>
> Nice app, keep up the good job!
> That SQL Designer, did you develop it? I found it very interesting.
>
> Gabriel Gilini
>
> www.usosim.com.br
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
>
> On Mon, Oct 20, 2008 at 1:13 PM, teknoid <[EMAIL PROTECTED]>wrote:
>
>>
>> I've posted the reply on the blog, but wanted to add here as well...
>> It would be nice to provide an option of working with models (as well
>> as tables) to setup validation rules per field and model association
>> types.
>>
>> Are you planning to open source this project?
>>
>> On Oct 20, 10:44 am, powtac <[EMAIL PROTECTED]> wrote:
>> > Thank you.
>> > - Download will come
>> > - I will remove "updated"
>> > - SQL editor will come in english by default...
>> >
>> > On 20 Okt., 16:33, Daniel Hofstetter <[EMAIL PROTECTED]> wrote:
>> >
>> > > Hi,
>> >
>> > > > I just started to build a WYSIWYG cake application builder:
>> http://cakeapp.com.
>> > > > Here you find a screencast how it works:
>> http://cakeapp.com/pages/screencast/
>> >
>> > > > If you want, give me some feedback, here at this message/thread or
>> by
>> > > > email: powtac at gmx dot de.
>> >
>> > > Nice app.
>> >
>> > > Here some feedback:
>> > > - When creating a new table it is redundant to have both columns
>> > > "modified" and "updated"
>> > > - I would load the SQL designer in English by default
>> > > - It would be useful if you could download the generated files/app
>> >
>> > > Hope that's useful for you!
>> >
>> > > --
>> > > Daniel Hofstetterhttp://cakebaker.42dh.com
>> >
>> >
>> >>
>>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to display users' country from country table in product list

2008-10-15 Thread Gabriel Kolbe

Thanks Dan. Everyday we learn.

On Wed, Oct 15, 2008 at 4:08 PM, Dan Bair <[EMAIL PROTECTED]> wrote:
>
> Hi Gabriel,
>
> You'll have to set the recursive property of the Product model to
> fetch the associated countries. You should also make sure that the
> correct relations are set in your three models ( Product, User,
> Country).
>
> Here's a quick overview of how recursion works with CakePHP's models:
> http://book.cakephp.org/view/439/recursive
>
> You could also leverage the handy containable behavior built-in with
> CakePHP 1.2:
> http://book.cakephp.org/view/474/Containable
>
> On Oct 15, 7:15 am, gabriel <[EMAIL PROTECTED]> wrote:
>> Hi, I have no idea where to start with this so I would appreciate it
>> if someone can point me in the right direction:
>>
>> I have a products (controller, model, view)
>> In it I display a list of products, in the products table there is a
>> user_id, in the user table there is a country_id.
>>
>> Question: how do I display the country of a user on a view, which
>> comes from the products controller?
>>
>> so far here is the controller code for my view.
>>
>>function view() {
>>$products = $this->Product->recursive = 0;
>>$this->set('products',$products);
>>$this->set('products',$this->paginate());
>>
>> }
>>
>> pfew!
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



how to display users' country from country table in product list

2008-10-15 Thread gabriel

Hi, I have no idea where to start with this so I would appreciate it
if someone can point me in the right direction:

I have a products (controller, model, view)
In it I display a list of products, in the products table there is a
user_id, in the user table there is a country_id.

Question: how do I display the country of a user on a view, which
comes from the products controller?

so far here is the controller code for my view.

   function view() {
   $products = $this->Product->recursive = 0;
   $this->set('products',$products);
   $this->set('products',$this->paginate());

}

pfew!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Installing Magento w/ CakePHP

2008-10-15 Thread Gabriel Kolbe

Hi Kyle

just a few questions...
why use cake and magento together if they do the same thing, I know
magento is a instant fix, for an ecommerce website, but you can use
bakesale and customise it if a ecommerce website is what you want -
and have it all cake. Secondly, if you want to go with magento why no
then you with the zend frame work, since magento is done in zend if I
am not mistaken..

Regards

On Wed, Oct 15, 2008 at 11:34 AM, Kyle Decot <[EMAIL PROTECTED]> wrote:
>
> I am attempting to integrate Magento with CakePHP but I'm having some
> problems. I put the Magento files into a folder I created in the
> webroot directory. I uploaded all that(which took forever) but then
> found out that I needed to run PHP 5.
>
> My hosting is with Godaddy(which I am beginning to hate more and more
> each day) and they only have PHP 4. So I found a article on Magento's
> website(http://www.magentocommerce.com/knowledge-base/entry/installing-
> magento-on-a-php4-server) about using the cgi-bin to use a PHP5
> Binary. The problem I am having is where do I put the cgi-bin folder?
> I tried it inside of the Magento folder, the webroot folder, the App
> folder, and my root folder and none of these seemed to work.
>
> When I navigate to http://www.affinityskateboards.com/store/ CakePHP
> tells me "Error: Missing.htmlController could not be found."
>
> Has anyone successfully done what I am attempting to do or does anyone
> have any suggestions(other then leaving GoDaddy)? Thank you.
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with get product by user, function in products controller

2008-10-14 Thread Gabriel Kolbe

Hi Marcus

I have done the following, but it returns ALL the products NOT just
the user's is it possible to point out my error?
Thanks

My model (user)
var $hasMany = array(
'Product' => array('className' => 'Product',
'foreignKey' => 'product_id',

product controller
function viewbyuser() {
$products = $this->User->Product->find('all' , array('conditions' =>
array('user_id' => $this->Session->read('Auth.User.id') )));
$this->set('products', $this->paginate());  
}


On Tue, Oct 14, 2008 at 10:33 PM, Marcus Silva
<[EMAIL PROTECTED]> wrote:
>
> Ok,
>
> You might be able to do this:
>
>
> Add a relationship in your user model; example: User hasMany Product
> etc...
>
> Then in you controller you can do the following:
>
>
> $this->User->id = $id; //Passed in the function
>
> $userProducts = $this->User->Product->find('all',$params =
> array(   'conditions' => add any extra condition in here , it can be
> an array as well.   ));
>
>
> //then set the data to be available int he view.
>
> Better yet, you could write a custom function in the User model to get
> products for the user, that would save typying etc..
>
> in user.php //model
>
> function getProduct(){
> //The model must be associated before trying to do this.
>
> return $this->Product->find();
>
> }
>
> in the controller you do:
>
> $userProducts = $this->User->getProduct();  //SImple
>
> Hope it helps...
>
> Cheers
>
>
>
> gabriel wrote:
>> Hi, i hope someone can help me here please, I need help with my
>> controller function, I want to get products by user_id, unfortunately
>> I have no idea where to start, help will be greatfully received.
>>
>> Here is my code so far...
>>
>>
>> class ProductsController extends AppController {
>> var $name = 'Products';
>> var $uses = array('Product', 'Category', 'User');
>> var $components = array('Search','Files');
>>
>>   function view() {
>>   $this->Product->recursive = 0;
>>   $this->set('products', $this->paginate());
>>   $this->set('users', $this->User->read(null, $id));
>>
>>   }
>>
>> Thanks
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: help with get product by user, function in products controller

2008-10-14 Thread Gabriel Kolbe

Thanks Marcus, I will try it, you are a star.

On Tue, Oct 14, 2008 at 10:33 PM, Marcus Silva
<[EMAIL PROTECTED]> wrote:
>
> Ok,
>
> You might be able to do this:
>
>
> Add a relationship in your user model; example: User hasMany Product
> etc...
>
> Then in you controller you can do the following:
>
>
> $this->User->id = $id; //Passed in the function
>
> $userProducts = $this->User->Product->find('all',$params =
> array(   'conditions' => add any extra condition in here , it can be
> an array as well.   ));
>
>
> //then set the data to be available int he view.
>
> Better yet, you could write a custom function in the User model to get
> products for the user, that would save typying etc..
>
> in user.php //model
>
> function getProduct(){
> //The model must be associated before trying to do this.
>
> return $this->Product->find();
>
> }
>
> in the controller you do:
>
> $userProducts = $this->User->getProduct();  //SImple
>
> Hope it helps...
>
> Cheers
>
>
>
> gabriel wrote:
>> Hi, i hope someone can help me here please, I need help with my
>> controller function, I want to get products by user_id, unfortunately
>> I have no idea where to start, help will be greatfully received.
>>
>> Here is my code so far...
>>
>>
>> class ProductsController extends AppController {
>> var $name = 'Products';
>> var $uses = array('Product', 'Category', 'User');
>> var $components = array('Search','Files');
>>
>>   function view() {
>>   $this->Product->recursive = 0;
>>   $this->set('products', $this->paginate());
>>   $this->set('users', $this->User->read(null, $id));
>>
>>   }
>>
>> Thanks
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



help with get product by user, function in products controller

2008-10-14 Thread gabriel

Hi, i hope someone can help me here please, I need help with my
controller function, I want to get products by user_id, unfortunately
I have no idea where to start, help will be greatfully received.

Here is my code so far...


class ProductsController extends AppController {
var $name = 'Products';
var $uses = array('Product', 'Category', 'User');
var $components = array('Search','Files');

function view() {
$this->Product->recursive = 0;
$this->set('products', $this->paginate());
$this->set('users', $this->User->read(null, $id));

}

Thanks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: email body/message does not come through

2008-10-14 Thread Gabriel Kolbe

found the answer... in the elements/email/text/thanks.cpt  do this
data['Contact']['content']; ?>

On Tue, Oct 14, 2008 at 1:46 PM, gabriel <[EMAIL PROTECTED]> wrote:
>
> Hi My emails works, but the message/body/content part of the email
> does not come through, the  $this->Email->template = 'thanks'; does
> not come through...can anyone please help.
>
>  class ContactsController extends AppController
> {
>var $name = "Contacts";
>var $uses = 'Contact';
>var $components = array('Email');
>
>
>  //-
>  function index(){
>$this->set('title_for_layout', 'Contacts');
>if(isset($this->data)) {
>if($this->Contact->create($this->data) && $this->Contact-
>>validates()){
>  //send e-mail
>  $this->_sendMail();
>}
>else {
>$this->Session->setFlash('Please correct the underlying errors');
>$this->redirect('/contacts/');
>  }
>  }
>  }
>
>  function _sendMail() {
>
>$senderEmail = $this->data['Contact']['mail'];
>
>$this->Email->to = $this->Session->read('Auth.User.email');
>$this->Email->subject = $this->data['Contact']['subject'];
>$this->Email->from = $senderEmail;
>$this->Email->replyTo = $this->Session->read('Auth.User.email');
> $this->Email->template = 'thanks';
>//Send as 'html', 'text' or 'both' (default is 'text')
>$this->Email->sendAs = 'text';
>//Set view variables as normal
>$this->set('fname', ucfirst($this->data['Contact']['fname']));
>$this->set('lname', ucfirst($this->data['Contact'] ['lname']));
>$this->set('mail', $senderEmail);
>$this->set('subject', $this->data['Contact']['subject']);
>
>//$this->$body=$this->data['Contact']['message']. "Email info: First
> Name: ". ucfirst($this->data['Contact']['fname']). "Last
> Name" .ucfirst($this->data['Contact'] ['lname']);
>//$this->set('message', $this->body);
>
>$this->set('content', $this->data['Contact']['content']);
>//Do not pass any args to send()
>if ( $this->Email->send() {
>$this->Session->setFlash('Your email was send successfully');
>$this->redirect('/contacts/');
>exit;
>} else {
>$this->Session->setFlash("There was error
>in sending the email. Please try again");
>$this->redirect('/contacts/');
>exit;
>}
>  }
> }
> ?>
>
> model
>
>  class Contact extends AppModel {
>
>  var $name = 'Contact';
>  var $useTable = false;
>  var $validate = array(
>'fname' => array('required' => VALID_NOT_EMPTY),
>'lname' => array('required' => VALID_NOT_EMPTY),
>'mail' => array('required' => VALID_NOT_EMPTY,
> 'validEmail'=>VALID_EMAIL),
>'subject' => array('required' => VALID_NOT_EMPTY),
>'content' => array('required' => VALID_NOT_EMPTY)
>  );
>   }
> ?>
>
> ###view 
>
> Contact Us
>
> create('Contact', array('url'=>'/contacts'));?>
> 
> echo $form->input('fname', array('label' => 'First Name', 'error' =>
> array('required' => 'Please specify your First name')));
> echo $form->input('lname', array('label' => 'Last Name', 'error' =>
> array('required' => 'Please specify your Last name')));
> echo $form->input('mail', array('label' => 'Email', 'error' =>
> array('required' => 'Please specify your email address', 'validEmail'
> => 'Insert a valid email')));
> echo $form->input('subject', array('label' => 'Subject', 'error' =>
> array('required' => 'Insert email subject')));
> echo $form->input('content', array('label' => 'Message', 'error' =>
> array('required' =>'Insert your message here'), 'type'=>'textarea',
> 'cols'=>30));
> ?>
> 
> 
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



email body/message does not come through

2008-10-14 Thread gabriel

Hi My emails works, but the message/body/content part of the email
does not come through, the  $this->Email->template = 'thanks'; does
not come through...can anyone please help.

set('title_for_layout', 'Contacts');
if(isset($this->data)) {
if($this->Contact->create($this->data) && $this->Contact-
>validates()){
  //send e-mail
  $this->_sendMail();
}
else {
$this->Session->setFlash('Please correct the underlying errors');
$this->redirect('/contacts/');
  }
  }
  }

  function _sendMail() {

$senderEmail = $this->data['Contact']['mail'];

$this->Email->to = $this->Session->read('Auth.User.email');
$this->Email->subject = $this->data['Contact']['subject'];
$this->Email->from = $senderEmail;
$this->Email->replyTo = $this->Session->read('Auth.User.email');
 $this->Email->template = 'thanks';
//Send as 'html', 'text' or 'both' (default is 'text')
$this->Email->sendAs = 'text';
//Set view variables as normal
$this->set('fname', ucfirst($this->data['Contact']['fname']));
$this->set('lname', ucfirst($this->data['Contact'] ['lname']));
$this->set('mail', $senderEmail);
$this->set('subject', $this->data['Contact']['subject']);

//$this->$body=$this->data['Contact']['message']. "Email info: First
Name: ". ucfirst($this->data['Contact']['fname']). "Last
Name" .ucfirst($this->data['Contact'] ['lname']);
//$this->set('message', $this->body);

$this->set('content', $this->data['Contact']['content']);
//Do not pass any args to send()
if ( $this->Email->send() {
$this->Session->setFlash('Your email was send successfully');
$this->redirect('/contacts/');
exit;
} else {
$this->Session->setFlash("There was error
in sending the email. Please try again");
$this->redirect('/contacts/');
exit;
}
  }
}
?>

model

 array('required' => VALID_NOT_EMPTY),
'lname' => array('required' => VALID_NOT_EMPTY),
'mail' => array('required' => VALID_NOT_EMPTY,
'validEmail'=>VALID_EMAIL),
'subject' => array('required' => VALID_NOT_EMPTY),
'content' => array('required' => VALID_NOT_EMPTY)
  );
   }
?>

###view 

Contact Us

create('Contact', array('url'=>'/contacts'));?>
input('fname', array('label' => 'First Name', 'error' =>
array('required' => 'Please specify your First name')));
echo $form->input('lname', array('label' => 'Last Name', 'error' =>
array('required' => 'Please specify your Last name')));
echo $form->input('mail', array('label' => 'Email', 'error' =>
array('required' => 'Please specify your email address', 'validEmail'
=> 'Insert a valid email')));
echo $form->input('subject', array('label' => 'Subject', 'error' =>
array('required' => 'Insert email subject')));
echo $form->input('content', array('label' => 'Message', 'error' =>
array('required' =>'Insert your message here'), 'type'=>'textarea',
'cols'=>30));
?>


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Yet another site powered by Cakephp

2008-10-13 Thread Gabriel Kolbe

Hi, my name is Gabriel, I did respond to your email on cake groups. As
I said I am working on a similar site - for the UK market. I am using
Bakesale as a basis which I edit. I know this is very  bold of me to
ask you this, but it would save me a lot of time if I could buy your
code and edit it to my own needs. I don't want to offend you, but
would you be willing to sell the code? After I am finished
personalising and taking away and adding stuff to it, it would look
very different to what you have now, but some of what you have I need
to do too and it would save me much time if I don't have to do
everything from scratch. I can also work on some ' modules' which you
might be interested in to add to your website. Hope to hear from you
soon.

Kind Regards

On Sun, Oct 12, 2008 at 10:50 PM, Sayhello <[EMAIL PROTECTED]> wrote:
>
> Thank you all for the feedback so far. I am not using bakesale right
> now, but perhaps that can be a feature for v1.5.
>
> Thanks
> www.sayhello.me
>
> On Oct 12, 2:36 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>> Hi did you use Bakesale and customized it a bit?
>> regards
>>
>>
>>
>> On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote:
>>
>> > Hello all,
>>
>> > Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
>> >www.sayhello.me. Sayhello is a new classified ads site to help you buy
>> > and sell. We are initially launching in the Los Angeles market. Check
>> > it out. Any suggestions and feedback are welcome.
>>
>> > Thank you!
>> >www.sayhello.me- Hide quoted text -
>>
>> - Show quoted text -
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Yet another site powered by Cakephp

2008-10-12 Thread Gabriel Kolbe

Hi did you use Bakesale and customized it a bit?
regards

On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
> www.sayhello.me. Sayhello is a new classified ads site to help you buy
> and sell. We are initially launching in the Los Angeles market. Check
> it out. Any suggestions and feedback are welcome.
>
> Thank you!
> www.sayhello.me
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Yet another site powered by Cakephp

2008-10-12 Thread Gabriel Kolbe

Hi Sayhello

I like your website, I am also busy working on a very similar website
- which will run here in the uk, (mostly) but with a few added
features. You can look at the first - version at www.beplaid.com.
Regards Gabriel



On Sat, Oct 11, 2008 at 8:28 AM, Sayhello <[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> Just wanted to introduce yet another site built with CakePHP 1.2 RC3 -
> www.sayhello.me. Sayhello is a new classified ads site to help you buy
> and sell. We are initially launching in the Los Angeles market. Check
> it out. Any suggestions and feedback are welcome.
>
> Thank you!
> www.sayhello.me
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: how to unit test a shell script

2008-10-10 Thread Gabriel Gilini

So, are there any guidelines to write a Shell Test Case?

On 16 set, 18:05, mark_story <[EMAIL PROTECTED]> wrote:
> Jeurgen,  Testingshellclasses is a bit tricky right now
> App::import() currently does not let you target shells so you have to
> include them regular php style.  We are working on ways of improving
> this though, as testing shells is a big pain right now.
>
> -Mark
>
> On Sep 16, 9:45 am, JuergenRiemer <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I do the following to unittestashellscript
> > [ learn.test.php ] put in a folder "tests/cases/shells" (that I
> > created)
> >  > App::import( 'Shell', 'Learn' );
>
> > class LearnShellTest extends CakeTestCase {
>
> >         function setUp(){
> >                 $this->LearnShell = new LearnShell();
> >         }
>
> >         function testOne(){
>
> >                 $this->LearnShell->testFunc();
> >         }}
>
> > ?>
>
> > how ever it does not find the Class LearnShell.
> > Now before I get deeper into it... can anyone point me to the proper
> > solution?
> > thx
> > Jeurgen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Recursive Association in Model

2008-10-10 Thread Gabriel Gilini
Hi there,

If you play around with Set::combine and Set::extract a bit you could
achieve the desired results. As I know for a fact that you're a fellow
brazilian, take a look at this blog post:
http://kiss.souagil.com.br/2008/08/manipulando-arrays-associativas/

I hope it'll help you.

Cheers,
Gabriel Gilini

www.usosim.com.br
[EMAIL PROTECTED]
[EMAIL PROTECTED]


On Thu, Oct 9, 2008 at 10:41 AM, SamuraiDio <[EMAIL PROTECTED]> wrote:

>
> Hi...
> A friend of mine is developing an application with uses a recursive
> hasMany association in a Model.
> Everything is working fine, except that the obtained data array is
> ugly, and dificult to work on.
>
> This is the Model definition:
>
> class PlanoConta extends AppModel {
>   var $name = 'PlanoConta';
>   var $displayField = 'nome';
>   var $hasMany = array(
>   'PlanoContaFilho' => array(
>   'className' => 'PlanoConta',
>   'foreignKey' => 'parent_id'
>   )
>   );
> }
>
> Using a
> find('all' array('recursive' = 3)); //omiting irrelevant option...
> The resultset is like this:
>
> http://pastebin.com/m354d1d17
>
> But it would be better to obtain something like this:
>
> http://pastebin.com/f31071d88
>
> Is it possible to obtain a resultset like this?
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: anyone know why this session check does not work like it suppose to

2008-10-09 Thread Gabriel Kolbe

ha-ha, thanks, so obvious!

On Thu, Oct 9, 2008 at 2:07 PM, 3lancer.eu <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> There is essential difference between read() and check() methods of
> the Session class.
>
> However, you should rather use the following convention:
> http://book.cakephp.org/view/247/AuthComponent-Methods#user-387
>
> Regards,
> Piotr
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



anyone know why this session check does not work like it suppose to

2008-10-09 Thread gabriel

I login, then want to check the session if a person has admin rights

If I login as an 'admin' where the role = admin or if I login as a non-
admin where the role=0, it displays in both situations the admin area
link...

the script:   if ($session->check('Auth.User.role') == 'admin') {
  echo $html->link('Admin Area', '/admin/');
  } else {
  echo $html->link('My Account', '/accnt/');
  }

In the debug the 'role' is set to '0'
in the debug I get :

[Auth] => Array
(
[User] => Array
(
[id] => 3
[username] => gab
[fname] =>
[lname] => sdf
[email] => [EMAIL PROTECTED]
[tell] => sdf
[cell] =>
[hnum] =>
[street] =>
[city] => 0
[county_id] => 0
[country_id] => 0
[pcode] =>
[maillist] => 0
[created] => 2008-10-01 13:52:50
[role] => 0
[ip] =>
[lastvisit] => -00-00 00:00:00
[emailssend] => 0
[browser] => 0
[screen] =>
)

)

any help
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Site powered by CakePHP

2008-10-09 Thread Gabriel Kolbe

Looks good, how do you join the project? By registering in the site?

On Wed, Oct 8, 2008 at 8:58 PM, dezpo <[EMAIL PROTECTED]> wrote:
>
> Hello bakers,
> Just wanted to show you what I have did in the past 2 months using
> cakephp. This is my new site about car fans. If you have time please
> try to test it or even join this project. Thank you.
>
> www.autolive.org
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: newbie question

2008-10-09 Thread Gabriel Kolbe

I user Xampp, and it works like a dream !!

On Thu, Oct 9, 2008 at 4:09 AM,  <[EMAIL PROTECTED]> wrote:
>
> I think it may be best if you use a real server!
>
> On 10/08/2008, JRough <[EMAIL PROTECTED]> wrote:
>>
>> I want to try out Cakephp.  Do you know if I can use it with XXAMP on
>> Windows just for testing or do I have to install it on a real server?
>>
>> thanks,
>>
>> >
>>
>
>
> --
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Add user_id from session to db when adding a product

2008-10-03 Thread Gabriel Kolbe

Hi I would prefer to get the value from the session.

When I do
 if(isset($this->data['Product']['user_id'] = $user_id)) {
 if(isset($this->data['Product']['user_id'] = $this->Auth->user('id');) {

I get this error
Parse error: syntax error, unexpected '=', expecting ',' or ')' in
C:\xampp\htdocs\bakesale\app\controllers\products_controller.php on
line 96

Seems like it does not like the ' = ' I don't want to be a bother, but
any idea how to fix it?

Regards

On Fri, Oct 3, 2008 at 4:18 PM, Mathew <[EMAIL PROTECTED]> wrote:
>
> Assuming you want the currently logged in administrator.
>
> $this->data['Product']['user_id'] = $this->Auth->user('id');
>
> Otherwise, you'll need a belongsTo association in your Product model,
> and allow scaffolding to show a user drop down list.
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Add user_id from session to db when adding a product

2008-10-03 Thread gabriel

Hi, I am busy reworking a bakesale script based on cake, my OOP php is
not that good. Maybe someone can point me here in the right direction.
I want to change a script the add a product and in sert in the db the
user_id in the product table - which should come from the User.id

function admin_add($category_id = 0) {
if(isset($this->data['Product'])) {
$this->redirect(array('action' => 'edit', 'id' => $this-
>Product->bsAdd($this->data)));
} else {
$this->set('data', $this->Category->read(null, 
$category_id));
}
}

 function bsAdd($data = array()) {
$this->create();
$this->data = $data;
$this->save($this->data);
return $this->getLastInsertID();
}

Any help will be most greatful !!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How do i upload images using cakephp

2008-10-03 Thread Gabriel Kolbe

Hi I don't know how too but.. you can steal some ideas how to handles
images at http://www.bakesalehq.com/ since it is a ecommerce
site/template that uses images

On Fri, Oct 3, 2008 at 12:43 PM, AceStudio <[EMAIL PROTECTED]> wrote:
>
> I am developing a social community and would like members profile to
> show their pictures or avatar. Cake documentation doesn't deal with
> this at all. Please i'd appreciate if someone treated this
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: trying to add new pages and use same layout page in Bakesale

2008-10-02 Thread Gabriel Kolbe

I also found some code in the routes.php which I copied and changed
for users, but it does not help yet . ( I have renamed the index views
and functions - show ) trying to replicate the other senarious.

// SEO setting for products
Router::connect('/:myvar/p/*',
array('myvar' => null, 'controller' => 'products', 'action' => 'show'),
array('myvar' => '.*')
);

Router::connect(
'/:slug-p-:id.html',
array('controller' => 'products', 'action' => 'show'),
array(
'pass' => array('id', 'slug'),
'slug' => '.*',
'id' => '[\d]+'
)
);

// SEO setting for users
Router::connect('/:myvar/u/*',
array('myvar' => null, 'controller' => 'users', 'action' => 'show'),
array('myvar' => '.*')
);

Router::connect(
'/:slug-p-:id.html',
array('controller' => 'users', 'action' => 'show'),
array(
'pass' => array('id', 'slug'),
'slug' => '.*',
'id' => '[\d]+'
)
);

On Thu, Oct 2, 2008 at 6:52 PM, gabriel <[EMAIL PROTECTED]> wrote:
>
> Hi All. I am trying to edit the Bakesale library I downloaded from the
> internet, which runs on cake. BakeSale uses, to layouts - admin, and
> show. I have added 2 new sets of controllers, views, models. If I type
> in users/register ,  it keeps opening up in the 'CakePHP: the rapid
> development php framework' default page, and NOT in the show - layout.
> I have been looking everywhere, and can not findout where they 'force'
> the views to open up in the specific layout. ( I have created a
> 'default' layout - and this kind of work) but this is not what I want
> to do. Does anyone have any ideas, it would be grate - the only code I
> find that might explain it is in the app_controller, posted below.
>
>function beforeFilter() {
>$this->_checkLogin();
>if (!isset($this->params['requested'])) {
>Configure::load('custom/bakesale_config');
>Configure::write('Config.language',
> Configure::read('Site.locale'));
>$this->theme = Configure::read('Site.theme');
>$this->_setDefaults();
>$this->addUrl();
>}
>}
>
>function _setDefaults() {
>$bodyClass = $checked = $selected = '';
>$extraCss = array();
>$isAdmin = $simpleLayout = false;
>if($this->Session->check('Auth.User.role')== 'role') {
>$isAdmin = true;
>}
>$this->set(compact('bodyClass', 'checked', 'selected', 
> 'isAdmin',
> 'extraCss', 'simpleLayout'));
>
>if(!isset($this->params['admin'])) {
>$this->layout = 'shop';
>} else {
>$this->Session->write('Admin.id', '1');
>$this->layout = 'admin';
>}
>}
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



trying to add new pages and use same layout page in Bakesale

2008-10-02 Thread gabriel

Hi All. I am trying to edit the Bakesale library I downloaded from the
internet, which runs on cake. BakeSale uses, to layouts - admin, and
show. I have added 2 new sets of controllers, views, models. If I type
in users/register ,  it keeps opening up in the 'CakePHP: the rapid
development php framework' default page, and NOT in the show - layout.
I have been looking everywhere, and can not findout where they 'force'
the views to open up in the specific layout. ( I have created a
'default' layout - and this kind of work) but this is not what I want
to do. Does anyone have any ideas, it would be grate - the only code I
find that might explain it is in the app_controller, posted below.

function beforeFilter() {
$this->_checkLogin();
if (!isset($this->params['requested'])) {
Configure::load('custom/bakesale_config');
Configure::write('Config.language',
Configure::read('Site.locale'));
$this->theme = Configure::read('Site.theme');
$this->_setDefaults();
$this->addUrl();
}
}

function _setDefaults() {
$bodyClass = $checked = $selected = '';
$extraCss = array();
$isAdmin = $simpleLayout = false;
if($this->Session->check('Auth.User.role')== 'role') {
$isAdmin = true;
}
$this->set(compact('bodyClass', 'checked', 'selected', 
'isAdmin',
'extraCss', 'simpleLayout'));

if(!isset($this->params['admin'])) {
$this->layout = 'shop';
} else {
$this->Session->write('Admin.id', '1');
$this->layout = 'admin';
}
}
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Adding to db without going to view..?

2008-09-29 Thread Gabriel Kolbe

Hi Rich

Thanks for that !! One more question..
If I want to change the
($this->UserFavourite->save($this->data)) {

where the controller gets the info from the view..
echo $form->input('user_id');
echo $form->input('item_id');

I want the controller not to go the the 'add' view but just add user
(in the session)($session->read('Auth.User.id')), to db, and also the
item_id which will be given in the URL like so:
testsite/user_favourites/add/2

Any idea how to do this??

Regards



On Fri, Sep 26, 2008 at 7:02 PM, Donkeybob <[EMAIL PROTECTED]> wrote:
>
> You use it the way you have it and just change the section in the add
> function to redirect . . .
>
> -> $this->redirect(array('action'=>'view'));
>
> Every function should have a related view file unless you state
> otherwise with a layout call.
>
> if your action is "add" then you have to have an add function in the
> controller, which uses the add view. . . .just redirect it in your
> statement.
>
> function add() {
>if (!empty($this->data)) {
>$this->UserFavourite->create();
>if ($this->UserFavourite->save($this->data)) {
>$this->Session->setFlash(__('The
> UserFavourite has been saved', true));
>$this-
>>redirect(array('action'=>'view'));
>} else {
>$this->Session->setFlash(__('The
> UserFavourite could not be saved. Please, try again.', true));
>$this-
>>redirect(array('action'=>'view'));
>}
>}
>}
>
>
> hope this is a start
> rich
>
>
> On Sep 26, 10:59 am, gabriel <[EMAIL PROTECTED]> wrote:
>> Hi, does anyone know how I can add  (like a favourite to a db table)
>> without going to the add view?
>>
>> I have a link
>> testsite/user_favourites/add/2
>>
>> IF I click on it it, it takes me to the add view (which has a model
>> and controller)
>> I DON'T want to go to the add view, but the 'view' view which shows
>> the favourite that had just been added... here is the add controller
>> and view and model
>>
>> 
>> controller /
>> function add() {
>> if (!empty($this->data)) {
>> $this->UserFavourite->create();
>> if ($this->UserFavourite->save($this->data)) {
>> $this->Session->setFlash(__('The 
>> UserFavourite has been saved',
>> true));
>> $this->redirect(array('action'=>'index'));
>> } else {
>> $this->Session->setFlash(__('The 
>> UserFavourite could not be saved.
>> Please, try again.', true));
>> }
>> }
>> $users = $this->UserFavourite->User->find('list');
>> $this->set(compact('users'));
>> }
>>
>> 
>> model//
>> class UserFavourite extends AppModel {
>>
>> var $name = 'UserFavourite';
>> var $validate = array(
>> 'id' => array('numeric'),
>> 'user_id' => array('numeric'),
>> 'item_id' => array('numeric')
>> );
>>
>> //The Associations below have been created with all possible keys,
>> those that are not needed can be removed
>> var $belongsTo = array(
>> 'User' => array('className' => 'User',
>> 'foreignKey' 
>> => 'user_id',
>> 'conditions' 
>> => '',
>> 'fields' => 
>> '',
>> 'order' => ''
>

Crumbs - crumbs - crumbs

2008-09-29 Thread gabriel

I could probably do this easily in sessions BUT I don't want to
reinvent Cakes wheels. So, I have added
addCrumb('Register', '/users/register');?> in the
register.ctp view. and added the the getCrumbs();?> in the
default.ctp layout. It only displays the current view and does not
remember the path like page1>>page2>>page3. ect.

Does any one know what do I do wrong?
Obvoiusly I will bless you if you can.;)
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Linking to the admin area?

2008-09-26 Thread Gabriel Kolbe

S'ok, found the answer..

echo $html->link('Admin Area', '/admin/users/accnt');




On Fri, Sep 26, 2008 at 4:14 PM, gabriel <[EMAIL PROTECTED]> wrote:
>
> Hi, I have to functions in the user_controller.
> One is admin_accnt, the other is accnt.
> How do I link to the admin_accnt ?
> My link
> echo $html->link("Admin", array("controller" => "users", "action" =>
> "admin_accnt"));
>
> IF I just do
> echo $html->link("Admin", array("controller" => "users", "action" =>
> "accnt"));
>
> I go the the accnt function/view
>
> IF I go the the admin_accnt I get
> Error: UsersController::admin_accnt() cannot be accessed directly.
>
> Help will be appreciated!!
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Linking to the admin area?

2008-09-26 Thread gabriel

Hi, I have to functions in the user_controller.
One is admin_accnt, the other is accnt.
How do I link to the admin_accnt ?
My link
echo $html->link("Admin", array("controller" => "users", "action" =>
"admin_accnt"));

IF I just do
echo $html->link("Admin", array("controller" => "users", "action" =>
"accnt"));

I go the the accnt function/view

IF I go the the admin_accnt I get
Error: UsersController::admin_accnt() cannot be accessed directly.

Help will be appreciated!!
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Adding to db without going to view..?

2008-09-26 Thread gabriel

Hi, does anyone know how I can add  (like a favourite to a db table)
without going to the add view?

I have a link
testsite/user_favourites/add/2

IF I click on it it, it takes me to the add view (which has a model
and controller)
I DON'T want to go to the add view, but the 'view' view which shows
the favourite that had just been added... here is the add controller
and view and model


controller /
function add() {
if (!empty($this->data)) {
$this->UserFavourite->create();
if ($this->UserFavourite->save($this->data)) {
$this->Session->setFlash(__('The UserFavourite 
has been saved',
true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The UserFavourite 
could not be saved.
Please, try again.', true));
}
}
$users = $this->UserFavourite->User->find('list');
$this->set(compact('users'));
}


model//
class UserFavourite extends AppModel {

var $name = 'UserFavourite';
var $validate = array(
'id' => array('numeric'),
'user_id' => array('numeric'),
'item_id' => array('numeric')
);

//The Associations below have been created with all possible keys,
those that are not needed can be removed
var $belongsTo = array(
'User' => array('className' => 'User',
'foreignKey' => 
'user_id',
'conditions' => 
'',
'fields' => '',
'order' => ''
)
);

}
///
view//

create('UserFavourite');?>


input('user_id');
echo $form->input('item_id');
?>

end('Submit');?>



link(__('List UserFavourites', true),
array('action'=>'index'));?>
link(__('List Users', true),
array('controller'=> 'users', 'action'=>'index')); ?> 
link(__('New User', true),
array('controller'=> 'users', 'action'=>'add')); ?> 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PLease help, 3 days struggle with 'simple' authentication

2008-09-24 Thread Gabriel Kolbe

ta

On Wed, Sep 24, 2008 at 1:17 PM, RichardAtHome <[EMAIL PROTECTED]> wrote:
>
>> $this->Auth->deny('admin', 'accnt', 'faq'); // does not work
>
> This doesn't work because the 'action' for all views in the pages
> controller is 'display' not 'admin', 'accnt'
>
> $this->Auth->deny("display") would work, but it would deny ALL views
> handled by the pages controller.
>
> Your workaround is a good compromise. Or you could make your own
> dedicated MyPagesController to group all these pages together.
>
> On Sep 24, 11:12 am, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>> S'ok, I created 'fake' functions in the user controller, then added
>> the views to the users views, then take the Authentication process
>> from the app_controller to the users_controller..
>>
>> On Wed, Sep 24, 2008 at 10:54 AM, gabriel <[EMAIL PROTECTED]> wrote:
>>
>> > This is my current code:
>> > class AppController extends Controller {
>>
>> >var $components = array('Auth');
>>
>> >  function beforeFilter() {
>> >$this->Auth->authorize = 'controller';
>> >$this->Auth->allow('*');
>> >$this->Auth->deny('admin', 'accnt', 'faq'); // does not work
>> >}
>>
>> >  function isAuthorized() {
>> >if ($this->Auth->user('role') == 'admin') {
>> >$this->Auth->allow('admin');
>> >}
>>
>> >  }
>> > }
>>
>> > What I want to do is something like the following:
>> >  function beforeFilter() {
>>
>> >$this->Auth->authorize = 'controller';
>> >$this->Auth->allow('pages/faq', 'pages/aboutus', 'users/
>> > register');
>> >$this->Auth->deny('pages/accnt', 'pages/admin', 'categories/
>> > edit');
>> >}
>>
>> >  function isAuthorized() {
>> >if ($this->Auth->user('role') == 'admin') {
>> >$this->Auth->allow('pages/admin', 'categories/edit');
>> >}
>> >   $this->Auth->allow('pages/accnt');
>> >  }
>> > }
>>
>> > NOTE: the pages does not have a model or controller..I HAVE read the
>> > cookbooks severaltimes, served the Cakegroup, posted several message,
>> > got different replies, but just can' t seem to find a answer to
>> > this... I would be grateful if someone can actually show me ..
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: PLease help, 3 days struggle with 'simple' authentication

2008-09-24 Thread Gabriel Kolbe

S'ok, I created 'fake' functions in the user controller, then added
the views to the users views, then take the Authentication process
from the app_controller to the users_controller..

On Wed, Sep 24, 2008 at 10:54 AM, gabriel <[EMAIL PROTECTED]> wrote:
>
> This is my current code:
> class AppController extends Controller {
>
>var $components = array('Auth');
>
>  function beforeFilter() {
>$this->Auth->authorize = 'controller';
>$this->Auth->allow('*');
>$this->Auth->deny('admin', 'accnt', 'faq'); // does not work
>}
>
>  function isAuthorized() {
>if ($this->Auth->user('role') == 'admin') {
>$this->Auth->allow('admin');
>}
>
>  }
> }
>
> What I want to do is something like the following:
>  function beforeFilter() {
>
>$this->Auth->authorize = 'controller';
>$this->Auth->allow('pages/faq', 'pages/aboutus', 'users/
> register');
>$this->Auth->deny('pages/accnt', 'pages/admin', 'categories/
> edit');
>}
>
>  function isAuthorized() {
>if ($this->Auth->user('role') == 'admin') {
>$this->Auth->allow('pages/admin', 'categories/edit');
>}
>   $this->Auth->allow('pages/accnt');
>  }
> }
>
> NOTE: the pages does not have a model or controller..I HAVE read the
> cookbooks severaltimes, served the Cakegroup, posted several message,
> got different replies, but just can' t seem to find a answer to
> this... I would be grateful if someone can actually show me ..
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



PLease help, 3 days struggle with 'simple' authentication

2008-09-24 Thread gabriel

This is my current code:
class AppController extends Controller {

var $components = array('Auth');

  function beforeFilter() {
$this->Auth->authorize = 'controller';
$this->Auth->allow('*');
$this->Auth->deny('admin', 'accnt', 'faq'); // does not work
}

  function isAuthorized() {
if ($this->Auth->user('role') == 'admin') {
$this->Auth->allow('admin');
}

  }
}

What I want to do is something like the following:
  function beforeFilter() {

$this->Auth->authorize = 'controller';
$this->Auth->allow('pages/faq', 'pages/aboutus', 'users/
register');
$this->Auth->deny('pages/accnt', 'pages/admin', 'categories/
edit');
}

  function isAuthorized() {
if ($this->Auth->user('role') == 'admin') {
$this->Auth->allow('pages/admin', 'categories/edit');
}
   $this->Auth->allow('pages/accnt');
  }
}

NOTE: the pages does not have a model or controller..I HAVE read the
cookbooks severaltimes, served the Cakegroup, posted several message,
got different replies, but just can' t seem to find a answer to
this... I would be grateful if someone can actually show me ..
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe

thanks

On Tue, Sep 23, 2008 at 7:26 PM, teknoid <[EMAIL PROTECTED]> wrote:
>
> Again, this approach is not correct.
> Checking for user status, should always be done in the controller.
>
> Take a look at the auth component in the manual to see how you can
> restrict access to certain resources/pages.
>
>
> On Sep 23, 2:14 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>> Sorry, just to add to the info below, the view DOES not have a
>> controller or a model, not I don't want to place it in the
>> app_controller, because some page accessable even if you are not
>> logged in.. my problem is I am unexperienced and it is mega
>> frastrating !!
>>
>> On Tue, Sep 23, 2008 at 7:09 PM, Gabriel Kolbe <[EMAIL PROTECTED]> wrote:
>> > Hi, my situation is the following:
>> > // check if user is logged in...
>> > check('Auth.User.id')) { ?>
>> > do your thing
>> >  
>> > redirect page somewhere else
>> > > > }
>> > ?>
>> > is is done in a view how, do you mean I have to check the login in the
>> > function in the controller ?
>>
>> > Regards
>>
>> > On Tue, Sep 23, 2008 at 4:34 PM, dr. Hannibal Lecter
>> > <[EMAIL PROTECTED]> wrote:
>>
>> >> Hi again,
>>
>> >> as teknoid said, don't redirect from a view.
>>
>> >> If you've come to a point where you redirect from a view, you should
>> >> seriously reconsider you coding strategy. Views are supposed to
>> >> display data, define the look of your app and input forms; but never
>> >> handle any business or application logic.
>>
>> >> The name itself implies it - view ;)
>>
>> >> On Sep 23, 4:53 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>> >>> Hi doc
>>
>> >>> Thanks for the reply, but how do I redirect in a view which does not
>> >>> have a model or controller?
>>
>> >>> On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter
>>
>> >>> <[EMAIL PROTECTED]> wrote:
>>
>> >>> > Of course, why not :)
>>
>> >>> >http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676...
>>
>> >>> > On Sep 23, 2:00 pm, gabriel <[EMAIL PROTECTED]> wrote:
>> >>> >> Wouldn't it be great if cake adds a straight PHP equivalent on it's
>> >>> >> manual pages, for instance I want to redirect a page in straight PHP
>> >>> >> it would be '  header("Location: index.php"); '  does any one know how
>> >>> >> to do this in CAKE ?
>>
>>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe

Sorry, just to add to the info below, the view DOES not have a
controller or a model, not I don't want to place it in the
app_controller, because some page accessable even if you are not
logged in.. my problem is I am unexperienced and it is mega
frastrating !!



On Tue, Sep 23, 2008 at 7:09 PM, Gabriel Kolbe <[EMAIL PROTECTED]> wrote:
> Hi, my situation is the following:
> // check if user is logged in...
> check('Auth.User.id')) { ?>
> do your thing
>  
> redirect page somewhere else
>  }
> ?>
> is is done in a view how, do you mean I have to check the login in the
> function in the controller ?
>
> Regards
>
> On Tue, Sep 23, 2008 at 4:34 PM, dr. Hannibal Lecter
> <[EMAIL PROTECTED]> wrote:
>>
>> Hi again,
>>
>> as teknoid said, don't redirect from a view.
>>
>> If you've come to a point where you redirect from a view, you should
>> seriously reconsider you coding strategy. Views are supposed to
>> display data, define the look of your app and input forms; but never
>> handle any business or application logic.
>>
>> The name itself implies it - view ;)
>>
>> On Sep 23, 4:53 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>>> Hi doc
>>>
>>> Thanks for the reply, but how do I redirect in a view which does not
>>> have a model or controller?
>>>
>>> On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter
>>>
>>> <[EMAIL PROTECTED]> wrote:
>>>
>>> > Of course, why not :)
>>>
>>> >http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676...
>>>
>>> > On Sep 23, 2:00 pm, gabriel <[EMAIL PROTECTED]> wrote:
>>> >> Wouldn't it be great if cake adds a straight PHP equivalent on it's
>>> >> manual pages, for instance I want to redirect a page in straight PHP
>>> >> it would be '  header("Location: index.php"); '  does any one know how
>>> >> to do this in CAKE ?
>>>
>>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe

Hi, my situation is the following:
// check if user is logged in...
check('Auth.User.id')) { ?>
do your thing
  
redirect page somewhere else

is is done in a view how, do you mean I have to check the login in the
function in the controller ?

Regards

On Tue, Sep 23, 2008 at 4:34 PM, dr. Hannibal Lecter
<[EMAIL PROTECTED]> wrote:
>
> Hi again,
>
> as teknoid said, don't redirect from a view.
>
> If you've come to a point where you redirect from a view, you should
> seriously reconsider you coding strategy. Views are supposed to
> display data, define the look of your app and input forms; but never
> handle any business or application logic.
>
> The name itself implies it - view ;)
>
> On Sep 23, 4:53 pm, "Gabriel Kolbe" <[EMAIL PROTECTED]> wrote:
>> Hi doc
>>
>> Thanks for the reply, but how do I redirect in a view which does not
>> have a model or controller?
>>
>> On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter
>>
>> <[EMAIL PROTECTED]> wrote:
>>
>> > Of course, why not :)
>>
>> >http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676...
>>
>> > On Sep 23, 2:00 pm, gabriel <[EMAIL PROTECTED]> wrote:
>> >> Wouldn't it be great if cake adds a straight PHP equivalent on it's
>> >> manual pages, for instance I want to redirect a page in straight PHP
>> >> it would be '  header("Location: index.php"); '  does any one know how
>> >> to do this in CAKE ?
>>
>>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread Gabriel Kolbe

Hi doc

Thanks for the reply, but how do I redirect in a view which does not
have a model or controller?

On Tue, Sep 23, 2008 at 1:26 PM, dr. Hannibal Lecter
<[EMAIL PROTECTED]> wrote:
>
> Of course, why not :)
>
> http://api.cakephp.org/class_controller.html#903188d3de83bd65c78bb676f61b3039
>
> On Sep 23, 2:00 pm, gabriel <[EMAIL PROTECTED]> wrote:
>> Wouldn't it be great if cake adds a straight PHP equivalent on it's
>> manual pages, for instance I want to redirect a page in straight PHP
>> it would be '  header("Location: index.php"); '  does any one know how
>> to do this in CAKE ?
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Wouldn't it be great if cake adds a straight PHP equivalent on it's manual pages e.g redirection

2008-09-23 Thread gabriel

Wouldn't it be great if cake adds a straight PHP equivalent on it's
manual pages, for instance I want to redirect a page in straight PHP
it would be '  header("Location: index.php"); '  does any one know how
to do this in CAKE ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



dealing with sessions - should be a simple answer..

2008-09-22 Thread gabriel

Hi, I have a reasonable simple question for an experienced person..

I did authentication according to the cookbook, I want to access the
user id via session.

I do this in the user controller...
function login() {
  $userid = $this->Auth->user('id');
  $this->Session->write('id', $userid );
   }

Then I want to do this in the view..
read('id')); ?>

to see if I get the value, but it does not seems to work in the login
function, if you place it in the view function it works, but I need
the values to be set to the session at login.

Help will be greatly appreciated. thanks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Getting the session user_id, when login

2008-09-22 Thread gabriel

Hi, I have created an authentication according to the cookbook. I
login and check the sessions, I can get the user_id like
$_SESSION['Auth']['User']['id'], is there any better way of getting
the session value ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth component not working for me

2008-09-19 Thread gabriel

$this->Auth->allow('display','index','register');

you don't have a 'display' funtion in your controller..don't know much
maybe this is it.



On 15 Sep, 06:51, "Golam Kibria" <[EMAIL PROTECTED]> wrote:
> hello i have triedauthcomponent and is not working for me.
>
> here is my code
>
>  class UsersController extends AppController {
>
>         var $name = 'Users';
>         var $helpers = array('Html', 'Form', 'Time', 'Javascript');
>         var $components = array('Auth');
>
>         var $ext = '.php';
>
>         function beforeFilter(){
>                 //Security::setHash('md5');
>                  $this->Auth->fields = array('username'=>'username', 
> 'password'=>'password');
>                  $this->Auth->loginAction = array('controller' => 'users', 
> 'action'
> => 'login');
>                  $this->Auth->loginRedirect = array('controller' => 'users',
> 'action' => 'index');
>                  $this->Auth->allow('display','index','register');
>                  $this->Auth->authorize = 'controller';
>                  $this->Auth->userScope = array('User.status'=>1);
>         }
>         function isAuthorized() {
>                  return true;
>         }
>
>         //var $uses = array('Group');
>         //var $layout='tadmin';
>
>         function index() {
>
>                 $this->User->recursive = 0;
>                 $this->set('users', $this->paginate());
>
>                 //$this->Group->
>
>                 //print_r($this->paginate());
>         }
>
>         function view($id = null) {
>                 if (!$id) {
>                         $this->Session->setFlash(__('Invalid User.', true));
>                         $this->redirect(array('action'=>'index'));
>                 }
>                 $this->set('user', $this->User->read(null, $id));
>         }
>
>         function add() {
>                 if (!empty($this->data)) {
>                         
> $this->data['User']['password']=$this->Auth->password($this->data['User']['­password']);
>                         $this->User->create();
>                         if ($this->User->save($this->data)) {
>                                 $this->Session->setFlash(__('The User has 
> been saved', true));
>                                 $this->redirect(array('action'=>'index'));
>                         } else {
>                                 $this->Session->setFlash(__('The User could 
> not be saved. Please,
> try again.', true));
>                         }
>                 }
>
>                 $groups=$this->User->Group->find('list');
>                 //$groups=$this->User->Group->generateList(null, 'name ASC', 
> null,
> '{n}.Group.id', '{n}.Group.name');
>                 $this->set('groups',$groups);
>                 //print_r($groups);
>         }
>
>         function edit($id = null) {
>                 if (!$id && empty($this->data)) {
>                         $this->Session->setFlash(__('Invalid User', true));
>                         $this->redirect(array('action'=>'index'));
>                 }
>                 if (!empty($this->data)) {
>                         if ($this->User->save($this->data)) {
>                                 $this->Session->setFlash(__('The User has 
> been saved', true));
>                                 $this->redirect(array('action'=>'index'));
>                         } else {
>                                 $this->Session->setFlash(__('The User could 
> not be saved. Please,
> try again.', true));
>                         }
>                 }
>                 if (empty($this->data)) {
>                         $this->data = $this->User->read(null, $id);
>                 }
>                 $groups=$this->User->Group->find('list');
>                 $this->set('groups',$groups);
>         }
>
>         function delete($id = null) {
>                 if (!$id) {
>                         $this->Session->setFlash(__('Invalid id for User', 
> true));
>                         $this->redirect(array('action'=>'index'));
>                 }
>                 if ($this->User->del($id)) {
>                         $this->Session->setFlash(__('User deleted', true));
>                         $this->redirect(array('action'=>'index'));
>                 }
>         }
>
>         function register(){
>                 if(!empty($this->data)){
>                         $this->data['User']['status']=1;
>                         $this->data['User']['group_id']=3;
>                         $this->data['User']['password']=
> $this->Auth->password($this->data['User']['password']);
>                         $this->User->create();
>                         if($this->User->save($this->data)){
>                                 $this->Session->setFlash(__('User 
> Registration Complete',true));
>                                 $this->redirect(array('action'=>'index'));
>                         }else{
>                                 $this->Session->setFlash(__('Problem found. 
> Ple

Re: simple session question - for Authentication

2008-09-19 Thread Gabriel Kolbe

NOPE !!! sorry made a mistake, can't stick the $this->Auth->allow in
the app_controller...

On Fri, Sep 19, 2008 at 4:51 PM, gabriel <[EMAIL PROTECTED]> wrote:
>
> Hi, sorry..found the solution to allow pages without a controller -
> stick it in the app_controller.. which only leaves me know with the
> question..
>
> SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
> get all the sessions - see below..I want the user_id, I have tried
> print_r($_SESSION['Config']['User']['id']) which works but when I put
> in the
>
>
> link("My classified adds ", array("controller" =>
> "items", "action" =>
> "view", ".$_SESSION['Config']['User']['id']).")); ?>
>
>
> it does not work, any ideas, anyone??? I have tried $session-
>
>
>
>>read('id'), which does not work..( in the view)
>
>
> On 19 Sep, 16:45, gabriel <[EMAIL PROTECTED]> wrote:
>> Hi, Yes!! just figured it out as well
>>
>> function beforeFilter(){
>> $this->Auth->allow('add', '');
>>
>>   }
>>
>> How do you 'allow' page which is not in a controler??
>>
>> ~AND Any ideas on ...
>>
>> SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
>> get all the sessions - see below..I want the user_id, I have tried
>> print_r($_SESSION['Config']['User']['id']) which works but when I put
>> in the
>>
>> link("My classified adds ", array("controller" =>
>> "items", "action" =>
>> "view", ".$_SESSION['Config']['User']['id']).")); ?>
>>
>> it does not work, any ideas, anyone??? I have tried $session-
>>
>> >read('id'), which does not work..( in the view)
>>
>> On 19 Sep, 15:39, avairet <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > Hi,
>>
>> > Just an idea for the first issue: put " $this->Auth->allow('add') " in
>> > your "beforeFilter()" function!
>>
>> > On 19 sep, 16:31, gabriel <[EMAIL PROTECTED]> wrote:
>>
>> > > Hi, I have followed the Authentication in the Cookbook. I have a few
>> > > problems, maybe someone can help me. Firstly to 'allow' certain pages,
>> > > I place the $this->Auth->allow('add');  in the Users controller and
>> > > get and error, I have also tried to include it in the add and login
>> > > functions, but it does not seems to work, the error is
>>
>> > > Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
>> > > in C:\xampp\htdocs\testsite\app\controllers\users_controller.php on
>> > > line 8
>>
>> > > class UsersController extends AppController {
>>
>> > > var $name = 'Users';
>> > > var $helpers = array('Html', 'Form', 'Session');
>>
>> > > // var $components = array('Auth'); //declared in app_controller.php
>>
>> > >   $this->Auth->allow('add');
>>
>> > > SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
>> > > get all the sessions - see below..I want the user_id, I have tried
>> > > print_r($_SESSION['Config']['User']['id']) which works but when I put
>> > > in the
>>
>> > > link("My classified adds ", array("controller" =>
>> > > "items", "action" =>
>> > > "view", ".$_SESSION['Config']['User']['id']).")); ?>
>>
>> > > it does not work, any ideas, anyone??? I have tried $session-
>>
>> > > >read('id'), which does not work..( in the view)
>>
>> > > Array
>> > > (
>> > > [User] => Array
>> > > (
>> > > [id] => 3
>> > > [username] => test
>> > > [name] => piet
>> > > [lname] => test
>> > > [email] => [EMAIL PROTECTED]
>> > > [tell] => 123
>> > > [cell] => 321
>> > > [hnum] => 2
>> > > [street] => car
>> > > [city_id] =

Re: simple session question - for Authentication

2008-09-19 Thread gabriel

Hi, sorry..found the solution to allow pages without a controller -
stick it in the app_controller.. which only leaves me know with the
question..

SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
get all the sessions - see below..I want the user_id, I have tried
print_r($_SESSION['Config']['User']['id']) which works but when I put
in the


link("My classified adds ", array("controller" =>
"items", "action" =>
"view", ".$_SESSION['Config']['User']['id']).")); ?>


it does not work, any ideas, anyone??? I have tried $session-



>read('id'), which does not work..( in the view)


On 19 Sep, 16:45, gabriel <[EMAIL PROTECTED]> wrote:
> Hi, Yes!! just figured it out as well
>
> function beforeFilter(){
>     $this->Auth->allow('add', '');
>
>   }
>
> How do you 'allow' page which is not in a controler??
>
> ~AND Any ideas on ...
>
> SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
> get all the sessions - see below..I want the user_id, I have tried
> print_r($_SESSION['Config']['User']['id']) which works but when I put
> in the
>
> link("My classified adds ", array("controller" =>
> "items", "action" =>
> "view", ".$_SESSION['Config']['User']['id']).")); ?>
>
> it does not work, any ideas, anyone??? I have tried $session-
>
> >read('id'), which does not work..( in the view)
>
> On 19 Sep, 15:39, avairet <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > Just an idea for the first issue: put " $this->Auth->allow('add') " in
> > your "beforeFilter()" function!
>
> > On 19 sep, 16:31, gabriel <[EMAIL PROTECTED]> wrote:
>
> > > Hi, I have followed the Authentication in the Cookbook. I have a few
> > > problems, maybe someone can help me. Firstly to 'allow' certain pages,
> > > I place the $this->Auth->allow('add');  in the Users controller and
> > > get and error, I have also tried to include it in the add and login
> > > functions, but it does not seems to work, the error is
>
> > > Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
> > > in C:\xampp\htdocs\testsite\app\controllers\users_controller.php on
> > > line 8
>
> > > class UsersController extends AppController {
>
> > >         var $name = 'Users';
> > >         var $helpers = array('Html', 'Form', 'Session');
>
> > > // var $components = array('Auth'); //declared in app_controller.php
>
> > >   $this->Auth->allow('add');
>
> > > SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
> > > get all the sessions - see below..I want the user_id, I have tried
> > > print_r($_SESSION['Config']['User']['id']) which works but when I put
> > > in the
>
> > > link("My classified adds ", array("controller" =>
> > > "items", "action" =>
> > > "view", ".$_SESSION['Config']['User']['id']).")); ?>
>
> > > it does not work, any ideas, anyone??? I have tried $session-
>
> > > >read('id'), which does not work..( in the view)
>
> > > Array
> > > (
> > >     [User] => Array
> > >         (
> > >             [id] => 3
> > >             [username] => test
> > >             [name] => piet
> > >             [lname] => test
> > >             [email] => [EMAIL PROTECTED]
> > >             [tell] => 123
> > >             [cell] => 321
> > >             [hnum] => 2
> > >             [street] => car
> > >             [city_id] => 1
> > >             [county_id] => 2
> > >             [country_id] => 3
> > >             [pcode] => mnh
> > >             [admin] => 7
> > >             [maillist] => 0
> > >             [created] => -00-00 00:00:00
> > >             [modified] => -00-00 00:00:00
> > >             [ip] => 1
> > >             [last_visit] => 2011-11-01 00:00:00
> > >             [group_id] => 1
> > >             [active] => 0
> > >             [emailssend] => 

Re: simple session question - for Authentication

2008-09-19 Thread gabriel

Hi, Yes!! just figured it out as well

function beforeFilter(){
$this->Auth->allow('add', '');

  }

How do you 'allow' page which is not in a controler??

~AND Any ideas on ...

SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
get all the sessions - see below..I want the user_id, I have tried
print_r($_SESSION['Config']['User']['id']) which works but when I put
in the


link("My classified adds ", array("controller" =>
"items", "action" =>
"view", ".$_SESSION['Config']['User']['id']).")); ?>


it does not work, any ideas, anyone??? I have tried $session-



>read('id'), which does not work..( in the view)




On 19 Sep, 15:39, avairet <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Just an idea for the first issue: put " $this->Auth->allow('add') " in
> your "beforeFilter()" function!
>
> On 19 sep, 16:31, gabriel <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I have followed the Authentication in the Cookbook. I have a few
> > problems, maybe someone can help me. Firstly to 'allow' certain pages,
> > I place the $this->Auth->allow('add');  in the Users controller and
> > get and error, I have also tried to include it in the add and login
> > functions, but it does not seems to work, the error is
>
> > Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
> > in C:\xampp\htdocs\testsite\app\controllers\users_controller.php on
> > line 8
>
> > class UsersController extends AppController {
>
> >         var $name = 'Users';
> >         var $helpers = array('Html', 'Form', 'Session');
>
> > // var $components = array('Auth'); //declared in app_controller.php
>
> >   $this->Auth->allow('add');
>
> > SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
> > get all the sessions - see below..I want the user_id, I have tried
> > print_r($_SESSION['Config']['User']['id']) which works but when I put
> > in the
>
> > link("My classified adds ", array("controller" =>
> > "items", "action" =>
> > "view", ".$_SESSION['Config']['User']['id']).")); ?>
>
> > it does not work, any ideas, anyone??? I have tried $session-
>
> > >read('id'), which does not work..( in the view)
>
> > Array
> > (
> >     [User] => Array
> >         (
> >             [id] => 3
> >             [username] => test
> >             [name] => piet
> >             [lname] => test
> >             [email] => [EMAIL PROTECTED]
> >             [tell] => 123
> >             [cell] => 321
> >             [hnum] => 2
> >             [street] => car
> >             [city_id] => 1
> >             [county_id] => 2
> >             [country_id] => 3
> >             [pcode] => mnh
> >             [admin] => 7
> >             [maillist] => 0
> >             [created] => -00-00 00:00:00
> >             [modified] => -00-00 00:00:00
> >             [ip] => 1
> >             [last_visit] => 2011-11-01 00:00:00
> >             [group_id] => 1
> >             [active] => 0
> >             [emailssend] => 0
> >             [browser_id] => 1
> >             [screen] => 11
> >         )
>
> > )
> > Array
> > (
> >     [Config] => Array
> >         (
> >             [userAgent] => a8c0ddfcbb06197967f6ae13f3fdd732
> >             [time] => 1221835585
> >             [rand] => 21704
> >             [timeout] => 10
> >         )
>
> >     [Message] => Array
> >         (
> >         )
>
> >     [Auth] => Array
> >         (
> >             [User] => Array
> >                 (
> >                     [id] => 3
> >                     [username] => test
> >                     [name] => piet
> >                     [lname] => test
> >                     [email] => [EMAIL PROTECTED]
> >                     [tell] => 123
> >                     [cell] => 321
> >                     [hnum] => 2
> >                     [street] => car
> >                     [city_id] => 1
> >                     [county_id] => 2
> >                     [country_id] => 3
> >                     [pcode] => mnh
> >                     [admin] => 7
> >                     [maillist] => 0
> >                     [created] => -00-00 00:00:00
> >                     [modified] => -00-00 00:00:00
> >                     [ip] => 1
> >                     [last_visit] => 2011-11-01 00:00:00
> >                     [group_id] => 1
> >                     [active] => 0
> >                     [emailssend] => 0
> >                     [browser_id] => 1
> >                     [screen] => 11
> >                 )
>
> >         )
>
> > )
> > v- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



simple session question - for Authentication

2008-09-19 Thread gabriel

Hi, I have followed the Authentication in the Cookbook. I have a few
problems, maybe someone can help me. Firstly to 'allow' certain pages,
I place the $this->Auth->allow('add');  in the Users controller and
get and error, I have also tried to include it in the add and login
functions, but it does not seems to work, the error is

Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION
in C:\xampp\htdocs\testsite\app\controllers\users_controller.php on
line 8

class UsersController extends AppController {

var $name = 'Users';
var $helpers = array('Html', 'Form', 'Session');

// var $components = array('Auth'); //declared in app_controller.php


  $this->Auth->allow('add');

SECONDLY: I am trying to do a on sessions, if I do pr($_SESSION); I
get all the sessions - see below..I want the user_id, I have tried
print_r($_SESSION['Config']['User']['id']) which works but when I put
in the

link("My classified adds ", array("controller" =>
"items", "action" =>
"view", ".$_SESSION['Config']['User']['id']).")); ?>

it does not work, any ideas, anyone??? I have tried $session-
>read('id'), which does not work..( in the view)


Array
(
[User] => Array
(
[id] => 3
[username] => test
[name] => piet
[lname] => test
[email] => [EMAIL PROTECTED]
[tell] => 123
[cell] => 321
[hnum] => 2
[street] => car
[city_id] => 1
[county_id] => 2
[country_id] => 3
[pcode] => mnh
[admin] => 7
[maillist] => 0
[created] => -00-00 00:00:00
[modified] => -00-00 00:00:00
[ip] => 1
[last_visit] => 2011-11-01 00:00:00
[group_id] => 1
[active] => 0
[emailssend] => 0
[browser_id] => 1
[screen] => 11
)

)
Array
(
[Config] => Array
(
[userAgent] => a8c0ddfcbb06197967f6ae13f3fdd732
[time] => 1221835585
[rand] => 21704
[timeout] => 10
)

[Message] => Array
(
)

[Auth] => Array
(
[User] => Array
(
[id] => 3
[username] => test
[name] => piet
[lname] => test
[email] => [EMAIL PROTECTED]
[tell] => 123
[cell] => 321
[hnum] => 2
[street] => car
[city_id] => 1
[county_id] => 2
[country_id] => 3
[pcode] => mnh
[admin] => 7
[maillist] => 0
[created] => -00-00 00:00:00
[modified] => -00-00 00:00:00
[ip] => 1
[last_visit] => 2011-11-01 00:00:00
[group_id] => 1
[active] => 0
[emailssend] => 0
[browser_id] => 1
[screen] => 11
)

)

)
v
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



trying to make othAuth login process work

2008-09-18 Thread gabriel

Hi, I have carefully followed the othAuth doc
http://bakery.cakephp.org/articles/view/othauth-0-5-documentation,
trying to get it to work, bur when I go to 
http://127.0.0.1/testsite/users/login,

I get the following errors..

Username
Warning (512): Method HtmlHelper::input does not exist [CORE\cake\libs
\view\helper.php, line
(512): Method HtmlHelper::tagErrorMsg does
Warning (512): Method HtmlHelper::checkbox does not exist [CORE\cake
\libs\view\helper.php, line 148]

Any ideas..

here is the login.ctp view..

Log In:


Username
 input('User/username', array('id' =>
'user_username', 'size' => '50')) ?>
tagErrorMsg('User/username', 'Please enter your
username') ?>


Password
 input('User/passwd', array('id' =>
'user_passwd', 'size' => '32', 'type'=>"password")) ?>
tagErrorMsg('User/passwd', 'Please enter your
password!') ?>


 checkbox("User/cookie");?>



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Warning 512 - cache problem

2008-09-18 Thread gabriel

Hi!,

I hava a serious problem with recent 1.2 RC-2 - I use svn to control
my projects - at som,e point I decided to try out a new cake - when I
uploaded my app (from a windows machine) and checked it out on a linux
(debian+apache) machine it showed me an error saying that fiel engine
is not configured properly Warning 512 - I searched the forum and
found out that it is beacuse of cake's problem with urls - I commented
out one line in core.php and it dissapeared but since then none of the
urls works - it displays this url can not be found on the server - I
wqould like to use cake 1.2 as I consider it being more advanced than
1.1 but it is now a pain for me? Why is that happening? Anyone knows?

Regards,
Gabriel

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: getting cake bake to work on vista, xampp..

2008-09-17 Thread Gabriel Kolbe

Thanks a mil, got it working !!

On Wed, Sep 17, 2008 at 3:16 PM, Donkeybob <[EMAIL PROTECTED]> wrote:
>
> I got this to work on my vista machine but I didn't use the direct
> file name in the path, just try
>
> C:\xampp\php; C:\xamp\htdocs\testsite\cake\console
>
> It works like a charm for me
>
> On Sep 17, 9:25 am, gabriel <[EMAIL PROTECTED]> wrote:
>> hi, I would like to know if anyone can help me..
>> I am trying to get cake bake to work on vista, xampp, I have also
>> installed cygwin..
>>
>> I have included in my advanced->Enviroment Variables->path (edit)
>>
>> C:\xamp\php\php4\phpcli.exe;C:\xamp\htdocs\testsite\cake\console
>> \cake.bat
>>
>> yet when I type in ' cake bake ' in the command prompt -
>> 'cake' is not recognized as an internal or external command operable
>> program or batch file
>>
>> or cygwin prompt it says
>> bash: cake: command not found
>>
>> Thanks for your help in advance
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



getting cake bake to work on vista, xampp..

2008-09-17 Thread gabriel

hi, I would like to know if anyone can help me..
I am trying to get cake bake to work on vista, xampp, I have also
installed cygwin..

I have included in my advanced->Enviroment Variables->path (edit)

C:\xamp\php\php4\phpcli.exe;C:\xamp\htdocs\testsite\cake\console
\cake.bat

yet when I type in ' cake bake ' in the command prompt -
'cake' is not recognized as an internal or external command operable
program or batch file

or cygwin prompt it says
bash: cake: command not found

Thanks for your help in advance
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Making a simple link to another page

2008-09-12 Thread gabriel

I would like to make a simple link to a view which does not have a
controller and model, can anyone help me.
REgards
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: making a view without a controller or model

2008-09-12 Thread gabriel

~Thanks !!

On 12 Sep, 15:28, grigri <[EMAIL PROTECTED]> wrote:
> The url you want is : /pages/account - that will get it to display
>
> If you want to access it via /account then add this line to app/config/
> routes.php:
>
> Router::connect('/account', array('controller' => 'pages', 'action' =>
> 'view', 'account'));
>
> hth
> grigri
>
> On Sep 12, 2:59 pm, gabriel <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I am new, as you might guess.., I have created an (HTML) view in
> > the pages folder in views, called account.ctp. It doesn't have a
> > controller or model. But is looking for a controller. How do I get
> > around this?
>
> > Thanks and blessings to the person who helps me.- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



making a view without a controller or model

2008-09-12 Thread gabriel

Hi, I am new, as you might guess.., I have created an (HTML) view in
the pages folder in views, called account.ctp. It doesn't have a
controller or model. But is looking for a controller. How do I get
around this?

Thanks and blessings to the person who helps me.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Help with installation cakephp on xamp package

2008-09-10 Thread gabriel

Hi, all. I have been reading a book by APRESS, called 'Beginning
CakePHP from novice to Professional' in it, it says that if you have
installed cake, and get the starting up screen without the fonts and
colours on the page working then, there is an error. Cake will work
but the scaffolding and other things might get errors..

I have tried EVERTHING, I have uncommented the 'LoadModule
rewrite_module modules/mod_rewrite.so', I have shared (in Vista) the
app folder, I have included the following

Options Indexes FollowSymLinks
AllowOverride ALL

in the httpd.conf folder...
And restarted the server, and it does not seems to fix the problem, I
have been going on with CAke and all seems fine, but sometimes I get
errors, then I doubt myself, I don't know if it is my configuration or
my coding...I would just like to know that everything works the way it
is suppose to..

hope is all make sense, and someone can help..

Thanks
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



missing view

2008-09-08 Thread gabriel

Hi, I am new to cake and are really frustrated with the basics. I have
created a default.thml in layouts, with the code , then I created a test.thtml in pages, I point
the server to it and get a missing view error - anyone any ideas?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---