function &getIni() { static $ini = 0; if (empty($ini)) { $basepath = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_jdefender'; $p = new JParameter(''); $conf = JD_Vars_Helper::getGroup('configuration'); $p->bind($conf); $ini = $p->toString('ini'); } return $ini; }
function jdGetScanStatus() { require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'log.php'; $objResponse = new xajaxResponse(); $controller = new JDefenderControllerScan(); $scanStatus = $controller->scan($doLog = JD_Scan_Helper::isLogging()); $scanInfo = JD_Vars_Helper::getGroup('jdefender_scan'); if (empty($scanInfo)) { $scanInfo = array(); } unset($scanInfo['status']); $progress = 0; if (!empty($scanInfo['total'])) { $scanned = 0; $scanned += @$scanInfo['files']; $scanned += @$scanInfo['dirs']; $progress = (int) floor($scanned / $scanInfo['total'] * 100); } $objResponse->assign('scanstatus', 'innerHTML', JText::_('Progress') . ': ' . $progress . '%'); $objResponse->script('setProgress(' . $progress . ');'); $objResponse->script('blink("scanstatus", 2);'); $js = array(); foreach ($scanInfo as $k => $v) { if ($k == 'last_scan_date') { continue; } $titles = JD_Log_Helper::readableLogType($k); if ($titles) { $js[] = '"' . addslashes(JHTML::link('index.php?option=com_jdefender&controller=log&task=showLog&cid[]=' . $k, $titles->title, 'target="_blank"')) . '" : ' . (int) $v; } else { $js[] = $k . ': ' . (int) $v; } } $js = '{' . implode(', ', $js) . '}'; $objResponse->script('onInfoUpdated("' . addslashes($js) . '")'); // Check scan status. if ($scanStatus && is_array($scanStatus) && count($scanStatus) == 2) { list($filesystemScanComplete, $optionScanComplete) = $scanStatus; if ($filesystemScanComplete && $optionScanComplete) { $objResponse->script('onScanComplete()'); } } return $objResponse; }
{ if (is_file(JPATH_ADMINISTRATOR.DS.'defined'.DS.'com_jslm'.DS.'jslm.php')) { $mainframe->redirect('index.php?option=com_jslm&cmt=com_jdefender'); } else { JError::raiseWarning(403, JText::_('Please install Mighty Assistant.').' <a target="_blank" href="http://www.mightyextensions.com/download-mighty-assistant">'.JText::_('Download').'</a>'); $mainframe->redirect('index.php'); } }*/ require_once JPATH_COMPONENT_ADMINISTRATOR . DS . 'lib' . DS . 'include.php'; jimport('joomla.application.component.model'); JModel::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models'); JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables'); $config = JD_Vars_Helper::getGroup('configuration'); if (empty($config) && JRequest::getCmd('controller') != 'configuration') { JRequest::setVar('controller', 'configuration'); JRequest::setVar('task', 'display'); JRequest::setVar('view', 'configuration'); JRequest::setVar('layout', 'default'); JError::raiseNotice(123, JText::_('Please, save the configurations')); } if ($controller = JRequest::getWord('controller')) { $path = JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php'; if (file_exists($path)) { require_once $path; $classname = 'JDefenderController' . ucfirst($controller); } } else { $path = JPATH_COMPONENT . DS . 'controllers' . DS . 'log.php';