Example #1
0
 function start($cachable = false, $urlparams = false)
 {
     $model = $this->getThisModel();
     $model->setState('restorationstep', 1);
     $message = $model->validateRequest();
     if ($message !== true) {
         $this->setRedirect('index.php?option=com_akeeba&view=buadmin', $message, 'error');
         $this->redirect();
         return true;
     }
     $model->setState('jps_key', $this->input->get('jps_key', '', 'cmd'));
     $model->setState('procengine', $this->input->get('procengine', 'direct', 'cmd'));
     $model->setState('ftp_host', $this->input->get('ftp_host', '', 'none', 2));
     $model->setState('ftp_port', $this->input->get('ftp_port', 21, 'int'));
     $model->setState('ftp_user', $this->input->get('ftp_user', '', 'none', 2));
     $model->setState('ftp_pass', $this->input->get('ftp_pass', '', 'none', 2));
     $model->setState('ftp_root', $this->input->get('ftp_root', '', 'none', 2));
     $model->setState('tmp_path', $this->input->get('tmp_path', '', 'none', 2));
     $model->setState('ftp_ssl', $this->input->get('usessl', 'false', 'cmd') == 'true');
     $model->setState('ftp_pasv', $this->input->get('passive', 'true', 'cmd') == 'true');
     $status = $model->createRestorationINI();
     if ($status === false) {
         $this->setRedirect('index.php?option=com_akeeba&view=buadmin', JText::_('RESTORE_ERROR_CANT_WRITE'), 'error');
         $this->redirect();
         return true;
     }
     parent::display($cachable, $urlparams);
 }
 /**
  * Fetches a complete backup set from a remote storage location to the local (server)
  * storage so that the user can download or restore it.
  */
 public function dltoserver()
 {
     // Get the parameters
     $id = $this->getAndCheckId();
     $part = $this->input->get('part', -1, 'int');
     $frag = $this->input->get('frag', -1, 'int');
     // Check the ID
     if ($id === false) {
         $url = 'index.php?option=com_akeeba&view=remotefiles&tmpl=component&task=listactions&id=' . $id;
         $this->setRedirect($url, JText::_('REMOTEFILES_ERR_INVALIDID'), 'error');
         return true;
     }
     $model = $this->getThisModel();
     $model->setState('id', $id);
     $model->setState('part', $part);
     $model->setState('frag', $frag);
     $result = $model->downloadToServer();
     if ($result['finished']) {
         $url = 'index.php?option=com_akeeba&view=remotefiles&tmpl=component&task=listactions&id=' . $id;
         $this->setRedirect($url, JText::_('REMOTEFILES_LBL_JUSTFINISHED'));
         return true;
     } elseif ($result['error']) {
         $url = 'index.php?option=com_akeeba&view=remotefiles&tmpl=component&task=listactions&id=' . $id;
         $this->setRedirect($url, $result['error'], 'error');
         return true;
     } else {
         parent::display(false, false);
     }
 }
 function start($cachable = false, $urlparams = false)
 {
     // CSRF prevention
     if ($this->csrfProtection) {
         $this->_csrfProtection();
     }
     $model = $this->getThisModel();
     $model->setState('restorestep', 1);
     $message = $model->validateRequest();
     if ($message !== true) {
         $this->setRedirect('index.php?option=com_akeeba&view=buadmin', $message, 'error');
         $this->redirect();
         return true;
     }
     $model->setState('procengine', $this->input->get('procengine', 'direct', 'cmd'));
     $model->setState('ftp_host', $this->input->get('ftp_host', '', 'none', 2));
     $model->setState('ftp_port', $this->input->get('ftp_port', 21, 'int'));
     $model->setState('ftp_user', $this->input->get('ftp_user', '', 'none', 2));
     $model->setState('ftp_pass', $this->input->get('ftp_pass', '', 'none', 2));
     $model->setState('ftp_root', $this->input->get('ftp_root', '', 'none', 2));
     $model->setState('tmp_path', $this->input->get('tmp_path', '', 'none', 2));
     $model->setState('ftp_ssl', $this->input->get('usessl', 'false', 'cmd') == 'true');
     $model->setState('ftp_pasv', $this->input->get('passive', 'true', 'cmd') == 'true');
     $status = $model->setRestorationParameters();
     parent::display($cachable, $urlparams);
 }
 /**
  * Fetches a complete backup set from a remote storage location to the local (server)
  * storage so that the user can download or restore it.
  */
 public function dltoserver($cachable = false, $urlparams = false)
 {
     $s3bucket = $this->input->get('s3bucket', null, 'none', 2);
     // Get the parameters
     $model = $this->getThisModel();
     if ($s3bucket) {
         $model->setState('s3bucket', $s3bucket);
     }
     $model->getS3Credentials();
     $model->setS3Credentials($model->getState('s3access'), $model->getState('s3secret'));
     // Set up the model's state
     $part = $this->input->getInt('part', -999);
     if ($part >= -1) {
         JFactory::getApplication()->setUserState('com_akeeba.s3import.part', $part);
     }
     $frag = $this->input->getInt('frag', -999);
     if ($frag >= -1) {
         JFactory::getApplication()->setUserState('com_akeeba.s3import.frag', $frag);
     }
     $step = $this->input->getInt('step', -999);
     if ($step >= -1) {
         JFactory::getApplication()->setUserState('com_akeeba.s3import.step', $step);
     }
     $result = $model->downloadToServer();
     if ($result === true) {
         // Part(s) downloaded successfully. Render the view.
         parent::display();
     } elseif ($result === false) {
         // Part did not download. Redirect to initial page with an error.
         $this->setRedirect('index.php?option=com_akeeba&view=s3import', $model->getError(), 'error');
     } else {
         // All done. Redirect to intial page with a success message.
         $this->setRedirect('index.php?option=com_akeeba&view=s3import', JText::_('S3IMPORT_MSG_IMPORTCOMPLETE'));
     }
 }
 public function execute($task)
 {
     if ($task != 'save') {
         $task = 'browse';
     }
     parent::execute($task);
 }
