$value) { $connectionString = str_replace('{{'.$key.'}}',$value,$connectionString); } $connectionString = str_replace('{{ROOT}}',dirname(__FILE__).DIRECTORY_SEPARATOR,$connectionString); try{ $connection = new PDO($connectionString, $_GET['login'], $_GET['password'],$connector::pdo_attributes()); }catch(Exception $e){ $response['error'] = 'Connexion impossible : '.$e->getMessage(); } echo json_encode($response); exit(); } try { /* Page customizable depuis n'importe quel app.json de plugin via la mention : "install": "Install.class.php", cette classe située au sein du plugin peut contenir les méthodes suivantes css : chemin relatif au plugin d'un fichier css custom d'install js : chemin relatif au plugin d'un fichier js custom d'install post_install : méthode contenant le code qui doit s'executer en fin d'installation. pre_install : méthode en début d'installation. */ date_default_timezone_set('Europe/Paris'); mb_internal_encoding('UTF-8'); require_once(__DIR__.'/function.php'); spl_autoload_register('app_autoloader'); $_ = array_map('secure_user_vars', array_merge($_POST, $_GET)); require_once('class/Plugin.class.php'); $entityFolder = __DIR__.'/class/'; if(file_exists(__DIR__.DIRECTORY_SEPARATOR.'.git') && !file_exists(__DIR__.DIRECTORY_SEPARATOR.'.git'.DIRECTORY_SEPARATOR.'.htaccess')){ file_put_contents(__DIR__.DIRECTORY_SEPARATOR.'.git'.DIRECTORY_SEPARATOR.'.htaccess', 'Require all denied'); } $custom = null; //Recherche de custom install dans les plugins foreach(glob(__DIR__.DIRECTORY_SEPARATOR.'plugin'.DIRECTORY_SEPARATOR.'*'.DIRECTORY_SEPARATOR.'app.json') as $app){ $manifest = json_decode(file_get_contents($app),true); if(!$manifest || !isset($manifest['install'])) continue; $custom = array(); $custom['plugin'] = 'plugin/'.basename(dirname($app)).'/'; $custom['pluginPath'] = __DIR__.DIRECTORY_SEPARATOR.'plugin'.DIRECTORY_SEPARATOR.basename(dirname($app)).DIRECTORY_SEPARATOR; $custom['class'] = basename(str_replace('.class.php', '', $manifest['install'])); $custom['classPath'] = $custom['pluginPath'].$custom['class'].'.class.php'; require_once($custom['classPath']); } /* Installation en mode cli, exemple : php install.php "{\"connector\":\"Mysql\",\"host\":\"mysql-host\",\"login\":\"root\",\"password\":\"root\",\"name\":\"hackpoint\",\"root\":\"http:\/\/127.0.0.1\/hackpoint\"}" */ if(php_sapi_name() == 'cli'){ echo 'Headless install...'.PHP_EOL; $parameters = json_decode($argv[1],true); echo 'Parameters: '.PHP_EOL; print_r($parameters); echo 'Installing... '.PHP_EOL; install_core($parameters,$custom); echo 'Installation done. '.PHP_EOL; exit(); } ?> Installateur
sudo chown -R www-data:www-data '.__ROOT__.'
ou de régler le dossier en écriture via votre client ftp'); if(!file_exists(__DIR__.'/file')) mkdir(__DIR__.'/file',0755,true); if(!file_exists(__DIR__.'/file/avatar')) mkdir(__DIR__.'/file/avatar',0755,true); //if(!extension_loaded('gd') || !function_exists('gd_info')) throw new Exception('L\'extension php GD2 est requise, veuillez installer GD2 (sous linux : sudo apt-get install php5-gd && service apache2 restart)'); //if(!in_array('sqlite',PDO::getAvailableDrivers())) throw new Exception('Le driver SQLITE est requis, veuillez installer sqlite3 (sous linux : sudo apt-get install php5-sqlite && service apache2 restart)'); if(isset($_['connector'])){ install_core($_,$custom); ?>
Succès! La base est bien installée, l'utilisateur par défaut est admin:admin, pensez à changer le mot de passe rapidemment.
Revenir à l'index

