2009-08-12 11 views
0

私はKohanaで認証モジュールを実装していますが、このエラーメッセージの原因を特定できないようです。作成する登録フォームを送信するとデータベース内のユーザー(正常に実行されます)。Kohana - ユーザー登録ランタイムエラー(auth)

このページの読み込みを妨げているエラーが検出されました。この問題が解決しない場合は、Webサイト管理者に連絡してください。

アプリケーション/コントローラ/ register.php [83]:

未定義のプロパティ:Register_Controller :: $認証

私はフォームを検証するためにjqueryのを使用していて、フォームが私の前に完全に働きました

* 

    Register_Controller->create_user() 

    * system/core/Kohana.php [291]: 

    ReflectionMethod->invokeArgs(Register_Controller Object 
    (
     [template] => View Object 
      (
       [kohana_filename:protected] => /var/www/ko/testsite/system/views/form/template.php 
       [kohana_filetype:protected] => .php 
       [kohana_local_data:protected] => Array 
        (
        ) 

      ) 

     [auto_render] => 1 
     [uri] => URI Object 
      (
      ) 

     [input] => Input Object 
      (
       [use_xss_clean:protected] => 1 
       [magic_quotes_gpc:protected] => 1 
       [ip_address] => 
      ) 

    ) 
    ) 

    * 

    Kohana::instance() 

    * system/core/Event.php [209]: 

    call_user_func(Array 
    (
     [0] => Kohana 
     [1] => instance 
    ) 
    ) 

    * system/core/Bootstrap.php [55]: 

    Event::run(system.execute) 

    * index.php [106]: 

    require(system/core/Bootstrap.php) 
:問題はAJAXリクエストを行う必要があるかもしれませんが、私はどこそこから行くのかわからないので、ここで

は、スタックトレースです...、jqueryのを追加しました

public function create_user() 
{ 
    if($_POST) 
    { 
     $post = $this->input->post(); 
     $user = ORM::factory('user'); 

     $user->add(ORM::factory('role', 'login')); 

    if($user->validate($post, TRUE)) 
     { 
     $this->auth->login($user, $post->password); 
     url::redirect(); 
     } 
     else 
     { 
     url::redirect('register'); 
     } 
    } 
} 

誰もが何か提案を持っている:

そして、ここではRegister_ControllerでCREATE_USER()メソッドですか? :P

答えて

1

変数の$ this - >認証は、あなたのコントローラ

私はあなたがコンストラクタで$this->auth = Auth::instance();を行うことを意味推測しているに存在しないので、あなたが取得しているエラーがあります。

+0

何かの理由で、私はすでに – mportiz08

関連する問題