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 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; }
/** * 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 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); }
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); }
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; }
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 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; }
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); } }
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); }
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; }
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; }
/** * 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); } }
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; }
</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">×</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>
<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">×</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>
<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
/** * 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(); } }
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 will use the cookie key as salt $crypt = md5($this->configModel->get('cookiekey') . $password1); // Update the database record $query = $db->getQuery(true)->update($db->qn('#__employee'))->set($db->qn('passwd') . ' = ' . $db->q($crypt))->set($db->qn('email') . ' = ' . $db->q($email))->where($db->qn('id_employee') . ' = ' . $db->q($id)); $db->setQuery($query)->execute(); return true; }
<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();
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; }
/** * Method to get the view name * * The model name by default parsed using the classname, or it can be set * by passing a $config['name'] in the class constructor * * @return string The name of the model * * @throws Exception */ public function getName() { if (empty($this->_name)) { $classname = get_class($this); $viewpos = strpos($classname, 'View'); if ($viewpos === false) { throw new Exception(AText::_('ANGI_APPLICATION_ERROR_VIEW_GET_NAME'), 500); } $this->_name = strtolower(substr($classname, $viewpos + 4)); } return $this->_name; }
" /> <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>
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; }
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); }
</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>
public function getExtraInfo() { static $extraInfo = null; if (is_null($extraInfo)) { $filename = APATH_INSTALLATION . '/extrainfo.ini'; if (file_exists($filename)) { $parsedData = parse_ini_file($filename, false); $extraInfo = array(); if (array_key_exists('host', $parsedData)) { $extraInfo['host'] = array('label' => AText::_('MAIN_EXTRAINFO_HOST'), 'current' => $parsedData['host']); } if (array_key_exists('backup_date', $parsedData)) { $extraInfo['backup_date'] = array('label' => AText::_('MAIN_EXTRAINFO_BACKUPDATE'), 'current' => $parsedData['backup_date'] . ' UTC'); } if (array_key_exists('akeeba_version', $parsedData)) { $extraInfo['akeeba_version'] = array('label' => AText::_('MAIN_EXTRAINFO_AKEEBAVERSION'), 'current' => $parsedData['akeeba_version']); } if (array_key_exists('php_version', $parsedData)) { $extraInfo['php_version'] = array('label' => AText::_('MAIN_EXTRAINFO_PHPVERSION'), 'current' => $parsedData['php_version']); } } } return $extraInfo; }