Example #6
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $base_path = JPATH_COMPONENT_ADMINISTRATOR . '/plugins';
     $model_path = $base_path . '/models';
     $view_path = $base_path . '/views';
     $this->addModelPath($model_path);
     $this->addViewPath($view_path);
 }
Example #7
0
 public function iframe($cachable = false, $urlparams = false)
 {
     $tag = $this->input->get('tag', null, 'cmd');
     if (empty($tag)) {
         $tag = null;
     }
     $model = $this->getThisModel();
     $model->setState('tag', $tag);
     Platform::getInstance()->load_configuration(Platform::getInstance()->get_active_profile());
     parent::display();
     flush();
     JFactory::getApplication()->close();
 }
Example #8
0
 public function display($cachable = false, $urlparams = false)
 {
     $folder = $this->input->get('folder', '', 'string');
     $processfolder = $this->input->get('processfolder', 0, 'int');
     $model = $this->getThisModel();
     $model->setState('folder', $folder);
     $model->setState('processfolder', $processfolder);
     $model->makeListing();
     parent::display();
     /*
     @ob_end_flush();
     flush();
     JFactory::getApplication()->close();
     */
 }
 /**
  * Discovers JPA, JPS and ZIP files in the selected profile's directory and
  * lets you select them for inclusion in the import process.
  */
 public function discover()
 {
     // CSRF prevention
     if (!$this->csrfProtection) {
         $this->_csrfProtection();
     }
     $directory = $this->input->get('directory', '', 'string');
     if (empty($directory)) {
         $url = 'index.php?option=com_akeeba&view=discover';
         $msg = JText::_('DISCOVER_ERROR_NODIRECTORY');
         $this->setRedirect($url, $msg, 'error');
         return true;
     }
     $model = $this->getThisModel();
     $model->setState('directory', $directory);
     parent::display();
 }
 /**
  * Apply the site transfer settings, test the connection, upload a test file
  * and show the last step's page.
  */
 public function step3($cachable = false, $urlparams = false)
 {
     $model = $this->getThisModel();
     $model->setState('stwstep', 3);
     $model->setState('method', $this->input->get('method', 'ftp', 'cmd'));
     $model->setState('hostname', $this->input->get('hostname', '', 'none', 2));
     $model->setState('port', $this->input->get('port', '', 'int'));
     $model->setState('username', $this->input->get('username', '', 'none', 2));
     $model->setState('password', $this->input->get('password', '', 'none', 2));
     $model->setState('directory', $this->input->get('directory', '', 'none', 2));
     $model->setState('passive', $this->input->get('passive', false, 'bool'));
     $model->setState('livesite', $this->input->get('livesite', '', 'none', 2));
     $result = $model->applyTransferSettings();
     if ($result != true) {
         $url = 'index.php?option=com_akeeba&view=stw&task=step2&method=none';
         $this->setRedirect($url, $result, 'error');
         return true;
     }
     parent::display($cachable, $urlparams);
 }