Installation

Merci de bien vouloir remplir les champs ci-dessous



Installer
Tester la connexion
Oops! getMessage().' - '.$e->getFile().' L'.$e->getLine().'
'.$e->getTraceAsString().'
'; ?>
$cryptKey )); foreach ($tags as $key => $value) { $constantStream = str_replace("{{".$key."}}",$value,$constantStream); } file_put_contents(__DIR__.DIRECTORY_SEPARATOR.'constant.php',$constantStream); require_once(__DIR__.DIRECTORY_SEPARATOR.'constant.php'); if(!file_exists(File::core())) mkdir(File::core(),0755,true); require_once(__ROOT__.'class'.SLASH.'Entity.class.php'); if( method_exists($custom['class'], 'pre_install') ) $custom['class']::pre_install(); //install entities Entity::install(__ROOT__.'class'); global $conf,$myUser; $conf = new Configuration(); $conf->getAll(); //create firm $firm = new Firm(); $firm->label = 'Établissement'; $firm->description = 'Établissement par défaut'; $firm->save(); /* RANKS */ //create admin rank $superAdmin = new Rank(); $superAdmin->label = 'Super Admin'; $superAdmin->description = 'Dispose de tous les accès'; $superAdmin->superadmin = true; $superAdmin->save(); //create all anonymous rank $anonymous = new Rank(); $anonymous->label = 'Tout le monde - Anonyme'; $anonymous->description = 'Utilisateur non connecté à la plateforme'; $anonymous->superadmin = false; $anonymous->save(); //create all connected rank $connected = new Rank(); $connected->label = 'Tout le monde - Connecté'; $connected->description = 'Utilisateur connecté à la plateforme'; $connected->superadmin = false; $connected->save(); //create default user $admin = new User(); $admin->login = 'admin'; $admin->password = User::password_encrypt('admin'); $admin->firstname = 'Administrateur'; $admin->name = 'Principal'; $admin->superadmin = 1; $admin->state = User::ACTIVE; $admin->meta = json_encode($admin->meta); $admin->save(); //create ufr $userfirmrank = new UserFirmRank(); $userfirmrank->user = $admin->login; $userfirmrank->firm = $firm->id; $userfirmrank->rank = $superAdmin->id; $userfirmrank->save(); $admin->loadRanks(); $_SESSION['currentUser'] = serialize($admin); $myUser = $admin; $scopes = array(); Plugin::callHook('section',array(&$scopes)); foreach($scopes as $scope=>$description){ $right = new Right(); $right->targetUid = $superAdmin->id; $right->targetScope = 'rank'; $right->scope = $scope; $right->read = true; $right->edit = true; $right->delete = true; $right->configure = true; $right->save(); } //droits sur les rangs créés only par superadmin foreach (array($superAdmin->id,$anonymous->id,$connected->id) as $rankId) { $right = new Right(); $right->scope = 'rank'; $right->uid = $rankId; $right->read = 1; $right->edit = 1; $right->delete = 1; $right->configure = 1; $right->recursive = 1; $right->targetScope = 'rank'; $right->targetUid = $superAdmin->id; $right->save(); } //Activation des plugins par défaut foreach ($enablePlugins as $plugin) { if(!Plugin::exist($plugin)) continue; Plugin::state($plugin,true); } $states = Plugin::states(); //Activation des plugins pour les établissements foreach(Firm::loadAll() as $firm){ foreach ($enablePlugins as $plugin) { if(!Plugin::exist($plugin)) continue; $firms = $states[$plugin]; $key = array_search($firm->id, $firms); $firms[] = $firm->id; $states[$plugin] = array_values($firms); Plugin::states($states); } } if( method_exists($custom['class'], 'post_install') ) $custom['class']::post_install(); } ?>