I just deployed my first cake application to the web, the apps works
well on my development system. But on moving to production on a shared
server, several issues cropped up like, session problems, mod-Rewrite
issues etc.

I have solved some of these problems going thru the posts on this
group, but the two listed below have proved so stubborn:

1. some of my controllers could not be found yet they exist and work
well in the development platform. I keep getting the error

'Not found
The requested address index was not found on this server.'

2. My login renders a blank page when a usual is autheticated, but if
the authentication fails it shows appropraitely.

Below is my code

function login()
    {
        //Don't show the error message if no data has been submitted.
        $this->set('error', false);

        // If a user has submitted form data:
        if (!empty($this->data))
        {
            // First, let's see if there are any users in the database
            // with the username supplied by the user using the form:

            $someone =
$this->User->findByUsername($this->data['User']['username']);

            // At this point, $someone is full of user data, or its
empty.
            // Let's compare the form-submitted password with the one
in
            // the database.

            if(!empty($someone['User']['password']) &&
$someone['User']['password'] == $this->data['User']['password'])
            {

                                        if(trim($someone['User']['active'])== 0)
                                        {
                                                // Remember the $error var in 
the view? Let's set that to true:
                                $this->set('error', true);
                                //give message about inactivity
                                $this->set('errmessage', 'Your account has been
deactivated, please contact the site administrator');
                                //render form again
                                $this->render();
                                //then exit
                                exit();
                                        }


                // This means they were the same. We can now build some
basic
                // session information to remember this user as
'logged-in'.

                $this->Session->write('User', $someone['User']);

                // Now that we have them stored in a session, forward
them on
                // to a landing page for the application.

                $this->redirect('/');
            }
            // Else, they supplied incorrect data:
            else
            {
                // Remember the $error var in the view? Let's set that
to true:
                $this->set('error', true);
                //give message about not known
                $this->set('errmessage', 'The login credentials you
supplied could not be recognized. Please try again.');
            }
        }
    }

Please any help will be appreciated

Baydel


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to