Changeset 22365

Show
Ignore:
Timestamp:
10/30/08 14:32:39 (5 years ago)
Author:
gen
Message:

adding home_controller, endoser and editing page_controller::index

Location:
events/phpframework/akelos/trunk
Files:
45 added
16 removed
35 modified

Legend:

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

    r21503 r22365  
    44{ 
    55    var $models = array('User','Sentinel'); 
     6    var $layout = 'page'; 
    67 
    78    function __construct() 
  • events/phpframework/akelos/trunk/app/controllers/admin_controller.php

    r21289 r22365  
    2424    { 
    2525        $this->beforeFilter('load_settings'); 
    26         $this->beforeFilter('authenticate', array('except' => 'login')); 
    27         !empty($this->protected_actions) ? $this->beforeFilter('_protectAction', array('except' => 'login')) : null; 
     26        $this->beforeFilter('authenticate'); 
     27        !empty($this->protected_actions) ? $this->beforeFilter('_protectAction') : null; 
    2828        !empty($this->protect_all_actions) ? $this->beforeFilter(array('_protectAllActions' => array('except'=>array('action_privileges_error', 'login')))) : null; 
    2929    } 
  • events/phpframework/akelos/trunk/app/controllers/help_controller.php

    r21458 r22365  
    33class HelpController extends ApplicationController 
    44{ 
    5     public $model = 'Introduction'; 
    6  
    7     // indexes 
    8     public function why()  { $this->index('why'); } 
    9     public function how()  { $this->index('how'); } 
    10     public function index($description = 'what') 
     5    public $layout = 'page'; 
     6     
     7    /* return descriptions for PageController::index with Ajax */ 
     8    public function what() { $this->render(array('partial' => 'what')); } 
     9    public function why()  { $this->render(array('partial' => 'why' )); } 
     10    public function how()  { $this->render(array('partial' => 'how' )); } 
     11     
     12    public function index() 
    1113    { 
    12         $this->settings = Ak::getSettings('admin'); 
    13         $this->introductions = $this->Introduction->random(3); 
    14         $this->description = $description; 
    15         $this->renderAction('index'); 
    1614    } 
    17  
     15     
    1816    public function aboutus() 
    1917    { 
  • events/phpframework/akelos/trunk/app/controllers/page_controller.php

    r21273 r22365  
    33class PageController extends ApplicationController 
    44{ 
     5    public $model = 'Endoser'; 
     6     
    57    function index() 
    68    { 
     9        $this->settings = Ak::getSettings('admin'); 
     10        $this->endosers = $this->Endoser->random(3); 
     11        $this->renderAction('index'); 
    712    } 
    813} 
    9  
    10 ?> 
  • events/phpframework/akelos/trunk/app/locales/account/en.php

    r21503 r22365  
    3838$dictionary['Title'] = 'Title'; 
    3939 
     40// 2008-10-30 9:40:44 
     41 
     42 
     43$dictionary['Invalid or expired authentication URL.'] = 'Invalid or expired authentication URL.'; 
     44 
     45// 2008-10-30 9:40:44 
     46 
     47 
     48$dictionary['User name & password reminder'] = 'User name & password reminder'; 
     49$dictionary['The email address you used to sign up on %settings-application_name'] = 'The email address you used to sign up on %settings-application_name'; 
     50$dictionary['Get access details'] = 'Get access details'; 
     51 
     52// 2008-10-30 13:45:45 
     53 
     54 
     55$dictionary['Footer'] = 'Footer'; 
     56$dictionary['About Us'] = 'About Us'; 
     57$dictionary['Contact'] = 'Contact'; 
     58$dictionary['Blog'] = 'Blog'; 
     59$dictionary['Status'] = 'Status'; 
     60$dictionary['API'] = 'API'; 
     61$dictionary['Search'] = 'Search'; 
     62$dictionary['Help'] = 'Help'; 
     63$dictionary['Jobs'] = 'Jobs'; 
     64$dictionary['TOS'] = 'TOS'; 
     65$dictionary['Privacy'] = 'Privacy'; 
     66 
    4067 
    4168?> 
  • events/phpframework/akelos/trunk/app/locales/account/ja.php

    r21503 r22365  
    3838$dictionary['Title'] = 'Title'; 
    3939 
     40// 2008-10-30 9:40:44 
     41 
     42 
     43$dictionary['Invalid or expired authentication URL.'] = 'Invalid or expired authentication URL.'; 
     44 
     45// 2008-10-30 9:40:44 
     46 
     47 
     48$dictionary['User name & password reminder'] = 'User name & password reminder'; 
     49$dictionary['The email address you used to sign up on %settings-application_name'] = 'The email address you used to sign up on %settings-application_name'; 
     50$dictionary['Get access details'] = 'Get access details'; 
     51 
     52// 2008-10-30 13:45:45 
     53 
     54 
     55$dictionary['Footer'] = 'Footer'; 
     56$dictionary['About Us'] = 'About Us'; 
     57$dictionary['Contact'] = 'Contact'; 
     58$dictionary['Blog'] = 'Blog'; 
     59$dictionary['Status'] = 'Status'; 
     60$dictionary['API'] = 'API'; 
     61$dictionary['Search'] = 'Search'; 
     62$dictionary['Help'] = 'Help'; 
     63$dictionary['Jobs'] = 'Jobs'; 
     64$dictionary['TOS'] = 'TOS'; 
     65$dictionary['Privacy'] = 'Privacy'; 
     66 
    4067 
    4168?> 
  • events/phpframework/akelos/trunk/app/locales/help/en.php

    r21458 r22365  
    4848$dictionary['User name or email address:'] = 'User name or email address:'; 
    4949 
     50// 2008-10-30 10:20:42 
     51 
     52 
     53$dictionary['<p class="teaser">Why</p>'] = '<p class="teaser">Why</p>'; 
     54 
     55// 2008-10-30 10:21:31 
     56 
     57 
     58$dictionary['<p class="teaser">How</p>'] = '<p class="teaser">How</p>'; 
     59 
    5060 
    5161?> 
  • events/phpframework/akelos/trunk/app/locales/help/ja.php

    r21458 r22365  
    4848$dictionary['User name or email address:'] = 'User name or email address:'; 
    4949 
     50// 2008-10-30 10:20:42 
     51 
     52 
     53$dictionary['<p class="teaser">Why</p>'] = '<p class="teaser">Why</p>'; 
     54 
     55// 2008-10-30 10:21:31 
     56 
     57 
     58$dictionary['<p class="teaser">How</p>'] = '<p class="teaser">How</p>'; 
     59 
    5060 
    5161?> 
  • events/phpframework/akelos/trunk/app/locales/helpers/active_record/en.php

    r21394 r22365  
    1919$dictionary['errors'] = 'errors'; 
    2020 
     21// 2008-10-30 13:49:45 
     22 
     23 
     24$dictionary['Email can\'t be blank'] = 'Email can\'t be blank'; 
     25$dictionary['Email Invalid email address'] = 'Email Invalid email address'; 
     26 
    2127 
    2228?> 
  • events/phpframework/akelos/trunk/app/locales/helpers/active_record/ja.php

    r21394 r22365  
    1919$dictionary['errors'] = 'errors'; 
    2020 
     21// 2008-10-30 13:49:45 
     22 
     23 
     24$dictionary['Email can\'t be blank'] = 'Email can\'t be blank'; 
     25$dictionary['Email Invalid email address'] = 'Email Invalid email address'; 
     26 
    2127 
    2228?> 
  • events/phpframework/akelos/trunk/app/locales/page/en.php

    r21273 r22365  
    5151$dictionary['Akelos Framework'] = 'Akelos Framework'; 
    5252 
     53// 2008-10-30 9:23:23 
     54 
     55 
     56$dictionary['What is Phwittr?'] = 'What is Phwittr?'; 
     57$dictionary['What?'] = 'What?'; 
     58$dictionary['Why?'] = 'Why?'; 
     59$dictionary['How?'] = 'How?'; 
     60$dictionary['<p class="teaser">Phwittr is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: <strong> What are you doing?</strong></p>'] = '<p class="teaser">Phwittr is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: <strong> What are you doing?</strong></p>'; 
     61$dictionary['Get Started-join!'] = 'Get Started-join!'; 
     62$dictionary['Watch a video!'] = 'Watch a video!'; 
     63 
     64// 2008-10-30 9:24:10 
     65 
     66 
     67$dictionary['Please sign in'] = 'Please sign in'; 
     68$dictionary['User name or email address:'] = 'User name or email address:'; 
     69$dictionary['Password'] = 'Password'; 
     70$dictionary['Remember me'] = 'Remember me'; 
     71$dictionary['Sign In'] = 'Sign In'; 
     72$dictionary['Forgot password?'] = 'Forgot password?'; 
     73$dictionary['Click here.'] = 'Click here.'; 
     74 
     75// 2008-10-30 9:30:21 
     76 
     77 
     78$dictionary['Title'] = 'Title'; 
     79$dictionary['English'] = 'English'; 
     80$dictionary['Japanese'] = 'Japanese'; 
     81$dictionary['Footer'] = 'Footer'; 
     82$dictionary['About Us'] = 'About Us'; 
     83$dictionary['Contact'] = 'Contact'; 
     84$dictionary['Blog'] = 'Blog'; 
     85$dictionary['Status'] = 'Status'; 
     86$dictionary['API'] = 'API'; 
     87$dictionary['Search'] = 'Search'; 
     88$dictionary['Help'] = 'Help'; 
     89$dictionary['Jobs'] = 'Jobs'; 
     90$dictionary['TOS'] = 'TOS'; 
     91$dictionary['Privacy'] = 'Privacy'; 
     92 
     93// 2008-10-30 10:58:09 
     94 
     95 
     96$dictionary['endoser.body'] = 'endoser.body'; 
     97 
    5398 
    5499?> 
  • events/phpframework/akelos/trunk/app/locales/page/ja.php

    r21273 r22365  
    5151$dictionary['Akelos Framework'] = 'Akelos フレームワーク'; 
    5252 
     53// 2008-10-30 9:23:23 
     54 
     55 
     56$dictionary['What is Phwittr?'] = 'What is Phwittr?'; 
     57$dictionary['What?'] = 'What?'; 
     58$dictionary['Why?'] = 'Why?'; 
     59$dictionary['How?'] = 'How?'; 
     60$dictionary['<p class="teaser">Phwittr is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: <strong> What are you doing?</strong></p>'] = '<p class="teaser">Phwittr is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: <strong> What are you doing?</strong></p>'; 
     61$dictionary['Get Started-join!'] = 'Get Started-join!'; 
     62$dictionary['Watch a video!'] = 'Watch a video!'; 
     63 
     64// 2008-10-30 9:24:10 
     65 
     66 
     67$dictionary['Please sign in'] = 'Please sign in'; 
     68$dictionary['User name or email address:'] = 'User name or email address:'; 
     69$dictionary['Password'] = 'Password'; 
     70$dictionary['Remember me'] = 'Remember me'; 
     71$dictionary['Sign In'] = 'Sign In'; 
     72$dictionary['Forgot password?'] = 'Forgot password?'; 
     73$dictionary['Click here.'] = 'Click here.'; 
     74 
     75// 2008-10-30 9:30:21 
     76 
     77 
     78$dictionary['Title'] = 'Title'; 
     79$dictionary['English'] = 'English'; 
     80$dictionary['Japanese'] = 'Japanese'; 
     81$dictionary['Footer'] = 'Footer'; 
     82$dictionary['About Us'] = 'About Us'; 
     83$dictionary['Contact'] = 'Contact'; 
     84$dictionary['Blog'] = 'Blog'; 
     85$dictionary['Status'] = 'Status'; 
     86$dictionary['API'] = 'API'; 
     87$dictionary['Search'] = 'Search'; 
     88$dictionary['Help'] = 'Help'; 
     89$dictionary['Jobs'] = 'Jobs'; 
     90$dictionary['TOS'] = 'TOS'; 
     91$dictionary['Privacy'] = 'Privacy'; 
     92 
     93// 2008-10-30 10:58:09 
     94 
     95 
     96$dictionary['endoser.body'] = 'endoser.body'; 
     97 
    5398 
    5499?> 
  • events/phpframework/akelos/trunk/app/models/sentinel.php

    r21289 r22365  
    5858        return $result; 
    5959    } 
    60      
     60 
    6161    function authenticateWithToken($token) 
    6262    { 
     
    110110    function hasUserOnSession() 
    111111    { 
    112         return !empty($this->Session['__CurrentUser']); 
     112        return !empty($this->Session['__current_user_id']); 
    113113    } 
    114114 
    115115    function getUserFromSession() 
    116116    { 
    117         return $this->hasUserOnSession() ? unserialize($this->Session['__CurrentUser']) : false; 
     117        if ($this->hasUserOnSession()) { 
     118            $model = isset($this->Session['__CurrentUserType'])?$this->Session['__CurrentUserType']:'User'; 
     119            Ak::import($model); 
     120            $UserInstance =& new $model(); 
     121            return $UserInstance->find($this->Session['__current_user_id'], array('include'=>'roles')); 
     122        } 
     123        return false; 
    118124    } 
    119125 
     
    121127    { 
    122128        if(!$this->hasUserOnSession() || $force){ 
    123             $this->Session['__CurrentUser'] = serialize($User); 
    124         } 
     129            $this->Session['__current_user_id'] = $User->getId(); 
     130            $this->Session['__CurrentUserType'] = get_class($User); 
     131        } 
     132 
    125133    } 
    126134 
     
    128136    { 
    129137        if($this->hasUserOnSession()){ 
    130             $this->Session['__CurrentUser'] = null; 
     138            $this->Session['__CurrentUserType'] = null; 
     139            $this->Session['__current_user_id'] = null; 
    131140        } 
    132141    } 
  • events/phpframework/akelos/trunk/app/models/user.php

    r21289 r22365  
    33 
    44defined('AK_DEFAULT_USER_ROLE') ? null : define('AK_DEFAULT_USER_ROLE', 'Registered user'); 
     5defined('AK_DEFAULT_ADMIN_SETTINGS') ? null : define('AK_DEFAULT_ADMIN_SETTINGS', 'admin'); 
    56 
    67class User extends ActiveRecord 
    78{ 
    8     var $habtm = array('roles' => array('unique'=>true)); 
     9    var $habtm = array('roles' => array('unique'=>true, 'foreign_key'=>'user_id')); 
    910 
    1011    /** 
     
    6263    function setDefaultRole() 
    6364    { 
    64         $settings = Ak::getSettings('admin'); 
     65        $settings = Ak::getSettings(AK_DEFAULT_ADMIN_SETTINGS); 
    6566        if(!empty($settings['account_settings']['default_role'])){ 
    6667            $this->role->load(); 
     
    259260        $options = array_merge($default_options, $options); 
    260261 
    261         $options['expires'] = empty($options['expires']) ? 0 : Ak::getTimestamp()+((empty($options['expires']) ? '0' : ($options['expires'] == true ? 86400 : $options['expires']))); 
     262        $options['expires'] = empty($options['expires']) ? 0 : Ak::getTimestamp()+((empty($options['expires']) ? '0' : ($options['expires'] === true ? 86400 : $options['expires']))); 
    262263        $options['single_use'] = $options['single_use'] ? 1 : 0; 
    263264 
     
    287288    function _encodeToken($options) 
    288289    { 
    289         return base64_encode(Ak::blowfishEncrypt(Ak::toJson($options), Ak::getSetting('admin', 'token_key'))); 
     290        return base64_encode(Ak::blowfishEncrypt(Ak::toJson($options), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key'))); 
    290291    } 
    291292 
     
    299300    function _decodeToken($token) 
    300301    { 
    301         return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting('admin', 'token_key'))); 
     302        return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key'))); 
    302303    } 
    303304 
     
    320321    { 
    321322        if(!isset($this->_activeRecordHasBeenInstantiated) ||  
    322             $this->getModelName() != 'User'){ 
     323            !in_array('User', array($this->getModelName(), $this->getParentModelName()))){ 
    323324            if (User::isLoaded()) { 
    324325                $User =& User::getCurrentUser(); 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/generators/admin_scaffold/USAGE

    r21289 r22365  
    1616     
    1717Example: 
    18     generate scaffold Account Bank debit credit 
     18    generate admin_scaffold Account Bank debit credit 
    1919 
    2020    This will generate an Account model and BankController with a full test 
    2121    suite and a basic user interface.  Now create the accounts table in your 
    22     database and browse to http://localhost/bank/ -- voila. 
     22    database and browse to http://localhost/admin/bank/ -- voila. 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/app/controllers/admin_controller.php

    r21289 r22365  
    2424    { 
    2525        $this->beforeFilter('load_settings'); 
    26         $this->beforeFilter('authenticate', array('except' => 'login')); 
    27         !empty($this->protected_actions) ? $this->beforeFilter('_protectAction', array('except' => 'login')) : null; 
     26        $this->beforeFilter('authenticate'); 
     27        !empty($this->protected_actions) ? $this->beforeFilter('_protectAction') : null; 
    2828        !empty($this->protect_all_actions) ? $this->beforeFilter(array('_protectAllActions' => array('except'=>array('action_privileges_error', 'login')))) : null; 
    2929    } 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/app/models/sentinel.php

    r21289 r22365  
    5858        return $result; 
    5959    } 
    60      
     60 
    6161    function authenticateWithToken($token) 
    6262    { 
     
    110110    function hasUserOnSession() 
    111111    { 
    112         return !empty($this->Session['__CurrentUser']); 
     112        return !empty($this->Session['__current_user_id']); 
    113113    } 
    114114 
    115115    function getUserFromSession() 
    116116    { 
    117         return $this->hasUserOnSession() ? unserialize($this->Session['__CurrentUser']) : false; 
     117        if ($this->hasUserOnSession()) { 
     118            $model = isset($this->Session['__CurrentUserType'])?$this->Session['__CurrentUserType']:'User'; 
     119            Ak::import($model); 
     120            $UserInstance =& new $model(); 
     121            return $UserInstance->find($this->Session['__current_user_id'], array('include'=>'roles')); 
     122        } 
     123        return false; 
    118124    } 
    119125 
     
    121127    { 
    122128        if(!$this->hasUserOnSession() || $force){ 
    123             $this->Session['__CurrentUser'] = serialize($User); 
    124         } 
     129            $this->Session['__current_user_id'] = $User->getId(); 
     130            $this->Session['__CurrentUserType'] = get_class($User); 
     131        } 
     132 
    125133    } 
    126134 
     
    128136    { 
    129137        if($this->hasUserOnSession()){ 
    130             $this->Session['__CurrentUser'] = null; 
     138            $this->Session['__CurrentUserType'] = null; 
     139            $this->Session['__current_user_id'] = null; 
    131140        } 
    132141    } 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/app/models/user.php

    r21289 r22365  
    33 
    44defined('AK_DEFAULT_USER_ROLE') ? null : define('AK_DEFAULT_USER_ROLE', 'Registered user'); 
     5defined('AK_DEFAULT_ADMIN_SETTINGS') ? null : define('AK_DEFAULT_ADMIN_SETTINGS', 'admin'); 
    56 
    67class User extends ActiveRecord 
    78{ 
    8     var $habtm = array('roles' => array('unique'=>true)); 
     9    var $habtm = array('roles' => array('unique'=>true, 'foreign_key'=>'user_id')); 
    910 
    1011    /** 
     
    6263    function setDefaultRole() 
    6364    { 
    64         $settings = Ak::getSettings('admin'); 
     65        $settings = Ak::getSettings(AK_DEFAULT_ADMIN_SETTINGS); 
    6566        if(!empty($settings['account_settings']['default_role'])){ 
    6667            $this->role->load(); 
     
    259260        $options = array_merge($default_options, $options); 
    260261 
    261         $options['expires'] = empty($options['expires']) ? 0 : Ak::getTimestamp()+((empty($options['expires']) ? '0' : ($options['expires'] == true ? 86400 : $options['expires']))); 
     262        $options['expires'] = empty($options['expires']) ? 0 : Ak::getTimestamp()+((empty($options['expires']) ? '0' : ($options['expires'] === true ? 86400 : $options['expires']))); 
    262263        $options['single_use'] = $options['single_use'] ? 1 : 0; 
    263264 
     
    287288    function _encodeToken($options) 
    288289    { 
    289         return base64_encode(Ak::blowfishEncrypt(Ak::toJson($options), Ak::getSetting('admin', 'token_key'))); 
     290        return base64_encode(Ak::blowfishEncrypt(Ak::toJson($options), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key'))); 
    290291    } 
    291292 
     
    299300    function _decodeToken($token) 
    300301    { 
    301         return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting('admin', 'token_key'))); 
     302        return (array)Ak::fromJson(Ak::blowfishDecrypt(base64_decode($token), Ak::getSetting(AK_DEFAULT_ADMIN_SETTINGS, 'token_key'))); 
    302303    } 
    303304 
     
    320321    { 
    321322        if(!isset($this->_activeRecordHasBeenInstantiated) ||  
    322             $this->getModelName() != 'User'){ 
     323            !in_array('User', array($this->getModelName(), $this->getParentModelName()))){ 
    323324            if (User::isLoaded()) { 
    324325                $User =& User::getCurrentUser(); 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/config/admin.yml

    r21289 r22365  
    66    do_not_reply_email: do-not-reply@example.com 
    77    account_settings: 
    8       allow_sign_up: true 
     8      allow_sign_up: false 
    99      default_role: Registered user 
    1010    sign_in_url:  
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/test/unit/app/models/user.php

    r21289 r22365  
    1010    { 
    1111        $this->uninstallAndInstallMigration('AdminPlugin'); 
    12         $this->includeAndInstatiateModels('User', 'Role', 'Permission'); 
     12        $this->includeAndInstatiateModels('User', 'Sentinel', 'Role', 'Permission'); 
    1313    } 
    1414 
     
    7474        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    7575        $token = $Alicia->getToken(array('single_use'=> true)); 
    76         $this->assertTrue($User = User::authenticateWithToken($token)); 
     76        $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 
    7777        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    78         $this->assertFalse($User = User::authenticateWithToken($token)); 
     78        $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 
    7979    } 
    8080 
     
    8383        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    8484        $token = $Alicia->getToken(); 
    85         $this->assertTrue($User = User::authenticateWithToken($token));         
     85        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
    8686        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    87         $this->assertTrue($User = User::authenticateWithToken($token)); 
     87        $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 
    8888    } 
    8989     
     
    9393        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    9494        $token = $Alicia->getToken(array('expires'=>1)); 
    95         $this->assertTrue($User = User::authenticateWithToken($token));         
    96         $this->assertTrue($User = User::authenticateWithToken($token));         
     95        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
     96        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
    9797        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    9898        sleep(1); 
    99         $this->assertFalse($User = User::authenticateWithToken($token)); 
     99        $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 
    100100    } 
    101101 
  • events/phpframework/akelos/trunk/app/vendor/plugins/admin/makelos

    r21289 r22365  
    6262 
    6363$Makelos = new Makelos(); 
    64 $Makelos->connectToDatabase($database_settings); 
     64$Makelos->connectToDatabase(@$database_settings); 
    6565$Makelos->$task(@$argv); 
    6666 
  • events/phpframework/akelos/trunk/app/views/application/_footer.tpl

    r21458 r22365  
    33  <ul> 
    44    <li class="first">(G) 2008 Phwittr</li> 
    5     <li><a href="/help/aboutus">_{About Us}</a></li> 
    6     <li><a href="/help/contact">_{Contact}</a></li> 
    7     <li><%= link_to _('Blog'), 'http://d.hatena.ne.jp/gegegen' %></a></li> 
    8     <li><a href="http://status.twitter.jp">_{Status}</a></li> 
    9     <li><a href="http://apiwiki.twitter.com/">_{API}</a></li> 
    10     <li><a href="http://search.twitter.com">_{Search}</a></li> 
     5    <li><%= link_to _('About Us'), 'help/aboutus' %></li> 
     6    <li><%= link_to _('Contact'),  'help/contact' %></li> 
     7    <li><%= link_to _('Blog'),     'http://d.hatena.ne.jp/gegegen' %></a></li> 
     8    <li><%= link_to _('Status'),   'help/status' %></li> 
     9    <li><%= link_to _('API'),      'help/api' %></li> 
     10    <li><%= link_to _('Search'),   'help/search' %></li> 
     11    <li><%= link_to _('Help'),     'help/help' %></li> 
    1112    <li><a href="http://jptwitterhelp.blogspot.com">_{Help}</a></li> 
    1213    <li><a href="/help/jobs">_{Jobs}</a></li> 
  • events/phpframework/akelos/trunk/app/views/layouts/_footer.tpl

    r21458 r22365  
    1 <%= javascript_include_tag %> 
    21</body> 
    32</html> 
  • events/phpframework/akelos/trunk/app/views/layouts/_header.tpl

    r21458 r22365  
    1111  <link rel="apple-touch-icon" href="images/twitter_57.png" /> 
    1212  <%= stylesheet_link_tag 'default' %> 
     13  <%= javascript_include_tag %> 
    1314  <style type="text/css"> 
    1415    body {background: #9ae4e8 url(<%= image_path 'bg.gif' %>) fixed no-repeat top left; } 
  • events/phpframework/akelos/trunk/app/views/layouts/account.tpl

    r21503 r22365  
    1 <%= render :partial => 'layouts/header' %> 
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
     4  <head> 
     5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     6    <title> 
     7      {settings-application_name} 
     8    </title> 
     9    <%= javascript_include_tag %> 
     10    <%= javascript_for_current_controller %> 
     11    <%= stylesheet_link_tag "account.css", :media=>'print,screen' %> 
     12  </head> 
    213  <body> 
    3     <%= javascript_for_current_controller %> 
    414    <div id="layout"> 
    515      <div id="canvas" class="login"> 
     
    1424              <%= link_to _'sign in', :action => 'sign_in' %> 
    1525              {?settings-account_settings-allow_sign_up} 
    16               _{or} 
     26              {or} 
    1727                  <%= link_to _'sign up', :action => 'sign_up' %> 
    1828              {end} 
     
    2838      </div> 
    2939    </div> 
    30 <%= render :partial => 'layouts/footer' %> 
     40  </body> 
     41</html> 
  • events/phpframework/akelos/trunk/app/views/layouts/application.tpl

    r21458 r22365  
    1 <%= render :partial => 'header' %> 
     1<%= render :partial => 'layouts/header' %> 
    22 
    33<body class="front" id="profile" onload="registerResponders();"> 
     
    88    </span> 
    99    <h1 id="header"> 
    10       <%= link_to image_tag('twitter_logo_s.png', :width => 175), {:controller => 'user', :action => 'home'}, :title => 'Phwittr home' %> 
     10      <%= link_to image_tag('twitter_logo_s.png', :alt => 'Pwittr', :width => 175),  
     11            {:controller => 'user', :action => 'home'}, :title => 'Phwittr home' %> 
    1112    </h1> 
    1213    <div id="flash" style="display:none;"></div> 
     
    1516    {content_for_layout} 
    1617 
    17     <div id="footer" > 
    18       <h3>Footer</h3> 
    19       <ul> 
    20         <li class="first">&copy; 2008 Twitter</li> 
    21         <li><a href="/help/aboutus">About Us</a></li> 
    22         <li><a href="/help/contact">Contact</a></li> 
    23         <li><a href="http://blog.twitter.com">Blog</a></li> 
    24         <li><a href="http://status.twitter.com">Status</a></li> 
    25         <li><a href="/downloads">Downloads</a></li> 
    26         <li><a href="http://apiwiki.twitter.com/">API</a></li> 
    27         <li><a href="http://search.twitter.com">Search</a></li> 
    28         <li><a href="http://help.twitter.com">Help</a></li> 
    29         <li><a href="/help/jobs">Jobs</a></li> 
    30         <li><a href="/tos">TOS</a></li> 
    31         <li><a href="/help/privacy">Privacy</a></li> 
    32       </ul> 
    33     </div> 
     18    <%= render :partial => 'application/footer' %> 
     19 
    3420    <hr /> 
    3521    <div id="navigation"> 
     
    5036</body> 
    5137 
    52 <%= render :partial => 'footer' %> 
     38<%= render :partial => 'layouts/footer' %> 
  • events/phpframework/akelos/trunk/app/views/layouts/page.tpl

    r21273 r22365  
    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    2         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    3 <html> 
    4   <head> 
    5     <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
    6     <title>_{Akelos Framework}</title> 
    7     <style type="text/css" media="screen"> 
    8         body { 
    9             margin: 0; 
    10             margin-bottom: 25px; 
    11             padding: 0; 
    12             background-color: #f0f0f0; 
    13             font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana"; 
    14             font-size: 13px; 
    15             color: #333; 
    16           } 
    17            
    18           h1 { 
    19             font-size: 28px; 
    20             color: #000; 
    21           } 
    22            
    23           a  {color: #03c} 
    24           a:hover { 
    25             background-color: #03c; 
    26             color: white; 
    27             text-decoration: none; 
    28           } 
    29            
    30            
    31           #page { 
    32             background: #f0f0f0; 
    33             width: 750px; 
    34             margin: 0; 
    35             margin-left: auto; 
    36             margin-right: auto; 
    37           } 
    38            
    39           #content { 
    40             float: left; 
    41             background: #fff url('<?=$asset_tag_helper->image_path('akelos_framework_logo')?>') 10px 10px no-repeat; 
    42             border: 3px solid #aaa; 
    43             border-top: none; 
    44             padding: 25px; 
    45             width: 650px; 
    46           } 
    47            
    48           #footer { 
    49             clear: both; 
    50           } 
    51            
    52      
    53           #header, #about, #main-content { 
    54             padding-left: 75px; 
    55             padding-right: 30px; 
    56           } 
    57      
    58      
    59           #header { 
    60             margin:0 0 35px 100px; 
    61           } 
    62            
    63           #header h1, #header h2 {margin: 0} 
    64           #header h2 { 
    65             color: #888; 
    66             font-weight: normal; 
    67             font-size: 16px; 
    68           } 
    69            
    70           #main-content { 
    71             border-top: 1px solid #ccc; 
    72             margin-top: 25px; 
    73             padding-top: 15px; 
    74           } 
    75           #main-content h1 { 
    76             margin: 0; 
    77             font-size: 20px; 
    78           } 
    79           #main-content h2 { 
    80             margin: 0; 
    81             font-size: 14px; 
    82             font-weight: normal; 
    83             color: #333; 
    84             margin-bottom: 25px; 
    85           } 
    86           #main-content ol { 
    87             margin-left: 0; 
    88             padding-left: 0; 
    89           } 
    90           #main-content li { 
    91             font-size: 18px; 
    92             color: #888; 
    93             margin-bottom: 25px; 
    94           } 
    95           #main-content li h2 { 
    96             margin: 0; 
    97             font-weight: normal; 
    98             font-size: 18px; 
    99             color: #333; 
    100           } 
    101           #main-content li p { 
    102             color: #555; 
    103             font-size: 13px; 
    104           } 
    105           fieldset { 
    106               width:400px; 
    107           } 
    108           label { 
    109               margin:0 10px 0 0; 
    110               display:block; 
    111           } 
    112           input{ 
    113               width:100%; 
    114           }    
    115           .sqlite_database_name { 
    116             width:180px; 
    117           }     
    118           #next-step { 
    119               text-align: right; 
    120           }   
    121           .important{ 
    122             font-weight: bold; 
    123             font-size: 140%; 
    124           } 
    125         .flash{ 
    126             margin-left:160px; 
    127             border:2px solid red; 
    128             padding:5px; 
    129         } 
    130     </style> 
    131   </head> 
    132   <body> 
    133     <div id="page"> 
    134       <div id="content"> 
    135       <?php echo $text_helper->flash();?> 
    136       <?php echo $content_for_layout; ?> 
    137        
    138       </div> 
    139       <div id="footer"> </div> 
    140     </div> 
    141   </body> 
    142 </html> 
     1<%= render :partial => 'layouts/header' %> 
     2<body id="front"> 
     3  <div id="container"> 
     4    <h1 id="header"> 
     5      <%= link_to image_tag('twitter.png', :alt => 'Phwittr', :height => 49, :width => 210),  
     6        {:controller => 'page'}, :title => 'Phwittr Home' %> 
     7    </h1> 
     8    {content_for_layout} 
     9    <%= render :partial => 'application/footer' %> 
     10    <hr /> 
     11  </div><!-- /container --> 
     12</body> 
     13<%= render :partial => 'layouts/footer' %> 
  • events/phpframework/akelos/trunk/app/views/page/index.tpl

    r21273 r22365  
    1 _{ 
    2         <div id="header"> 
    3           <h1>Welcome aboard</h1> 
    4           <h2>You&rsquo;re using The Akelos Framework!</h2> 
    5         </div> 
    6  
    7         <div id="main-content"> 
    8           <h1>Getting started</h1> 
    9           <ol> 
    10             <li> 
    11               <h2>Use <tt>script/generate</tt> to create your models and controllers</h2> 
    12               <p>To see all available options, run it without parameters.</p> 
    13             </li> 
    14              
    15             <li> 
    16               <h2>Set up a default routes (config/routes.php) or edit the default controller (app/controllers/page_controller.php)</h2> 
    17             </li> 
    18              
    19           </ol> 
    20         </div> 
    21 } 
     1<%= render :partial => 'lang_select' %> 
     2<div id="content"> 
     3  <div class="wrapper"> 
     4    <div class="intro"> 
     5      <h2>_{What is Phwittr?}</h2> 
     6      <ul id="menu"> 
     7        <li><%= link_to_remote _('What?'), :url => {:controller => 'help', :action => 'what'}, :update => 'shout' %></li> 
     8        <li><%= link_to_remote _('Why?'),  :url => {:controller => 'help', :action => 'why'},  :update => 'shout' %></li> 
     9        <li><%= link_to_remote _('How?'),  :url => {:controller => 'help', :action => 'how'},  :update => 'shout' %></li> 
     10      </ul> 
     11      <div id="shout"><%= render :partial => 'help/what' %></div> 
     12      <p><%= link_to _('Get Started-join!'), {:controller => 'account', :action => 'sign_up'}, :id => 'signup_submit', :class => 'join' %></a></p> 
     13    </div> 
     14    <hr /> 
     15    <p><%= link_to "#{image_tag('arrow_on_red.gif')} #{_('Watch a video!')}", image_path('nomore.jpg'), :id => 'videobutton' %></p> 
     16    <%= render :partial => 'sign_in' %> 
     17  </div> 
     18</div> 
     19<div id="whatistwitter"> 
     20<ul> 
     21  {loop endosers} 
     22  <li> 
     23    <blockquote> 
     24      <p>{_endoser.body}</p> 
     25    </blockquote> 
     26    <cite class="vcard">{_endoser.author}</cite> 
     27  </li> 
     28  {end} 
     29</ul> 
     30</div> 
  • events/phpframework/akelos/trunk/config/admin.yml

    r21289 r22365  
    11default: 
    2     application_name: Akelos Application 
     2    application_name: Pwittr  
    33    http_auth_realm: Application Administration 
    44    default_authentication_method: post 
     
    66    do_not_reply_email: do-not-reply@example.com 
    77    account_settings: 
    8       allow_sign_up: true 
     8      allow_sign_up: false 
    99      default_role: Registered user 
    1010    sign_in_url:  
     
    1717      action: logout 
    1818    authentication_url: 
    19       controller: dashboard 
    20       module: admin 
     19      controller: home 
     20      module: false  
  • events/phpframework/akelos/trunk/config/config.php

    r21464 r22365  
    1717 
    1818// Use this in order to allow only these locales on web requests 
    19 define('AK_ACTIVE_RECORD_DEFAULT_LOCALES', 'ja,en'); 
    20 define('AK_APP_LOCALES', 'ja,en'); 
    21 define('AK_PUBLIC_LOCALES', 'ja,en'); 
     19define('AK_ACTIVE_RECORD_DEFAULT_LOCALES', 'en,ja'); 
     20define('AK_APP_LOCALES', 'en,ja'); 
     21define('AK_PUBLIC_LOCALES', 'en,ja'); 
    2222 
    2323 
  • events/phpframework/akelos/trunk/config/database.yml

    r21503 r22365  
    44    port:  
    55    user: root 
    6     password:  
     6    password: root  
    77    options:  
    88 
  • events/phpframework/akelos/trunk/config/locales/en.php

    r21503 r22365  
    284284$dictionary['Could not find %namespace settings file in %path.'] = 'Could not find %namespace settings file in %path.'; 
    285285 
     286// 2008-10-30 8:42:27 
     287 
     288 
     289$dictionary['Connection to the database failed. %dsn'] = 'Connection to the database failed. %dsn'; 
     290 
     291// 2008-10-30 8:43:06 
     292 
     293 
     294$dictionary['Could not create or alter table %name using the SQL  
     295-------- 
     296%sql 
     297-------- 
     298'] = 'Could not create or alter table %name using the SQL  
     299-------- 
     300%sql 
     301-------- 
     302'; 
     303 
     304// 2008-10-30 13:27:17 
     305 
     306 
     307$dictionary['You can\'t upgrade to version %version, when you are currently on version %current_version'] = 'You can\'t upgrade to version %version, when you are currently on version %current_version'; 
     308 
    286309 
    287310?> 
  • events/phpframework/akelos/trunk/config/locales/ja.php

    r21503 r22365  
    282282$dictionary['Could not find %namespace settings file in %path.'] = 'Could not find %namespace settings file in %path.'; 
    283283 
     284// 2008-10-30 8:42:27 
     285 
     286 
     287$dictionary['Connection to the database failed. %dsn'] = 'Connection to the database failed. %dsn'; 
     288 
     289// 2008-10-30 8:43:06 
     290 
     291 
     292$dictionary['Could not create or alter table %name using the SQL  
     293-------- 
     294%sql 
     295-------- 
     296'] = 'Could not create or alter table %name using the SQL  
     297-------- 
     298%sql 
     299-------- 
     300'; 
     301 
     302// 2008-10-30 13:27:17 
     303 
     304 
     305$dictionary['You can\'t upgrade to version %version, when you are currently on version %current_version'] = 'You can\'t upgrade to version %version, when you are currently on version %current_version'; 
     306 
    284307 
    285308?> 
  • events/phpframework/akelos/trunk/config/routes.php

    r21458 r22365  
    11<?php  
     2// You can find more about routes on /lib/AkRouters.php and /test/test_AkRouter.php 
    23 
    3 $Map->connect('/', array('controller' => 'help', 'action' => 'index')); 
     4$Map->connect('/', array('controller' => 'page', 'action' => 'index')); 
    45 
    56$Map->connect('/login',  array('controller' => 'account', 'action' => 'sign_in')); 
    67$Map->connect('/signup', array('controller' => 'account', 'action' => 'sign_up')); 
    78 
    8 $Map->connect('/home', array('controller' => 'dashboard', 'action' => 'index', 'module' => 'admin')); 
    99$Map->connect('/admin/:controller/:action/:id', array('controller' => 'dashboard', 'action' => 'index', 'module' => 'admin'));  
    10  
    11 // You can find more about routes on /lib/AkRouters.php and /test/test_AkRouter.php 
    12  
    1310$Map->connect('/:controller/:action/:id'); 
  • events/phpframework/akelos/trunk/test/unit/app/models/user.php

    r21289 r22365  
    1010    { 
    1111        $this->uninstallAndInstallMigration('AdminPlugin'); 
    12         $this->includeAndInstatiateModels('User', 'Role', 'Permission'); 
     12        $this->includeAndInstatiateModels('User', 'Sentinel', 'Role', 'Permission'); 
    1313    } 
    1414 
     
    7474        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    7575        $token = $Alicia->getToken(array('single_use'=> true)); 
    76         $this->assertTrue($User = User::authenticateWithToken($token)); 
     76        $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 
    7777        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    78         $this->assertFalse($User = User::authenticateWithToken($token)); 
     78        $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 
    7979    } 
    8080 
     
    8383        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    8484        $token = $Alicia->getToken(); 
    85         $this->assertTrue($User = User::authenticateWithToken($token));         
     85        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
    8686        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    87         $this->assertTrue($User = User::authenticateWithToken($token)); 
     87        $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 
    8888    } 
    8989     
     
    9393        $Alicia =& $this->User->findFirstBy('login', 'alicia'); 
    9494        $token = $Alicia->getToken(array('expires'=>1)); 
    95         $this->assertTrue($User = User::authenticateWithToken($token));         
    96         $this->assertTrue($User = User::authenticateWithToken($token));         
     95        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
     96        $this->assertTrue($User = Sentinel::authenticateWithToken($token));         
    9797        $this->assertEqual($Alicia->get('login'), $User->get('login')); 
    9898        sleep(1); 
    99         $this->assertFalse($User = User::authenticateWithToken($token)); 
     99        $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 
    100100    } 
    101101