Beispiel #1
0
 /**
  * Return true if the Live Update can be used
  *
  * @return boolean True if the Live Update can be used
  */
 public function canUseLiveUpdate()
 {
     $update = new LiveUpdate();
     if (!$update->hasPhp()) {
         return false;
     }
     if (!$update->hasPhar()) {
         return false;
     }
     if (!$update->hasSsl()) {
         return false;
     }
     if ($update->hasIonCube()) {
         return false;
     }
     if ($update->hasSuhosin()) {
         return false;
     }
     if ($update->hasDetectUnicode()) {
         return false;
     }
     if ($update->isFastCgiEaccelerator()) {
         return false;
     }
     if (!$update->canConnect()) {
         return false;
     }
     return true;
 }
 public function display($tpl = null)
 {
     if (!class_exists('VmConfig')) {
         require JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'config.php';
     }
     VmConfig::loadConfig();
     // Load the CSS
     $config = LiveUpdateConfig::getInstance();
     $this->assign('config', $config);
     if (JVM_VERSION === 2) {
         JHtml::_('bootstrap.loadCss');
     }
     if (!$config->addMedia()) {
         // No custom CSS overrides were set; include our own
         // $document = JFactory::getDocument();
         // $url = JURI::base().'/components/'.JRequest::getCmd('option','').'/liveupdate/assets/liveupdate.css';
         // $document->addStyleSheet($url, 'text/css');
     }
     $requeryURL = 'index.php?option=' . JRequest::getCmd('option', '') . '&view=' . JRequest::getCmd('view', 'liveupdate') . '&force=1';
     $this->assign('requeryURL', $requeryURL);
     $extInfo = (object) $config->getExtensionInformation();
     JToolBarHelper::title($extInfo->title . ' – ' . JText::_('LIVEUPDATE_TASK_OVERVIEW'), 'liveupdate');
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $msg = 'JTOOLBAR_BACK';
     } else {
         $msg = 'Back';
     }
     JToolBarHelper::back($msg, 'index.php?option=' . JRequest::getCmd('option', ''));
     switch (JRequest::getCmd('task', 'default')) {
         case 'startupdate':
             $this->setLayout('startupdate');
             $this->assign('url', 'index.php?option=' . JRequest::getCmd('option', '') . '&view=' . JRequest::getCmd('view', 'liveupdate') . '&task=download');
             break;
         case 'install':
             $this->setLayout('install');
             // Get data from the model
             $state =& $this->get('State');
             // Are there messages to display ?
             $showMessage = false;
             if (is_object($state)) {
                 $message1 = $state->get('message');
                 $message2 = $state->get('extension.message');
                 $showMessage = $message1 || $message2;
             }
             $this->assign('showMessage', $showMessage);
             $this->assignRef('state', $state);
             break;
         case 'overview':
         default:
             $this->setLayout('overview');
             $force = JRequest::getInt('force', 0);
             $this->assign('updateInfo', LiveUpdate::getUpdateInformation($force));
             $this->assign('runUpdateURL', 'index.php?option=' . JRequest::getCmd('option', '') . '&view=' . JRequest::getCmd('view', 'liveupdate') . '&task=startupdate');
             $needsAuth = !$config->getAuthorization() && $config->requiresAuthorization();
             $this->assign('needsAuth', $needsAuth);
             break;
     }
     parent::display($tpl);
 }
Beispiel #3
0
	public function download()
	{
		// Get the path to Joomla!'s temporary directory
		$jreg =& JFactory::getConfig();
		$tmpdir = $jreg->getValue('config.tmp_path');
		
		jimport('joomla.filesystem.folder');
		// Make sure the user doesn't use the system-wide tmp directory. You know, the one that's
		// being erased periodically and will cause a real mess while installing extensions (Grrr!)
		if(realpath($tmpdir) == '/tmp') {
			// Someone inform the user that what he's doing is insecure and stupid, please. In the
			// meantime, I will fix what is broken.
			$tmpdir = JPATH_SITE.DS.'tmp';
		} // Make sure that folder exists (users do stupid things too often; you'd be surprised)
		elseif(!JFolder::exists($tmpdir)) {
			// Darn it, user! WTF where you thinking? OK, let's use a directory I know it's there...
			$tmpdir = JPATH_SITE.DS.'tmp';
		}

		// Oki. Let's get the URL of the package
		$updateInfo = LiveUpdate::getUpdateInformation();
		$config = LiveUpdateConfig::getInstance();
		$auth = $config->getAuthorization();
		$url = $updateInfo->downloadURL;
		
		// Sniff the package type. If sniffing is impossible, I'll assume a ZIP package
		$basename = basename($url);
		if(strstr($basename,'?')) {
			$basename = substr($basename, strstr($basename,'?')+1);
		}
		if(substr($basename,-4) == '.zip') {
			$type = 'zip';
		} elseif(substr($basename,-4) == '.tar') {
			$type = 'tar';
		} elseif(substr($basename,-4) == '.tgz') {
			$type = 'tar.gz';
		} elseif(substr($basename,-7) == '.tar.gz') {
			$type = 'tar.gz';
		} else {
			$type = 'zip';
		}
		
		// Cache the path to the package file and the temp installation directory in the session
		$target = $tmpdir.DS.$updateInfo->extInfo->name.'.update.'.$type;
		$tempdir = $tmpdir.DS.$updateInfo->extInfo->name.'_update';
		
		$session = JFactory::getSession();
		$session->set('target', $target, 'liveupdate');
		$session->set('tempdir', $tempdir, 'liveupdate');
		
		// Let's download!
		require_once dirname(__FILE__).'/download.php';
		return LiveUpdateDownloadHelper::download($url, $target);
	}
Beispiel #4
0
 function checkUpdates()
 {
     //force information reload
     $updateInfo = LiveUpdate::getUpdateInformation(true);
     //send json response
     $document =& JFactory::getDocument();
     $document->setMimeEncoding('application/json');
     if ($updateInfo->hasUpdates) {
         $msg = JText::_('COM_FALANG_CPANEL_OLD_VERSION') . '<a href="index.php?option=com_falang&view=liveupdate"/> ' . JText::_('COM_FALANG_CPANEL_UPDATE_LINK') . '</a>';
         echo json_encode(array('update' => "true", 'version' => $updateInfo->version, 'message' => $msg));
     } else {
         $msg = JText::_('COM_FALANG_CPANEL_LATEST_VERSION');
         echo json_encode(array('update' => "false", 'version' => $updateInfo->version, 'message' => $msg));
     }
     return true;
 }
