Exemple #1
2
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SAFEMODE'), 'current' => (bool) ini_get('safe_mode'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCR'), 'current' => (bool) ini_get('magic_quotes_runtime'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCGPC'), 'current' => (bool) ini_get('magic_quotes_gpc'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_CURL'), 'current' => function_exists('curl_init'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_FTP'), 'current' => function_exists('ftp_connect'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SSH2'), 'current' => extension_loaded('ssh2'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_FOPEN'), 'current' => ini_get('allow_url_fopen'), 'recommended' => true);
         if (function_exists('gzencode')) {
             $gz = @gzencode('dd') !== false;
         } else {
             $gz = false;
         }
         $phpOptions[] = array('label' => AText::_('MAIN_REC_GZ'), 'current' => $gz, 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCRYPT'), 'current' => function_exists('mcrypt_encrypt'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DOM'), 'current' => extension_loaded('Dom'), 'recommended' => true);
     }
     return $phpOptions;
 }
 public function start()
 {
     $key = $this->input->get('key', null);
     $data = $this->input->get('dbinfo', null, 'array');
     if (empty($key) || empty($data['dbtype'])) {
         $result = array('percent' => 0, 'restored' => 0, 'total' => 0, 'eta' => 0, 'error' => AText::_('DATABASE_ERR_INVALIDKEY'), 'done' => 1);
         echo json_encode($result);
         return;
     }
     $model = AModel::getAnInstance('Database', 'AngieModel');
     $savedData = $model->getDatabaseInfo($key);
     if (is_object($savedData)) {
         $savedData = (array) $savedData;
     }
     if (!is_array($savedData)) {
         $savedData = array();
     }
     $data = array_merge($savedData, $data);
     $model->setDatabaseInfo($key, $data);
     $model->saveDatabasesIni();
     try {
         $restoreEngine = ADatabaseRestore::getInstance($key, $data);
         $restoreEngine->removeInformationFromStorage();
         $result = array('percent' => 0, 'restored' => 0, 'total' => $restoreEngine->getTotalSize(true), 'eta' => '–––', 'error' => '', 'done' => 0);
     } catch (Exception $exc) {
         $result = array('percent' => 0, 'restored' => 0, 'total' => 0, 'eta' => 0, 'error' => $exc->getMessage(), 'done' => 1);
     }
     echo json_encode($result);
 }
Exemple #3
0
 public function applyjson()
 {
     // We have to use the HTML filter, since the key could contain a forward slash
     // e.g. virtual_folders/first_folder
     $key = $this->input->getCmd('substep', 'default', 'html');
     if (empty($key)) {
         $result = array('percent' => 0, 'error' => AText::_('OFFSITEDIRS_ERR_INVALIDKEY'), 'done' => 1, 'showconfig' => '');
         echo json_encode($result);
         return;
     }
     try {
         /** @var AngieModelDrupal7Setup $model */
         $model = $this->getThisModel();
         $config = '';
         $error = '';
         $writtenConfiguration = $model->applySettings($key);
         if (!$writtenConfiguration) {
             /** @var AngieModelDrupal7Configuration $configModel */
             $configModel = AModel::getAnInstance('Configuration', 'AngieModel', array(), $this->container);
             $config = $configModel->getFileContents(APATH_SITE . '/sites/' . $key . '/settings.php');
             $error = AText::_('FINALISE_LBL_CONFIGINTRO') . '<br/>' . AText::_('FINALISE_LBL_CONFIGOUTRO');
         }
         $result = array('percent' => 100, 'error' => $error, 'done' => 1, 'showconfig' => $config);
     } catch (Exception $exc) {
         $result = array('percent' => 0, 'error' => $exc->getMessage(), 'done' => 1, 'showconfig' => '');
     }
     echo json_encode($result);
 }
