Changeset 19968

Show
Ignore:
Timestamp:
09/26/08 19:12:38 (6 years ago)
Author:
gen
Message:

適当にuser_controller弄った

Location:
events/phpframework/akelos/trunk
Files:
1 added
8 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/akelos/trunk/app/application_controller.php

    r18146 r19968  
    11<?php 
    2  
    3 require_once(AK_LIB_DIR.DS.'AkActionController.php'); 
    4  
    5 /** 
    6 * This file is application-wide controller file. You can put all  
    7 * application-wide controller-related methods here. 
    8 * 
    9 * Add your application-wide methods in the class below, your controllers  
    10 * will inherit them. 
    11 *  
    12 * @package ActionController 
    13 * @subpackage Base 
    14 */ 
    15  
    162class ApplicationController extends AkActionController  
    173{ 
     4    public function __construct() 
     5    { 
     6        parent::__construct(); 
     7    } 
    188 
     9    private function isPublic() 
     10    { 
     11    } 
     12 
     13    private function isLogin() 
     14    { 
     15        //tekitou 
     16        return !empty($this->session['user']); 
     17    } 
    1918} 
    20  
    21 ?> 
  • events/phpframework/akelos/trunk/app/controllers/page_controller.php

    r19947 r19968  
    33class PageController extends ApplicationController 
    44{ 
    5     function index() 
     5    public function index() 
    66    { 
    77    } 
  • events/phpframework/akelos/trunk/app/controllers/user_controller.php

    r19938 r19968  
    66    { 
    77    }     
     8 
     9    function login() 
     10    { 
     11        if (!empty($this->params) && User::login($this->params)) { 
     12            return $this->renderAction('home'); 
     13        } 
     14    } 
    815 
    916    function index() 
     
    5360            $this->user =& $this->User->find($this->params['id']); 
    5461            if($this->Request->isPost()){ 
    55                 $this->user->destroy(); 
     62                $this->user->is_deleted = true; 
     63                $this->user->save(); 
    5664                $this->redirectTo(array('action' => 'listing')); 
    5765            } 
     
    5967    }   
    6068} 
    61  
    62 ?> 
  • events/phpframework/akelos/trunk/app/models/user.php

    r19814 r19968  
    11<?php 
    2  
    32class User extends ActiveRecord 
    43{ 
     4    public static function login($params) 
     5    { 
     6        return false; 
     7    } 
    58 
     9    public function logout() 
     10    { 
     11        return true; 
     12    } 
    613} 
    7  
    8 ?> 
  • events/phpframework/akelos/trunk/config/config.php

    r19943 r19968  
    2020); 
    2121unset($common_settings); 
     22 
     23// 0 -> create file, 1 -> use database 
     24define('AK_SESSION_HANDLER', 0); 
    2225 
    2326// If you want to write/delete/create files or directories using ftp instead of local file 
  • events/phpframework/akelos/trunk/config/locales/en.php

    r19934 r19968  
    296296'; 
    297297 
     298// 2008-09-26 16:41:57 
     299 
     300 
     301$dictionary['Invalid filter %filter. Filters need to be a method name or a class implementing a static filter method'] = 'Invalid filter %filter. Filters need to be a method name or a class implementing a static filter method'; 
     302 
    298303 
    299304?> 
  • events/phpframework/akelos/trunk/config/locales/ja.php

    r19934 r19968  
    294294'; 
    295295 
     296// 2008-09-26 16:41:57 
     297 
     298 
     299$dictionary['Invalid filter %filter. Filters need to be a method name or a class implementing a static filter method'] = 'Invalid filter %filter. Filters need to be a method name or a class implementing a static filter method'; 
     300 
    296301 
    297302?> 
  • events/phpframework/akelos/trunk/config/routes.php

    r19942 r19968  
    1616 
    1717$Map->connect('/:controller/:action/:id', array('controller' => 'page', 'action' => 'index')); 
    18 ?>