Beispiel #5
0
 /**
  * Control Panel display function
  *
  * @param template $tpl
  */
 public function display($tpl = null)
 {
     JHTML::stylesheet('falang.css', 'administrator/components/com_falang/assets/css/');
     $document = JFactory::getDocument();
     $document->setTitle(JText::_('COM_FALANG_TITLE') . ' :: ' . JText::_('COM_FALANG_CONTROL_PANEL'));
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('COM_FALANG_TITLE') . ' :: ' . JText::_('COM_FALANG_HEADER'), 'falang');
     JToolBarHelper::preferences('com_falang', '580', '750');
     JToolBarHelper::help('screen.cpanel', true);
     if (FALANG_J30) {
         JHtmlSidebar::addEntry(JText::_('COM_FALANG_CONTROL_PANEL'), 'index.php?option=com_falang', true);
         JHtmlSidebar::addEntry(JText::_('COM_FALANG_TRANSLATION'), 'index.php?option=com_falang&amp;task=translate.overview');
         JHtmlSidebar::addEntry(JText::_('COM_FALANG_ORPHANS'), 'index.php?option=com_falang&amp;task=translate.orphans');
         JHtmlSidebar::addEntry(JText::_('COM_FALANG_CONTENT_ELEMENTS'), 'index.php?option=com_falang&amp;task=elements.show', false);
         JHtmlSidebar::addEntry(JText::_('COM_FALANG_HELP_AND_HOWTO'), 'index.php?option=com_falang&amp;task=help.show', false);
         $this->sidebar = JHtmlSidebar::render();
     } else {
         JSubMenuHelper::addEntry(JText::_('COM_FALANG_CONTROL_PANEL'), 'index.php?option=com_falang', true);
         JSubMenuHelper::addEntry(JText::_('COM_FALANG_TRANSLATION'), 'index.php?option=com_falang&amp;task=translate.overview');
         JSubMenuHelper::addEntry(JText::_('COM_FALANG_ORPHANS'), 'index.php?option=com_falang&amp;task=translate.orphans');
         JSubMenuHelper::addEntry(JText::_('COM_FALANG_CONTENT_ELEMENTS'), 'index.php?option=com_falang&amp;task=elements.show', false);
         JSubMenuHelper::addEntry(JText::_('COM_FALANG_HELP_AND_HOWTO'), 'index.php?option=com_falang&amp;task=help.show', false);
     }
     $this->panelStates = $this->get('PanelStates');
     $this->contentInfo = $this->get('ContentInfo');
     $this->performanceInfo = $this->get('PerformanceInfo');
     $this->assignRef('panelStates', $this->panelStates);
     $this->assignRef('contentInfo', $this->contentInfo);
     $this->assignRef('performanceInfo', $this->performanceInfo);
     //version
     $updateInfo = LiveUpdate::getUpdateInformation();
     // Get current version available
     $this->currentVersion = $updateInfo->extInfo->version;
     //get latest version
     $this->latestVersion = $updateInfo->version;
     $this->updateInfo = $updateInfo;
     $js = "var progress_msg = '" . JText::_('COM_FALANG_CPANEL_CHECK_PROGRESS') . "';";
     $document->addScriptDeclaration($js);
     $document->addScript('components/com_falang/assets/js/cpanel.js');
     JHTML::_('behavior.tooltip');
     parent::display($tpl);
 }
