Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/i-plan.ru/administrator/components/com_pay/controllers/
Upload File :
Current File : /var/www/iplanru/data/www/i-plan.ru/administrator/components/com_pay/controllers/payment.php

<?php

// No direct access
defined( '_JEXEC' ) or die;

/**
 * Controller for edit current element
 * @author kirdinyuri
 */
class PayControllerPayment extends JControllerForm
{

	/**
	 * Class constructor
	 * @param array $config
	 */
	function __construct( $config = array() )
	{
		$this->view_list = 'payments';
		parent::__construct( $config );
	}

	/**
	 * Method override to check if you can edit an existing record.
	 *
	 * @param    array    $data    An array of input data.
	 * @param    string    $key    The name of the key for the primary key.
	 *
	 * @return    boolean
	 * @since    1.6
	 */
	protected function allowEdit( $data = array(), $key = 'id' )
    {
        // инициализируем переменные
        $recordId = ( int )isset( $data[$key] ) ? $data[$key] : 0;
        //получение объекта текущего пользователя
        $user = JFactory::getUser();
        //Получаем идентификатор пользователя
        $userId = $user->get( 'id' );
        // Сначала проверяем общий доступ на редактирование и если
        //пользователь может редактировать то возвращаем истину
        if ( $user->authorise( 'core.edit', 'com_pay.payment.' . $recordId ) ) {
            return true;
        }
        return parent::allowEdit( $data, $key );
    }
}