Exemple #4
0
 public static function loadLanguage($langCode = null)
 {
     if (is_null($langCode)) {
         $langCode = self::detectLanguage();
     }
     // If we are asked to load a non-default language, load the English (Great Britain) base translation first
     if ($langCode != 'en-GB') {
         static::loadLanguage('en-GB');
     }
     // Main file
     $filename = APATH_INSTALLATION . '/' . AApplication::getInstance()->getName() . '/language/' . $langCode . '.ini';
     $strings = AngieHelperIni::parse_ini_file($filename, false);
     self::$strings = array_merge(self::$strings, $strings);
     // Platform override file
     $filename = APATH_INSTALLATION . '/' . AApplication::getInstance()->getName() . '/platform/language/' . $langCode . '.ini';
     if (!@file_exists($filename)) {
         $filename = APATH_INSTALLATION . '/platform/language/' . $langCode . '.ini';
     }
     if (@file_exists($filename)) {
         $strings = AngieHelperIni::parse_ini_file($filename, false);
         self::$strings = array_merge(self::$strings, $strings);
     }
     // Performs callback on loaded strings
     if (!empty(static::$iniProcessCallbacks) && !empty(self::$strings)) {
         foreach (static::$iniProcessCallbacks as $callback) {
             $ret = call_user_func($callback, $filename, self::$strings);
             if ($ret === false) {
                 return;
             } elseif (is_array($ret)) {
                 self::$strings = $ret;
             }
         }
     }
 }
Exemple #5
0
 /**
  * Apply the settings to the configuration file and the database
  */
 public function applySettings()
 {
     // Get the state variables and update the global configuration
     $stateVars = $this->getStateVariables();
     // -- General settings
     $this->configModel->set('sitename', $stateVars->sitename);
     $this->configModel->set('sitedescr', $stateVars->sitedescr);
     $this->configModel->set('siteurl', $stateVars->siteurl);
     // -- Database settings
     $connectionVars = $this->getDbConnectionVars();
     $this->configModel->set('dbtype', $connectionVars->dbtype);
     $this->configModel->set('dbhost', $connectionVars->dbhost);
     $this->configModel->set('dbuser', $connectionVars->dbuser);
     $this->configModel->set('dbpass', $connectionVars->dbpass);
     $this->configModel->set('dbname', $connectionVars->dbname);
     $this->configModel->set('dbprefix', $connectionVars->prefix);
     $this->configModel->saveToSession();
     // Sanity check
     if (!$stateVars->siteurl) {
         throw new Exception(AText::_('SETUP_SITEURL_REQUIRED'));
     }
     // Apply the Super Administrator changes
     $this->applySuperAdminChanges();
     // Get the wp-config.php file and try to save it
     if (!$this->configModel->writeConfig(APATH_ROOT . '/config.php')) {
         return false;
     }
     return true;
 }
    public function onBeforeMain()
    {
        ADocument::getInstance()->addScriptDeclaration(<<<ENDSRIPT
var akeebaAjax = null;
\$(document).ready(function(){
    akeebaAjax = new akeebaAjaxConnector('index.php');

    akeebaAjax.callJSON({
        'view'   : 'runscripts',
        'format' : 'raw'
    });
});
ENDSRIPT
);
        $model = $this->getModel();
        $this->showconfig = $model->getState('showconfig', 0);
        if ($this->showconfig) {
            $this->configuration = AModel::getAnInstance('Configuration', 'AngieModel')->getFileContents();
        }
        if (ASession::getInstance()->get('tfa_warning', false)) {
            $this->extra_warning = '<div class="alert alert-block alert-error">';
            $this->extra_warning .= '<h4 class="alert-heading">' . AText::_('FINALISE_TFA_DISABLED_TITLE') . '</h4>';
            $this->extra_warning .= '<p>' . AText::_('FINALISE_TFA_DISABLED_BODY') . '</p>';
            $this->extra_warning .= '</div>';
        }
        return true;
    }
Exemple #7
0
 public function getRecommended()
 {
     $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_MCR'), 'current' => (bool) ini_get('magic_quotes_runtime'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
     return $phpOptions;
 }
Exemple #8
0
 public function getRecommended()
 {
     $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
     $phpOptions[] = array('label' => AText::_('MAIN_REC_NATIVEZIP'), 'current' => function_exists('zip_open') && function_exists('zip_read'), 'recommended' => true);
     return $phpOptions;
 }
 public function initialise()
 {
     // Load the version file
     require_once APATH_INSTALLATION . '/version.php';
     // Load text callbacks
     if (file_exists(APATH_INSTALLATION . '/angie/platform/iniprocess.php')) {
         require_once APATH_INSTALLATION . '/angie/platform/iniprocess.php';
         AText::addIniProcessCallback(array('IniProcess', 'processLanguageIniFile'));
     }
 }
