Re: The page is not redirecting properly

2009-11-15 Thread MaNuM
Hi Scott.

Thank's for your answer. This is one of my isAuthorized methods:

 if($this->action !="view")
{


if ($this->Auth->user('role') == 'admin')
{
return true;
}


$course_slug = $this->params['pass']['0'];
$teacher_courses = $this->Session->read("User.courses");
foreach($teacher_courses as $temp_teacher_course)
{

if($temp_teacher_course['slug'] == $course_slug)
{
return true;
}
}

return false;
}

The thing is that when the user that is not logged in tries to access
a function that is not "view", the browser shows the "The page is not
redirecting properly" message...

On 12 nov, 01:17, Scott Dahl  wrote:
> Can you post your isAuthorized method?  Also, you shouldn't need that method
> in every controller just in app_controller.php...the rest will inherit it
> automagically.
>
> On Wed, Nov 11, 2009 at 3:42 PM, MaNuM  wrote:
> > Hi all.
>
> > I have a problem in my application when I try to access some pages
> > (belonging to not allowed actions group) and user is not logged in,
> > the browser shows this message.
>
> > The page is not redirecting properly
>
> > I have the isAuthorized method redefined in every controller.. I don't
> > know the cause of this.. Could it be anything related to the cookies??
>
> > Thank's and regards.
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=.

--

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




The page is not redirecting properly

2009-11-11 Thread MaNuM
Hi all.

I have a problem in my application when I try to access some pages
(belonging to not allowed actions group) and user is not logged in,
the browser shows this message.

The page is not redirecting properly

I have the isAuthorized method redefined in every controller.. I don't
know the cause of this.. Could it be anything related to the cookies??

Thank's and regards.

--

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




Apache crashes with some pages

2009-11-01 Thread MaNuM

Hi everyone!

I encountered a problem today that is getting me down... I was doing
some changes in the searchable behaviour I downloaded and something
went wrong. I undid the changes but the problem is still there. The
target page goes blank... When I check the apache error log I get this
message:

[Sun Nov 01 18:09:01 2009] [notice] child pid 9510 exit signal
Segmentation fault (11);

The thing is this problem appears just in some pages of the
application... I don't know what is going on...

could it be something linked to apache cache?? Nothing seems to be
corrupted and database is fine.

How can I get more info of this problem? (I've already tried to enable
apache coredumps errors but it doesn't show anything...


Thank's!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Custom url's

2009-03-05 Thread MaNuM

Thank you for asnwering!

I think I'm close to make it work, but I'm havent been able yet... I
followed the instructions of the article and what I have is:

1) A database table called "fields"(it's strange, but fields is the
real name of the table :S), whose fields are
id   fieldname content

2) In my Field model
class Field extends AppModel {
var $name = 'Article';
var $actsAs = array('Sluggable' => array('separator' => '_',
'overwrite' => true, 'slug'=>'id', 'label'=>'fieldname'));  ;
}

3) In my Fields Controller:
function view($slug) {
$field= $this->Field->findBySlug($slug);

$this->set('field', $field);
}

4) The link to see a field is like that:
echo $html->link($temp_field['Field']['fieldname'],array
('controller'=>'fields','action'=>'view',$temp_field['Field']['id']));

Previously, I put the sluggable.php file in the app/models/behaviors
folder. What I'm missing or doing wrong??

Thank you very much again.

Regards!






On 5 mar, 02:38, Sam Sherlock  wrote:
> have a look athttp://bakery.cakephp.org/articles/view/sluggable-behavior
>
> 2009/3/5 park 
>
>
>
> > You either define a '/fields/view/science' route (hard coded) in /app/
> > config/route.php,
> > Or pass 'science' as an argument an do a query in db.
>
> > On Mar 5, 8:23 am, MaNuM  wrote:
> > > Hi everybody. I haven't worked for a long time with CakePHP and I
> > > can't find a solution for this:
>
> > > In my application a I have now url's like this one:
>
> > >http://localhost/cake/ocwdev/fields/view/17
>
> > > 17 is the id refered to a field called "Science" for example. I would
> > > like the url to be like this one:
>
> > >http://localhost/cake/ocwdev/fields/view/Science
>
> > > Is this possible without passing "Science" as an argument? I think it
> > > is not a good idea to search by 'name' instead of by 'id' in the
> > > controller to see the contents of the field..
>
> > > Thank's in advanced.
>
> > > Regards.

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



Custom url's

2009-03-04 Thread MaNuM

Hi everybody. I haven't worked for a long time with CakePHP and I
can't find a solution for this:

In my application a I have now url's like this one:

http://localhost/cake/ocwdev/fields/view/17

17 is the id refered to a field called "Science" for example. I would
like the url to be like this one:

http://localhost/cake/ocwdev/fields/view/Science

Is this possible without passing "Science" as an argument? I think it
is not a good idea to search by 'name' instead of by 'id' in the
controller to see the contents of the field..

Thank's in advanced.

Regards.

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