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

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

class UsersController extends AppController {

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

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


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

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

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

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


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

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

    [Message] => Array
        (
        )

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

        )

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

Reply via email to