Show
Ignore:
Timestamp:
07/02/08 00:58:49 (6 months ago)
Author:
kumatch
Message:

Adjusted the reviewed and refactored behaviors to the presentation layer.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/web/frontend/webapp/actions/Account/PasswordAction.php

    r13959 r15019  
    1313require_once 'Piece/Unity/Service/FlowAction.php'; 
    1414require_once 'Piece/Unity/Service/Runemaster.php'; 
     15require_once 'Phwittr/Self.php'; 
    1516require_once 'Phwittr/Account.php'; 
    1617 
     
    5051    function entryForm() 
    5152    { 
    52         if (is_null($this->_userId)) { 
    53             $user = $this->_context->getSession()->getAttribute('user'); 
    54             $this->_userId = $user->id; 
     53        if (is_null($this->_self)) { 
     54            $loginUser = $this->_context->getSession()->getAttribute('loginUser'); 
     55            $this->_self = new Phwittr_Self($loginUser->id); 
    5556        } 
    5657    } 
     
    6061        $master = new Piece_Unity_Service_Runemaster(); 
    6162        $master->addForm('AccountPassword', '/account/password'); 
     63 
     64        $viewElement = $this->_context->getViewElement(); 
     65        $viewElement->setElementByRef('self', $this->_self); 
    6266    } 
    6367 
     
    7175 
    7276        try { 
    73             $account = new Phwittr_Account(); 
    74             $account->updatePassword($this->_userId, $formValue->password); 
    75  
     77            Phwittr_Account::updatePassword($this->_userId, 
     78                                            $formValue->password 
     79                                            ); 
    7680            return 'DisplayForm'; 
    7781