Friday, December 31, 2010

Re: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

I think what AD was saying is that the primary purpose of a UUID *when compared with an integer* is that it is globally unique across all servers, not just 'this' server, which of course I forgot to point out in my original reply. This means you have a choice of data type when creating a primary key, both of which have pros/cons. However, it is still a primary key, which has the primary purpose of ensuring data/model integrity.

As far as coding data saves, see http://book.cakephp.org/view/75/Saving-Your-Data for full details.

On 31 Dec 2010, at 17:09, John Maxim wrote:

So normally we don't use char(36) ? and its primary purpose is not for
data /model integrity .. if I hear you right, AD.

Is the Model::save method the way we usually save by calling

function add()
{
}

are there additional steps ?

thanks, best regards.
Maxim


On Dec 29 2010, 7:29 am, AD7six <andydawso...@gmail.com> wrote:
On Dec 28, 3:55 am, John Maxim <goog...@gmail.com> wrote:

Hi Jeremy, Thanks for your link will definitely look into that.

~~Continue my question~~
I was going to ask about using this:http://book.cakephp.org/view/1027/query

There are 2 options if I'm correct based on cookbook 1.3
~~
Rather than using an auto-increment key as the primary key, you may
also use char(36). Cake will then use a unique 36 character uuid
(String::uuid) whenever you save a new record using the Model::save
method.

according to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
~~
What's the advantage of using char(36) ?

A uuid (a 36 char string) is unique - always. It's main purpose is to
be unique, nothing else. Obfuscation is a side effect, not the goal.

They are most relevant with distributed datastores whereby you need to
synchronize data and inserts across multiple servers. An insert on
server A can safely and without concern be replicated to server B
because a row with the same ID cannot exist originating from another
server.

http://en.wikipedia.org/wiki/Universally_unique_identifier

AD

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

Re: Urgent Help: Path for Production environment..

Slight typo: it is of course /cake/libs/controllers, not /cake/libs/controller.

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 1 Jan 2011, at 06:27, Jeremy Burns | Class Outfit wrote:

> This is the standard way of doing things. The /cake/libs folder contains /controller/pages_controller.php and /views/pages/home.ctp that provide the default home page. There is also a default layout. You should never adjust these as it breaks the upgrade path, but one of the first things you should do when developing an app is to copy these into the /app directory and customise as you wish (although I tend to leave the controller as and where it is). Then you can create your own css stylesheet and replace the default Cake one in the default layout and your site starts to like like your own.
>
> Jeremy Burns
> Class Outfit
>
> jeremyburns@classoutfit.com
> http://www.classoutfit.com
>
> On 1 Jan 2011, at 04:31, John Maxim wrote:
>
>> Since I found a solution, share this if someone facing this too it may
>> help..
>>
>> not sure if it's exactly suggested production setting (installation)
>>
>> I copied and pasted home.ctp from cake/ to my app/views/pages
>>
>> from here I edit the home.ctp and works fine.
>>
>> reference: IRC cakephp user: know1edge
>>
>> Regards,
>> Maxim
>>
>> On Dec 31 2010, 10:22 pm, John Maxim <goog...@gmail.com> wrote:
>>> Hi people,
>>> I need this solved, help if you can. how exactly do I start my page at
>>> localhost/ without displaying Cake's system info page..?
>>> Rgds,
>>> Maxim
>>>
>>> On Dec 31, 9:00 pm, John Maxim <goog...@gmail.com> wrote:
>>>
>>>> Hello everyone,
>>>
>>>> My index now is in my root */www/
>>>
>>>> Anyone knows how to remove the cake system page ? now it just display
>>>> the Cake system page everytime it is routed tohttp://localhost/
>>>
>>>> I need it to be a customised page, such as, "Welcome to ABC company
>>>> etc... "
>>>
>>>> Urgently need help with this.
>>>
>>>> Regards,
>>>> Maxim
>>>
>>>> On Dec 30, 8:43 pm, John Maxim <goog...@gmail.com> wrote:
>>>
>>>>> My document root is:
>>>
>>>>> DocumentRoot "c:/wamp/www/"
>>>
>>>>> Isn't it already pointing to the correct folder ?
>>>
>>>>> Regards,
>>>>> Maxim
>>>
>>>>> On Dec 30, 8:37 pm, John Maxim <goog...@gmail.com> wrote:
>>>
>>>>>> http://book.cakephp.org/view/914/Production
>>>
>>>>>> Hi, following the above link, I tried to build my App so it starts
>>>>>> here:
>>>>>> ------http://localhost/
>>>>>> ------
>>>>>> I don't understand the link above..
>>>
>>>>>> I unzipped the cake's folder into my root which is in */www/ and
>>>>>> renamed the index.php file to something else but it still brings up
>>>>>> the cake system information page each time I loadhttp://localhost/
>>>
>>>>>> Can someone share how to remove or rename/replace the cake's index
>>>>>> page to somewhere so I can start my app athttp://localhost
>>>
>>>>>> Thanks,
>>>>>> Maxim
>>
>> 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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Urgent Help: Path for Production environment..

This is the standard way of doing things. The /cake/libs folder contains /controller/pages_controller.php and /views/pages/home.ctp that provide the default home page. There is also a default layout. You should never adjust these as it breaks the upgrade path, but one of the first things you should do when developing an app is to copy these into the /app directory and customise as you wish (although I tend to leave the controller as and where it is). Then you can create your own css stylesheet and replace the default Cake one in the default layout and your site starts to like like your own.

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 1 Jan 2011, at 04:31, John Maxim wrote:

> Since I found a solution, share this if someone facing this too it may
> help..
>
> not sure if it's exactly suggested production setting (installation)
>
> I copied and pasted home.ctp from cake/ to my app/views/pages
>
> from here I edit the home.ctp and works fine.
>
> reference: IRC cakephp user: know1edge
>
> Regards,
> Maxim
>
> On Dec 31 2010, 10:22 pm, John Maxim <goog...@gmail.com> wrote:
>> Hi people,
>> I need this solved, help if you can. how exactly do I start my page at
>> localhost/ without displaying Cake's system info page..?
>> Rgds,
>> Maxim
>>
>> On Dec 31, 9:00 pm, John Maxim <goog...@gmail.com> wrote:
>>
>>> Hello everyone,
>>
>>> My index now is in my root */www/
>>
>>> Anyone knows how to remove the cake system page ? now it just display
>>> the Cake system page everytime it is routed tohttp://localhost/
>>
>>> I need it to be a customised page, such as, "Welcome to ABC company
>>> etc... "
>>
>>> Urgently need help with this.
>>
>>> Regards,
>>> Maxim
>>
>>> On Dec 30, 8:43 pm, John Maxim <goog...@gmail.com> wrote:
>>
>>>> My document root is:
>>
>>>> DocumentRoot "c:/wamp/www/"
>>
>>>> Isn't it already pointing to the correct folder ?
>>
>>>> Regards,
>>>> Maxim
>>
>>>> On Dec 30, 8:37 pm, John Maxim <goog...@gmail.com> wrote:
>>
>>>>> http://book.cakephp.org/view/914/Production
>>
>>>>> Hi, following the above link, I tried to build my App so it starts
>>>>> here:
>>>>> ------http://localhost/
>>>>> ------
>>>>> I don't understand the link above..
>>
>>>>> I unzipped the cake's folder into my root which is in */www/ and
>>>>> renamed the index.php file to something else but it still brings up
>>>>> the cake system information page each time I loadhttp://localhost/
>>
>>>>> Can someone share how to remove or rename/replace the cake's index
>>>>> page to somewhere so I can start my app athttp://localhost
>>
>>>>> Thanks,
>>>>> Maxim
>
> 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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Hi need Help: How to log-out from Acl ?

Here's some sample code that you can place in an element and drop it in to views as and when needed:

<?php
if ($this->Session->check('Auth.User')):
echo $this->Html->link(
'Log Out',
array(
'controller' => 'users',
'action' => 'logout'
)
);
else:
echo $this->Html->link(
'Log In',
array(
'controller' => 'users',
'action' => 'login'
)
);
endif;
?>

I usually include this as part of my site navigation so that it is always available. You can also add links such as 'Your Details' to the logged in piece, and 'Register' to the logged out piece.

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 1 Jan 2011, at 03:17, John Maxim wrote:

> Hi, thanks for the reply..
>
> function logout() {
> $this->Session->setFlash('Good-Bye');
> $this->redirect($this->Auth->logout());
> }
>
> I created it in usersController alright. I access it by creating a
> link to it am I correct?
>
> I'm looking for a uniform way to put it in one single place so it can
> be viewed 'only' after logging into users, groups, posts, and
> widgets.
>
> Can it be accomplished?
>
> (1)
> I could do this:
>
> <p><?php echo $html->link('logout', array('action' => 'logout')); ?>
>
> and place it on the indexes of groups, users, posts, widgets.. But I
> would need to create addition of 3 more function logout() for each of
> the 3 controllers.
>
> (2)
> But the link logout is displayed even we're not logged in. Is it we
> need to use Access method from the views? as attempted but failed in
> this post:
> http://groups.google.com/group/cake-php/browse_thread/thread/478daa30a5c26e18
> I posted a solution but the Access for some reason wasn't called and
> the links for edit and delete were never displayed regardless of
> loggin status.
> http://groups.google.com/group/cake-php/browse_thread/thread/8a4aa81664b5a96d
>
> Furthermore, the tutorial says it was like a 'hack' to get access
> component working in views I wonder if there's a proper way to do this
> without breaking MVC Cake convention.
> The tutorial for Access to work in Views:
> http://net.tutsplus.com/tutorials/php/how-to-use-cakephps-access-control-lists/
>
>
>
> Regards,
> Maxim
>
>
> On Jan 1, 3:18 am, AD7six <andydawso...@gmail.com> wrote:
>> On Dec 31, 3:01 pm, John Maxim <goog...@gmail.com> wrote:
>>
>>> Hi,
>>
>>> I'm right here:http://book.cakephp.org/view/1552/Logout
>>
>>> May I ask if anyone could help to point out how exactly am I to log-
>>> out now ??
>>
>> You access the function logout which after following the tutorial you
>> will have created in your users controller.
>>
>>
>>
>>> I went through some comments on that page suggested to
>>
>>> $this->Auth->allowedActions = array('logout');
>>
>> for what reason?
>>
>>
>>
>>> What's your suggestion?
>>
>> You could start with explaining in what way the tutorial you're
>> following isn't working with exactly what you're doing and what you're
>> expecting to happen
>>
>> AD
>
> 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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Running a function in URL only once ?

Hi,

I'm still thinking why I could only run this function once in my url,
after acos table is populated with data, I tried to run once again, it
doesn't work anymore. What's the reason? Aren't we supposed to run it
to update new acos ?

The url won't load and says make sure to create a file named build_acl
in my users model / groups model--which is the function's name.
Link here: http://book.cakephp.org/view/1549/An-Automated-tool-for-creating-ACOs