Exemple #10
0
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SAFEMODE'), 'current' => (bool) ini_get('safe_mode'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_UPLOADS'), 'current' => (bool) ini_get('file_uploads'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_NATIVEZIP'), 'current' => function_exists('zip_open') && function_exists('zip_read'), 'recommended' => true);
     }
     return $phpOptions;
 }
Exemple #11
0
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_UPLOADS'), 'current' => (bool) ini_get('file_uploads'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_XML'), 'current' => extension_loaded('xml'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_CURL'), 'current' => function_exists('curl_init'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_LBL_REQ_ICONV'), 'current' => extension_loaded('iconv'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_NATIVEZIP'), 'current' => function_exists('zip_open') && function_exists('zip_read'), 'recommended' => true);
     }
     return $phpOptions;
 }
 public function unlock()
 {
     $parts = explode(':', AKEEBA_PASSHASH);
     $password = $this->input->get('password', '', 'raw');
     $passHash = md5($password . $parts[1]);
     ASession::getInstance()->set('angie.passhash', $passHash);
     ASession::getInstance()->saveData();
     if ($passHash == $parts[0]) {
         $this->setRedirect('index.php?view=main');
     } else {
         $msg = AText::_('PASSWORD_ERR_INVALIDPASSWORD');
         $this->setRedirect('index.php?view=password', $msg, 'error');
     }
 }
 public function moveDir($key)
 {
     $dirs = $this->getDirs(true, true);
     $dir = $dirs[$key];
     $info = $this->input->get('info', array(), 'array');
     $virtual = APATH_ROOT . '/' . $dir['virtual'];
     $target = str_replace(array('[SITEROOT]', '[ROOTPARENT]'), array(APATH_ROOT, realpath(APATH_ROOT . '/..')), $info['target']);
     if (!file_exists($virtual)) {
         throw new Exception(AText::_('OFFSITEDIRS_VIRTUAL_DIR_NOT_FOUND'), 0);
     }
     if (!$this->recurse_copy($virtual, $target)) {
         throw new Exception(AText::_('OFFSITEDIRS_VIRTUAL_COPY_ERROR'), 0);
     }
 }
Exemple #14
0
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SAFEMODE'), 'current' => (bool) ini_get('safe_mode'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCR'), 'current' => (bool) ini_get('magic_quotes_runtime'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCGPC'), 'current' => (bool) ini_get('magic_quotes_gpc'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_CURL'), 'current' => function_exists('curl_init'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_FTP'), 'current' => function_exists('ftp_connect'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SSH2'), 'current' => extension_loaded('ssh2'), 'recommended' => true);
     }
     return $phpOptions;
 }
 public function move()
 {
     // We have to use the HTML filter, since the key could contain a forward slash
     // e.g. virtual_folders/first_folder
     $key = $this->input->get('key', null, 'html');
     if (empty($key)) {
         $result = array('percent' => 0, 'error' => AText::_('OFFSITEDIRS_ERR_INVALIDKEY'), 'done' => 1);
         echo json_encode($result);
         return;
     }
     try {
         $this->getThisModel()->moveDir($key);
         $result = array('percent' => 100, 'error' => '', 'done' => 1);
     } catch (Exception $exc) {
         $result = array('percent' => 0, 'error' => $exc->getMessage(), 'done' => 1);
     }
     echo json_encode($result);
 }
Exemple #16
0
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $jVersion = $this->container->session->get('jversion');
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SAFEMODE'), 'current' => (bool) ini_get('safe_mode'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_UPLOADS'), 'current' => (bool) ini_get('file_uploads'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCR'), 'current' => (bool) ini_get('magic_quotes_runtime'), 'recommended' => false);
         if (version_compare($jVersion, '3.0.0', 'lt')) {
             $phpOptions[] = array('label' => AText::_('MAIN_REC_MCGPC'), 'current' => (bool) ini_get('magic_quotes_gpc'), 'recommended' => false);
         }
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_NATIVEZIP'), 'current' => function_exists('zip_open') && function_exists('zip_read'), 'recommended' => true);
     }
     return $phpOptions;
 }
