/home/suroeste/public_html/wp-content/plugins/akeebabackupwp/app/Solo/View/Main
Edit: /home/suroeste/public_html/wp-content/plugins/akeebabackupwp/app/Solo/View/Main/Html.php (9962B)
getModel();
$statusHelper = Status::getInstance($this->container);
$session = $this->container->segment;
$this->profile = Platform::getInstance()->get_active_profile();
$this->profileList = $model->getProfileList();
$this->quickIconProfiles = $model->getQuickIconProfiles();
$this->statusCell = $statusHelper->getStatusCell();
$this->detailsCell = $statusHelper->getQuirksCell();
$this->latestBackupCell = $statusHelper->getLatestBackupDetails();
$this->needsDownloadId = $model->needsDownloadID();
$this->warnCoreDownloadId = $model->mustWarnAboutDownloadIdInCore();
$this->checkMbstring = $model->checkMbstring();
$this->frontEndSecretWordIssue = $model->getFrontendSecretWordError();
$this->newSecretWord = $session->get('newSecretWord', null);
$this->stuckUpdates = ($this->container->appConfig->get('updatedb', 0) == 1);
$this->promptForConfigurationWizard = Factory::getConfiguration()->get('akeeba.flag.confwiz', 0) == 0;
$this->countWarnings = count(Factory::getConfigurationChecks()->getDetailedStatus());
$this->desktop_notifications = Platform::getInstance()->get_platform_configuration_option('desktop_notifications', '0') ? 1 : 0;
$this->formattedChangelog = $this->formatChangelog();
$this->lastUpsellDismiss = $this->container->appConfig->get('lastUpsellDismiss', 0);
$this->hasOutputDirectorySecurityFiles = $model->hasOutputDirectorySecurityFiles();
$this->isOutputDirectoryUnderSiteRoot = $model->isOutputDirectoryUnderSiteRoot();
// Solo: the output directory may be under Solo's root, not the site's root. It's equally important to me.
if (!$this->container->segment->get('insideCMS', false))
{
$this->isOutputDirectoryUnderSiteRoot |= $model->isOutputDirectoryUnderSiteRoot(null, true);
}
/** @var Stats $statsModel */
$statsModel = $this->container->mvcFactory->makeTempModel('Stats');
$this->statsIframe = $statsModel->collectStatistics(true);
// Load the Javascript for this page
Template::addJs('media://js/solo/main.js', $this->container->application);
$router = $this->container->router;
$document = $this->container->application->getDocument();
$document->addScriptOptions('akeeba.System.notification.hasDesktopNotification', $this->desktop_notifications);
$document->addScriptOptions('akeeba.ControlPanel.checkOutDirUrl', $router->route('index.php?view=main&format=raw&task=checkOutputDirectory'));
$document->addScriptOptions('akeeba.ControlPanel.outputDirUnderSiteRoot', (bool) $this->isOutputDirectoryUnderSiteRoot);
$document->addScriptOptions('akeeba.ControlPanel.hasSecurityFiles', (bool) $this->hasOutputDirectorySecurityFiles);
$document->addScriptOptions('akeeba.ControlPanel.cloudFlareURN', 'CLOUDFLARE::' . Template::parsePath('media://js/solo/system.js', false, $this->getContainer()->application));
$document->addScriptOptions('akeeba.ControlPanel.updateInfoURL', $router->route('index.php?view=main&format=raw&task=getUpdateInformation&' . $this->getContainer()->session->getCsrfToken()->getValue() . '=1'));
if ($this->container->segment->get('insideCMS', false))
{
/** @var Migreight $migreightModel */
$migreightModel = $this->getModel('Migreight');
$this->needsMigreight = count($migreightModel->getAffectedProfiles())
|| count($migreightModel->getArchiveFolderMap());
}
return true;
}
/**
* Performs automatic access control checks
*
* @param string $view The view being considered
* @param string $task The task being considered
*
* @return bool True if access is allowed
*
* @throws RuntimeException
*/
public function canAccess($view, $task)
{
$view = strtolower($view);
$task = strtolower($task);
if (!isset($this->aclChecks[$view]))
{
return true;
}
if (!isset($this->aclChecks[$view][$task]))
{
if (!isset($this->aclChecks[$view]['*']))
{
return true;
}
$requiredPrivileges = $this->aclChecks[$view]['*'];
}
else
{
$requiredPrivileges = $this->aclChecks[$view][$task];
}
$user = $this->container->userManager->getUser();
foreach ($requiredPrivileges as $privilege)
{
if (!$user->getPrivilege('akeeba.' . $privilege))
{
return false;
}
}
return true;
}
protected function formatChangelog($onlyLast = false)
{
$container = $this->getContainer();
$filePath = isset($container['changelogPath']) ? $container['changelogPath'] : null;
if (empty($filePath))
{
$filePath = APATH_BASE . '/CHANGELOG.php';
}
$ret = '';
$file = $filePath;
$lines = @file($file);
if (empty($lines))
{
return $ret;
}
array_shift($lines);
foreach ($lines as $line)
{
$line = trim($line);
if (empty($line))
{
continue;
}
$type = substr($line, 0, 1);
switch ($type)
{
case '=':
continue 2;
break;
case '+':
$ret .= "\t" . '
Added ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
case '-':
$ret .= "\t" . '
Removed ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
case '~':
case '^':
$ret .= "\t" . '
Changed ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
case '*':
$ret .= "\t" . '
Security ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
case '!':
$ret .= "\t" . '
Important ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
case '#':
$ret .= "\t" . '
Fixed ' . htmlentities(trim(substr($line, 2))) . "\n";
break;
default:
if (!empty($ret))
{
$ret .= "";
if ($onlyLast)
{
return $ret;
}
}
if (!$onlyLast)
{
$ret .= "
$line
\n";
}
$ret .= "
\n";
break;
}
}
return $ret;
}
}