<?php
class AppController extends Controller {

  var $components = array('Auth');
  var $helpers = array('Flash');

  function beforeFilter() {
    $this->Auth->loginAction = '/admin/users/login';
    $this->Auth->loginError = 'ログインエラーです';
    $this->Auth->authError = 'ログインしてください';
    $this->Auth->loginRedirect = '/admin/sites';
  }

  function flash( $message, $class = 'status' ) {
    $this->Session->activate();
    $old = $this->Session->read('messages');
    $old[$class][] = $message;
    $this->Session->write( 'messages', $old );
  }

}
?>
