ProfileController Class Reference

List of all members.

Public Member Functions

 init ()
 indexAction ()
 deleteavatarAction ()


Member Function Documentation

ProfileController::deleteavatarAction (  ) 

00111                                             {
00112                 $userData = $this->_auth->getIdentity();
00113                 $users = new Default_Model_Users();
00114                 $user = $users->fetchRow(array ('UserID'  => $userData->UserID));
00115 
00116                 unlink($this->_config['profile']['avatar']['path'] . $user->ImageNameOrig);
00117                 unlink($this->_config['profile']['avatar']['path'] . $user->ImageName);
00118                 $users->update(array ('ImageName' => '', 'ImageNameOrig' => ''),
00119                                 $users->getAdapter()->quoteInto('UserID = ?', $userData->UserID)
00120                         );
00121                 $this->_redirect('profile/index');
00122         }

ProfileController::indexAction (  ) 

00019         {
00020                 $userData = $this->_auth->getIdentity();
00021                 $this->_user = new Default_Model_Users();
00022                 $this->view->user = $this->_user->fetchRow( $this->_user->getAdapter()->quoteInto('UserID = ? ', $userData->UserID));
00023                 $this->view->form = $this->getForm($this->view->user);
00024                 
00025                 if ($this->getRequest()->isPost()) {
00026 
00027                         if ($this->view->form->isValid($_POST)){
00028                                 $this->_user->update(array (
00029                                                 'Email'    => $this->getRequest()->getParam('email'),
00030                                                 'Author'   => $this->getRequest()->getParam('author'),
00031                                                 'Password' => new Zend_Db_Expr ($this->_user->getAdapter()->quoteInto('SHA1(?)', $this->getRequest()->getParam('password'))),
00032                                         )
00033                                         , $this->_user->getAdapter()->quoteInto('UserID = ?', $userData->UserID));
00034                                 $this->processImages($userData->UserID);
00035                         }
00036                 }
00037         }

ProfileController::init (  ) 

00012         {
00013                 /* Initialize action controller here */
00014                 $this->_auth   = Zend_Auth::getInstance();
00015                 $this->_config = Zend_Registry::get('config');
00016         }


The documentation for this class was generated from the following file:

Generated on Mon Oct 19 16:22:50 2009 for IndyArticles by  doxygen 1.5.8