Example #11
0
 /**
  * Default task; shows the initial page where the user selects a profile
  * and enters description and comment
  *
  */
 public function onBeforeAdd()
 {
     $result = parent::onBeforeEdit();
     if ($result) {
         // Push models to view
         $model = $this->getThisModel();
         $view = $this->getThisView();
         $view->setModel($model, true);
         $newProfile = $this->input->get('profileid', -10, 'int');
         if (is_numeric($newProfile) && $newProfile > 0) {
             $this->_csrfProtection();
             $session = JFactory::getSession();
             $session->set('profile', $newProfile, 'akeeba');
             AEPlatform::getInstance()->load_configuration($newProfile);
         }
         // Deactivate the menus
         JRequest::setVar('hidemainmenu', 1);
         // Push data to the model
         $model->setState('profile', $this->input->get('profileid', -10, 'int'));
         $model->setState('ajax', $this->input->get('ajax', '', 'cmd'));
         $model->setState('autostart', $this->input->get('autostart', 0, 'int'));
         if ($this->input instanceof FOFInput) {
             $srpinfo = array('tag' => $this->input->get('tag', 'backend', 'cmd'), 'type' => $this->input->get('type', '', 'cmd'), 'name' => $this->input->get('name', '', 'cmd'), 'group' => $this->input->get('group', '', 'cmd'), 'customdirs' => $this->input->get('customdirs', array(), 'array', 2), 'extraprefixes' => $this->input->get('extraprefixes', array(), 'array', 2), 'customtables' => $this->input->get('customtables', array(), 'array', 2), 'skiptables' => $this->input->get('skiptables', array(), 'array', 2), 'xmlname' => $this->input->get('xmlname', '', 'string'));
         } else {
             $srpinfo = array('tag' => $this->input->get('tag', 'backend', 'cmd'), 'type' => $this->input->get('type', '', 'cmd'), 'name' => $this->input->get('name', '', 'cmd'), 'group' => $this->input->get('group', '', 'cmd'), 'customdirs' => $this->input->get('customdirs', array(), 'array', 2), 'extraprefixes' => $this->input->get('extraprefixes', array(), 'array', 2), 'customtables' => $this->input->get('customtables', array(), 'array', 2), 'skiptables' => $this->input->get('skiptables', array(), 'array', 2), 'xmlname' => $this->input->get('xmlname', '', 'string'));
         }
         $model->setState('srpinfo', $srpinfo);
         $description = $this->input->get('description', null, 'string', 2);
         if (!empty($description)) {
             $model->setState('description', $description);
         }
         $comment = $this->input->get('comment', null, 'string', 2);
         if (!empty($comment)) {
             $model->setState('comment', $comment);
         }
         $model->setState('jpskey', $this->input->get('jpskey', '', 'raw', 2));
         $model->setState('angiekey', $this->input->get('angiekey', '', 'raw', 2));
         $model->setState('returnurl', $this->input->get('returnurl', '', 'raw', 2));
     }
     return $result;
 }
Example #12
0
 /**
  * Default task; shows the initial page where the user selects a profile
  * and enters description and comment
  *
  */
 public function onBeforeAdd()
 {
     $result = parent::onBeforeEdit();
     if ($result) {
         // Push models to view
         $model = $this->getThisModel();
         $view = $this->getThisView();
         $view->setModel($model, true);
         $newProfile = $this->input->get('profileid', -10, 'int');
         if (is_numeric($newProfile) && $newProfile > 0) {
             $this->_csrfProtection();
             $session = JFactory::getSession();
             $session->set('profile', $newProfile, 'akeeba');
             Platform::getInstance()->load_configuration($newProfile);
         }
         // Deactivate the menus
         JRequest::setVar('hidemainmenu', 1);
         // Push data to the model
         $model->setState('profile', $this->input->get('profileid', -10, 'int'));
         $model->setState('ajax', $this->input->get('ajax', '', 'cmd'));
         $model->setState('autostart', $this->input->get('autostart', 0, 'int'));
         $description = $this->input->get('description', null, 'string', 2);
         if (!empty($description)) {
             $model->setState('description', $description);
         }
         $comment = $this->input->get('comment', null, 'html', 2);
         if (!empty($comment)) {
             $model->setState('comment', $comment);
         }
         $model->setState('jpskey', $this->input->get('jpskey', '', 'raw', 2));
         $model->setState('angiekey', $this->input->get('angiekey', '', 'raw', 2));
         $model->setState('returnurl', $this->input->get('returnurl', '', 'raw', 2));
         $model->setState('backupid', $this->input->get('backupid', null, 'cmd'));
     }
     return $result;
 }
