Source for file verifyftpsettings.php

Documentation is available at verifyftpsettings.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Installation
  4.  * @subpackage  Controller
  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.  * Controller class to verify the FTP settings for the Joomla Installer.
  14.  *
  15.  * @package     Joomla.Installation
  16.  * @subpackage  Controller
  17.  * @since       3.1
  18.  */
  19. {
  20.     /**
  21.      * Execute the controller.
  22.      *
  23.      * @return  void 
  24.      *
  25.      * @since   3.1
  26.      */
  27.     public function execute()
  28.     {
  29.         // Get the application
  30.         /* @var InstallationApplicationWeb $app */
  31.         $app $this->getApplication();
  32.  
  33.         // Check for request forgeries.
  34.         JSession::checkToken(or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN')403));
  35.  
  36.         // Get the setup model.
  37.         $model new InstallationModelSetup;
  38.  
  39.         // Get the data
  40.         $data $app->input->post->get('jform'array()'array');
  41.  
  42.         // Store the options in the session.
  43.         $vars $model->storeOptions($data);
  44.  
  45.         // Get the database model.
  46.         $ftp new InstallationModelFtp;
  47.  
  48.         // Attempt to detect the Joomla root from the ftp account.
  49.         $return $ftp->verifyFtpSettings($vars);
  50.  
  51.         // Build the response object
  52.         $r new stdClass;
  53.         $r->view 'ftp';
  54.  
  55.         // If we got a FTP root, add it to the response object
  56.         if ($return)
  57.         {
  58.             $r->valid $return;
  59.         }
  60.  
  61.         $app->sendJsonResponse($r);
  62.     }
  63. }

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