Exemple #17
0
 public function getRecommended()
 {
     static $phpOptions = array();
     if (empty($phpOptions)) {
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MBSTRING'), 'current' => extension_loaded('mbstring'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OPENSSL'), 'current' => extension_loaded('openssl'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_TOKENIZER'), 'current' => extension_loaded('tokenizer'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_XMLRPC'), 'current' => extension_loaded('xmlrpc'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SOAP'), 'current' => extension_loaded('soap'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SAFEMODE'), 'current' => (bool) ini_get('safe_mode'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_DISPERRORS'), 'current' => (bool) ini_get('display_errors'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_UPLOADS'), 'current' => (bool) ini_get('file_uploads'), 'recommended' => true);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_MCR'), 'current' => (bool) ini_get('magic_quotes_runtime'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_OUTBUF'), 'current' => (bool) ini_get('output_buffering'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_SESSIONAUTO'), 'current' => (bool) ini_get('session.auto_start'), 'recommended' => false);
         $phpOptions[] = array('label' => AText::_('MAIN_REC_NATIVEZIP'), 'current' => function_exists('zip_open') && function_exists('zip_read'), 'recommended' => true);
     }
     return $phpOptions;
 }
Exemple #18
0
 /**
  * Override the parent class since I have to store some extra info
  *
  * @param $key
  * @throws Exception
  */
 public function moveDir($key)
 {
     $dirs = $this->getDirs(true, true);
     if (!isset($dirs[$key])) {
         throw new Exception(AText::_('OFFSITEDIRS_VIRTUAL_DIR_NOT_FOUND'), 0);
     }
     $dir = $dirs[$key];
     $info = $this->input->get('info', array(), 'array');
     $virtual = APATH_ROOT . '/' . $dir['virtual'];
     $target = str_replace(array('[SITEROOT]', '[ROOTPARENT]'), array(APATH_ROOT, realpath(APATH_ROOT . '/..')), $info['target']);
     // Are we trying to restore the moodledata directory? If so let's save the target, so I can update the config file
     if ($key == 'moodledata') {
         $this->container->session->set('directories.moodledata', $target);
     }
     if (!file_exists($virtual)) {
         throw new Exception(AText::_('OFFSITEDIRS_VIRTUAL_DIR_NOT_FOUND'), 0);
     }
     if (!$this->recurse_copy($virtual, $target)) {
         throw new Exception(AText::_('OFFSITEDIRS_VIRTUAL_COPY_ERROR'), 0);
     }
 }
Exemple #19
0
 public function fix()
 {
     // Connect to FTP
     $vars = $this->getStateVariables();
     $ftp = AFtp::getInstance($vars->hostname, $vars->port, array('type' => FTP_AUTOASCII), $vars->username, $vars->password);
     $root = rtrim($vars->directory, '/');
     // Can we find ourself?
     try {
         $ftp->chdir($root . '/installation');
         $ftp->read('defines.php', $buffer);
         if (!strlen($buffer)) {
             throw new Exception('Cannot read defines.php');
         }
     } catch (Exception $exc) {
         throw new Exception(AText::_('SESSION_ERR_INVALIDDIRECTORY'));
     }
     // Let's try to chmod the directory
     $success = true;
     try {
         $trustMeIKnowWhatImDoing = 500 + 10 + 1;
         // working around overzealous scanners written by bozos
         $ftp->chmod($root . '/installation/tmp', $trustMeIKnowWhatImDoing);
     } catch (Exception $exc) {
         $success = false;
     }
     if ($success) {
         return true;
     }
     try {
         // That didn't work. Let's try creating an empty file in there.
         $ftp->write($root . '/installation/tmp/storagedata.dat', '');
         // ...and let's try giving it some Number Of The Server Beast permissions
         $trustMeIKnowWhatImDoing = 500 + 10 + 1;
         // working around overzealous scanners written by bozos
         $ftp->chmod($root . '/installation/tmp/storagedata.dat', $trustMeIKnowWhatImDoing);
     } catch (Exception $exc) {
         throw new Exception(AText::_('SESSION_ERR_CANNOTFIX'));
     }
     return true;
 }