Example #13
0
 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->modelName = 'AkeebaModelConfwiz';
 }
 /**
  * Toggles the exclusion of a template
  *
  */
 function toggleTemplate()
 {
     //JResponse::setHeader('Cache-Control','no-cache, must-revalidate',true); // HTTP 1.1 - Cache control
     //JResponse::setHeader('Expires','Sat, 26 Jul 1997 05:00:00 GMT',true); // HTTP 1.0 - Date in the past
     // Get the option passed along
     $root = $this->input->get('root', '', 'string');
     $item = $this->input->get('item', '', 'string');
     // Try to figure out if this component is allowed to be excluded (exists and is non-Core)
     $model = $this->getThisModel();
     $templates = $model->getTemplates();
     $found = false;
     $numRows = count($templates);
     for ($i = 0; $i < $numRows; $i++) {
         $row = $templates[$i];
         if ($row['item'] == $item && $row['root'] == $root) {
             $found = true;
             $name = $row['name'];
             break;
         }
     }
     $link = JURI::base() . 'index.php?option=com_akeeba&view=extfilter&task=templates';
     if (!$found) {
         $msg = JText::sprintf('EXTFILTER_ERROR_INVALIDTEMPLATE', $item);
         $this->setRedirect($link, $msg, 'error');
     } else {
         $model->toggleTemplateFilter($root, $item);
         $msg = JText::sprintf('EXTFILTER_MSG_TOGGLEDTEMPLATE', $name);
         $this->setRedirect($link, $msg);
     }
     parent::redirect();
 }
 /**
  * Display the main list
  *
  */
 public function browse($cachable = false, $urlparams = false)
 {
     parent::display($cachable, $urlparams);
 }
Example #16
0
 public function onBeforeEdit()
 {
     $result = parent::onBeforeEdit();
     if ($result) {
         $session = JFactory::getSession();
         $task = $session->get('buadmin.task', 'browse', 'akeeba');
         $model = $this->getThisModel();
         $id = $model->getId();
         if ($id <= 0) {
             $this->setRedirect(JURI::base() . 'index.php?option=com_akeeba&view=buadmin&task=' . $task, JText::_('STATS_ERROR_INVALIDID'), 'error');
             $result = false;
         }
     }
     return $result;
 }
Example #17
0
 public function browse($cachable = false, $urlparams = false)
 {
     $task = $this->input->get('task', 'normal', 'cmd');
     $this->getThisModel()->setState('browse_task', $task);
     parent::display($cachable, $urlparams);
 }
Example #18
0
 /**
  * Default task, shows the wizard interface
  *
  * @param   bool   $cachable   Is this a cacheable view?
  * @param   array  $urlparams  URL parameters for caching. False to let FOF figure it out by itself.
  */
 public function wizard($cachable = false, $urlparams = false)
 {
     parent::display($cachable, $urlparams);
 }
Example #19
0
 public function execute($task)
 {
     $task = 'browse';
     parent::execute($task);
 }
Example #20
0
 public function start($cachable = false, $urlparams = false)
 {
     $id = $this->getAndCheckId();
     // Check the backup stat ID
     if ($id === false) {
         $url = 'index.php?option=com_akeeba&view=upload&tmpl=component&task=cancelled&id=' . $id;
         $this->setRedirect($url, JText::_('AKEEBA_TRANSFER_ERR_INVALIDID'), 'error');
         return true;
     }
     $view = $this->getThisView();
     $view->done = 0;
     $view->error = 0;
     $view->id = $id;
     $view->setLayout('default');
     parent::display($cachable, $urlparams);
 }