12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- require_once '../inc/lib/main_api.lib.php';
- require_once '../inc/lib/fileUpload.lib.php';
- require_once '../inc/lib/database.lib.php';
- if (defined('DOKEOS_INSTALL') || defined('DOKEOS_COURSE_UPDATE')) {
-
- $file = file('../inc/conf/configuration.php');
- $fh = fopen('../inc/conf/configuration.php', 'w');
- $found_version = false;
- $found_stable = false;
- foreach ($file as $line) {
- $ignore = false;
- if(stristr($line, '$_configuration[\'dokeos_version\']')) {
- $found_version = true;
- $line = '$_configuration[\'dokeos_version\'] = \''.$new_version.'\';'."\r\n";
- } elseif(stristr($line, '$_configuration[\'dokeos_stable\']')) {
- $found_stable = true;
- $line = '$_configuration[\'dokeos_stable\'] = '.($new_version_stable?'true':'false').';'."\r\n";
- } elseif(stristr($line, '$userPasswordCrypted')) {
- $line = '$userPasswordCrypted = \''.($userPasswordCrypted).'\';'."\r\n";
- } elseif(stristr($line, '?>')) {
-
- $ignore = true;
- }
- if (!$ignore) {
- fwrite($fh, $line);
- }
- }
- if (!$found_version) {
- fwrite($fh, '$_configuration[\'dokeos_version\'] = \''.$new_version.'\';'."\r\n");
- }
- if (!$found_stable) {
- fwrite($fh, '$_configuration[\'dokeos_stable\'] = '.($new_version_stable?'true':'false').';'."\r\n");
- }
- fwrite($fh, '?>');
- fclose($fh);
- $perm = api_get_permissions_for_new_directories();
-
-
-
- if (!is_dir($pathForm.'home/default_platform_document/template_thumb')) {
- mkdir($pathForm.'home/default_platform_document/template_thumb', $perm);
- }
- } else {
- echo 'You are not allowed here !';
- }
|