User Management Plugin Cakephp 2

2012-05-05 Thread Steven Scaffidi
Hi I'm using a user management plugin for cakephp. The one I'm using can be 
found here: http://usermgmt.ektasoftwares.com/

Has anyone ever used this plugin? For some reason I can't get the 
permissions to work. For example, I create another user (as a user not 
admin) and I gave users permission to edit their profile through the admin 
side. However, when I go to the user side I can't edit my profile - it just 
says access denied and tells me to go back to the dashboard...I checked the 
database in myphpadmin and the table seems to be correct for the particular 
row I'm talking about. I don't understand why it isn't working. 

If anyone can help with this problem or just recommend another plugin 
similar I'd really appreciate it.

-- 
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: CakePHP Containable on Associated Model

2012-05-05 Thread bs28723

  

  
  
Are you looking for a find where  "Log.user_id=2 OR Book.log_id =
null"? 

On 5/3/2012 11:00 PM, Rob-3 [via CakePHP] wrote:
 I have a setup where there are Books Users and Logs.
  Each Log has a
  
  Book and a User and I am trying to retrieve a list of all the
  books
  
  regardless of the user, but then also retrieve the Logs associated
  
  with that book (recursive is set to 1), but then only retrieving
  the
  
  logs of the current logged in user.
  
  
  Hopefully that's clear. I tried using Containable and like so:
  
  
  $this->Book->contain('Log.user_id = 2');
  
  
  But unfortunately this leaves out Books for which User 2 has no
  logs
  
  for. Am I going about this correctly and I'm just not using
  
  containable properly, or am I doing this all wrong.
  
  
  Let me know if anything needs to be clarified or expanded...Any
  help
  
  is appreciated!
  
  
  -- 
  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
  
  [hidden email] 
  For more options, visit this group at 
http://groups.google.com/group/cake-php 
  
  
  
  
If you reply to this email, your
  message will be added to the discussion below: 

http://cakephp.1045679.n5.nabble.com/CakePHP-Containable-on-Associated-Model-tp5684781.html
 
  
  
To start a new topic under CakePHP, email
ml-node+s1045679n125572...@n5.nabble.com  
To unsubscribe from CakePHP, click
  here . 
NAML  

  



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/CakePHP-Containable-on-Associated-Model-tp5684781p5688778.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
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


Authorize component ordering

2012-05-05 Thread bs28723
I am trying to set the order for my Authorize components.
I have a App/Controller/Component/Auth/OrgAuthorize.php

I have tried starting with
in AppController
 public $components = array(
 'Auth' => array(
 'authorize' => array('Controller')
 )
 );

Then in my OrganizationContoller
 public $components = array(
 'Auth' => array(
 'authorize' => array('Org')
 )
 );

The problem is that it Orders the authorize to look like 
array('Controller', 'Org')
But I would like the array to look like array('Org', 'Controller'), so 
Org get called first.
I don't need Org in all the controllers.

how can I reorder the array?

Thanks,
Bill


--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Authorize-component-ordering-tp5688772.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
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: CakePHP Containable on Associated Model

2012-05-05 Thread Rob
Hi Michael,

I tried to get it working, but I still only get the same results as
above.  What I want is a list of every book, and then in that same
query I want only logs of the specified user, instead I am getting
only books with logs of the specified user...not all books.  Any
ideas?

On May 5, 9:53 am, Michael Stelly  wrote:
> Yes, I'd work it using
> Containable
> .
>
> Sincerely,
> Michael Stelly
>
>
>
>
>
>
>
> On Thu, May 3, 2012 at 9:59 PM, Rob  wrote:
> > I have a setup where there are Books Users and Logs. Each Log has a
> > Book and a User and I am trying to retrieve a list of all the books
> > regardless of the user, but then also retrieve the Logs associated
> > with that book (recursive is set to 1), but then only retrieving the
> > logs of the current logged in user.
>
> > Hopefully that's clear. I tried using Containable and like so:
>
> > $this->Book->contain('Log.user_id = 2');
>
> > But unfortunately this leaves out Books for which User 2 has no logs
> > for. Am I going about this correctly and I'm just not using
> > containable properly, or am I doing this all wrong.
>
> > Let me know if anything needs to be clarified or expanded...Any help
> > is appreciated!
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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
> > athttp://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: Instantiating and Saving a Model from another Model

