/** * Tries to authenticate the user and start the backup, or send him back to the default task */ function authenticate() { // Enforce raw mode - I need to be in full control! $format = JRequest::getCmd('format', 'html'); if ($format != 'raw') { $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=light&format=raw'); parent::redirect(); } else { if (!$this->_checkPermissions()) { parent::redirect(); } else { $this->_setProfile(); jimport('joomla.utilities.date'); jpimport('core.cube'); JoomlapackCUBE::reset(); $cube =& JoomlapackCUBE::getInstance(); $user =& JFactory::getUser(); $userTZ = $user->getParam('timezone', 0); $dateNow = new JDate(); $dateNow->setOffset($userTZ); $cube->start(JText::_('DEFAULT_COMMENT') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'), '')); $cube->save(); $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=light&task=step&key=' . JRequest::getVar('key') . '&profile=' . JRequest::getInt('profile') . '&format=raw'); } } }
function display() { // Check permissions $this->_checkPermissions(); // Set the profile $this->_setProfile(); // Force the output to be of the raw format type JRequest::setVar('format', 'raw'); $document =& JFactory::getDocument(); $document->setType('raw'); // Start the backup jimport('joomla.utilities.date'); jpimport('core.cube'); JoomlapackCUBE::reset(); $cube =& JoomlapackCUBE::getInstance(); $jconfig =& JFactory::getConfig(); $userTZ = $jconfig->get('config.offset'); /* $user =& JFactory::getUser(); $userTZ = $user->getParam('timezone',0); */ $dateNow = new JDate(); $dateNow->setOffset($userTZ); $cube->start(JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2'), '')); $cube->save(); $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=backup&task=step&key=' . JRequest::getVar('key') . '&profile=' . JRequest::getInt('profile', 1) . '&format=raw'); parent::display(); }
/** * Starts a backup * @return */ function display() { // Check permissions $this->_checkPermissions(); // Set the profile $this->_setProfile(); // Force the output to be of the raw format type JRequest::setVar('format', 'raw'); $document =& JFactory::getDocument(); $document->setType('raw'); // Get the description, if present; otherwise use the default description jimport('joomla.utilities.date'); $user =& JFactory::getUser(); $userTZ = $user->getParam('timezone', 0); $dateNow = new JDate(); $dateNow->setOffset($userTZ); $default_description = JText::_('BACKUP_DEFAULT_DESCRIPTION') . ' ' . $dateNow->toFormat(JText::_('DATE_FORMAT_LC2')); $description = JRequest::getString('description', $default_description); // Start the backup (CUBE Operation) jpimport('core.cube'); JoomlapackCUBE::reset(); $cube =& JoomlapackCUBE::getInstance(); $cube->start($description, ''); $cube->save(); // Return the JSON output parent::display(false); }
function start($description, $comment) { jpimport('core.cube'); JoomlapackCUBE::reset(); $cube =& JoomlapackCUBE::getInstance(); $cube->start($description, $comment); $cube->save(); return _processCUBE(); }
/** * Displays the Control Panel (main page) * Accessible at index.php?option=com_joomlapack * */ function display() { $registry =& JoomlapackModelRegistry::getInstance(); // FIX 2.1.b2 - Disabled the nag screen because of incompatibility with some servers /* // Make sure the user has seen the license nag screen $nagscreen = $registry->get('nagscreen',false); if(!$nagscreen) { $this->setRedirect(JURI::base().'index.php?option=com_joomlapack&view=nag' ); return; } */ // Invalidate stale backups jpimport('core.cube'); JoomlapackCUBE::reset(); // If this is the Easy Mode, force switch to profile #1 (default profile) if ($registry->get('easymode', false)) { $session =& JFactory::getSession(); $session->set('profile', 1, 'joomlapack'); } // Display the panel parent::display(); }
/** * Starts a backup in JS redirects mode * */ function start() { $document =& JFactory::getDocument(); JRequest::setVar('tpl', 'start'); $description = JRequest::getString('description'); $comment = JRequest::getString('comment'); jpimport('core.cube'); JoomlapackCUBE::reset(); $cube =& JoomlapackCUBE::getInstance(); $cube->start($description, $comment); $cube->save(); parent::display(); }