getApplication(); // Check for request forgeries. JSession::checkToken() or $app->sendJsonResponse(new Exception(JText::_('JINVALID_TOKEN'), 403)); // Get the setup model. $model = new InstallationModelSetup; // Get the data $data = $app->input->post->get('jform', array(), 'array'); // Store the options in the session. $vars = $model->storeOptions($data); // Get the database model. $ftp = new InstallationModelFtp; // Attempt to detect the Joomla root from the ftp account. $return = $ftp->verifyFtpSettings($vars); // Build the response object $r = new stdClass; $r->view = 'ftp'; // If we got a FTP root, add it to the response object if ($return) { $r->valid = $return; } $app->sendJsonResponse($r); } }