~~
function build_acl() {
if (!Configure::read('debug')) {
return $this->_stop();
}
$log = array();

$aco =& $this->Acl->Aco;
$root = $aco->node('controllers');
if (!$root) {
$aco->create(array('parent_id' => null, 'model' => null, 'alias' =>
'controllers'));
$root = $aco->save();
$root['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for controllers';
} else {
$root = $root[0];
}

App::import('Core', 'File');
$Controllers = Configure::listObjects('controller');
$appIndex = array_search('App', $Controllers);
if ($appIndex !== false ) {
unset($Controllers[$appIndex]);
}
$baseMethods = get_class_methods('Controller');
$baseMethods[] = 'build_acl';

$Plugins = $this->_getPluginControllerNames();
$Controllers = array_merge($Controllers, $Plugins);

// look at each controller in app/controllers
foreach ($Controllers as $ctrlName) {
$methods = $this->_getClassMethods($this-
>_getPluginControllerPath($ctrlName));

// Do all Plugins First
if ($this->_isPlugin($ctrlName)){
$pluginNode = $aco->node('controllers/'.$this-
>_getPluginName($ctrlName));
if (!$pluginNode) {
$aco->create(array('parent_id' => $root['Aco']['id'], 'model' =>
null, 'alias' => $this->_getPluginName($ctrlName)));
$pluginNode = $aco->save();
$pluginNode['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for ' . $this-
>_getPluginName($ctrlName) . ' Plugin';
}
}
// find / make controller node
$controllerNode = $aco->node('controllers/'.$ctrlName);
if (!$controllerNode) {
if ($this->_isPlugin($ctrlName)){
$pluginNode = $aco->node('controllers/' . $this-
>_getPluginName($ctrlName));
$aco->create(array('parent_id' => $pluginNode['0']['Aco']['id'],
'model' => null, 'alias' => $this-
>_getPluginControllerName($ctrlName)));
$controllerNode = $aco->save();
$controllerNode['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for ' . $this-
>_getPluginControllerName($ctrlName) . ' ' . $this-
>_getPluginName($ctrlName) . ' Plugin Controller';
} else {
$aco->create(array('parent_id' => $root['Aco']['id'], 'model' =>
null, 'alias' => $ctrlName));
$controllerNode = $aco->save();
$controllerNode['Aco']['id'] = $aco->id;
$log[] = 'Created Aco node for ' . $ctrlName;
}
} else {
$controllerNode = $controllerNode[0];
}

//clean the methods. to remove those in Controller and private
actions.
foreach ($methods as $k => $method) {
if (strpos($method, '_', 0) === 0) {
unset($methods[$k]);
continue;
}
if (in_array($method, $baseMethods)) {
unset($methods[$k]);
continue;
}
$methodNode = $aco->node('controllers/'.$ctrlName.'/'.$method);
if (!$methodNode) {
$aco->create(array('parent_id' => $controllerNode['Aco']['id'],
'model' => null, 'alias' => $method));
$methodNode = $aco->save();
$log[] = 'Created Aco node for '. $method;
}
}
}
if(count($log)>0) {
debug($log);
}
}

function _getClassMethods($ctrlName = null) {
App::import('Controller', $ctrlName);
if (strlen(strstr($ctrlName, '.')) > 0) {
// plugin's controller
$num = strpos($ctrlName, '.');
$ctrlName = substr($ctrlName, $num+1);
}
$ctrlclass = $ctrlName . 'Controller';
$methods = get_class_methods($ctrlclass);

// Add scaffold defaults if scaffolds are being used
$properties = get_class_vars($ctrlclass);
if (array_key_exists('scaffold',$properties)) {
if($properties['scaffold'] == 'admin') {
$methods = array_merge($methods, array('admin_add', 'admin_edit',
'admin_index', 'admin_view', 'admin_delete'));
} else {
$methods = array_merge($methods, array('add', 'edit', 'index',
'view', 'delete'));
}
}
return $methods;
}

function _isPlugin($ctrlName = null) {
$arr = String::tokenize($ctrlName, '/');
if (count($arr) > 1) {
return true;
} else {
return false;
}
}

function _getPluginControllerPath($ctrlName = null) {
$arr = String::tokenize($ctrlName, '/');
if (count($arr) == 2) {
return $arr[0] . '.' . $arr[1];
} else {
return $arr[0];
}
}

function _getPluginName($ctrlName = null) {
$arr = String::tokenize($ctrlName, '/');
if (count($arr) == 2) {
return $arr[0];
} else {
return false;
}
}

function _getPluginControllerName($ctrlName = null) {
$arr = String::tokenize($ctrlName, '/');
if (count($arr) == 2) {
return $arr[1];
} else {
return false;
}
}

/**
* Get the names of the plugin controllers ...
*
* This function will get an array of the plugin controller names, and
* also makes sure the controllers are available for us to get the
* method names by doing an App::import for each plugin controller.
*
* @return array of plugin names.
*
*/
function _getPluginControllerNames() {
App::import('Core', 'File', 'Folder');
$paths = Configure::getInstance();
$folder =& new Folder();
$folder->cd(APP . 'plugins');

// Get the list of plugins
$Plugins = $folder->read();
$Plugins = $Plugins[0];
$arr = array();

// Loop through the plugins
foreach($Plugins as $pluginName) {
// Change directory to the plugin
$didCD = $folder->cd(APP . 'plugins'. DS . $pluginName . DS .
'controllers');
// Get a list of the files that have a file name that ends
// with controller.php
$files = $folder->findRecursive('.*_controller\.php');

// Loop through the controllers we found in the plugins directory
foreach($files as $fileName) {
// Get the base file name
$file = basename($fileName);

// Get the controller name
$file = Inflector::camelize(substr($file, 0, strlen($file)-
strlen('_controller.php')));
if (!preg_match('/^'. Inflector::humanize($pluginName). 'App/',
$file)) {
if (!App::import('Controller', $pluginName.'.'.$file)) {
debug('Error importing '.$file.' for plugin '.$pluginName);
} else {
/// Now prepend the Plugin name ...
// This is required to allow us to fetch the method names.
$arr[] = Inflector::humanize($pluginName) . "/" . $file;
}
}
}
}
return $arr;
}
~~

happy new year 2011, regards.
Maxim

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

Re: Urgent Help: Path for Production environment..

Since I found a solution, share this if someone facing this too it may
help..

not sure if it's exactly suggested production setting (installation)

I copied and pasted home.ctp from cake/ to my app/views/pages

from here I edit the home.ctp and works fine.

reference: IRC cakephp user: know1edge

Regards,
Maxim

On Dec 31 2010, 10:22 pm, John Maxim <goog...@gmail.com> wrote:
> Hi people,
> I need this solved, help if you can. how exactly do I start my page at
> localhost/ without displaying Cake's system info page..?
> Rgds,
> Maxim
>
> On Dec 31, 9:00 pm, John Maxim <goog...@gmail.com> wrote:
>
> > Hello everyone,
>
> > My index now is in my root */www/
>
> > Anyone knows how to remove the cake system page ? now it just display
> > the Cake system page everytime it is routed tohttp://localhost/
>
> > I need it to be a customised page, such as, "Welcome to ABC company
> > etc... "
>
> > Urgently need help with this.
>
> > Regards,
> > Maxim
>
> > On Dec 30, 8:43 pm, John Maxim <goog...@gmail.com> wrote:
>
> > > My document root is:
>
> > > DocumentRoot "c:/wamp/www/"
>
> > > Isn't it already pointing to the correct folder ?
>
> > > Regards,
> > > Maxim
>
> > > On Dec 30, 8:37 pm, John Maxim <goog...@gmail.com> wrote:
>
> > > >http://book.cakephp.org/view/914/Production
>
> > > > Hi, following the above link, I tried to build my App so it starts
> > > > here:
> > > > ------http://localhost/
> > > > ------
> > > > I don't understand the link above..
>
> > > > I unzipped the cake's folder into my root which is in */www/ and
> > > > renamed the index.php file to something else but it still brings up
> > > > the cake system information page each time I loadhttp://localhost/
>
> > > > Can someone share how to remove or rename/replace the cake's index
> > > > page to somewhere so I can start my app athttp://localhost
>
> > > > Thanks,
> > > > Maxim

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

Re: Add User/Group in Descending Order by Time(Last Add)

SELECT * FROM users;

On Jan 1, 3:20 am, AD7six <andydawso...@gmail.com> wrote:
> On Dec 31, 3:10 pm, John Maxim <goog...@gmail.com> wrote:
>
> > I understand but looking at the admin page it just goes along with the
> > original arrangement as in MySQL database. Are you suggesting to
> > rewrite the display page for the data I want displayed ?
>
> what sql query is generating your results.
>
> AD

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

Re: Hi need Help: How to log-out from Acl ?

Hi, thanks for the reply..

function logout() {
$this->Session->setFlash('Good-Bye');
$this->redirect($this->Auth->logout());
}

I created it in usersController alright. I access it by creating a
link to it am I correct?

I'm looking for a uniform way to put it in one single place so it can
be viewed 'only' after logging into users, groups, posts, and
widgets.

Can it be accomplished?

(1)
I could do this:

<p><?php echo $html->link('logout', array('action' => 'logout')); ?>

and place it on the indexes of groups, users, posts, widgets.. But I
would need to create addition of 3 more function logout() for each of
the 3 controllers.

(2)
But the link logout is displayed even we're not logged in. Is it we
need to use Access method from the views? as attempted but failed in
this post:
http://groups.google.com/group/cake-php/browse_thread/thread/478daa30a5c26e18
I posted a solution but the Access for some reason wasn't called and
the links for edit and delete were never displayed regardless of
loggin status.
http://groups.google.com/group/cake-php/browse_thread/thread/8a4aa81664b5a96d

Furthermore, the tutorial says it was like a 'hack' to get access
component working in views I wonder if there's a proper way to do this
without breaking MVC Cake convention.
The tutorial for Access to work in Views:
http://net.tutsplus.com/tutorials/php/how-to-use-cakephps-access-control-lists/

Regards,
Maxim


On Jan 1, 3:18 am, AD7six <andydawso...@gmail.com> wrote:
> On Dec 31, 3:01 pm, John Maxim <goog...@gmail.com> wrote:
>
> > Hi,
>
> > I'm right here:http://book.cakephp.org/view/1552/Logout
>
> > May I ask if anyone could help to point out how exactly am I to log-
> > out now ??
>
> You access the function logout which after following the tutorial you
> will have created in your users controller.
>
>
>
> > I went through some comments on that page suggested to
>
> > $this->Auth->allowedActions = array('logout');
>
> for what reason?
>
>
>
> > What's your suggestion?
>
> You could start with explaining in what way the tutorial you're
> following isn't working with exactly what you're doing and what you're
> expecting to happen
>
> AD

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

Re: Hi need Help: How to log-out from Acl ?

On Dec 31, 3:01 pm, John Maxim <goog...@gmail.com> wrote:
> Hi,
>
> I'm right here:http://book.cakephp.org/view/1552/Logout
>
> May I ask if anyone could help to point out how exactly am I to log-
> out now ??

You access the function logout which after following the tutorial you
will have created in your users controller.

>
> I went through some comments on that page suggested to

>
> $this->Auth->allowedActions = array('logout');

for what reason?

>
> What's your suggestion?

You could start with explaining in what way the tutorial you're
following isn't working with exactly what you're doing and what you're
expecting to happen

AD

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

Re: post form data from URL

On Fri, Dec 31, 2010 at 8:31 AM, Steve Mallett <steve.mallett@gmail.com> wrote:
> Sorry, I thought you were suggesting the routing wasn't needed.  I
> replace it, added your debug code suggestion & this is the result:
>
> URL address: http://localhost/links/add/http://www.youtube.com/watch%3Fv%3DvDVnuFxsfbE
> URL passed to form currently: www.youtube.com
> debug result:
>
> array(8) { ["controller"]=> string(5) "links" ["action"]=> &string(3)
> "add" ["named"]=> array(1) { ["http"]=> string(0) "" } ["pass"]=>
> array(2) { [0]=> string(15) "www.youtube.com" [1]=> string(5) "watch"
> } ["plugin"]=> NULL ["form"]=> array(0) { } ["url"]=> array(2) {
> ["url"]=> string(37) "links/add/http:/www.youtube.com/watch" ["v"]=>
> string(11) "vDVnuFxsfbE" } ["models"]=> array(1) { [0]=> string(4)
> "Link" } }
>
>
> Current routing code:
> Router::connect(
>               '/links/add/:url',
>               array(
>                       'controller' => 'links',
>                       'action' => 'add'
>               ),
>               array(
>                       //Looks for http://
>                                        'url' => '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
>                       // passes it
>                                        'pass' => array('url')
>               )
>        );
> ------------
> add.ctp:
> echo $this->Form->input('Link.url', array('value' => $url, 'type' => 'text'));

A light bulb just clicked on. Instead of calling your param 'url', try
something like 'link', or 'foo', etc. Cake also uses 'url' for routes.

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

Re: Downloadable files without mod_rewrite

On Fri, Dec 31, 2010 at 7:01 AM, WhyNotSmile <sharongilmore78@gmail.com> wrote:
> Debug is set to 2, but it's not throwing any error messages, or even
> the SQL output.  Is there a setting that would be supressing that
> output?

Oops! Of course, debug has to be set to 0 for MediaView's render(),
actually. What you could do is add this at the beginning of the
action:

Configure::write('debug', 2);
die(debug('found download action'));

That'll tell you if the action is at least truly being found. But, if
you're not setting debug to 0 yourself, and Media doesn't do it
anywhere, AFAIK, maybe this really is an authentic 404. That could be
a routing issue (do you have anything in you routes that could be
interfering?) or, as you suggested, the lack of mod_rewrite. In which
case, I can't think of how to resolve this.

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

Re: Downloadable files without mod_rewrite

I found output'ing the mediaview params to be helpful
in my case I was missing some slashes in the path

 - S




On 31 December 2010 12:01, WhyNotSmile <sharongilmore78@gmail.com> wrote:
Debug is set to 2, but it's not throwing any error messages, or even
the SQL output.  Is there a setting that would be supressing that
output?

Thanks


On Dec 30, 7:21 pm, cricket <zijn.digi...@gmail.com> wrote:
> On Thu, Dec 30, 2010 at 10:28 AM, WhyNotSmile <sharongilmor...@gmail.com> wrote:
> > I'm trying to create a link on my page to download a file.  However,
> > the server won't let me use mod_rewrite, and I'm having problems
> > getting the download to work.  I googled the problem, and made some
> > progress.
>
> > So far, I have:
>
> > In the view, the link to download the file is:
>
> >    <?php echo $this->Html->link('Download File', '/downloads/
> > download', array('class' => 'bluelink'));?>
>
> > I have a controller called downloads_controller.php which contains:
>
> > <?php
> > class DownloadsController extends AppController {
>
> >  function download () {
> >  $this->view = 'Media';
> >  $params = array(
> >   'id' => 'constition.pdf', // hard-coded for now
> >   'name' => 'constitution',
> >   'download' => true,
> >   'extension' => 'pdf',
> >   'path' => APP . 'files' . DS
> >  );
> >  $this->set($params);
> >  }
> > }
>
> > The file is in the directory 'app/files'.
>
> > When I click on the link in the view I get:
>
> >     Not Found
>
> >     Error: The requested address '/downloads/download' was not found
> > on this server.
>
> > Does anyone have any ideas as to what else I should be doing?
>
> Set debug to 2 in core.php. Cake throws a 404 when it encounters an
> error and is in production mode.

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

Re: Any Test on Test Suite?

on lines 16 & 17 of Mark Storys test he imports parts of the app required to perform the test

on line 60 the AclComp is used to generate a mock instance for use with the testcase created on line 67

--

by importing I meant `App::import`
http://book.cakephp.org/view/1644/App

On 31 December 2010 16:46, John Maxim <googol6@gmail.com> wrote:

Actually I don't get what you mean by importing .. is that a script
generally used?..

Regards,
Maxim, John.

On Dec 28 2010, 1:01 pm, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> App::import the parts of cake needed by your tests
>
> Seehttps://github.com/markstory/cakephp_menu_component/blob/master/tests...
>
>  - S
>
> On 28 December 2010 04:54, John Maxim <goog...@gmail.com> wrote:
>
> > I went through Testing athttp://book.cakephp.org/view/1196/Testing
>
> > Can we create any kind of test in that suite? Are there limitations to
> > what we are able to test ? or what we can't test on the Test Suite?
>
> > Let's say I want to test ACL scripts on the Test Suite?
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For 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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Urgent Help needed: How to Correct this table so it doesn't have Composite Primary Key?

So normally we don't use char(36) ? and its primary purpose is not for
data /model integrity .. if I hear you right, AD.

Is the Model::save method the way we usually save by calling

function add()
{
}

are there additional steps ?

thanks, best regards.
Maxim


On Dec 29 2010, 7:29 am, AD7six <andydawso...@gmail.com> wrote:
> On Dec 28, 3:55 am, John Maxim <goog...@gmail.com> wrote:
>
> > Hi Jeremy, Thanks for your link will definitely look into that.
>
> > ~~Continue my question~~
> > I was going to ask about using this:http://book.cakephp.org/view/1027/query
>
> > There are 2 options if I'm correct based on cookbook 1.3
> > ~~
> > Rather than using an auto-increment key as the primary key, you may
> > also use char(36). Cake will then use a unique 36 character uuid
> > (String::uuid) whenever you save a new record using the Model::save
> > method.
>
> > according to:http://book.cakephp.org/view/903/Model-and-Database-Conventions
> > ~~
> > What's the advantage of using char(36) ?
>
> A uuid (a 36 char string) is unique - always. It's main purpose is to
> be unique, nothing else. Obfuscation is a side effect, not the goal.
>
> They are most relevant with distributed datastores whereby you need to
> synchronize data and inserts across multiple servers. An insert on
> server A can safely and without concern be replicated to server B
> because a row with the same ID cannot exist originating from another
> server.
>
> http://en.wikipedia.org/wiki/Universally_unique_identifier
>
> AD

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

Re: Any Test on Test Suite?

Actually I don't get what you mean by importing .. is that a script
generally used?..

Regards,
Maxim, John.

On Dec 28 2010, 1:01 pm, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> App::import the parts of cake needed by your tests
>
> Seehttps://github.com/markstory/cakephp_menu_component/blob/master/tests...
>
>  - S
>
> On 28 December 2010 04:54, John Maxim <goog...@gmail.com> wrote:
>
> > I went through Testing athttp://book.cakephp.org/view/1196/Testing
>
> > Can we create any kind of test in that suite? Are there limitations to
> > what we are able to test ? or what we can't test on the Test Suite?
>
> > Let's say I want to test ACL scripts on the Test Suite?
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Help on Routes, should we use it ?

Thanks..wow, cricket your explanation is way advanced for me. But I
got the concept...thanks everyone.

regards,
Maxim

On Dec 29, 10:29 am, cricket <zijn.digi...@gmail.com> wrote:
> On Tue, Dec 28, 2010 at 10:14 AM, John Maxim <goog...@gmail.com> wrote:
> > Refer to link below:
> >http://book.cakephp.org/view/1541/Routes
>
> > I don't understand. What does it accomplish ??
>
> > Do we normally change the route as shown from the link above ?
>
> Cake's routes default to:
>
> /controller/action/param
>
> So, if you had a BookController, to view a specific Book, you'd have
> something like:
>
> /books/view/42
>
> ... where 42 is the $id of this Book. However, you might instead want
> to have URLs like:
>
> /books/alice-in-wonderland
>
> ... in which case, you'd want a route like so:
>
> Router::connect(
>         '/books/:slug',
>         array(
>                 'controller' => 'books',
>                 'action' => 'view',
>         ),
>         array(
>                 'slug' => '[-a-z0-9]+',
>                 'pass' => array('slug')
>         )
> );
>
> So, Book.slug must be contain only lowercase alpha chars, integers, or
> hyphens. And your Book model would have:
>
> public $actsAs = array(
>         'Sluggable' => array(
>                 'translation' => 'utf-8',
>                 'separator' => '-',
>                 'label' => 'title',
>                 'length' => 64,
>                 'overwrite' => true
>         )
> );
>
> Note the separator is a hyphen. It can also be an underscore, or
> whatever. Just ensure the route regexp is set up for that.
>
> Your action would then be defined as:
>
> public function view($slug = null) {
>
> Meanwhile, to create a link in a view (other mark-up aside):
>
> foreach ($data as $d)
> {
>         echo $this->Html->link(
>                 $d['Book']['title'],
>                 array(
>                         'controller' => 'books',
>                         'action' => 'view',
>                         'slug' => $d['Book']['slug']
>                 ),
>                 array('title' => 'read this book')
>         );
>
> }
>
> Note that 'slug' is passed in the first array, whereas it's in the
> second array in the route definition. If it's an admin route, you pass
> 'admin' => 1 in the first array for both link and route, and the URL
> would be '/admin/...' inthe route.

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

Re: Scaffolding vs Bake

I appreciate this discussion, thanks everyone..

rgds,
Maxim

On Dec 30, 5:18 am, "Larry E. Masters" <php...@gmail.com> wrote:
> Larry pointed this out earlier
>
>
>
>
>
> >> you might add a new table to your database, it is easier to create the
> >> controller/model combination while you are creating all of the fields in
> >> your new table and see how it is working instead of going to the command
> >> line every change you make.
>
> > scaffolding is use for rough prototyping and is not for actual use;  in
> > architectural terms you use the scaffolding erect the initial structure your
> > still deciding upon the final structure of the database.  Perhaps early
> > alpha stages of you app - never goes live for public to interact with.
>
> > whereas baking is for when you have pretty much finalised your db and do
> > not need to remodel.  This is beta phaze of you app, closer to final but
> > tweaks need to be made still.
>
> > whilst scaffolding dealing with views would be a burden.
>
> When I added the scaffold code to the core CakePHP did not even have the
> shell scripts.
>
> I left it in the core because I am lazy and because of the reasons you
> repeated above.
>
> --
> Larry E. Masters

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

Re: (Acl) Error: aro not found No tree returned.

Hi thanks, Amit. It still can't be resolved I tried your suggestion.
I'm starting installing acl from fresh. Based on what you said should
work (executing in the webpage)..

Rgds,
Maxim

On Dec 31, 2:42 pm, Amit Badkas <amit.sanis...@gmail.com> wrote:
> Hi,
>
> Add following code at the end of myAction() method, so that it won't try to
> render the view
>
> $this->render(false);
>
> Also look at the SQL queries if 'aros' table is populating correctly or not
> by setting debug level to 2.
>
> Hope this helps.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Dec 31, 2010 at 11:52 AM, John Maxim <goog...@gmail.com> wrote:
> > I tried executing by going to url: localhost/my_app_name/users/
> > anyAction
>
> > can't load it asks me to check and make sure my file anyaction.ctp is
> > created in views/users
>
> > regards,
> > maxim
>
> > On Dec 31, 12:42 pm, Amit Badkas <amit.sanis...@gmail.com> wrote:
> > > Hi,
>
> > > I meant that you need to access the method myAction() from URL so that
> > the
> > > code in that method will get executed and according to that code, the
> > dummy
> > > records will get populated to 'aros' table.
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Fri, Dec 31, 2010 at 9:40 AM, John Maxim <goog...@gmail.com> wrote:
> > > > Hi Amit...thanks for the reply but.. I don't understand.
>
> > > > In my Users, there is no file named by anyAction..
>
> > > > anyAction function was saved in /controllers/users_controller.php
>
> > > > What do you mean ?..
>
> > > > best regards,
> > > > Maxim
> > > > On Dec 31, 11:33 am, Amit Badkas <amit.sanis...@gmail.com> wrote:
> > > > > Hi,
>
> > > > > Have you executed the code in anyAction() to populate ACL tables with
> > > > dummy
> > > > > data, something like http://
> > > > > <your-domain-here>/<your-app-name-here>/users/anyAction?
>
> > > > > Amit Badkas
>
> > > > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > > > On Thu, Dec 30, 2010 at 8:39 PM, John Maxim <goog...@gmail.com>
> > wrote:
> > > > > > Hi everyone,
>
> > > > > > While working on the sample provided from cookbook (link below) I
> > was
> > > > > > going to create an aro where the codes are to be placed in a
> > > > > > controller. I chose users_controller.php and I then verify by
> > typing
> > > > > > on my console:
>
> > > > > > cake acl view aro
>
> > > > > > It resulted in
>
> > > > > > Error: aro not found No tree returned.
>
> > > > > > What's wrong with it ?
>
> >http://book.cakephp.org/view/1245/Defining-Permissions-Cake-s-Databas.
> > > > ..
>
> > > > > > Regards,
> > > > > > Maxim
>
> > > > > > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>
> > <cake-php%2Bunsubscribe@googlegroups.com<cake-php%252Bunsubscribe@googlegroups.com>
>
> > > > <cake-php%2Bunsubscribe@googlegroups.com<cake-php%252Bunsubscribe@googlegroups.com>
> > <cake-php%252Bunsubscribe@googlegroups.com<cake-php%25252Bunsubscribe@googlegroups.com>
> > >>For
> > > > more options, visit this group at
> > > > > >http://groups.google.com/group/cake-php?hl=en
>
> > > > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>
> > <cake-php%2Bunsubscribe@googlegroups.com<cake-php%252Bunsubscribe@googlegroups.com>>For
> > more options, visit this group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Urgent Help: Path for Production environment..

Hi people,
I need this solved, help if you can. how exactly do I start my page at
localhost/ without displaying Cake's system info page..?
Rgds,
Maxim

On Dec 31, 9:00 pm, John Maxim <goog...@gmail.com> wrote:
> Hello everyone,
>
> My index now is in my root */www/
>
> Anyone knows how to remove the cake system page ? now it just display
> the Cake system page everytime it is routed tohttp://localhost/
>
> I need it to be a customised page, such as, "Welcome to ABC company
> etc... "
>
> Urgently need help with this.
>
> Regards,
> Maxim
>
> On Dec 30, 8:43 pm, John Maxim <goog...@gmail.com> wrote:
>
> > My document root is:
>
> > DocumentRoot "c:/wamp/www/"
>
> > Isn't it already pointing to the correct folder ?
>
> > Regards,
> > Maxim
>
> > On Dec 30, 8:37 pm, John Maxim <goog...@gmail.com> wrote:
>
> > >http://book.cakephp.org/view/914/Production
>
> > > Hi, following the above link, I tried to build my App so it starts
> > > here:
> > > ------http://localhost/
> > > ------
> > > I don't understand the link above..
>
> > > I unzipped the cake's folder into my root which is in */www/ and
> > > renamed the index.php file to something else but it still brings up
> > > the cake system information page each time I loadhttp://localhost/
>
> > > Can someone share how to remove or rename/replace the cake's index
> > > page to somewhere so I can start my app athttp://localhost
>
> > > Thanks,
> > > Maxim

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

Re: How to use Grant in Shell ?

Greeting. Thanks people,

I find that I can completely leave this step, I created the permission
in the following code from book.. finishing with no error.

Is that just another suggestion to change permission using shell ?
thus.. we may choose to do it by creating a temporary function to
execute the permission setting into table aros_acos.

And it solved ?

Right ?..

Rgds,
Maxim

On Dec 31, 8:00 pm, Jon Bennett <jmbenn...@gmail.com> wrote:
> > I don't know. Do you mean the table's data ?
>
> > I'm following the tutorial here
>
> >http://book.cakephp.org/view/1550/Setting-up-permissions
>
> > it says to allow permission for aro and aco tables..
>
> > how to enable the permission ?
>
> Here's an example 'installation' controller:http://pastie.org/1419477
>
> it will do 3 things in the order required:
>
> 1. populate the aco table with a record for every public controller method.
> 2. create the user groups
> 3. set the permissions for the groups
>
> 1 you can leave as it is
> 2 you might need to change, depends how complex your app is (I would
> suggest starting simple until you grasp the fundamentals)
> 3 you'll definitely need to change to match your requirements.
>
> hth
>
> Jon
> ps: don't forget to disable the actions when you deploy to live!
>
> --
> jon bennett -www.jben.net- blog.jben.net

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

Re: Add User/Group in Descending Order by Time(Last Add)

I understand but looking at the admin page it just goes along with the
original arrangement as in MySQL database. Are you suggesting to
rewrite the display page for the data I want displayed ?

Thanks for the reply,
Maxim

On Dec 31, 12:39 pm, Amit Badkas <amit.sanis...@gmail.com> wrote:
> Hi,
>
> From the data you posted, it seems that they are properly inserting in table
> as the IDs are incrementing. If you are displaying that data anywhere and
> you need to sort/order them in a particular way then use 'order' parameter
> while finding the records.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Fri, Dec 31, 2010 at 9:31 AM, John Maxim <goog...@gmail.com> wrote:
> > Hi
> > As I go through this tutorial:
> >http://book.cakephp.org/view/1547/Acts-As-a-Requester
>
> > When we add Group/User, after deleting some, the new data doesn't line
> > up in descending order e.g. User:
>
> > Id  Name
> > -------------
> > 2. Jennifer<--- 2nd user is added
> > 1. Jason   <--- 1st user is added
> > 3. Mark    <--- 3rd user is added
>
> > ~~
>
> > Can someone point this logical issue? like how to fix it so it goes in
> > descending order by time. (the oldest at the top....)
>
> > regards,
> > Maxim
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Hi need Help: How to log-out from Acl ?

Hi,

I'm right here: http://book.cakephp.org/view/1552/Logout

May I ask if anyone could help to point out how exactly am I to log-
out now ??

I went through some comments on that page suggested to

$this->Auth->allowedActions = array('logout');

What's your suggestion?

Kind regards,
Maxim

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

Re: post form data from URL

Sorry, I thought you were suggesting the routing wasn't needed. I
replace it, added your debug code suggestion & this is the result:

URL address: http://localhost/links/add/http://www.youtube.com/watch%3Fv%3DvDVnuFxsfbE
URL passed to form currently: www.youtube.com
debug result:

array(8) { ["controller"]=> string(5) "links" ["action"]=> &string(3)
"add" ["named"]=> array(1) { ["http"]=> string(0) "" } ["pass"]=>
array(2) { [0]=> string(15) "www.youtube.com" [1]=> string(5) "watch"
} ["plugin"]=> NULL ["form"]=> array(0) { } ["url"]=> array(2) {
["url"]=> string(37) "links/add/http:/www.youtube.com/watch" ["v"]=>
string(11) "vDVnuFxsfbE" } ["models"]=> array(1) { [0]=> string(4)
"Link" } }


Current routing code:
Router::connect(
'/links/add/:url',
array(
'controller' => 'links',
'action' => 'add'
),
array(
//Looks for http://
'url' => '^http\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$',
// passes it
'pass' => array('url')
)
);
------------
add.ctp:
echo $this->Form->input('Link.url', array('value' => $url, 'type' => 'text'));

Thanks!
S


On Thu, Dec 30, 2010 at 11:05 PM, john lyles <confidential99@gmail.com> wrote:
> You are certain you are passing data to the url correctly?
>
> On Dec 30, 9:27 pm, Steve Mallett <steve.mall...@gmail.com> wrote:
>> I don't think so.  With or without echo var_dump($this->params) that results in:
>> Notice (8): Undefined index: action [CORE/cake/dispatcher.php, line 269]
>> Notice (8): Undefined index: controller [CORE/cake/dispatcher.php, line 121]
>>
>> S
>>
>>
>>
>>
>>
>>
>>
>> On Thu, Dec 30, 2010 at 10:15 PM, john lyles <confidentia...@gmail.com> wrote:
>> > Let me see if I get this: You have a url such as
>> >http://localhost/controller/action?url=http://www.example.com/page.html
>> > And all you need to do is populate the url into the form?
>> > If I understand the situation correctly then here is my simple
>> > solution:
>> > echo var_dump($this->params);
>> > This will return an array. What you need will be here.
>>
>> > On Dec 30, 8:39 pm, Steve Mallett <steve.mall...@gmail.com> wrote:
>> >> On Thu, Dec 30, 2010 at 9:26 PM, cricket <zijn.digi...@gmail.com> wrote:
>> >> > On Thu, Dec 30, 2010 at 8:21 PM, Steve Mallett <steve.mall...@gmail.com> wrote:
>> >> >> More on routing, I think,  if I use an URL with a subdirectory ie.
>> >> >> example.com/dir the "\" appears to break the routing defaulting to
>> >> >> example.com. Any suggestions on dealing with that?
>>
>> >> > Are you escaping the URL, actually? You're going to have problems if not.
>>
>> >> Well, if I encode example.com/dir as example.com%2fdir cake appears to
>> >> turn it back into example.com/dir... at least in the browser address
>> >> bar (chrome), but still can't deal with it turning it into example.com
>> >> in $url
>>
>> >> > Again, why not just add the URL in the form instead of first passing
>> >> > it in the request URL?
>>
>> >> I'm trying to prepopulate the url via a bookmarklet which just makes
>> >> saving an URL in the form much faster & easier.
>>
>> >> S
>>
>> > 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+unsubscribe@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+unsubscribe@googlegroups.com For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Urgent Help: Path for Production environment..

Hello everyone,

My index now is in my root */www/

Anyone knows how to remove the cake system page ? now it just display
the Cake system page everytime it is routed to http://localhost/

I need it to be a customised page, such as, "Welcome to ABC company
etc... "

Urgently need help with this.

Regards,
Maxim


On Dec 30, 8:43 pm, John Maxim <goog...@gmail.com> wrote:
> My document root is:
>
> DocumentRoot "c:/wamp/www/"
>
> Isn't it already pointing to the correct folder ?
>
> Regards,
> Maxim
>
> On Dec 30, 8:37 pm, John Maxim <goog...@gmail.com> wrote:
>
> >http://book.cakephp.org/view/914/Production
>
> > Hi, following the above link, I tried to build my App so it starts
> > here:
> > ------http://localhost/
> > ------
> > I don't understand the link above..
>
> > I unzipped the cake's folder into my root which is in */www/ and
> > renamed the index.php file to something else but it still brings up
> > the cake system information page each time I loadhttp://localhost/
>
> > Can someone share how to remove or rename/replace the cake's index
> > page to somewhere so I can start my app athttp://localhost
>
> > Thanks,
> > Maxim

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

Re: Changing Core Path in Shell (PHP Console)

(SOLVED)

For those facing this problem. You can easily change it in environment
variables following the way how you created in the first place.

Regards,
Maxim

On Dec 30, 11:02 pm, John Maxim <goog...@gmail.com> wrote:
> Hi,
>
> Previously I installed(set up) cake /PHP console in another folder
> therefore now my Console shows my core path as:
>
> */www/oldAppFolder
>
> I have changed my working and application folder to */www/
>
> Is there a way to change the core path to the new place ?
>
> It's not impeding my work but it bothers me each time I launch the
> console seeing the old path to be the CORE path.
>
> Regards,
> Maxim

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

Re: is it possible to include the failed input string in the validation message?

thats already possible - you don't necessarily need the view for this

app_model.php:

/**
* Overrides the Core invalidate function from the Model class
* with the addition to use internationalization (I18n and L10n)
* @param string $field Name of the table column
* @param mixed $value The message or value which should be returned
* @param bool $translate If translation should be done here
* 2010-01-22 ms
*/
function invalidate($field, $value = null, $translate = true) {
if (!is_array($this->validationErrors)) {
$this->validationErrors = array();
}
if (empty($value)) {
$value = true;
} else {
$value = (array )$value;
}

//TODO: make more generic?
if (is_array($value)) {
$value[0] = $translate ? __($value[0], true) : $value[0];

if (count($value) > 3) { # string %s %s string, trans1, trans2
$value = sprintf($value[0], $value[1], $value[2], $value[3]);
} elseif (count($value) > 2) { # string %s %s string, trans1,
trans2
$value = sprintf($value[0], $value[1], $value[2]);
} elseif (count($value) > 1) { # string %s string, trans1
$value = sprintf($value[0], $value[1]);
} else {
$value = $value[0];
}
}
$this->validationErrors[$field] = $value;
}


On 31 Dez., 09:27, netusco <ernestcon...@gmail.com> wrote:
> > As for the second point about handling this in the controller. It's
> > the manual itself that says this should be handled with FormHelper.
> > From this page here:http://book.cakephp.org/view/1143/Data-Validation
> > , it says: "For more information about how to handle the displaying of
> > validation errors, check out the section covering FormHelper."
>
> For those who use i28n, error messages need to be in our views,
> otherwise they cannot be translated from our models. Would be good on
> new versions (2.0?) to have this possibility included as this cleans
> up a lot of code and lines in our views.

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