Beispiel #6
0
 public static function update()
 {
     // Load translations
     $basepath = JPATH_ADMINISTRATOR . '/components/com_projectfork/liveupdate';
     $lang = JFactory::getLanguage();
     $lang->load('liveupdate', $basepath, 'en-GB', true);
     $lang->load('liveupdate', $basepath, $lang->getDefault(), true);
     $lang->load('liveupdate', $basepath, null, true);
     $info = LiveUpdate::getUpdateInformation();
     $btn = array();
     $html = array();
     if (!$info->supported) {
         // Unsupported
         $btn['class'] = 'btn-warning';
         $btn['icon'] = 'icon-warning';
         $btn['text'] = JText::_('LIVEUPDATE_ICON_UNSUPPORTED');
     } elseif ($info->stuck) {
         // Stuck
         $btn['class'] = 'btn-danger';
         $btn['icon'] = 'icon-warning';
         $btn['text'] = JText::_('LIVEUPDATE_ICON_CRASHED');
     } elseif ($info->hasUpdates) {
         // Has updates
         $btn['class'] = 'btn-primary';
         $button['icon'] = 'icon-download-alt';
         $btn['text'] = JText::_('LIVEUPDATE_ICON_UPDATES');
     } else {
         // Already in the latest release
         $btn['class'] = 'btn-success';
         $btn['icon'] = 'icon-ok';
         $btn['text'] = JText::_('LIVEUPDATE_ICON_CURRENT');
     }
     $html[] = '<a class="btn btn-small hasTooltip ' . $btn['class'] . '" rel="tooltip" title="Complete Task" href="index.php?option=com_projectfork&view=liveupdate">';
     $html[] = '<span aria-hidden="true" class="' . $btn['icon'] . '"></span> ';
     $html[] = $btn['text'];
     $html[] = '</a>';
     return implode('', $html);
 }
 public function cleanup()
 {
     // Perform the cleanup
     $ftp = $this->setCredentialsFromRequest('ftp');
     $model = $this->getThisModel();
     $model->cleanup();
     // Force reload update information
     $dummy = LiveUpdate::getUpdateInformation(true);
     die('OK');
 }
 public function save()
 {
     $enableSRP = $this->input->get('srp', 0, 'bool');
     $enableAutoupdate = $this->input->get('autoupdate', 0, 'bool');
     $runConfwiz = $this->input->get('confwiz', 0, 'bool');
     $angieupgrade = $this->input->get('angieupgrade', 0, 'bool');
     $minStability = $this->input->get('minstability', 'stable', 'cmd');
     $acceptlicense = $this->input->get('acceptlicense', 0, 'bool');
     $acceptsupport = $this->input->get('acceptsupport', 0, 'bool');
     $acceptbackuptest = $this->input->get('acceptbackuptest', 0, 'bool');
     if (!in_array($minStability, array('alpha', 'beta', 'rc', 'stable'))) {
         $minStability = 'stable';
     }
     // SRP is only supported on MySQL databases
     if (!$this->isMySQL()) {
         $enableSRP = false;
     }
     $db = JFactory::getDBO();
     if ($enableSRP) {
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('1'))->where($db->qn('element') . ' = ' . $db->q('srp'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
     } else {
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('0'))->where($db->qn('element') . ' = ' . $db->q('srp'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
     }
     if ($enableAutoupdate) {
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('1'))->where($db->qn('element') . ' = ' . $db->q('oneclickaction'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('1'))->where($db->qn('element') . ' = ' . $db->q('akeebaupdatecheck'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
     } else {
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('0'))->where($db->qn('element') . ' = ' . $db->q('oneclickaction'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
         $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('enabled') . ' = ' . $db->q('0'))->where($db->qn('element') . ' = ' . $db->q('akeebaupdatecheck'))->where($db->qn('folder') . ' = ' . $db->q('system'));
         $db->setQuery($query);
         $db->execute();
     }
     if ($angieupgrade) {
         $this->_angieUpgrade();
     }
     // Update last version check and minstability. DO NOT USE JCOMPONENTHELPER!
     $sql = $db->getQuery(true)->select($db->qn('params'))->from($db->qn('#__extensions'))->where($db->qn('type') . ' = ' . $db->q('component'))->where($db->qn('element') . ' = ' . $db->q('com_akeeba'));
     $db->setQuery($sql);
     $rawparams = $db->loadResult();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $params = new JRegistry();
         if (version_compare(JVERSION, '3.0', 'ge')) {
             $params->loadString($rawparams);
         } else {
             $params->loadJSON($rawparams);
         }
     } else {
         $params = new JParameter($rawparams);
     }
     if ($acceptlicense && $acceptsupport) {
         $version = AKEEBA_VERSION;
     } else {
         $version = '0.0.0';
     }
     if (version_compare(JVERSION, '3.0', 'ge')) {
         $params->set('lastversion', $version);
         $params->set('minstability', $minStability);
         $params->set('acceptlicense', $acceptlicense);
         $params->set('acceptsupport', $acceptsupport);
         $params->set('acceptbackuptest', $acceptbackuptest);
         $params->set('angieupgrade', $angieupgrade ? 1 : 0);
     } else {
         $params->setValue('lastversion', $version);
         $params->setValue('minstability', $minStability);
         $params->setValue('acceptlicense', $acceptlicense);
         $params->setValue('acceptsupport', $acceptsupport);
         $params->setValue('acceptbackuptest', $acceptbackuptest);
         $params->setValue('angieupgrade', $angieupgrade ? 1 : 0);
     }
     $data = $params->toString('JSON');
     $sql = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('params') . ' = ' . $db->q($data))->where($db->qn('element') . ' = ' . $db->q('com_akeeba'))->where($db->qn('type') . ' = ' . $db->q('component'));
     $db->setQuery($sql);
     $db->execute();
     // Even better, create the "akeeba.lastversion.php" file with this information
     $fileData = "<" . "?php\ndefined('_JEXEC') or die();\ndefine('AKEEBA_LASTVERSIONCHECK','" . $version . "');";
     JLoader::import('joomla.filesystem.file');
     $fileName = JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php';
     JFile::write($fileName, $fileData);
     // Force reload the Live Update information
     if ($version != '0.0.0') {
         $dummy = LiveUpdate::getUpdateInformation(true);
     }
     // Run the configuration wizard if requested
     $message = '';
     if ($runConfwiz) {
         $url = 'index.php?option=com_akeeba&view=confwiz';
     } else {
         $url = 'index.php?option=com_akeeba&view=cpanel';
     }
     if (!$acceptlicense) {
         JFactory::getApplication()->enqueueMessage(JText::_('AKEEBA_POSTSETUP_ERR_ACCEPTLICENSE'), 'error');
         $url = 'index.php?option=com_akeeba&view=postsetup';
     }
     if (!$acceptsupport) {
         JFactory::getApplication()->enqueueMessage(JText::_('AKEEBA_POSTSETUP_ERR_ACCEPTSUPPORT'), 'error');
         $url = 'index.php?option=com_akeeba&view=postsetup';
     }
     if (!$acceptbackuptest) {
         JFactory::getApplication()->enqueueMessage(JText::_('AKEEBA_POSTSETUP_ERR_ACCEPTBACKUPTEST'), 'error');
         $url = 'index.php?option=com_akeeba&view=postsetup';
     }
     JFactory::getApplication()->redirect($url);
 }
</div>
    <?php 
}
?>
    <?php 
if ($this->canDo->get('core.admin') || $this->canDo->get('vm.user.editshop')) {
    ?>
	<div class="icon"><?php 
    VmImage::displayImageButton(JROUTE::_('index.php?option=com_virtuemart&view=user&task=editshop'), 'vm_shop_mart_48', JText::_('COM_VIRTUEMART_STORE'));
    ?>
</div>
    <?php 
}
?>
	<div class="icon"><?php 
VmImage::displayImageButton('http://virtuemart.org/index.php?option=com_content&amp;task=view&amp;id=248&amp;Itemid=125', 'vm_shop_help_48', JText::_('COM_VIRTUEMART_DOCUMENTATION'));
?>
</div>
    <?php 
if ($this->canDo->get('core.admin')) {
    ?>
	<div class="icon"><?php 
    echo LiveUpdate::getIcon(array(), 'url');
    ?>
</div>
    <?php 
}
?>

<div class="clear"></div>
</div>
Beispiel #10
0
	public function display($tpl = null)
	{
		// Load the CSS
		$config = LiveUpdateConfig::getInstance();
		$this->assign('config', $config);
		if(!$config->addMedia()) {
			// No custom CSS overrides were set; include our own
			$document = JFactory::getDocument();
			$url = JURI::base().'/components/'.JRequest::getCmd('option','').'/liveupdate/assets/liveupdate.css';
			$document->addStyleSheet($url, 'text/css');
		}
		
		$requeryURL = 'index.php?option='.JRequest::getCmd('option','').'&view='.JRequest::getCmd('view','liveupdate').'&force=1';
		$this->assign('requeryURL', $requeryURL);
		
		$model = $this->getModel();
		
		$extInfo = (object)$config->getExtensionInformation();
		JToolBarHelper::title($extInfo->title.' &ndash; '.JText::_('LIVEUPDATE_TASK_OVERVIEW'),'liveupdate');
		JToolBarHelper::back('AKEEBA_CONTROLPANEL', 'index.php?option='.JRequest::getCmd('option'));
		
		switch(JRequest::getCmd('task','default'))
		{
			case 'startupdate':
				$this->setLayout('startupdate');
				$this->assign('url','index.php?option='.JRequest::getCmd('option','').'&view='.JRequest::getCmd('view','liveupdate').'&task=download');
				break;
				
			case 'install':
				$this->setLayout('install');

				// Get data from the model
				$state		= &$this->get('State');
		
				// Are there messages to display ?
				$showMessage	= false;
				if ( is_object($state) )
				{
					$message1		= $state->get('message');
					$message2		= $state->get('extension.message');
					$showMessage	= ( $message1 || $message2 );
				}
		
				$this->assign('showMessage',	$showMessage);
				$this->assignRef('state',		$state);
				
				break;
				
			case 'overview':
			default:
				$this->setLayout('overview');
				
				$force = JRequest::getInt('force',0);
				$this->assign('updateInfo', LiveUpdate::getUpdateInformation($force));
				$this->assign('runUpdateURL','index.php?option='.JRequest::getCmd('option','').'&view='.JRequest::getCmd('view','liveupdate').'&task=startupdate');
				
				$needsAuth = !($config->getAuthorization()) && ($config->requiresAuthorization());
				$this->assign('needsAuth', $needsAuth); 
				break;
		}
		
		parent::display($tpl);
	}
    echo base64_encode(JURI::getInstance()->toString());
    ?>
">
				<div class="ak-icon ak-icon-componentparams">&nbsp;</div>
				<span><?php 
    echo JText::_('CPANEL_LABEL_COMPONENTCONFIG');
    ?>
</span>
			</a>
			<?php 
}
?>
		</div>

		<?php 
echo LiveUpdate::getIcon();
?>

		<div class="ak_clr"></div>

		<?php 
