Source for file profile.php

Documentation is available at profile.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_admin
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * User profile controller class.
  14.  *
  15.  * @package     Joomla.Administrator
  16.  * @subpackage  com_admin
  17.  * @since       1.6
  18.  */
  19. {
  20.     /**
  21.      * Method to check if you can edit a record.
  22.      *
  23.      * Extended classes can override this if necessary.
  24.      *
  25.      * @param   array   $data  An array of input data.
  26.      * @param   string  $key   The name of the key for the primary key.
  27.      *
  28.      * @return  boolean 
  29.      *
  30.      * @since   1.6
  31.      */
  32.     protected function allowEdit($data array()$key 'id')
  33.     {
  34.         return isset($data['id']&& $data['id'== JFactory::getUser()->id;
  35.     }
  36.  
  37.     /**
  38.      * Overrides parent save method to check the submitted passwords match.
  39.      *
  40.      * @param   string  $key     The name of the primary key of the URL variable.
  41.      * @param   string  $urlVar  The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
  42.      *
  43.      * @return  boolean  True if successful, false otherwise.
  44.      *
  45.      * @since   3.2
  46.      */
  47.     public function save($key null$urlVar null)
  48.     {
  49.         $this->setRedirect(JRoute::_('index.php?option=com_admin&view=profile&layout=edit&id=' JFactory::getUser()->idfalse));
  50.  
  51.         $return parent::save();
  52.  
  53.         if ($this->getTask(!= 'apply')
  54.         {
  55.             // Redirect to the main page.
  56.             $this->setRedirect(JRoute::_('index.php'false));
  57.         }
  58.  
  59.         return $return;
  60.     }
  61.  
  62.     /**
  63.      * Method to cancel an edit.
  64.      *
  65.      * @param   string  $key  The name of the primary key of the URL variable.
  66.      *
  67.      * @return  Boolean  True if access level checks pass, false otherwise.
  68.      *
  69.      * @since   1.6
  70.      */
  71.     public function cancel($key null)
  72.     {
  73.         $return parent::cancel($key);
  74.  
  75.         // Redirect to the main page.
  76.         $this->setRedirect(JRoute::_('index.php'false));
  77.  
  78.         return $return;
  79.     }
  80. }

Documentation generated on Tue, 19 Nov 2013 15:11:15 +0100 by phpDocumentor 1.4.3