芝麻web文件管理V1.00
编辑当前文件:/home/asmplong/www/ancien-site-2019/site/administrator/components/com_akeeba/controllers/stw.php
authorise('akeeba.backup', 'com_akeeba')) { $this->setRedirect('index.php?option=com_akeeba'); return JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); $this->redirect(); } } else { // Custom ACL for Joomla! 1.5 $aclModel = JModel::getInstance('Acl','AkeebaModel'); if(!$aclModel->authorizeUser('backup')) { $this->setRedirect('index.php?option=com_akeeba'); return JError::raiseWarning(403, JText::_('Access Forbidden')); $this->redirect(); } } } /** * Step 1 - select profile * @param type $cachable */ public function display($cachable = false) { JRequest::setVar('layout','step1'); parent::display($cachable); } /** * Applies the profile creation preferences and displays the transfer setup * page. * * @return void */ public function step2() { $method = JRequest::getCmd('method','none'); $oldprofile = JRequest::getInt('oldprofile', 0); $model = $this->getModel('Stw','AkeebaModel'); $model->setState('method', $method); $model->setState('oldprofile', $oldprofile); $result = $model->makeOrUpdateProfile(); if($result == false) { $url = 'index.php?option=com_akeeba&view=stw'; $this->setRedirect($url, JText::_('STW_PROFILE_ERR_COULDNOTCREATESTWPROFILE'), 'error'); return; } JRequest::setVar('layout','step2'); parent::display(); } /** * Apply the site transfer settings, test the connection, upload a test file * and show the last step's page. */ public function step3() { $model = $this->getModel('Stw','AkeebaModel'); $model->setState('method', JRequest::getCmd('method','ftp')); $model->setState('hostname', JRequest::getVar('hostname','')); $model->setState('port', JRequest::getInt('port','')); $model->setState('username', JRequest::getVar('username','')); $model->setState('password', JRequest::getVar('password','')); $model->setState('directory', JRequest::getVar('directory','')); $model->setState('passive', JRequest::getBool('passive',false)); $model->setState('livesite', JRequest::getVar('livesite','')); $result = $model->applyTransferSettings(); if($result != true) { $url = 'index.php?option=com_akeeba&view=stw&task=step2&method=none'; $this->setRedirect($url, $result, 'error'); return; } JRequest::setVar('layout','step3'); parent::display(); } }