if (!empty($this->icondefs['inclusion'])) {
    ?>
		<h3><?php 
    echo JText::_('CPANEL_HEADER_INCLUSION');
    ?>
</h3>
		<?php 
    foreach ($this->icondefs['inclusion'] as $icon) {
        ?>
		<div class="icon">
    public function onAfterRender()
    {
        // Check for PHP4
        if (defined('PHP_VERSION')) {
            $version = PHP_VERSION;
        } elseif (function_exists('phpversion')) {
            $version = phpversion();
        } else {
            // No version info. I'll lie and hope for the best.
            $version = '5.0.0';
        }
        // Old PHP version detected. EJECT! EJECT! EJECT!
        if (!version_compare($version, '5.2.7', '>=')) {
            return;
        }
        // Make sure Akeeba Backup is installed
        if (!file_exists(JPATH_ADMINISTRATOR . '/components/com_akeeba')) {
            return;
        }
        JLoader::import('joomla.filesystem.file');
        $db = JFactory::getDBO();
        // If another extension using Live Update is already loaded, or if
        // another update check plugin has already run, bail out.
        if (class_exists('LiveUpdate')) {
            return;
        }
        // Is Akeeba Backup with Live Update installed?
        $liveUpdateFile = JPATH_ADMINISTRATOR . '/components/com_akeeba/liveupdate/liveupdate.php';
        if (!JFile::exists($liveUpdateFile)) {
            return;
        }
        // Is Akeeba Backup enabled?
        $query = $db->getQuery(true)->select($db->qn('enabled'))->from($db->qn('#__extensions'))->where($db->qn('element') . ' = ' . $db->q('com_akeeba'))->where($db->qn('type') . ' = ' . $db->q('component'));
        $db->setQuery($query);
        $enabled = $db->loadResult();
        if (!$enabled) {
            return;
        }
        // Is the One Click Action plugin enabled?
        $app = JFactory::getApplication();
        $jResponse = $app->triggerEvent('onOneClickActionEnabled');
        if (empty($jResponse)) {
            return;
        }
        $status = false;
        foreach ($jResponse as $response) {
            $status = $status || $response;
        }
        if (!$status) {
            return;
        }
        // Do we have to run (at most once per 3 hours)?
        JLoader::import('joomla.html.parameter');
        JLoader::import('joomla.application.component.helper');
        $component = JComponentHelper::getComponent('com_akeeba');
        if (!$component->params instanceof JRegistry) {
            $params = new JParameter($component->params);
        } else {
            $params = $component->params;
        }
        if (version_compare(JVERSION, '3.0', 'ge')) {
            $last = $params->get('plg_akeebaupdatecheck', 0);
        } else {
            $last = $params->getValue('plg_akeebaupdatecheck', 0);
        }
        $now = time();
        if (abs($now - $last) < 86400) {
            return;
        }
        // Use a 20% chance of running; this allows multiple concurrent page
        // requests to not cause double update emails being sent out.
        $random = rand(1, 5);
        if ($random != 3) {
            return;
        }
        // Update last run status
        if (version_compare(JVERSION, '3.0', 'ge')) {
            $params->set('plg_akeebaupdatecheck', $now);
        } else {
            $params->setValue('plg_akeebaupdatecheck', $now);
        }
        $db = JFactory::getDBO();
        $data = $params->toString('JSON');
        $query = $db->getQuery(true)->update($db->qn('#__extensions'))->set($db->qn('params') . ' = ' . $db->q($data))->where($db->qn('element') . ' = ' . $db->q('com_akeeba'))->where($db->qn('type') . ' = ' . $db->q('component'));
        $db->setQuery($query);
        // If a DB error occurs, return null
        $db->execute();
        if ($db->getErrorNum()) {
            return;
        }
        if (!defined('AKEEBAENGINE')) {
            define('AKEEBAENGINE', 1);
            // Required for accessing Akeeba Engine's factory class
        }
        include_once JPATH_ADMINISTRATOR . '/components/com_akeeba/version.php';
        require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/akeeba/factory.php';
        // If this is not the Professional release, bail out. So far I have only
        // received complaints about this feature from users of the Core release
        // who never bothered to read the documentation. FINE! If you are bitching
        // about it, you don't get this feature (unless you are a developer who can
        // come here and edit the code). Fair enough.
        if (!defined('AKEEBA_PRO')) {
            return;
        }
        if (!AKEEBA_PRO) {
            return;
        }
        // OK, cool. Let's run Live Update fetch, OK?
        require_once $liveUpdateFile;
        $updateInfo = LiveUpdate::getUpdateInformation();
        if (!$updateInfo->hasUpdates) {
            return;
        }
        // No point continuing if there are no udpates available
        if (!$updateInfo->supported) {
            return;
        }
        // No point continuing if Live Update is not supported
        if ($updateInfo->stuck) {
            return;
        }
        // No point continuing if Live Update is stuck
        if (empty($updateInfo->version)) {
            return;
        }
        // No point continuing if the version is empty (something went wrong)
        if (empty($updateInfo->stability)) {
            return;
        }
        // Ditto
        // If we're here, we have updates. Let's create an OTP.
        $uri = JURI::base();
        $uri = rtrim($uri, '/');
        $uri .= substr($uri, -13) != 'administrator' ? '/administrator/' : '/';
        $link = 'index.php?option=com_akeeba&view=liveupdate&task=startupdate';
        $superAdmins = array();
        $superAdminEmail = $this->params->get('email', '');
        if (!empty($superAdminEmail)) {
            $superAdmins = $this->_getSuperAdministrators($superAdminEmail);
        }
        if (empty($superAdmins)) {
            $superAdmins = $this->_getSuperAdministrators();
        }
        if (empty($superAdmins)) {
            return;
        }
        $this->_loadLanguage();
        $email_subject = <<<ENDSUBJECT
THIS EMAIL IS SENT FROM YOUR SITE "[SITENAME]" - Update available
ENDSUBJECT;
        $email_body = <<<ENDBODY
This email IS NOT sent by the authors of Akeeba Backup. It is sent automatically
by your own site, [SITENAME]

================================================================================
UPDATE INFORMATION
================================================================================

Your site has determined that there is an updated version of Akeeba Backup
available for download.

New version number: [VERSION]
Release date:       [DATE]
Stability level:    [STABILITY]

This email is sent to you by your site to remind you of this fact. The authors
of the software will never contact you about available updates.

================================================================================
UPDATE INSTRUCTIONS
================================================================================

To install the update on [SITENAME] please click the following link. (If the URL
is not a link, simply copy & paste it to your browser).

Update link:        [LINK]

This one-time use link, valid for 24 hours, will automatically log you in to
your site, [SITENAME], and perform the update automatically.

================================================================================
WHY AM I RECEIVING THIS EMAIL?
================================================================================

This email has been automatically sent by a plugin you, or the person who built
or manages your site, has installed and explicitly activated. This plugin looks
for updated versions of the software and sends an email notification to all
Super Users. You will receive several similar emails from your site, up to 6
times per day, until you either update the software or disable these emails.

To disable these emails, please unpublish the 'Akeeba Backup Update
Notification' plugin in the Plugin Manager on your site.

If you do not understand what this means, please do not contact the authors of
the software. They are NOT sending you this email and they cannot help you.
Instead, please contact the person who built or manages your site.

If you are the person who built or manages your website, please note that you
activated the update email notification feature during Akeeba Backup's first
run, by clicking on a check box with a clear explanation of how this feature
works printed under it.

================================================================================
WHO SENT ME THIS EMAIL?
================================================================================

This email is sent to you by your own site, [SITENAME]

ENDBODY;
        $jconfig = JFactory::getConfig();
        if (version_compare(JVERSION, '3.0', 'ge')) {
            $sitename = $jconfig->get('sitename');
        } else {
            $sitename = $jconfig->getValue('config.sitename');
        }
        $substitutions = array('[VERSION]' => $updateInfo->version, '[DATE]' => $updateInfo->date, '[STABILITY]' => ucfirst($updateInfo->stability), '[SITENAME]' => $sitename);
        // If Admin Tools Professional is installed, fetch the administrator secret key as well
        $adminpw = '';
        $modelFile = JPATH_ROOT . '/administrator/components/com_admintools/models/storage.php';
        if (@file_exists($modelFile)) {
            include_once $modelFile;
            if (class_exists('AdmintoolsModelStorage')) {
                if (version_compare(JVERSION, '3.0', 'ge')) {
                    $model = JModelLegacy::getInstance('Storage', 'AdmintoolsModel');
                } else {
                    $model = JModel::getInstance('Storage', 'AdmintoolsModel');
                }
                $adminpw = $model->getValue('adminpw', '');
            }
        }
        foreach ($superAdmins as $sa) {
            $otp = plgSystemOneclickaction::addAction($sa->id, $link);
            if (is_null($otp)) {
                // If the OTP is null, a database error occurred
                return;
            } elseif (empty($otp)) {
                // If the OTP is empty, an OTP for the same action was already
                // created and it hasn't expired.
                continue;
            }
            $emaillink = $uri . 'index.php?oneclickaction=' . $otp;
            if (!empty($adminpw)) {
                $emaillink .= '&' . urlencode($adminpw);
            }
            $substitutions['[LINK]'] = $emaillink;
            foreach ($substitutions as $k => $v) {
                $email_subject = str_replace($k, $v, $email_subject);
                $email_body = str_replace($k, $v, $email_body);
            }
            $mailer = JFactory::getMailer();
            if (version_compare(JVERSION, '3.0', 'ge')) {
                $mailfrom = $jconfig->get('mailfrom');
                $fromname = $jconfig->get('fromname');
            } else {
                $mailfrom = $jconfig->getValue('config.mailfrom');
                $fromname = $jconfig->getValue('config.fromname');
            }
            $mailer->setSender(array($mailfrom, $fromname));
            $mailer->addRecipient($sa->email);
            $mailer->setSubject($email_subject);
            $mailer->setBody($email_body);
            $mailer->Send();
        }
    }
Beispiel #13
0
 public function dispatch()
 {
     if (!class_exists('AkeebaControllerDefault')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/controllers/default.php';
     }
     // Merge the language overrides
     $paths = array(JPATH_ROOT, JPATH_ADMINISTRATOR);
     $jlang = JFactory::getLanguage();
     $jlang->load($this->component, $paths[0], 'en-GB', true);
     $jlang->load($this->component, $paths[0], null, true);
     $jlang->load($this->component, $paths[1], 'en-GB', true);
     $jlang->load($this->component, $paths[1], null, true);
     $jlang->load($this->component . '.override', $paths[0], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[0], null, true);
     $jlang->load($this->component . '.override', $paths[1], 'en-GB', true);
     $jlang->load($this->component . '.override', $paths[1], null, true);
     // Live Update translation
     $jlang->load('liveupdate', JPATH_COMPONENT_ADMINISTRATOR . '/liveupdate', 'en-GB', true);
     $jlang->load('liveupdate', JPATH_COMPONENT_ADMINISTRATOR . '/liveupdate', $jlang->getDefault(), true);
     $jlang->load('liveupdate', JPATH_COMPONENT_ADMINISTRATOR . '/liveupdate', null, true);
     FOFInflector::addWord('alice', 'alices');
     // Timezone fix; avoids errors printed out by PHP 5.3.3+ (thanks Yannick!)
     if (function_exists('date_default_timezone_get') && function_exists('date_default_timezone_set')) {
         if (function_exists('error_reporting')) {
             $oldLevel = error_reporting(0);
         }
         $serverTimezone = @date_default_timezone_get();
         if (empty($serverTimezone) || !is_string($serverTimezone)) {
             $serverTimezone = 'UTC';
         }
         if (function_exists('error_reporting')) {
             error_reporting($oldLevel);
         }
         @date_default_timezone_set($serverTimezone);
     }
     // Necessary defines for Akeeba Engine
     if (!defined('AKEEBAENGINE')) {
         define('AKEEBAENGINE', 1);
         // Required for accessing Akeeba Engine's factory class
         define('AKEEBAROOT', dirname(__FILE__) . '/akeeba');
         define('ALICEROOT', dirname(__FILE__) . '/alice');
     }
     // Setup Akeeba's ACLs, honoring laxed permissions in component's parameters, if set
     // Access check, Joomla! 1.6 style.
     $user = JFactory::getUser();
     if (!$user->authorise('core.manage', 'com_akeeba')) {
         return JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
     }
     // Make sure we have a profile set throughout the component's lifetime
     $session = JFactory::getSession();
     $profile_id = $session->get('profile', null, 'akeeba');
     if (is_null($profile_id)) {
         // No profile is set in the session; use default profile
         $session->set('profile', 1, 'akeeba');
     }
     // Load the factory
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/akeeba/factory.php';
     @(include_once JPATH_COMPONENT_ADMINISTRATOR . '/alice/factory.php');
     // Load the Akeeba Backup configuration and check user access permission
     $aeconfig = AEFactory::getConfiguration();
     AEPlatform::getInstance()->load_configuration();
     unset($aeconfig);
     // Preload helpers
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/includes.php';
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/escape.php';
     // Load the utils helper library
     AEPlatform::getInstance()->load_version_defines();
     // Create a versioning tag for our static files
     $staticFilesVersioningTag = md5(AKEEBA_VERSION . AKEEBA_DATE);
     define('AKEEBAMEDIATAG', $staticFilesVersioningTag);
     // If JSON functions don't exist, load our compatibility layer
     if (!function_exists('json_encode') || !function_exists('json_decode')) {
         require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/jsonlib.php';
     }
     // Handle Live Update requests
     if (!class_exists('LiveUpdate')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_akeeba/liveupdate/liveupdate.php';
         if ($this->input->get('view', '', 'cmd') == 'liveupdate') {
             LiveUpdate::handleRequest();
             return true;
         }
     }
     // Look for controllers in the plugins folder
     $option = $this->input->get('option', 'com_foobar', 'cmd');
     $view = $this->input->get('view', $this->defaultView, 'cmd');
     $c = FOFInflector::singularize($view);
     $alt_path = JPATH_ADMINISTRATOR . '/components/' . $option . '/plugins/controllers/' . $c . '.php';
     JLoader::import('joomla.filesystem.file');
     if (JFile::exists($alt_path)) {
         // The requested controller exists and there you load it...
         require_once $alt_path;
     }
     $this->input->set('view', $this->view);
     parent::dispatch();
 }
    /**
     * Start the administrator area table
     *
     * The entire administrator area with contained in a table which include the admin ribbon menu
     * in the left column and the content in the right column.  This function sets up the table and
     * displayes the admin menu in the left column.
     */
    static function startAdminArea($backEnd = true)
    {
        if (JRequest::getWord('format') == 'pdf') {
            return;
        }
        if (JRequest::getWord('tmpl') == 'component') {
            self::$backEnd = false;
            include 'front/edit.html.php';
        }
        if (self::$vmAdminAreaStarted) {
            return;
        }
        self::$vmAdminAreaStarted = true;
        $front = JURI::root(true) . '/components/com_virtuemart/assets/';
        $admin = JURI::root(true) . '/administrator/components/com_virtuemart/assets/';
        $document = JFactory::getDocument();
        //loading defaut admin CSS
        // $document->addStyleSheet($admin.'css/admin_ui.css');
        // $document->addStyleSheet($admin.'css/admin_menu.css');
        JHtml::_('bootstrap.framework');
        if (JVM_VERSION === 2 || self::$backEnd === false) {
            $document->addStyleSheet($front . 'css/ui/bootstrap.min.css');
            // JHtml::_('bootstrap.loadCss') ;
            JHtml::_('bootstrap.tooltip');
            if (JVM_VERSION === 2) {
                $document->addScript($admin . 'js/j25fixes.js');
            }
            $document->setMetadata('viewport', 'width=device-width, initial-scale=1.0');
            JHtml::_('behavior.framework');
        }
        $document->addStyleSheet($admin . 'css/admin.styles.css');
        $document->addStyleSheet($admin . 'css/toolbar_images.css');
        $document->addStyleSheet($admin . 'css/menu_images.css');
        $document->addStyleSheet($admin . 'css/fileinput.css');
        // $document->addStyleSheet($front.'css/chosen.css');
        // $document->addStyleSheet($front.'css/vtip.css');
        $document->addStyleSheet($front . 'css/jquery.fancybox-1.3.4.css');
        //$document->addStyleSheet($admin.'css/jqtransform.css');
        //loading defaut script
        JHtml::_('behavior.framework');
        // JHtml::_('bootstrap.tooltip');
        $document->addScript($front . 'js/fancybox/jquery.mousewheel-3.0.4.pack.js');
        $document->addScript($front . 'js/fancybox/jquery.easing-1.3.pack.js');
        $document->addScript($front . 'js/fancybox/jquery.fancybox-1.3.4.pack.js');
        $document->addScript($admin . 'js/jquery.coookie.js');
        // $document->addScript($front.'js/chosen.jquery.min.js');
        JHtml::_('formbehavior.chosen', 'select');
        $document->addScript($admin . 'js/vm2admin.js');
        $document->addScript($admin . 'js/fileinput.js');
        //$document->addScript($admin.'js/jquery.jqtransform.js');
        if (JText::_('COM_VIRTUEMART_JS_STRINGS') == 'COM_VIRTUEMART_JS_STRINGS') {
            $vm2string = "editImage: 'edit image',select_all_text: 'select all options',select_some_options_text: 'select some options'";
        } else {
            $vm2string = JText::_('COM_VIRTUEMART_JS_STRINGS');
        }
        //prevent joomlaJtext bug.
        JText::script('JGLOBAL_SELECT_SOME_OPTIONS');
        // old type image var tip_image='".JURI::root(true)."/components/com_virtuemart/assets/js/images/vtip_arrow.png';
        // fix for jsonRequest in front admin
        $baseUrlCurrent = self::$backEnd === false ? '/' : '/administrator/';
        $document->addScriptDeclaration("\n//<![CDATA[\n\t\tvar vmBaseUrl = '" . JURI::root(true) . $baseUrlCurrent . "';\n\t\tvar vm2string ={" . $vm2string . "} ;\n\t\t jQuery( function(\$) {\n\n\t\t\t\$('dl#system-message').hide().slideDown(400);\n\t\t\t\$('.virtuemart-admin-area .toggler').vm2admin('toggle');\n\t\t\t\$('#admin-ui-menu').vm2admin('accordeon');\n\t\t\t// if ( \$('#adminForm > ul').length  ) {\n\t\t\t\t// \$('#adminForm > ul').vm2admin('tabs',virtuemartcookie);\n\t\t\t\t//.find('select').chosen({enable_select_all: true,select_all_text : vm2string.select_all_text,select_some_options_text:vm2string.select_some_options_text}); \n\t\t\t// }\n\n\t\t\t// TIPS IS now from bootstrap  \$('#content-box [title]').vm2admin('tips',tip_image);\n\t\t\tjQuery('.hasTip').tooltip({});\n\n\t\t\t\$('.fb-modal-toggle,.modalbox').fancybox();\n\t\t\t// \$('.modal').modal();\n\t\t\t\$('.reset-value').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tnone = '';\n\t\t\t\tjQuery(this).parent().find('.ui-autocomplete-input').val(none);\n\t\t\t\t\n\t\t\t});\n\n\t\t});\n//]]>\n\t\t");
        ?>


		<?php 
        // Include ALU System
        if (self::$backEnd) {
            require_once JPATH_VM_ADMINISTRATOR . DS . 'liveupdate' . DS . 'liveupdate.php';
            ?>
		<div class="vm2admin">
		<div class="row-fluid">
		<div class="span12">
			<div class="btn btn-large btn-inverse" id="sidebar-toggle"><i class="icon-chevron-left"></i></div>
			<div class="span3 j-sidebar-container" id="j-sidebar-container">
				<div class="well well-small"><a href="index.php?option=com_virtuemart&view=virtuemart" ><div class="menu-vmlogo"></div></a></div>
				<?php 
            AdminUIHelper::showAdminMenu();
            if ($admin = JFactory::getUser()->authorise('core.admin')) {
                ?>
					<div class="menu-notice hidden-phone">
						<?php 
                echo LiveUpdate::getIcon(array(), 'notice');
                ?>
						<?php 
                echo VmConfig::getInstalledVersion();
                ?>
					</div>
					<?php 
            }
            ?>

			</div>
		<?php 
        }
        $view = jRequest::getWord('view', 'virtuemart');
        if (!self::$backEnd) {
            $span = $view === 'virtuemart' ? 'span8' : '';
        } elseif ($view == 'virtuemart') {
            $span = 'span5';
        } else {
            $span = 'span9';
        }
        ?>
			<div id="j-main-container" class="<?php 
        echo $span;
        ?>
">
		<?php 
    }
Beispiel #15
0
 private function _apiUpdateDownload($config)
 {
     require_once JPATH_ROOT . '/administrator/components/com_akeeba/liveupdate/liveupdate.php';
     require_once JPATH_ROOT . '/administrator/components/com_akeeba/liveupdate/classes/model.php';
     // Do we need to update?
     $updateInformation = LiveUpdate::getUpdateInformation();
     if (!$updateInformation->hasUpdates) {
         return (object) array('download' => 0);
     }
     $model = new LiveupdateModel();
     $ret = $model->download();
     $session = JFactory::getSession();
     $target = $session->get('target', '', 'liveupdate');
     $tempdir = $session->get('tempdir', '', 'liveupdate');
     // Save the target and tempdir
     $session = JFactory::getSession();
     $session->set('profile', 1, 'akeeba');
     AEPlatform::getInstance()->load_configuration(1);
     $config = AEFactory::getConfiguration();
     $config->set('remoteupdate.target', $target);
     $config->set('remoteupdate.tempdir', $tempdir);
     AEPlatform::getInstance()->save_configuration(1);
     if (!$ret) {
         // An error ocurred :(
         $this->status = self::STATUS_ERROR;
         $this->encapsulation = self::ENCAPSULATION_RAW;
         return "Could not download the update package";
     } else {
         return (object) array('download' => 1);
     }
 }
Beispiel #16
0
# copyright Copyright (C) 2014 - 19 Weblogicxindia.com. All Rights Reserved.
# @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://j2store.org
# Technical Support:  Forum - http://j2store.org/forum/index.html
-------------------------------------------------------------------------*/
// No direct access
defined('_JEXEC') or die;
$links = $vars->links;
$doc = JFactory::getDocument();
$doc->addStyleSheet(JUri::root() . 'media/j2store/css/font-awesome.min.css');
require_once JPATH_ADMINISTRATOR . '/components/com_j2store/version.php';
$user = JFactory::getUser();
$isroot = $user->authorise('core.admin');
$update_yes = 0;
if ($isroot) {
    $update = LiveUpdate::getUpdateInformation();
    if ($update->hasUpdates) {
        $update_yes = 1;
        $update_version = $update->version;
        $update_url = 'index.php?option=com_j2store&view=liveupdate';
    }
}
if (!empty($links)) {
    ?>
<!-- J2store Admin Sidebar Starts -->
<?php 
    if (version_compare(JVERSION, '3.0', 'lt')) {
        ?>
<div class="j2store">
<div class="row-fluid">
<?php 
 public function save()
 {
     $enableSRP = JRequest::getBool('srp', 0);
     $enableAutoupdate = JRequest::getBool('autoupdate', 0);
     $runConfwiz = JRequest::getBool('confwiz', 0);
     $db = JFactory::getDBO();
     if ($enableSRP) {
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $query = "UPDATE #__extensions SET enabled=1 WHERE element='srp' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         } else {
             $query = "UPDATE #__plugins SET published=1 WHERE element='srp' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         }
     } else {
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $query = "UPDATE #__extensions SET enabled=0 WHERE element='srp' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         } else {
             $query = "UPDATE #__plugins SET published=0 WHERE element='srp' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         }
     }
     if ($enableAutoupdate) {
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $query = "UPDATE #__extensions SET enabled=1 WHERE element='oneclickaction' AND folder='system'";
             $db->setQuery($query);
             $db->query();
             $query = "UPDATE #__extensions SET enabled=1 WHERE element='akeebaupdatecheck' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         } else {
             $query = "UPDATE #__plugins SET published=1 WHERE element='oneclickaction' AND folder='system'";
             $db->setQuery($query);
             $db->query();
             $query = "UPDATE #__plugins SET published=1 WHERE element='akeebaupdatecheck' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         }
     } else {
         if (version_compare(JVERSION, '1.6.0', 'ge')) {
             $query = "UPDATE #__extensions SET enabled=0 WHERE element='oneclickaction' AND folder='system'";
             $db->setQuery($query);
             $db->query();
             $query = "UPDATE #__extensions SET enabled=0 WHERE element='akeebaupdatecheck' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         } else {
             $query = "UPDATE #__plugins SET published=0 WHERE element='oneclickaction' AND folder='system'";
             $db->setQuery($query);
             $db->query();
             $query = "UPDATE #__plugins SET published=0 WHERE element='akeebaupdatecheck' AND folder='system'";
             $db->setQuery($query);
             $db->query();
         }
     }
     // Update last version check. DO NOT USE JCOMPONENTHELPER!
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__extensions') . ' WHERE ' . $db->nameQuote('type') . ' = ' . $db->Quote('component') . ' AND ' . $db->nameQuote('element') . ' = ' . $db->Quote('com_akeeba');
         $db->setQuery($sql);
     } else {
         $sql = 'SELECT ' . $db->nameQuote('params') . ' FROM ' . $db->nameQuote('#__components') . ' WHERE ' . $db->nameQuote('option') . ' = ' . $db->Quote('com_akeeba') . " AND `parent` = 0 AND `menuid` = 0";
         $db->setQuery($sql);
     }
     $rawparams = $db->loadResult();
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         $params = new JRegistry();
         $params->loadJSON($rawparams);
     } else {
         $params = new JParameter($rawparams);
     }
     $params->setValue('lastversion', AKEEBA_VERSION);
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         // Joomla! 1.6
         $data = $params->toString('JSON');
         $sql = 'UPDATE `#__extensions` SET `params` = ' . $db->Quote($data) . ' WHERE ' . "`element` = " . $db->Quote('com_akeeba') . " AND `type` = 'component'";
     } else {
         // Joomla! 1.5
         $data = $params->toString('INI');
         $sql = 'UPDATE `#__components` SET `params` = ' . $db->Quote($data) . ' WHERE ' . "`option` = " . $db->Quote('com_akeeba') . " AND `parent` = 0 AND `menuid` = 0";
     }
     $db->setQuery($sql);
     $db->query();
     // Even better, create the "akeeba.lastversion.php" file with this information
     $fileData = "<" . "?php\ndefined('_JEXEC') or die();\ndefine('AKEEBA_LASTVERSIONCHECK','" . AKEEBA_VERSION . "');";
     jimport('joomla.filesystem.file');
     $fileName = JPATH_COMPONENT_ADMINISTRATOR . '/akeeba.lastversion.php';
     JFile::write($fileName, $fileData);
     // Force reload the Live Update information
     $dummy = LiveUpdate::getUpdateInformation(true);
     // Run the configuration wizard if requested
     if ($runConfwiz) {
         $url = 'index.php?option=com_akeeba&view=confwiz';
     } else {
         $url = 'index.php?option=com_akeeba&view=cpanel';
     }
     $app = JFactory::getApplication();
     $app->redirect($url);
 }
Beispiel #18
0
			<?php endif; ?>
			
			<div class="icon">
				<?php if(AKEEBA_JVERSION == '15'): ?>
				<a href="index.php?option=com_config&controller=component&component=com_akeeba&path="
				<?php else: ?>
				<a href="index.php?option=com_config&view=component&component=com_akeeba&path=&tmpl=component"
				<?php endif; ?>
					class="modal"
					rel="{handler: 'iframe', size: {x: 660, y: 500}}">
					<div class="ak-icon ak-icon-componentparams">&nbsp;</div>
					<span><?php echo JText::_('CPANEL_LABEL_COMPONENTCONFIG'); ?></span>
				</a>
			</div>

			<?php echo LiveUpdate::getIcon(); ?>			
		</fieldset>

		<?php if(!empty($this->icondefs['inclusion'])): ?>
		<fieldset>
			<legend><?php echo JText::_('CPANEL_HEADER_INCLUSION'); ?></legend>
			<?php foreach($this->icondefs['inclusion'] as $icon): ?>
			<div class="icon">
				<a href="<?php echo 'index.php?option=com_akeeba'.
					(is_null($icon['view']) ? '' : '&amp;view='.$icon['view']).
					(is_null($icon['task']) ? '' : '&amp;task='.$icon['task']); ?>">
				<div class="ak-icon ak-icon-<?php echo $icon['icon'] ?>">&nbsp;</div>
				<span><?php echo $icon['label']; ?></span>
				</a>
			</div>
			<?php endforeach; ?>
Beispiel #19
0
    /**
     * Start the administrator area table
     *
     * The entire administrator area with contained in a table which include the admin ribbon menu
     * in the left column and the content in the right column.  This function sets up the table and
     * displayes the admin menu in the left column.
     */
    static function startAdminArea($backEnd = true)
    {
        if (JRequest::getWord('format') == 'pdf') {
            return;
        }
        if (JRequest::getWord('tmpl') == 'component') {
            self::$backEnd = false;
        }
        if (self::$vmAdminAreaStarted) {
            return;
        }
        self::$vmAdminAreaStarted = true;
        $front = JURI::root(true) . '/components/com_virtuemart/assets/';
        $admin = JURI::root(true) . '/administrator/components/com_virtuemart/assets/';
        $document = JFactory::getDocument();
        //loading defaut admin CSS
        $document->addStyleSheet($admin . 'css/admin_ui.css');
        $document->addStyleSheet($admin . 'css/admin_menu.css');
        $document->addStyleSheet($admin . 'css/admin.styles.css');
        $document->addStyleSheet($admin . 'css/toolbar_images.css');
        $document->addStyleSheet($admin . 'css/menu_images.css');
        $document->addStyleSheet($front . 'css/chosen.css');
        $document->addStyleSheet($front . 'css/vtip.css');
        $document->addStyleSheet($front . 'js/fancybox/jquery.fancybox-1.3.4.css');
        //$document->addStyleSheet($admin.'css/jqtransform.css');
        //loading defaut script
        $document->addScript($front . 'js/fancybox/jquery.mousewheel-3.0.4.pack.js');
        $document->addScript($front . 'js/fancybox/jquery.easing-1.3.pack.js');
        $document->addScript($front . 'js/fancybox/jquery.fancybox-1.3.4.pack.js');
        $document->addScript($admin . 'js/jquery.coookie.js');
        $document->addScript($front . 'js/chosen.jquery.min.js');
        $document->addScript($admin . 'js/vm2admin.js');
        //$document->addScript($admin.'js/jquery.jqtransform.js');
        if (JText::_('COM_VIRTUEMART_JS_STRINGS') == 'COM_VIRTUEMART_JS_STRINGS') {
            $vm2string = "editImage: 'edit image',select_all_text: 'select all options',select_some_options_text: 'select some options'";
        } else {
            $vm2string = JText::_('COM_VIRTUEMART_JS_STRINGS');
        }
        $document->addScriptDeclaration("\n\t\tvar tip_image='" . JURI::root(true) . "/components/com_virtuemart/assets/js/images/vtip_arrow.png';\n\t\tvar vm2string ={" . $vm2string . "} ;\n\t\t jQuery( function(\$) {\n\n\t\t\t\$('dl#system-message').hide().slideDown(400);\n\t\t\t\$('.virtuemart-admin-area .toggler').vm2admin('toggle');\n\t\t\t\$('#admin-ui-menu').vm2admin('accordeon');\n\t\t\tif ( \$('#admin-ui-tabs').length  ) {\n\t\t\t\t\$('#admin-ui-tabs').vm2admin('tabs',virtuemartcookie).find('select').chosen({enable_select_all: true,select_all_text : vm2string.select_all_text,select_some_options_text:vm2string.select_some_options_text}); \n\t\t\t}\n\n\t\t\t\$('#content-box [title]').vm2admin('tips',tip_image);\n\t\t\t\$('.modal').fancybox();\n\t\t\t\$('.reset-value').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tnone = '';\n\t\t\t\tjQuery(this).parent().find('.ui-autocomplete-input').val(none);\n\t\t\t\t\n\t\t\t});\n\n\t\t});\n\t\t");
        ?>
		<?php 
        if (!self::$backEnd) {
            echo '<div class="toolbar" style="height: 84px;position: relative;">' . vmView::getToolbar() . '</div>';
        }
        ?>
		<div class="virtuemart-admin-area">
		<?php 
        // Include ALU System
        if (self::$backEnd) {
            require_once JPATH_VM_ADMINISTRATOR . DS . 'liveupdate' . DS . 'liveupdate.php';
            ?>

			<div class="menu-wrapper">
				<a href="index.php?option=com_virtuemart&view=virtuemart" ><div class="menu-vmlogo"></div></a>
				<?php 
            AdminUIHelper::showAdminMenu();
            ?>
				<div class="menu-notice">
				<?php 
            echo LiveUpdate::getIcon(array(), 'notice');
            ?>
				<?php 
            echo VmConfig::getInstalledVersion();
            ?>
				</div>

			</div>
		<?php 
        }
        ?>
			<div id="admin-content-wrapper">
			<div class="toggler vmicon-show"></div>
				<div id="admin-content" class="admin-content">
		<?php 
    }
Beispiel #20
0
AEPlatform::load_version_defines();

// Create a versioning tag for our static files
$staticFilesVersioningTag = md5(AKEEBA_VERSION.AKEEBA_DATE.AKEEBA_JVERSION);
define('AKEEBAMEDIATAG', $staticFilesVersioningTag);

// If JSON functions don't exist, load our compatibility layer
if( (!function_exists('json_encode')) || (!function_exists('json_decode')) )
{
	require_once JPATH_COMPONENT_ADMINISTRATOR.DS.'helpers'.DS.'jsonlib.php';
}

// Handle Live Update requests
require_once JPATH_COMPONENT_ADMINISTRATOR.DS.'liveupdate'.DS.'liveupdate.php';
if(JRequest::getCmd('view','') == 'liveupdate') {
	LiveUpdate::handleRequest();
	return;
}

// Load the appropriate controller
$c = JRequest::getCmd('c','cpanel');
$path = JPATH_COMPONENT_ADMINISTRATOR.DS.'controllers'.DS.$c.'.php';
$alt_path = JPATH_COMPONENT_ADMINISTRATOR.DS.'plugins'.DS.'controllers'.DS.$c.'.php';
if(JFile::exists($path))
{
	// The requested controller exists and there you load it...
	require_once($path);
}
elseif(JFile::exists($alt_path))
{
	require_once($alt_path);
<?php

/**
 * Compojoom Control Center
 * @package Joomla!
 * @Copyright (C) 2012 - Yves Hoppe - compojoom.com
 * @All rights reserved
 * @Joomla! is Free Software
 * @Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
 * @version $Revision: 0.9.0 beta $
 **/
defined('_JEXEC') or die('Restricted access');
$extension = $params->get('extension', '');
require_once JPATH_ADMINISTRATOR . "/components/" . $extension . "/liveupdate/liveupdate.php";
$updateinfos = LiveUpdate::getUpdateInformation(true);
?>
<div style="padding: 12px;">
    <?php 
if ($updateinfos->hasUpdates) {
    echo "<h2>" . JText::_('MOD_CCC_MATUKIO_UPDATE_UPDATE_FOUND') . "</h2>";
    echo "<p>";
    echo JText::_('MOD_CCC_MATUKIO_UPDATE_NEW_VERSION') . ": " . $updateinfos->version . "<br />";
    echo JText::_('MOD_CCC_MATUKIO_UPDATE_NEW_VERSION_DATE') . ": " . $updateinfos->date . "<br />";
    echo "</p>";
    echo "<p>";
    echo JText::_('MOD_CCC_MATUKIO_UPDATE_HOWTO_UPDATE_TEXT');
    echo "</p>";
} else {
    echo JText::_('MOD_CCC_MATUKIO_UPDATE_NO_UPDATES');
}
?>