2012-05-05 Thread Michael Stelly
if(!isset($this->ModelName){
  $this->ModelName->loadModel();
}

This only works in the controller, but it should get you what you want if I
understood the question correctly.

Sincerely,
Michael Stelly
mobile: +1.918.978.2000
skype: mjstelly
LinkedIn 



On Sat, May 5, 2012 at 8:34 PM, CakeNino  wrote:

> I am new to CakePHP and am building an application to help learn the
> framework.  I am having a problem trying to instiate one model from
> another model.  Here is the basic premise...
>
> Assume a simple application - I have Feeds (as in RSS Feeds) and
> Content.  I want to create a page that grabs an RSS feed, loops
> through each of the items, and saves each item in separately in the
> Content table.  Here is what I would LIKE to do - but have problems.
> My problems may be both conceptual and/or syntax related.
>
>
>
> In the FEED model, I created a function called processFeedContent.
> Here is how I would like it to work (written in psuedo-code):
>
>
>
>public function processFeedContent($feedUrl = null) {
>
>$xml = Xml::build($feedUrl);
>$x_array = Xml::toArray($xml);
>$contents = $x_array['rss']['channel']['item'];
>
>for each($contents as $content) {
>$title = $content['title'];
>$link = $content['link'];
>
>
>//THIS IS THE PART I NEED HELP WITH.
>   //THE CODE BELOW IS WHAT I WOULD LIKE TO DO IN
> PSUEDO CODE
>
> //STEP 1 - Instantiate an empty Content
> Object
>$myContent = $this->Create('Content');
>
>//STEP 2 - Set appropriate values in the newly
> created object
>$myContent->set('title', $title);
>$myContent->set('link', $link);
>
>
>   //STEP3 - Save the New Object
>  $myContent->save();
>}
>}
>
>
>
> ANy help or guidance will be greatly apprecaited
>
> --
> 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


Instantiating and Saving a Model from another Model

2012-05-05 Thread CakeNino
I am new to CakePHP and am building an application to help learn the
framework.  I am having a problem trying to instiate one model from
another model.  Here is the basic premise...

Assume a simple application - I have Feeds (as in RSS Feeds) and
Content.  I want to create a page that grabs an RSS feed, loops
through each of the items, and saves each item in separately in the
Content table.  Here is what I would LIKE to do - but have problems.
My problems may be both conceptual and/or syntax related.



In the FEED model, I created a function called processFeedContent.
Here is how I would like it to work (written in psuedo-code):



public function processFeedContent($feedUrl = null) {

$xml = Xml::build($feedUrl);
$x_array = Xml::toArray($xml);
$contents = $x_array['rss']['channel']['item'];

for each($contents as $content) {
$title = $content['title'];
$link = $content['link'];


//THIS IS THE PART I NEED HELP WITH.
   //THE CODE BELOW IS WHAT I WOULD LIKE TO DO IN
PSUEDO CODE

 //STEP 1 - Instantiate an empty Content
Object
$myContent = $this->Create('Content');

//STEP 2 - Set appropriate values in the newly
created object
$myContent->set('title', $title);
$myContent->set('link', $link);


   //STEP3 - Save the New Object
  $myContent->save();
}
}



ANy help or guidance will be greatly apprecaited

-- 
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: Model Associations and Inserting through Associations

2012-05-05 Thread stork
If user is not logged in, then in Event form:

echo $this->Form->input('Event.user_id', array('type' => 'hidden', 'value' 
=> $user['User']['id']));

and in controller:

$this->Event->create($this->request->data);
if ($this->Event->save()) {
...

Do not forget to use SecurityComponent in AppController, so nobody can 
change value of that hidden field in browser.

-- 
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


Display unescaped html elements

2012-05-05 Thread Matteo Landi
On May/05, Matteo Landi wrote:
> Hi everybody,
> 
> Could you tell me what is the right way to display html formatted content
> extracted from the database?  Taking the blog tutorial as example, how is
> possible to let users create posts containing html tags such as `strong`, 
> `em`,
> `ul` and so forth?
> 
> 
> Thanks,
> Matteo
> 
> -- 
> http://www.matteolandi.net

Excuse me for double posting, but the previous message contained an incomplete
subject.


Cheers,
Matteo

-- 
http://www.matteolandi.net

-- 
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: Model Associations and Inserting through Associations

2012-05-05 Thread Nate
I should have specified - the user doesn't necessarily have to be the 
logged in user. It could be any user, in which case $this->Auth->user('id') 
doesn't fit my needs. This is closer, I just need to figure out how to grab 
the user id from the users/view page.

On Saturday, May 5, 2012 10:33:09 AM UTC-6, stork wrote:
>
> $this->Event->create($this->request->data);
> $this->Event->set('user_id', $this->Auth->user('id'));
> if ($this->Event->save()) {
> ...
>

-- 
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: Model Associations and Inserting through Associations

2012-05-05 Thread Nate
Trying to learn it through straight code before I dive into any console 
commands. One of the biggest reasons that I've put off using MVC is because 
I like to feel like I'm in control. Yes, probably dumb, but it makes more 
sense to my fragile brain.

On Saturday, May 5, 2012 7:57:13 AM UTC-6, Michael wrote:
>
> You should take some time to learn how to use bake. It will setup the 
> basics for you based on your database and will serve as a great 
> example of how to do things. 
>
>
> http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html
>  
>
> There are many tutorials out there about setting it up. 
>
> ~Michael 
>

-- 
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: Model Associations and Inserting through Associations

2012-05-05 Thread stork
$this->Event->create($this->request->data);
$this->Event->set('user_id', $this->Auth->user('id'));
if ($this->Event->save()) {
...

-- 
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


Table 'cakehr.cake_errors' doesn't exists

2012-05-05 Thread Florin Trifu
Did anyone encountered this error:

[PDOException] SQLSTATE[42S02]: Base table or view not found: 1146 Table
'cakehr.cake_errors' doesn't exist

?

I have no idea why this is happening. The problem is that I can't see the
errors because they are nested inside a div having the
id="search-form-container".
If I delete that id the error is printed but the entire page is re-rendered.


Best regards!

-- 
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


i

2012-05-05 Thread Matteo Landi
Hi everybody,

Could you tell me what is the right way to display html formatted content
extracted from the database?  Taking the blog tutorial as example, how is
possible to let users create posts containing html tags such as `strong`, `em`,
`ul` and so forth?


Thanks,
Matteo

-- 
http://www.matteolandi.net

-- 
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: Model Associations and Inserting through Associations

2012-05-05 Thread Michael Gaiser
You should take some time to learn how to use bake. It will setup the
basics for you based on your database and will serve as a great
example of how to do things.

http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html

There are many tutorials out there about setting it up.

~Michael

-- 
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: CakePHP Containable on Associated Model

2012-05-05 Thread Michael Stelly
Yes, I'd work it using
Containable
.

Sincerely,
Michael Stelly




On Thu, May 3, 2012 at 9:59 PM, Rob  wrote:

> I have a setup where there are Books Users and Logs. Each Log has a
> Book and a User and I am trying to retrieve a list of all the books
> regardless of the user, but then also retrieve the Logs associated
> with that book (recursive is set to 1), but then only retrieving the
> logs of the current logged in user.
>
> Hopefully that's clear. I tried using Containable and like so:
>
> $this->Book->contain('Log.user_id = 2');
>
> But unfortunately this leaves out Books for which User 2 has no logs
> for. Am I going about this correctly and I'm just not using
> containable properly, or am I doing this all wrong.
>
> Let me know if anything needs to be clarified or expanded...Any help
> is appreciated!
>
> --
> 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: [Cake 2.1.1] AJAX POST with jQuery cross Controller - Bad Request

2012-05-05 Thread jmail
After search and making lot of tests I have decided to do this by other 
way. 

1. I have removed Security component from AppController
2. I have added Security component to every Controller
3. I have added AjaxController to my app without Security component
4. No I am creating functions controller_action_name in AjaxController to 
give easy search of required methods. 

Everything is working perfectly. 

Now I am just thinking if I don't have to make more Ajax controllers for 
example UserAjaxController. I think tha I have got about 200 functions to 
do this way so I am just thinking - but that is just a problem which I like 
to have ^^ My projects are on the run again ;)

Thanks for help 

jmail

W dniu piątek, 4 maja 2012 13:58:16 UTC+2 użytkownik jmail napisał:
>
> Hi!
>
> I've got application which I am translating from other technology to 
> CakePHP. Application is in about 60% written with AJAX.There are a lot of 
> cross controller sends :/ So I've got a problem because when I am trying to 
> make something similar with Cake I get error 400 - bad request. Of course I 
> am using Security component and I would like to use this component. App 
> it's quite secure with that component. Of course when I am using GET 
> request everything is OK, but when try to use POST request there is a 
> problem. 
>
> I've got Controller MainController with function start
>
> class MainController extends AppController{
> function start(){
> $this->set('contests', $this->Contest->find('all', array('conditions' => 
> array('Contest.start <= now()', 'Contest.finish > now()', 'Contest.active' 
> => 1, 'Board.status' => 1;
> if(CakeSession::read('user') === null){
> $this->layout = 'nonloginlayout';
> }
> else{
> $this->render('startlogged');
> }
> }
> }
>
> Then in startlogged.ctp I've got script:
>
> function moreChances(){
> $.prompt.close();
> $.prompt(states, {zIndex: 11000});
> $.ajax({
> url: "/user/invite/"
> ,async: true
> ,dataType: "html"
> ,type: "GET"
> ,success: function(data){
> $.prompt.close();
> $.prompt(data, {buttons:{}, zIndex: 11000})
>  }
>
> });
> }
>  function sendInvite(){
> mail = document.getElementById('inviteMail').value;
> message = document.getElementById('inviteMessage').value;
> $.prompt.close();
> $.prompt(states, {zIndex: 11000});
> $.ajax({
> url: "/user/send_invite?tmp="+Math.random()
> ,async: false
> ,data: {test:'doopa'}
> ,type: "POST"
> ,dataType: "html"
> ,success: function(data){
> $('#deb').html(data); 
> }
> ,error: function(jqXHR, textStatus, errorThrown){
> $('#deb').html(errorThrown);
> }
> });
>}
>
>
> user/invite just loading a form into a prompt window
>
>
> Email address:
> 
> 
> Message:
> 
> 
> 
> send
> 
>
> and User controller look like this
>
> class UserController extends AppController{
>
> function beforeFilter() {
> parent::beforeFilter();
> $json_actions = array('send_invite');
> if(in_array($this->action, $json_actions)){
> $this->Security->validatePost = false = array('Session', 'RequestHandler', 
> 'ImageConverter');
> }
> }
>  function invite(){
> $this->layout = '';
> }
>  function send_invite(){
> $this->autoRender = false;
> var_dump($_POST);
> }
> }
>
> And I don't know what to do more. Every POST request generating error:
>
> 2012-05-04 13:54:27 Error: [BadRequestException] The request has been 
> black-holed
> #0 
> !!!Path_to_root!!!\lib\Cake\Controller\Component\SecurityComponent.php(227): 
> SecurityComponent->blackHole(Object(UserController), 'csrf')
>
>
> Can some please help me? I don't know what to do to not get black-holed. I 
> am desperate because of that three of my projects are stoped :(
>
> Thanks for all.
>

W dniu piątek, 4 maja 2012 13:58:16 UTC+2 użytkownik jmail napisał:
>
> Hi!
>
> I've got application which I am translating from other technology to 
> CakePHP. Application is in about 60% written with AJAX.There are a lot of 
> cross controller sends :/ So I've got a problem because when I am trying to 
> make something similar with Cake I get error 400 - bad request. Of course I 
> am using Security component and I would like to use this component. App 
> it's quite secure with that component. Of course when I am using GET 
> request everything is OK, but when try to use POST request there is a 
> problem. 
>
> I've got Controller MainController with function start
>
> class MainController extends AppController{
> function start(){
> $this->set('contests', $this->Contest->find('all', array('conditions' => 
> array('Contest.start <= now()', 'Contest.finish > now()', 'Contest.active' 
> => 1, 'Board.status' => 1;
> if(CakeSession::read('user') === null){
> $this->layout = 'nonloginlayout';
> }
> else{
> $this->render('startlogged');
> }
> }
> }
>
> Then in startlogged.ctp I've got script:
>
> function moreChances(){
> $.prompt.close();
> $.prompt(states, {zIndex: 11000});
> $.ajax({
> url: "/user/invite/"
> ,async: true
> ,dataType: "html"
> ,typ

Model Associations and Inserting through Associations

2012-05-05 Thread Nate
MVC Beginner here - I have created a database with a USER table which 
hasMany EVENTS, and conversely have set the EVENTS belongsTo USER

Here's my question: When I want to add an event from a user page 
(users/view), how do I automatically associate that event(event/add) with 
the user in the database? I know that it makes the foreign key connection 
with a user_id field in the events table, but I don't know how to get to 
the event/add page and carry/apply the user id to the form helper. Am I 
making any sense here?

Thanks in advance.

-- 
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


Call another controller paginate

2012-05-05 Thread nikunj kansara
Hello all,

I have tow controller, with name of asycontroller, and askcontroller.

class saycontroller extends AppController
{
var $name = 'Asks';
var $helpers = array('Html', 'Form', 'Session', 'Time', 'Paginator');
var $components = array('Session', 'Auth', 'RequestHandler');
var $paginate = array(
 'fields' => array('Ask.id', 'Ask.question', 'Ask.user_id'),
 'limit' => 10,
 'order' => array( 'Ask.id' => 'desc')
 );


function all()
{
$ask = $this->paginate(); 
 if (!empty($this->params['requested'])) 
 {
 return $ask;
} 
else 
{
 $this->set('askList', $ask);
   } 
}
}

Now from my ask controller i call all action with the help of 
"requestAction"

$askList = $this->requestAction(array("controller"=>"Ask","action"=>"all"));

but i am not able to access all pagination value of my saycontroller/all.

How can i access paginate and of my saycontoller to askcontoller.

Please help me.

I have try some solutions but i am not success with that

(1)

function index()
{
$this->loadModel('Ask');
$askList = $this->Ask->paginate('Ask');
//$askList = 
$this->requestAction(array("controller"=>"Ask","action"=>"all"));
$this->set("askList",$askList);
}

-- 
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: Fatal Error: Class 'String' not found in Model

2012-05-05 Thread WyriHaximus
Hey I've encountered the same bug on a different place tho. Are you by any 
change running with E_STRICT error logging on? Cause going from E_ALL | 
E_STRICT to just E_ALL 'solved' the problem. (Had this on both windows and 
linux.)

On Thursday, May 3, 2012 2:21:16 AM UTC+2, Conor Manning wrote:
>
> I have a web application that has been working fine until recently when I 
> switched operating systems. I migrated from Ubuntu to Arch Linux, backing 
> up my application online. In the process I lost some directories and my web 
> application no longer worked.
>
> To solve this, I downloaded CakePHP again, copied the Controllers, Models 
> and Views from my old project into my new copy of Cake, and modified my 
> config to reflect my database.
>
> I'm using Cake's AuthComponent and I'm getting this strange error message:
>
>> Fatal error: Class 'String' not found in /srv/http/bfm/app/Model/User.php on 
>> line 39
>
>
> I didn't know what to make of the line number because line 39 is the last 
> line in the file. I'm not particularly experienced with PHP outside of Cake 
> so perhaps somebody else will be able to tell me what that might mean.
>
> Each User has many Podcasts, and each Podcast belongs to a User. It was in 
> accessing any page which used find to retrieve Podcasts and associated User 
> objects that the error occurred.
>
> Stranger still, actions managed by the UsersController worked fine. I was 
> able to access my user login page with no problems, and I was redirected to 
> login when I tried to create a new user, which is consistent with my Auth 
> settings.
>
> In any case, I decided to track down the cause of this error. I commented 
> out my validation code and my beforeSave method, which used 
> AuthComponent::password to hash and salt my users' passwords. Once I did 
> this, the error vanished. With some further clumsy debugging through 
> commenting, I figured out that it was specifically the beforeSave method 
> that was causing problems. 
> I tried following the trail of functions called from beforeSave, through 
> AuthComponent and Security. Both of those files had App::uses('String', 
> 'Utility') in them. What's more, I tried adding that line to User.php, and 
> it didn't help solve the problem either.
> My beforeSave method looks like this:
>
> public beforeSave() {
> if (isset($this->data[$this->alias]['password']) {
> $password = $this->data[$this->alias]['password'];
> $this->data[$this->alias]['password'] = AuthComponent::password($password);
> }
> return true;
> }
>
> When I replaced AuthComponent::password($password) with $password, the 
> error was still there, which confused me, because I was sure String was 
> needed for AuthComponent::password (via Security), and that was what was 
> causing the trouble.
>
> Maybe this was too long, but I wanted to give all the information I had, 
> because I am well and truly stuck. I have no idea what's happening inside 
> my code.
> I can provide more information or code if it's useful. I just don't know 
> where to begin.
>

-- 
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: Wrong request method (2.1.2)

2012-05-05 Thread euromark
thats why I don't care about PUT or POST:
https://github.com/dereuromark/tools/blob/2.0/Controller/Component/CommonComponent.php#L143
 

for me:
posted = put or post
get otherwise

at least in a practical sense anyway (since the one is only a more specific 
version of the other).


Am Samstag, 5. Mai 2012 08:10:43 UTC+2 schrieb Jimit Kapadya:
>
> Which book is best in CakePhp..
>
> On Sat, May 5, 2012 at 9:41 AM, Miles J  wrote:
>
>> I believe it has changed so if you are doing an edit it sends a PUT, else 
>> if you are doing a create it sends a POST.
>>
>> I ran into that same issue today.
>>
>>
>> On Friday, May 4, 2012 1:17:31 PM UTC-7, SigalX wrote:
>>>
>>> I've seen that cake had sent "PUT" in the "_method" variable but it was 
>>> POST and I got "PUT" from $this->request->method() in the controller as 
>>> well. How to get truly request method via cake?
>>
>>  -- 
>> 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: Problem with Miles J. Uploader plugin and image name

2012-05-05 Thread Xoubaman
3.5

El sábado, 5 de mayo de 2012 06:10:32 UTC+2, Miles J escribió:
>
> What version are you using?
>
> On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>>
>> This is my behavior setup:
>>
>> public $actsAs = array(
>> 'Uploader.Attachment' => array(
>> 'image_upload' => array(
>> 'name'=> 'formatFileName', 
>> 'baseDir'=> IMAGES,
>> 'uploadDir'=> 'writers',
>> 'dbColumn'=> 'image', 
>> 'maxNameLength'=> 200, 
>> 'overwrite' => true,
>> 'transforms' => array(
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_H, 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' 
>> => false),
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
>> 'thumb', 'append' => '_thumb')
>> )
>> )
>> )
>> );
>>
>> The problem is that the saved image in 'image' column is "bowser-1.png", 
>> instead the expected "bowser.png".
>>
>> The thumb works fine and is named "bowser_thumb.png" as expected.
>>
>> Any idea?
>>
>>
> On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>>
>> This is my behavior setup:
>>
>> public $actsAs = array(
>> 'Uploader.Attachment' => array(
>> 'image_upload' => array(
>> 'name'=> 'formatFileName', 
>> 'baseDir'=> IMAGES,
>> 'uploadDir'=> 'writers',
>> 'dbColumn'=> 'image', 
>> 'maxNameLength'=> 200, 
>> 'overwrite' => true,
>> 'transforms' => array(
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_H, 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' 
>> => false),
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
>> 'thumb', 'append' => '_thumb')
>> )
>> )
>> )
>> );
>>
>> The problem is that the saved image in 'image' column is "bowser-1.png", 
>> instead the expected "bowser.png".
>>
>> The thumb works fine and is named "bowser_thumb.png" as expected.
>>
>> Any idea?
>>
>>
> On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>>
>> This is my behavior setup:
>>
>> public $actsAs = array(
>> 'Uploader.Attachment' => array(
>> 'image_upload' => array(
>> 'name'=> 'formatFileName', 
>> 'baseDir'=> IMAGES,
>> 'uploadDir'=> 'writers',
>> 'dbColumn'=> 'image', 
>> 'maxNameLength'=> 200, 
>> 'overwrite' => true,
>> 'transforms' => array(
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_H, 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' 
>> => false),
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
>> 'thumb', 'append' => '_thumb')
>> )
>> )
>> )
>> );
>>
>> The problem is that the saved image in 'image' column is "bowser-1.png", 
>> instead the expected "bowser.png".
>>
>> The thumb works fine and is named "bowser_thumb.png" as expected.
>>
>> Any idea?
>>
>>
> On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>>
>> This is my behavior setup:
>>
>> public $actsAs = array(
>> 'Uploader.Attachment' => array(
>> 'image_upload' => array(
>> 'name'=> 'formatFileName', 
>> 'baseDir'=> IMAGES,
>> 'uploadDir'=> 'writers',
>> 'dbColumn'=> 'image', 
>> 'maxNameLength'=> 200, 
>> 'overwrite' => true,
>> 'transforms' => array(
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_H, 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' 
>> => false),
>> array('method' => 'resize', 'width' => 
>> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
>> 'thumb', 'append' => '_thumb')
>> )
>> )
>> )
>> );
>>
>> The problem is that the saved image in 'image' column is "bowser-1.png", 
>> instead the expected "bowser.png".
>>
>> The thumb works fine and is named "bowser_thumb.png" as expected.
>>
>> Any idea?
>>
>>
> On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>>
>> This is my behavior setup:
>>
>> public $actsAs = array(
>> 'Uploader.Attachment' => array(
>> 'image_upload' => array(
>> 'name'=> 'formatFileName', 
>> 'baseDir'=> IMAGES,
>> 'uploadDir'=> 'writers',
>> 'dbColumn