Changeset 22365
- Timestamp:
- 10/30/08 14:32:39 (5 years ago)
- Location:
- events/phpframework/akelos/trunk
- Files:
-
- 45 added
- 16 removed
- 35 modified
-
app/controllers/account_controller.php (modified) (1 diff)
-
app/controllers/admin_controller.php (modified) (1 diff)
-
app/controllers/help_controller.php (modified) (1 diff)
-
app/controllers/home_controller.php (added)
-
app/controllers/page_controller.php (modified) (1 diff)
-
app/helpers/home_helper.php (added)
-
app/installers/endoser_installer.php (added)
-
app/installers/introduction_installer.php (deleted)
-
app/locales/account/en.php (modified) (1 diff)
-
app/locales/account/ja.php (modified) (1 diff)
-
app/locales/endoser (added)
-
app/locales/endoser/en.php (added)
-
app/locales/help/en.php (modified) (1 diff)
-
app/locales/help/ja.php (modified) (1 diff)
-
app/locales/helpers/active_record/en.php (modified) (1 diff)
-
app/locales/helpers/active_record/ja.php (modified) (1 diff)
-
app/locales/home (added)
-
app/locales/home/en.php (added)
-
app/locales/home/ja.php (added)
-
app/locales/page/en.php (modified) (1 diff)
-
app/locales/page/ja.php (modified) (1 diff)
-
app/models/endoser.php (added)
-
app/models/introduction.php (deleted)
-
app/models/sentinel.php (modified) (4 diffs)
-
app/models/user.php (modified) (6 diffs)
-
app/vendor/plugins/admin/generators/admin_scaffold/USAGE (modified) (1 diff)
-
app/vendor/plugins/admin/installer/admin_files/app/controllers/admin_controller.php (modified) (1 diff)
-
app/vendor/plugins/admin/installer/admin_files/app/models/sentinel.php (modified) (4 diffs)
-
app/vendor/plugins/admin/installer/admin_files/app/models/user.php (modified) (6 diffs)
-
app/vendor/plugins/admin/installer/admin_files/config/admin.yml (modified) (1 diff)
-
app/vendor/plugins/admin/installer/admin_files/test/fixtures/app/models/sentinel.php (added)
-
app/vendor/plugins/admin/installer/admin_files/test/unit/app/models/user.php (modified) (4 diffs)
-
app/vendor/plugins/admin/makelos (modified) (1 diff)
-
app/views/application/_footer.tpl (modified) (1 diff)
-
app/views/help/_how.tpl (added)
-
app/views/help/_lang_select.tpl (deleted)
-
app/views/help/_sign_in.tpl (deleted)
-
app/views/help/_what.tpl (added)
-
app/views/help/_what_is_phwittr.tpl (deleted)
-
app/views/help/_why.tpl (added)
-
app/views/help/how.tpl (deleted)
-
app/views/help/what.tpl (deleted)
-
app/views/help/why.tpl (deleted)
-
app/views/home (added)
-
app/views/home/index.tpl (added)
-
app/views/layouts/_footer.tpl (modified) (1 diff)
-
app/views/layouts/_header.tpl (modified) (1 diff)
-
app/views/layouts/account.tpl (modified) (3 diffs)
-
app/views/layouts/application.tpl (modified) (4 diffs)
-
app/views/layouts/compiled/page.tpl.php (deleted)
-
app/views/layouts/help.tpl (deleted)
-
app/views/layouts/page.tpl (modified) (1 diff)
-
app/views/page/_lang_select.tpl (added)
-
app/views/page/_sign_in.tpl (added)
-
app/views/page/index.tpl (modified) (1 diff)
-
config/admin.yml (modified) (3 diffs)
-
config/cache (added)
-
config/cache/development (added)
-
config/cache/development/admin.php (added)
-
config/cache/development/caching.php (added)
-
config/cache/development/database.php (added)
-
config/cache/development/inflector.php (added)
-
config/cache/development/sessions.php (added)
-
config/cache/production (added)
-
config/cache/production/admin.php (added)
-
config/cache/production/caching.php (added)
-
config/cache/production/database.php (added)
-
config/cache/production/inflector.php (added)
-
config/cache/production/sessions.php (added)
-
config/cache/testing (added)
-
config/cache/testing/admin.php (added)
-
config/cache/testing/caching.php (added)
-
config/cache/testing/database.php (added)
-
config/cache/testing/inflector.php (added)
-
config/cache/testing/sessions.php (added)
-
config/config.php (modified) (1 diff)
-
config/database.yml (modified) (1 diff)
-
config/locales/en.php (modified) (1 diff)
-
config/locales/ja.php (modified) (1 diff)
-
config/routes.php (modified) (1 diff)
-
test/fixtures/app/controllers/home_controller.php (added)
-
test/fixtures/app/helpers/home_helper.php (added)
-
test/fixtures/app/installers/endoser_installer.php (added)
-
test/fixtures/app/installers/introduction_installer.php (deleted)
-
test/fixtures/app/models/endoser.php (added)
-
test/fixtures/app/models/introduction.php (deleted)
-
test/fixtures/app/models/sentinel.php (added)
-
test/functional/controllers/home_controller.php (added)
-
test/unit/app/models/endoser.php (added)
-
test/unit/app/models/introduction.php (deleted)
-
test/unit/app/models/user.php (modified) (4 diffs)
-
tmp/installer_versions/development_endoser_version.txt (added)
-
tmp/installer_versions/development_introduction_version.txt (deleted)
-
tmp/sess_b1e5b90ba9d50ad656bd6ebfff190da1 (added)
-
tmp/sess_cc0ab4da9208e2bf6176ccf203074a1b (deleted)
-
tmp/views (deleted)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/akelos/trunk/app/controllers/account_controller.php
r21503 r22365 4 4 { 5 5 var $models = array('User','Sentinel'); 6 var $layout = 'page'; 6 7 7 8 function __construct() -
events/phpframework/akelos/trunk/app/controllers/admin_controller.php
r21289 r22365 24 24 { 25 25 $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; 28 28 !empty($this->protect_all_actions) ? $this->beforeFilter(array('_protectAllActions' => array('except'=>array('action_privileges_error', 'login')))) : null; 29 29 } -
events/phpframework/akelos/trunk/app/controllers/help_controller.php
r21458 r22365 3 3 class HelpController extends ApplicationController 4 4 { 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() 11 13 { 12 $this->settings = Ak::getSettings('admin');13 $this->introductions = $this->Introduction->random(3);14 $this->description = $description;15 $this->renderAction('index');16 14 } 17 15 18 16 public function aboutus() 19 17 { -
events/phpframework/akelos/trunk/app/controllers/page_controller.php
r21273 r22365 3 3 class PageController extends ApplicationController 4 4 { 5 public $model = 'Endoser'; 6 5 7 function index() 6 8 { 9 $this->settings = Ak::getSettings('admin'); 10 $this->endosers = $this->Endoser->random(3); 11 $this->renderAction('index'); 7 12 } 8 13 } 9 10 ?> -
events/phpframework/akelos/trunk/app/locales/account/en.php
r21503 r22365 38 38 $dictionary['Title'] = 'Title'; 39 39 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 40 67 41 68 ?> -
events/phpframework/akelos/trunk/app/locales/account/ja.php
r21503 r22365 38 38 $dictionary['Title'] = 'Title'; 39 39 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 40 67 41 68 ?> -
events/phpframework/akelos/trunk/app/locales/help/en.php
r21458 r22365 48 48 $dictionary['User name or email address:'] = 'User name or email address:'; 49 49 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 50 60 51 61 ?> -
events/phpframework/akelos/trunk/app/locales/help/ja.php
r21458 r22365 48 48 $dictionary['User name or email address:'] = 'User name or email address:'; 49 49 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 50 60 51 61 ?> -
events/phpframework/akelos/trunk/app/locales/helpers/active_record/en.php
r21394 r22365 19 19 $dictionary['errors'] = 'errors'; 20 20 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 21 27 22 28 ?> -
events/phpframework/akelos/trunk/app/locales/helpers/active_record/ja.php
r21394 r22365 19 19 $dictionary['errors'] = 'errors'; 20 20 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 21 27 22 28 ?> -
events/phpframework/akelos/trunk/app/locales/page/en.php
r21273 r22365 51 51 $dictionary['Akelos Framework'] = 'Akelos Framework'; 52 52 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 53 98 54 99 ?> -
events/phpframework/akelos/trunk/app/locales/page/ja.php
r21273 r22365 51 51 $dictionary['Akelos Framework'] = 'Akelos フレームワーク'; 52 52 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 53 98 54 99 ?> -
events/phpframework/akelos/trunk/app/models/sentinel.php
r21289 r22365 58 58 return $result; 59 59 } 60 60 61 61 function authenticateWithToken($token) 62 62 { … … 110 110 function hasUserOnSession() 111 111 { 112 return !empty($this->Session['__ CurrentUser']);112 return !empty($this->Session['__current_user_id']); 113 113 } 114 114 115 115 function getUserFromSession() 116 116 { 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; 118 124 } 119 125 … … 121 127 { 122 128 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 125 133 } 126 134 … … 128 136 { 129 137 if($this->hasUserOnSession()){ 130 $this->Session['__CurrentUser'] = null; 138 $this->Session['__CurrentUserType'] = null; 139 $this->Session['__current_user_id'] = null; 131 140 } 132 141 } -
events/phpframework/akelos/trunk/app/models/user.php
r21289 r22365 3 3 4 4 defined('AK_DEFAULT_USER_ROLE') ? null : define('AK_DEFAULT_USER_ROLE', 'Registered user'); 5 defined('AK_DEFAULT_ADMIN_SETTINGS') ? null : define('AK_DEFAULT_ADMIN_SETTINGS', 'admin'); 5 6 6 7 class User extends ActiveRecord 7 8 { 8 var $habtm = array('roles' => array('unique'=>true ));9 var $habtm = array('roles' => array('unique'=>true, 'foreign_key'=>'user_id')); 9 10 10 11 /** … … 62 63 function setDefaultRole() 63 64 { 64 $settings = Ak::getSettings( 'admin');65 $settings = Ak::getSettings(AK_DEFAULT_ADMIN_SETTINGS); 65 66 if(!empty($settings['account_settings']['default_role'])){ 66 67 $this->role->load(); … … 259 260 $options = array_merge($default_options, $options); 260 261 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']))); 262 263 $options['single_use'] = $options['single_use'] ? 1 : 0; 263 264 … … 287 288 function _encodeToken($options) 288 289 { 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'))); 290 291 } 291 292 … … 299 300 function _decodeToken($token) 300 301 { 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'))); 302 303 } 303 304 … … 320 321 { 321 322 if(!isset($this->_activeRecordHasBeenInstantiated) || 322 $this->getModelName() != 'User'){323 !in_array('User', array($this->getModelName(), $this->getParentModelName()))){ 323 324 if (User::isLoaded()) { 324 325 $User =& User::getCurrentUser(); -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/generators/admin_scaffold/USAGE
r21289 r22365 16 16 17 17 Example: 18 generate scaffold Account Bank debit credit18 generate admin_scaffold Account Bank debit credit 19 19 20 20 This will generate an Account model and BankController with a full test 21 21 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 24 24 { 25 25 $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; 28 28 !empty($this->protect_all_actions) ? $this->beforeFilter(array('_protectAllActions' => array('except'=>array('action_privileges_error', 'login')))) : null; 29 29 } -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/app/models/sentinel.php
r21289 r22365 58 58 return $result; 59 59 } 60 60 61 61 function authenticateWithToken($token) 62 62 { … … 110 110 function hasUserOnSession() 111 111 { 112 return !empty($this->Session['__ CurrentUser']);112 return !empty($this->Session['__current_user_id']); 113 113 } 114 114 115 115 function getUserFromSession() 116 116 { 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; 118 124 } 119 125 … … 121 127 { 122 128 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 125 133 } 126 134 … … 128 136 { 129 137 if($this->hasUserOnSession()){ 130 $this->Session['__CurrentUser'] = null; 138 $this->Session['__CurrentUserType'] = null; 139 $this->Session['__current_user_id'] = null; 131 140 } 132 141 } -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/app/models/user.php
r21289 r22365 3 3 4 4 defined('AK_DEFAULT_USER_ROLE') ? null : define('AK_DEFAULT_USER_ROLE', 'Registered user'); 5 defined('AK_DEFAULT_ADMIN_SETTINGS') ? null : define('AK_DEFAULT_ADMIN_SETTINGS', 'admin'); 5 6 6 7 class User extends ActiveRecord 7 8 { 8 var $habtm = array('roles' => array('unique'=>true ));9 var $habtm = array('roles' => array('unique'=>true, 'foreign_key'=>'user_id')); 9 10 10 11 /** … … 62 63 function setDefaultRole() 63 64 { 64 $settings = Ak::getSettings( 'admin');65 $settings = Ak::getSettings(AK_DEFAULT_ADMIN_SETTINGS); 65 66 if(!empty($settings['account_settings']['default_role'])){ 66 67 $this->role->load(); … … 259 260 $options = array_merge($default_options, $options); 260 261 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']))); 262 263 $options['single_use'] = $options['single_use'] ? 1 : 0; 263 264 … … 287 288 function _encodeToken($options) 288 289 { 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'))); 290 291 } 291 292 … … 299 300 function _decodeToken($token) 300 301 { 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'))); 302 303 } 303 304 … … 320 321 { 321 322 if(!isset($this->_activeRecordHasBeenInstantiated) || 322 $this->getModelName() != 'User'){323 !in_array('User', array($this->getModelName(), $this->getParentModelName()))){ 323 324 if (User::isLoaded()) { 324 325 $User =& User::getCurrentUser(); -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/config/admin.yml
r21289 r22365 6 6 do_not_reply_email: do-not-reply@example.com 7 7 account_settings: 8 allow_sign_up: true8 allow_sign_up: false 9 9 default_role: Registered user 10 10 sign_in_url: -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/installer/admin_files/test/unit/app/models/user.php
r21289 r22365 10 10 { 11 11 $this->uninstallAndInstallMigration('AdminPlugin'); 12 $this->includeAndInstatiateModels('User', ' Role', 'Permission');12 $this->includeAndInstatiateModels('User', 'Sentinel', 'Role', 'Permission'); 13 13 } 14 14 … … 74 74 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 75 75 $token = $Alicia->getToken(array('single_use'=> true)); 76 $this->assertTrue($User = User::authenticateWithToken($token));76 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 77 77 $this->assertEqual($Alicia->get('login'), $User->get('login')); 78 $this->assertFalse($User = User::authenticateWithToken($token));78 $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 79 79 } 80 80 … … 83 83 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 84 84 $token = $Alicia->getToken(); 85 $this->assertTrue($User = User::authenticateWithToken($token));85 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 86 86 $this->assertEqual($Alicia->get('login'), $User->get('login')); 87 $this->assertTrue($User = User::authenticateWithToken($token));87 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 88 88 } 89 89 … … 93 93 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 94 94 $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)); 97 97 $this->assertEqual($Alicia->get('login'), $User->get('login')); 98 98 sleep(1); 99 $this->assertFalse($User = User::authenticateWithToken($token));99 $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 100 100 } 101 101 -
events/phpframework/akelos/trunk/app/vendor/plugins/admin/makelos
r21289 r22365 62 62 63 63 $Makelos = new Makelos(); 64 $Makelos->connectToDatabase( $database_settings);64 $Makelos->connectToDatabase(@$database_settings); 65 65 $Makelos->$task(@$argv); 66 66 -
events/phpframework/akelos/trunk/app/views/application/_footer.tpl
r21458 r22365 3 3 <ul> 4 4 <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> 11 12 <li><a href="http://jptwitterhelp.blogspot.com">_{Help}</a></li> 12 13 <li><a href="/help/jobs">_{Jobs}</a></li> -
events/phpframework/akelos/trunk/app/views/layouts/_footer.tpl
r21458 r22365 1 <%= javascript_include_tag %>2 1 </body> 3 2 </html> -
events/phpframework/akelos/trunk/app/views/layouts/_header.tpl
r21458 r22365 11 11 <link rel="apple-touch-icon" href="images/twitter_57.png" /> 12 12 <%= stylesheet_link_tag 'default' %> 13 <%= javascript_include_tag %> 13 14 <style type="text/css"> 14 15 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> 2 13 <body> 3 <%= javascript_for_current_controller %>4 14 <div id="layout"> 5 15 <div id="canvas" class="login"> … … 14 24 <%= link_to _'sign in', :action => 'sign_in' %> 15 25 {?settings-account_settings-allow_sign_up} 16 _{or}26 {or} 17 27 <%= link_to _'sign up', :action => 'sign_up' %> 18 28 {end} … … 28 38 </div> 29 39 </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' %> 2 2 3 3 <body class="front" id="profile" onload="registerResponders();"> … … 8 8 </span> 9 9 <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' %> 11 12 </h1> 12 13 <div id="flash" style="display:none;"></div> … … 15 16 {content_for_layout} 16 17 17 <div id="footer" > 18 <h3>Footer</h3> 19 <ul> 20 <li class="first">© 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 34 20 <hr /> 35 21 <div id="navigation"> … … 50 36 </body> 51 37 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’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 1 1 default: 2 application_name: Akelos Application2 application_name: Pwittr 3 3 http_auth_realm: Application Administration 4 4 default_authentication_method: post … … 6 6 do_not_reply_email: do-not-reply@example.com 7 7 account_settings: 8 allow_sign_up: true8 allow_sign_up: false 9 9 default_role: Registered user 10 10 sign_in_url: … … 17 17 action: logout 18 18 authentication_url: 19 controller: dashboard20 module: admin19 controller: home 20 module: false -
events/phpframework/akelos/trunk/config/config.php
r21464 r22365 17 17 18 18 // 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');19 define('AK_ACTIVE_RECORD_DEFAULT_LOCALES', 'en,ja'); 20 define('AK_APP_LOCALES', 'en,ja'); 21 define('AK_PUBLIC_LOCALES', 'en,ja'); 22 22 23 23 -
events/phpframework/akelos/trunk/config/database.yml
r21503 r22365 4 4 port: 5 5 user: root 6 password: 6 password: root 7 7 options: 8 8 -
events/phpframework/akelos/trunk/config/locales/en.php
r21503 r22365 284 284 $dictionary['Could not find %namespace settings file in %path.'] = 'Could not find %namespace settings file in %path.'; 285 285 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 286 309 287 310 ?> -
events/phpframework/akelos/trunk/config/locales/ja.php
r21503 r22365 282 282 $dictionary['Could not find %namespace settings file in %path.'] = 'Could not find %namespace settings file in %path.'; 283 283 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 284 307 285 308 ?> -
events/phpframework/akelos/trunk/config/routes.php
r21458 r22365 1 1 <?php 2 // You can find more about routes on /lib/AkRouters.php and /test/test_AkRouter.php 2 3 3 $Map->connect('/', array('controller' => ' help', 'action' => 'index'));4 $Map->connect('/', array('controller' => 'page', 'action' => 'index')); 4 5 5 6 $Map->connect('/login', array('controller' => 'account', 'action' => 'sign_in')); 6 7 $Map->connect('/signup', array('controller' => 'account', 'action' => 'sign_up')); 7 8 8 $Map->connect('/home', array('controller' => 'dashboard', 'action' => 'index', 'module' => 'admin'));9 9 $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.php12 13 10 $Map->connect('/:controller/:action/:id'); -
events/phpframework/akelos/trunk/test/unit/app/models/user.php
r21289 r22365 10 10 { 11 11 $this->uninstallAndInstallMigration('AdminPlugin'); 12 $this->includeAndInstatiateModels('User', ' Role', 'Permission');12 $this->includeAndInstatiateModels('User', 'Sentinel', 'Role', 'Permission'); 13 13 } 14 14 … … 74 74 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 75 75 $token = $Alicia->getToken(array('single_use'=> true)); 76 $this->assertTrue($User = User::authenticateWithToken($token));76 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 77 77 $this->assertEqual($Alicia->get('login'), $User->get('login')); 78 $this->assertFalse($User = User::authenticateWithToken($token));78 $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 79 79 } 80 80 … … 83 83 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 84 84 $token = $Alicia->getToken(); 85 $this->assertTrue($User = User::authenticateWithToken($token));85 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 86 86 $this->assertEqual($Alicia->get('login'), $User->get('login')); 87 $this->assertTrue($User = User::authenticateWithToken($token));87 $this->assertTrue($User = Sentinel::authenticateWithToken($token)); 88 88 } 89 89 … … 93 93 $Alicia =& $this->User->findFirstBy('login', 'alicia'); 94 94 $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)); 97 97 $this->assertEqual($Alicia->get('login'), $User->get('login')); 98 98 sleep(1); 99 $this->assertFalse($User = User::authenticateWithToken($token));99 $this->assertFalse($User = Sentinel::authenticateWithToken($token)); 100 100 } 101 101
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)