Exemple #20
0
	</div>

	<div id="success-dialog" class="modal hide fade">
		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal" aria-hidden="true" id="success-btn-modalclose">&times;</button>
			<h3><?php 
echo AText::_('FINALISE_HEADER_SUCCESS');
?>
</h3>
		</div>
		<div class="modal-body">
			<p>
				<?php 
echo AText::sprintf('FINALISE_LBL_SUCCESS', 'https://www.akeebabackup.com/documentation/troubleshooter/prbasicts.html');
?>
			</p>
			<a class="btn btn-success" href="<?php 
echo AUri::base() . '../index.php';
?>
">
				<span class="icon-white icon-forward"></span>
				<?php 
echo AText::_('FINALISE_BTN_VISITFRONTEND');
?>
			</a>
		</div>
	</div>

</div>

Exemple #21
0
		<table class="table-striped" width="100%">
			<tbody>
				<tr>
					<td>
						<label><?php 
echo AText::_('MAIN_LBL_SITE_PHP');
?>
</label>
					</td>
					<td><?php 
echo PHP_VERSION;
?>
</td>
				</tr>
			</tbody>
		</table>
	</div>
</div>

<div class="modal hide fade" id="readmeDialog">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		<h3><?php 
echo AText::_('MAIN_HEADER_OPENREADME');
?>
</h3>
	</div>
	<div class="modal-body">
		<iframe src="README.html" width="100%" height="350"></iframe>
	</div>
