/** * @param string|object $config filename of the ini file to configure the framework, or the config object itself * this parameter is optional if jApp::loadConfig has been already called * @param boolean $enableErrorHandler enable the error handler of jelix. * keep it to true, unless you have something to debug * and really have to use the default handler or an other handler */ function __construct($configFile = '', $enableErrorHandler = true) { if ($configFile) { jApp::loadConfig($configFile, $enableErrorHandler); } $this->_loadPlugins(); }
/** * action to process the page after the submit * @return 0 */ function process() { $errors = array(); $login = $_SESSION['adminaccount']['login'] = trim($_POST['login']); if ($login == '') { $errors[] = $this->locales['error.missing.login']; } $password = $_SESSION['adminaccount']['password'] = trim($_POST['password']); if ($password == '') { $errors[] = $this->locales['error.missing.password']; } $passwordconf = $_SESSION['adminaccount']['password_confirm'] = trim($_POST['password_confirm']); if ($password != $passwordconf) { $errors[] = $this->locales['error.confirm.password']; } $email = $_SESSION['adminaccount']['email'] = trim($_POST['email']); if ($email == '') { $errors[] = $this->locales['error.missing.email']; } if (count($errors)) { $_SESSION['adminaccount']['errors'] = $errors; return false; } jApp::loadConfig('havefnubb/config.ini.php'); $db = jDb::getConnection(); $db->exec('INSERT INTO ' . $db->encloseName($db->prefixTable('community_users')) . ' (login, password, email, nickname, status, create_date) VALUES (' . $db->quote($login) . ',' . $db->quote(md5($password)) . ',' . $db->quote($email) . ',' . $db->quote($login) . ',1,' . "'" . date('Y-m-d H:i:s') . "')"); $idu = $db->lastInsertId(); $db->exec('INSERT INTO ' . $db->encloseName($db->prefixTable('jacl2_group')) . ' (id_aclgrp, name, grouptype, ownerlogin) ' . 'VALUES (' . $db->quote('__priv_' . $login) . ',' . $db->quote($login) . ',2,' . $db->quote($login) . ')'); $db->exec('INSERT INTO ' . $db->encloseName($db->prefixTable('jacl2_user_group')) . ' (login, id_aclgrp) VALUES (' . $db->quote($login) . ',\'admins\')'); $db->exec('INSERT INTO ' . $db->encloseName($db->prefixTable('jacl2_user_group')) . ' (login, id_aclgrp) VALUES (' . $db->quote($login) . ',' . $db->quote('__priv_' . $login) . ')'); unset($_SESSION['adminaccount']); return 0; }
<?php /** * @package lizmap * @subpackage admin * @author 3liz * @copyright 2011 3liz * @link http://3liz.com * @license Mozilla Public License : http://www.mozilla.org/MPL/ */ require '../application.init.php'; require JELIX_LIB_CORE_PATH . 'request/jClassicRequest.class.php'; checkAppOpened(); // Charge la configuration jApp::loadConfig('admin/config.ini.php'); // nouveau coordinateur, que l'on indique à jApp jApp::setCoord(new jCoordinator()); // Nouvel objet request, que l'on passe au coordinateur, pour traiter le routage. jApp::coord()->process(new jClassicRequest());
/** * private function to handle the database migration */ private function _updateDatabase() { //1) if the file installer.ini.php does not exist we cant install jelix nor havefnubb; // then the application has not been installed with jelix 1.2 // so we copy the installer.ini.php build for the application havefnubb //2) if the file exists, that means jelix 1.2 is "installed" // so no need to try to install jelix if (!file_exists(jApp::configPath() . 'installer.ini.php')) { copy(dirname(__FILE__) . '/../../../install/installer.ini.php', jApp::configPath() . 'installer.ini.php'); } jApp::loadConfig('havefnubb/config.ini.php'); //get the dbprofils file $dbProfile = jIniFile::read(jApp::configPath() . jApp::config()->dbProfils); //get the default profile $tools = jDb::getTools($dbProfile['default']); // migrate from 1.3.6 to 1.4.0 $tools->execSQLScript(dirname(__FILE__) . '/../../../sql/update_to_1.4.0.mysql.sql'); }
<?php /** * @package lizmap * @subpackage lizmap * @author 3liz * @copyright 2011 3liz * @link http://3liz.com * @license Mozilla Public License : http://www.mozilla.org/MPL/ */ require '../application.init.php'; require JELIX_LIB_CORE_PATH . 'request/jClassicRequest.class.php'; checkAppOpened(); // Charge la configuration jApp::loadConfig('index/config.ini.php'); // nouveau coordinateur, que l'on indique à jApp jApp::setCoord(new jCoordinator()); // Nouvel objet request, que l'on passe au coordinateur, pour traiter le routage. jApp::coord()->process(new jClassicRequest());
<?php require_once '../application.init.php'; checkAppOpened(); jApp::loadConfig('soap/config.ini.php'); ini_set("soap.wsdl_cache_enabled", "0"); // disabling PHP's WSDL cache $jelix = new jSoapCoordinator(); jApp::setCoord($jelix); $jelix->request = new jSoapRequest(); $jelix->request->initService(); $jelix->processSoap();
<?php /** * @package testapp * @subpackage scripts * @author Laurent Jouanneau * @contributor * @copyright */ require_once '../application.init.php'; require_once JELIX_LIB_CORE_PATH . 'request/jCmdLineRequest.class.php'; jApp::loadConfig('cmdline/configtests.ini.php'); $jelix = new jCoordinator(); $jelix->process(new jCmdLineRequest());
<?php /** * @package havefnubb * @subpackage havefnubb * @author FoxMaSk * @copyright 2008-2011 FoxMaSk * @link http://havefnubb.org * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file */ require 'havefnubb/application.init.php'; if (!isAppInstalled()) { header("location: install.php"); } else { require JELIX_LIB_CORE_PATH . 'request/jClassicRequest.class.php'; jApp::loadConfig('havefnubb/config.ini.php'); jApp::setCoord(new jCoordinator()); jApp::coord()->process(new jClassicRequest()); }