- Timestamp:
- 07/04/08 01:30:16 (5 years ago)
- Location:
- events/phpframework/piece_framework/trunk
- Files:
-
- 11 modified
-
libs/Phwittr/Interceptor/Self.php (modified) (3 diffs)
-
web/frontend/webapp/actions/Account/PasswordAction.php (modified) (3 diffs)
-
web/frontend/webapp/actions/Account/PictureAction.php (modified) (3 diffs)
-
web/frontend/webapp/actions/Account/SettingsAction.php (modified) (3 diffs)
-
web/frontend/webapp/actions/AuthenticationAction.php (modified) (1 diff)
-
web/frontend/webapp/actions/SelfAction.php (modified) (1 diff)
-
web/frontend/webapp/actions/User/ArchiveAction.php (modified) (2 diffs)
-
web/frontend/webapp/actions/User/UserListAction.php (modified) (1 diff)
-
web/frontend/webapp/config/piece-unity-config.yaml (modified) (1 diff)
-
web/frontend/webapp/config/prepare.php (modified) (1 diff)
-
web/frontend/webapp/templates/Layout/Contents.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/piece_framework/trunk/libs/Phwittr/Interceptor/Self.php
r15132 r15136 14 14 require_once 'Piece/Unity/Service/Authentication.php'; 15 15 16 // {{{ Phwittr_Interceptor_ LayoutSetter16 // {{{ Phwittr_Interceptor_Self 17 17 18 18 /** 19 * Phwittr レイアウトセット19 * Phwittr Self Interceptor 20 20 * 21 21 * @package Phwittr_PieceFramework … … 24 24 * @since Class available since Release 0.1.0 25 25 */ 26 class Phwittr_Interceptor_ LayoutSetterextends Piece_Unity_Plugin_Common26 class Phwittr_Interceptor_Self extends Piece_Unity_Plugin_Common 27 27 { 28 28 … … 61 61 public function invoke() 62 62 { 63 $viewElement = $this->_context->getViewElement();64 63 $service = new Piece_Unity_Service_Authentication(); 64 if ($service->isAuthenticated()) { 65 $self = $this->_context->getSession()->getAttribute('self'); 66 } else { 67 $self = null; 68 } 65 69 66 if ($service->isAuthenticated()) { 67 $viewElement->setElement('isAuthenticated', true); 68 } else { 69 $viewElement->setElement('isAuthenticated', false); 70 } 70 $this->_context->setAttributeByRef('self', $self); 71 $this->_context->getViewElement()->setElementByRef('self', $self); 71 72 72 73 return true; -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/Account/PasswordAction.php
r15019 r15136 52 52 { 53 53 if (is_null($this->_self)) { 54 $loginUser = $this->_context->getSession()->getAttribute('loginUser'); 55 $this->_self = new Phwittr_Self($loginUser->id); 54 $this->_self = $this->_context->getAttribute('self'); 56 55 } 57 56 } … … 61 60 $master = new Piece_Unity_Service_Runemaster(); 62 61 $master->addForm('AccountPassword', '/account/password'); 63 64 $viewElement = $this->_context->getViewElement();65 $viewElement->setElementByRef('self', $this->_self);66 62 } 67 63 … … 75 71 76 72 try { 77 Phwittr_Account::updatePassword($this->_ userId,73 Phwittr_Account::updatePassword($this->_self->id, 78 74 $formValue->password 79 75 ); 76 80 77 return 'DisplayForm'; 81 78 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/Account/PictureAction.php
r15019 r15136 52 52 { 53 53 if (is_null($this->_self)) { 54 $loginUser = $this->_context->getSession()->getAttribute('loginUser'); 55 $this->_self = new Phwittr_Self($loginUser->id); 54 $this->_self = $this->_context->getAttribute('self'); 56 55 } 57 56 } … … 61 60 $master = new Piece_Unity_Service_Runemaster(); 62 61 $master->addForm('AccountPicture', '/account/picture', true, true); 63 64 $viewElement = $this->_context->getViewElement();65 $viewElement->setElementByRef('self', $this->_self);66 62 } 67 63 … … 83 79 84 80 Phwittr_Account::updatePicture($this->_self->id, $saveFilePath); 85 unset($this->_self); 86 $this->_self = null; 81 82 $selfId = $this->_self->id; 83 $this->_self = new Phwittr_Self($selfId); 84 85 $this->_context->getSession()->setAttributeByRef('self', $this->_self); 86 $this->_context->getViewElement()->setElementByRef('self', $this->_self); 87 87 88 88 return 'DisplayForm'; -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/Account/SettingsAction.php
r15018 r15136 53 53 { 54 54 if (is_null($this->_self)) { 55 $this->_ loginUser = $this->_context->getSession()->getAttribute('loginUser');55 $this->_self = $this->_context->getAttribute('self'); 56 56 57 $this->_self = new Phwittr_Self($this->_loginUser->id); 58 $this->_user->userName = $this->_self->userName; 59 $this->_user->email = $this->_self->email; 57 $this->_user->userName = $this->_self->userName; 58 $this->_user->email = $this->_self->email; 60 59 $this->_user->privateFlag = $this->_self->privateFlag; 61 60 } … … 67 66 $master->addForm('AccountSettings', '/account/settings'); 68 67 $master->setFormValue('AccountSettings', $this->_user); 69 70 $viewElement = $this->_context->getViewElement();71 $viewElement->setElementByRef('self', $this->_self);72 68 } 73 69 … … 80 76 81 77 try { 82 Phwittr_Account::confirmNewUserName($this->_ loginUser->id,78 Phwittr_Account::confirmNewUserName($this->_self->id, 83 79 $this->_user->userName 84 80 ); 85 Phwittr_Account::confirmNewEmail($this->_ loginUser->id,81 Phwittr_Account::confirmNewEmail($this->_self->id, 86 82 $this->_user->email 87 83 ); 88 84 85 $user = clone($this->_self); 86 $user->userName = $this->_user->userName; 87 $user->email = $this->_user->email; 88 $user->privateFlag = $this->_user->privateFlag; 89 89 90 $account = new Phwittr_Account(); 90 $account->update($ this->_user);91 $account->update($user); 91 92 92 $this->_loginUser->userName = $this->_user->userName; 93 $this->_loginUser->email = $this->_user->email; 94 $this->_loginUser->privateFlag = $this->_user->privateFlag; 95 96 $this->_context->getSession()->setAttribute('loginUser', $this->_loginUser); 97 $this->_self = new Phwittr_Self($this->_loginUser->id); 93 $this->_self->userName = $this->_user->userName; 94 $this->_self->email = $this->_user->email; 95 $this->_self->privateFlag = $this->_user->privateFlag; 98 96 99 97 return 'DisplayForm'; -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/AuthenticationAction.php
r14873 r15136 64 64 65 65 try { 66 $ loginUser= Phwittr_Service::authenticate($this->_user->userName,66 $self = Phwittr_Service::authenticate($this->_user->userName, 67 67 $this->_user->password 68 68 ); 69 69 70 70 $session = $this->_context->getSession(); 71 $session->setAttributeByRef(' loginUser', $loginUser);71 $session->setAttributeByRef('self', $self); 72 72 73 73 $authentication = &new Piece_Unity_Service_Authentication(); -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/SelfAction.php
r14946 r15136 59 59 } 60 60 61 $loginUser = $this->_context->getSession()->getAttribute('loginUser'); 62 $this->_self = new Phwittr_Self($loginUser->id); 63 61 $this->_self = $this->_context->getAttribute('self'); 64 62 $this->_page = $this->_context->getAttribute('page'); 65 63 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/User/ArchiveAction.php
r14874 r15136 53 53 } 54 54 55 $ loginUser = $context->getSession()->getAttribute('loginUser');56 if ($ loginUser) {57 $ loginUserId = $loginUser->id;55 $self = $context->getAttribute('self'); 56 if ($self) { 57 $selfId = $self->id; 58 58 } else { 59 $ loginUserId = null;59 $selfId = null; 60 60 } 61 61 … … 63 63 64 64 try { 65 $user = new Phwittr_User($request->userName, $ loginUserId);65 $user = new Phwittr_User($request->userName, $selfId); 66 66 $viewElement->setElementByRef('user', $user); 67 67 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/User/UserListAction.php
r14874 r15136 55 55 $userName = $request->userName; 56 56 } else { 57 $ loginUser = $context->getSession()->getAttribute('loginUser');58 $userName = $ loginUser->userName;57 $self = $context->getAttribute('self'); 58 $userName = $self->userName; 59 59 } 60 60 -
events/phpframework/piece_framework/trunk/web/frontend/webapp/config/piece-unity-config.yaml
r14939 r15136 70 70 - Interceptor_Paging 71 71 - Interceptor_Authentication 72 - Interceptor_ LayoutSetter72 - Interceptor_Self 73 73 74 74 - name: Interceptor_Authentication -
events/phpframework/piece_framework/trunk/web/frontend/webapp/config/prepare.php
r13954 r15136 12 12 require_once 'Piece/Unity.php'; 13 13 require_once 'Phwittr/ErrorHandler.php'; 14 require_once 'Phwittr/Self.php'; 14 15 15 16 session_name('PHWITTR'); -
events/phpframework/piece_framework/trunk/web/frontend/webapp/templates/Layout/Contents.html
r14937 r15136 27 27 <div id="header"> 28 28 <h1><img src="/img/share/phwittr_logo.gif" alt="phwittr" /></h1> 29 <ul id="guideNav" if=" isAuthenticated">29 <ul id="guideNav" if="self"> 30 30 <li><a href="/home">ホーム</a></li> 31 31 <li><a href="/account/settings">設定</a></li> 32 32 <li><a href="/logout">ログアウト</a></li> 33 33 </ul> 34 <ul id="guideNav" if="! isAuthenticated">34 <ul id="guideNav" if="!self"> 35 35 <li><a href="/login">ログイン</a></li> 36 36 <li><a href="/signup">ユーザ登録</a></li>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)