</div>
Exemple #22
0
<ul class="breadcrumb">
<?php 
$found_active = false;
foreach ($crumbs as $crumb) {
    $i++;
    if ($crumb['active']) {
        $found_active = true;
    }
    ?>
  <li <?php 
    echo $crumb['active'] ? 'class="active"' : '';
    ?>
>
	  <?php 
    echo AText::_('GENERIC_CRUMB_' . $crumb['name']);
    ?>
	  <?php 
    if ($crumb['substeps'] - $crumb['active_substep'] > 0 && $found_active) {
        ?>
	  <span class="label label-important">
		  <?php 
        if ($crumb['active']) {
            ?>
		  <?php 
            echo $crumb['substeps'] - $crumb['active_substep'];
            ?>
		  <?php 
        } else {
            ?>
		  <?php 
Exemple #23
0
 /**
  * The main code of the Dispatcher. It spawns the necessary controller and
  * runs it.
  *
  * @return  null
  *
  * @throws  Exception
  */
 public function dispatch()
 {
     if (!$this->onBeforeDispatch()) {
         // For json, don't use normal 403 page, but a json encoded message
         if ($this->input->get('format', '') == 'json') {
             echo json_encode(array('code' => '403', 'error' => $this->getError()));
             exit;
         }
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     // Get and execute the controller
     $defaultApp = $this->container->application->getName();
     $option = $this->input->getCmd('option', $defaultApp);
     $view = $this->input->getCmd('view', $this->defaultView);
     $task = $this->input->getCmd('task', 'default');
     if (empty($task)) {
         $task = $this->getTask($view);
     }
     $this->input->set('view', $view);
     $this->input->set('task', $task);
     $config = $this->config;
     $config['input'] = $this->input;
     $controller = AController::getTmpInstance($option, $view, $config, $this->container);
     $status = $controller->execute($task);
     if ($status === false) {
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     if (!$this->onAfterDispatch()) {
         throw new Exception(AText::_('ANGI_APPLICATION_ERROR_ACCESS_FORBIDDEN'), 403);
     }
     // Issue the redirect only if we're not in JSON format
     if ($this->input->getCmd('format', '') != 'json') {
         $controller->redirect();
     }
 }
Exemple #24
0
</h3>

		<div class="form-horizontal">
			<div class="control-group">
				<label class="control-label" for="virtual_folder"><?php 
echo AText::_('OFFSITEDIRS_VIRTUAL_FOLDER');
?>
</label>
				<div class="controls">
					<input type="text" id="virtual_folder" class="input-xxlarge" disabled="disabled" value="<?php 
echo $this->substep['virtual'];
?>
"/>
				</div>
			</div>

            <div class="control-group">
                <label class="control-label" for="target_folder"><?php 
echo AText::_('OFFSITEDIRS_TARGET_FOLDER');
?>
</label>
                <div class="controls">
                    <input type="text" id="target_folder" class="input-xxlarge" value="<?php 
echo $this->substep['target'];
?>
"/>
                </div>
            </div>
		</div>
	</div>
</div>
Exemple #25
0
<div id="browseModal" class="modal hide fade" tabindex="-1" role="dialog" aria-hidden="true" aria-labelledby="browseModalLabel">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h3 id="browseModalLabel"><?php 
echo AText::_('GENERIC_FTP_BROWSER');
?>
</h3>
	</div>
	<div class="modal-body">
		<iframe id="browseFrame" src="index.php?view=ftpbrowser" width="100%" height="300px"></iframe>
	</div>
	<div class="modal-footer">
		<button class="btn" data-dismiss="modal" aria-hidden="true">
			<?php 
echo AText::_('SESSION_BTN_CANCEL');
?>
		</button>
	</div>
</div>

<script type="text/javascript">
<?php 
if (isset($this->stateVars->superusers)) {
    ?>
setupSuperUsers = <?php 
    echo json_encode($this->stateVars->superusers);
    ?>
;
$(document).ready(function(){
	setupSuperUserChange();
Exemple #26
0
 private function applySuperAdminChanges()
 {
     // Let's load the password compatibility file
     require_once APATH_ROOT . '/installation/framework/utils/password.php';
     // Get the Super User ID. If it's empty, skip.
     $id = $this->getState('superuserid', 0);
     if (!$id) {
         return false;
     }
     // Get the Super User email and password
     $email = $this->getState('superuseremail', '');
     $password1 = $this->getState('superuserpassword', '');
     $password2 = $this->getState('superuserpasswordrepeat', '');
     // If the email is empty but the passwords are not, fail
     if (empty($email)) {
         if (empty($password1) && empty($password2)) {
             return false;
         } else {
             throw new Exception(AText::_('SETUP_ERR_EMAILEMPTY'));
         }
     }
     // If the passwords are empty, skip
     if (empty($password1) && empty($password2)) {
         return false;
     }
     // Make sure the passwords match
     if ($password1 != $password2) {
         throw new Exception(AText::_('SETUP_ERR_PASSWORDSDONTMATCH'));
     }
     // Connect to the database
     $db = $this->getDatabase();
     // Create a new encrypted password
     $cryptpass = password_hash($password1, PASSWORD_DEFAULT);
     // Update the database record
     $query = $db->getQuery(true)->update($db->qn('#__user'))->set($db->qn('password') . ' = ' . $db->q($cryptpass))->set($db->qn('email') . ' = ' . $db->q($email))->where($db->qn('id') . ' = ' . $db->q($id));
     $db->setQuery($query)->execute();
     return true;
 }
Exemple #27
0
 /**
  * Loads a template given any path. The path is in the format:
  * viewname/templatename
  *
  * @param   string  $path
  * @param   array   $forceParams A hash array of variables to be extracted in the local scope of the template file
  *
  * @return \Exception|string
  */
 public function loadAnyTemplate($path = '', $forceParams = array())
 {
     $template = $this->container->application->getTemplate();
     $layoutTemplate = $this->getLayoutTemplate();
     // Parse the path
     $templateParts = $this->_parseTemplatePath($path);
     // Get the default paths
     $paths = array();
     $paths[] = APATH_THEMES . '/' . $template . '/html/' . $this->input->getCmd('option', 'angie') . '/' . $templateParts['view'];
     $paths[] = APATH_INSTALLATION . '/' . $this->input->getCmd('option', 'angie') . '/platform/views/' . $templateParts['view'] . '/tmpl';
     $paths[] = APATH_INSTALLATION . '/platform/views/' . $templateParts['view'] . '/tmpl';
     $paths[] = APATH_INSTALLATION . '/' . $this->input->getCmd('option', 'angie') . '/views/' . $templateParts['view'] . '/tmpl';
     if (isset($this->_path) || property_exists($this, '_path')) {
         $paths = array_merge($paths, $this->_path['template']);
     } elseif (isset($this->path) || property_exists($this, 'path')) {
         $paths = array_merge($paths, $this->path['template']);
     }
     // Look for a template override
     if (isset($layoutTemplate) && $layoutTemplate != '_' && $layoutTemplate != $template) {
         $apath = array_shift($paths);
         array_unshift($paths, str_replace($template, $layoutTemplate, $apath));
     }
     $filetofind = $templateParts['template'] . '.php';
     $this->_tempFilePath = AUtilsPath::find($paths, $filetofind);
     if ($this->_tempFilePath) {
         // Unset from local scope
         unset($template);
         unset($layoutTemplate);
         unset($paths);
         unset($path);
         unset($filetofind);
         // Never allow a 'this' property
         if (isset($this->this)) {
             unset($this->this);
         }
         // Force parameters into scope
         if (!empty($forceParams)) {
             extract($forceParams);
         }
         // Start capturing output into a buffer
         ob_start();
         // Include the requested template filename in the local scope
         // (this will execute the view logic).
         include $this->_tempFilePath;
         // Done with the requested template; get the buffer and
         // clear it.
         $this->_output = ob_get_contents();
         ob_end_clean();
         return $this->_output;
     } else {
         return new Exception(AText::sprintf('ANGI_APPLICATION_ERROR_LAYOUTFILE_NOT_FOUND', $path), 500);
     }
 }
Exemple #28
0
" />
			<span class="help-tooltip icon-question-sign" data-toggle="tooltip" data-html="true" data-placement="top"
				  title="<?php 
echo AText::_('DATABASE_LBL_MAXEXECTIME_HELP');
?>
"></span>
		</div>
	</div>
	<div class="control-group">
		<label class="control-label" for="throttle">
			<?php 
echo AText::_('DATABASE_LBL_THROTTLEMSEC');
?>
		</label>
		<div class="controls">
			<input class="input-mini" type="text" id="maxexectime" placeholder="<?php 
echo AText::_('DATABASE_LBL_THROTTLEMSEC');
?>
" value="<?php 
echo $this->db->throttle;
?>
" />
			<span class="help-tooltip icon-question-sign" data-toggle="tooltip" data-html="true" data-placement="top"
				  title="<?php 
echo AText::_('DATABASE_LBL_THROTTLEMSEC_HELP');
?>
"></span>
		</div>
	</div>
</div>
Exemple #29
0
 private function applySuperAdminChanges()
 {
     // Get the Super User ID. If it's empty, skip.
     $id = $this->getState('superuserid', 0);
     if (!$id) {
         return false;
     }
     // Get the Super User email and password
     $email = $this->getState('superuseremail', '');
     $password1 = $this->getState('superuserpassword', '');
     $password2 = $this->getState('superuserpasswordrepeat', '');
     // If the email is empty but the passwords are not, fail
     if (empty($email)) {
         if (empty($password1) && empty($password2)) {
             return false;
         } else {
             throw new Exception(AText::_('SETUP_ERR_EMAILEMPTY'));
         }
     }
     // If the passwords are empty, skip
     if (empty($password1) && empty($password2)) {
         return false;
     }
     // Make sure the passwords match
     if ($password1 != $password2) {
         throw new Exception(AText::_('SETUP_ERR_PASSWORDSDONTMATCH'));
     }
     // Connect to the database
     $db = $this->getDatabase();
     // Create a new encrypted password. We are using the plain md5 since WP will update the hased
     // password the first time the user successfully logs in
     $crypt = md5($password1);
     // Update the database record
     $query = $db->getQuery(true)->update($db->qn('#__users'))->set($db->qn('user_pass') . ' = ' . $db->q($crypt))->set($db->qn('user_email') . ' = ' . $db->q($email))->where($db->qn('ID') . ' = ' . $db->q($id));
     $db->setQuery($query)->execute();
     return true;
 }
Exemple #30
0
 public static function dbtype($selected = 'mysqli', $technology = null)
 {
     $connectors = ADatabaseDriver::getConnectors($technology);
     $options = array();
     foreach ($connectors as $connector) {
         $options[] = self::option($connector, AText::_('DATABASE_LBL_TYPE_' . $connector));
     }
     return self::genericlist($options, 'dbtype', null, 'value', 'text', $selected);
 }