Update plugin

remotes/angel/1.11.x
jmontoyaa 9 years ago
parent e556ac8902
commit f7ce628c84
  1. 2
      plugin/vchamilo/cli/bulkcreatenodes.php
  2. 1
      plugin/vchamilo/cli/bulkdestroynodes.php
  3. 12
      plugin/vchamilo/cli/cleaninstall.sh
  4. 1
      plugin/vchamilo/cli/clilib.php
  5. 1
      plugin/vchamilo/cli/cron.php
  6. 2
      plugin/vchamilo/cli/maincron.php
  7. 17
      plugin/vchamilo/cli/nodelist-test.csv
  8. 15
      plugin/vchamilo/cli/vchamilo-nodelist-preprod.csv
  9. 14
      plugin/vchamilo/cli/vchamilo-nodelist-prod.csv
  10. 16
      plugin/vchamilo/cli/vchamilo-nodelist-recette.csv
  11. 14
      plugin/vchamilo/cli/vchamilo-nodelist.csv
  12. 4
      plugin/vchamilo/index.php
  13. 163
      plugin/vchamilo/lib.php
  14. 60
      plugin/vchamilo/lib/QuickForm/cancel.php
  15. 5
      plugin/vchamilo/lib/bootlib.php
  16. 9
      plugin/vchamilo/lib/vchamilo_plugin.class.php
  17. 10
      plugin/vchamilo/views/editinstance.controller.php

@ -1,5 +1,5 @@
<?php
exit;
global $debuglevel;
global $debugdisplay;
$debuglevel = 4;

@ -1,4 +1,5 @@
<?php
exit;
/**
* This script is to be used from PHP command line and will create a set
* of Virtual VChamilo automatically from a CSV nodelist description.

@ -1,12 +0,0 @@
rm -rf /app/www/chamilo19-ene-atrium/courses-lgt-*
rm -rf /app/www/chamilo19-ene-atrium/courses-lp-*
rm -rf /app/www/chamilo19-ene-atrium/archive/lp-*
rm -rf /app/www/chamilo19-ene-atrium/archive/lgt-*
rm -rf /app/www/chamilo19-ene-atrium/home/lp-*
rm -rf /app/www/chamilo19-ene-atrium/home/lgt-*
rm -rf /data/chamilodata/courses-lp-*
rm -rf /data/chamilodata/courses-lgt-*
rm -rf /data/chamilodata/home/lp-*
rm -rf /data/chamilodata/home/lgt-*
rm -rf /data/chamilodata/archives/lp-*
rm -rf /data/chamilodata/archives/lgt-*

@ -1,4 +1,5 @@
<?php
exit;
/**
* Opens and parses/checks a VChamilo instance definition file

@ -1,4 +1,5 @@
<?php
exit;
/**
* This script should be called by a properly set cron process on your server.
* For more information, check the installation guide in the documentation

@ -1,4 +1,6 @@
<?php
exit;
/**
* This script should be called by a properly set cron process on your server.
* For more information, check the installation guide in the documentation

@ -1,17 +0,0 @@
#
# root_web : a fully qualified domain as wwwroot for the instance
# template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
# tracking_enabled : 0 or 1
# single_database : 0 or 1
# main_database : the main database
# statistics_database : if empty, is using main_database
# user_personal_database : if empty, is using main_database
# course_folder : absolute path to course material
# plugin_<pluginkey>|<variablekey>
#
root_web;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
#http://clone2.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 2;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone2;;;courses_clone2;0131111A;1;cas
http://clone3.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 3;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone3;;;courses_clone3;0131111A;1;cas
http://clone4.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 4;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone4;;;courses_clone4;0132222B;1;cas
#http://clone5.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 5;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone5;;;courses_clone5;0133333C;1;cas
http://clone6.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 6;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone6;;;courses_clone6;0134444D;1;cas
1 #
2 # root_web : a fully qualified domain as wwwroot for the instance
3 # template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
4 # tracking_enabled : 0 or 1
5 # single_database : 0 or 1
6 # main_database : the main database
7 # statistics_database : if empty, is using main_database
8 # user_personal_database : if empty, is using main_database
9 # course_folder : absolute path to course material
10 # plugin_<pluginkey>|<variablekey>
11 #
12 root_web;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
13 #http://clone2.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 2;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone2;;;courses_clone2;0131111A;1;cas
14 http://clone3.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 3;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone3;;;courses_clone3;0131111A;1;cas
15 http://clone4.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 4;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone4;;;courses_clone4;0132222B;1;cas
16 #http://clone5.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 5;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone5;;;courses_clone5;0133333C;1;cas
17 http://clone6.chamilo-atrium.fr;clone1.chamilo-atrium.fr;Lycée Clone 6;Lycées Atrium;localhost;root;spr1ngb0ks;;;0;1;chamilo19_clone6;;;courses_clone6;0134444D;1;cas

@ -1,15 +0,0 @@
#
# root_web : a fully qualified domain as wwwroot for the instance
# template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
# tracking_enabled : 0 or 1
# single_database : 0 or 1
# main_database : the main database
# statistics_database : if empty, is using main_database
# user_personal_database : if empty, is using main_database
# course_folder : absolute path to course material
#
root_web;visible;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
#http://template.chamilo-preprod.atrium-paca.fr;0;template.chamilo-preprod.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
http://lgt-jean-cocteau-13141.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
http://lp-lyc-metier-frederic-mistral-13417.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
http://lgt-saint-charles-13232.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas
1 #
2 # root_web : a fully qualified domain as wwwroot for the instance
3 # template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
4 # tracking_enabled : 0 or 1
5 # single_database : 0 or 1
6 # main_database : the main database
7 # statistics_database : if empty, is using main_database
8 # user_personal_database : if empty, is using main_database
9 # course_folder : absolute path to course material
10 #
11 root_web;visible;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
12 #http://template.chamilo-preprod.atrium-paca.fr;0;template.chamilo-preprod.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
13 http://lgt-jean-cocteau-13141.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
14 http://lp-lyc-metier-frederic-mistral-13417.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
15 http://lgt-saint-charles-13232.chamilo-preprod.atrium-paca.fr;1;template.chamilo-preprod.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;ene-preprod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas

@ -1,14 +0,0 @@
#
# root_web : a fully qualified domain as wwwroot for the instance
# template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
# tracking_enabled : 0 or 1
# single_database : 0 or 1
# main_database : the main database
# statistics_database : if empty, is using main_database
# user_personal_database : if empty, is using main_database
# course_folder : absolute path to course material
root_web;visible:template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
https://template.chamilo.atrium-paca.fr;0;template.chamilo.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
https://lgt-jean-cocteau-13141.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
https://lp-lyc-metier-frederic-mistral-13417.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
https://lgt-saint-charles-13232.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;%DBHOST%;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas
1 #
2 # root_web : a fully qualified domain as wwwroot for the instance
3 # template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
4 # tracking_enabled : 0 or 1
5 # single_database : 0 or 1
6 # main_database : the main database
7 # statistics_database : if empty, is using main_database
8 # user_personal_database : if empty, is using main_database
9 # course_folder : absolute path to course material
10 root_web;visible:template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
11 https://template.chamilo.atrium-paca.fr;0;template.chamilo.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
12 https://lgt-jean-cocteau-13141.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
13 https://lp-lyc-metier-frederic-mistral-13417.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
14 https://lgt-saint-charles-13232.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;%DBHOST%;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas

@ -1,16 +0,0 @@
#
# root_web : a fully qualified domain as wwwroot for the instance
# template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
# tracking_enabled : 0 or 1
# visible : 0 or 1
# single_database : 0 or 1
# main_database : the main database
# statistics_database : if empty, is using main_database
# user_personal_database : if empty, is using main_database
# course_folder : absolute path to course material
#
root_web;visible;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
#http://template.chamilo-recette.atrium-paca.fr;0;template.chamilo-recette.atrium-paca.fr;Lycée Modèle;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_template;;;courses-template;;1;cas
http://lgt-jean-cocteau-13141.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Jean Cocteau;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
http://lp-lyc-metier-frederic-mistral-13417.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
http://lgt-saint-charles-13232.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Saint Charles;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas
1 #
2 # root_web : a fully qualified domain as wwwroot for the instance
3 # template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
4 # tracking_enabled : 0 or 1
5 # visible : 0 or 1
6 # single_database : 0 or 1
7 # main_database : the main database
8 # statistics_database : if empty, is using main_database
9 # user_personal_database : if empty, is using main_database
10 # course_folder : absolute path to course material
11 #
12 root_web;visible;template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
13 #http://template.chamilo-recette.atrium-paca.fr;0;template.chamilo-recette.atrium-paca.fr;Lycée Modèle;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_template;;;courses-template;;1;cas
14 http://lgt-jean-cocteau-13141.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Jean Cocteau;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
15 http://lp-lyc-metier-frederic-mistral-13417.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
16 http://lgt-saint-charles-13232.chamilo-recette.atrium-paca.fr;1;template.chamilo-recette.atrium-paca.fr;Lycée Saint Charles;Lycées Atrium Paca;10.40.42.195;chamiloadm;Spr!ngY4rds;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas

@ -1,14 +0,0 @@
#
# root_web : a fully qualified domain as wwwroot for the instance
# template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
# tracking_enabled : 0 or 1
# single_database : 0 or 1
# main_database : the main database
# statistics_database : if empty, is using main_database
# user_personal_database : if empty, is using main_database
# course_folder : absolute path to course material
root_web;visible:template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
https://template.chamilo.atrium-paca.fr;0;template.chamilo.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
https://lgt-jean-cocteau-13141.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
https://lp-lyc-metier-frederic-mistral-13417.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
https://lgt-saint-charles-13232.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;%DBHOST%;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas
1 #
2 # root_web : a fully qualified domain as wwwroot for the instance
3 # template : a VChamilo template name (stored from a vchamilo snapshot) or empty if no template
4 # tracking_enabled : 0 or 1
5 # single_database : 0 or 1
6 # main_database : the main database
7 # statistics_database : if empty, is using main_database
8 # user_personal_database : if empty, is using main_database
9 # course_folder : absolute path to course material
10 root_web;visible:template;sitename;institution;db_host;db_user;db_password;table_prefix;db_prefix;tracking_enabled;single_database;main_database;statistics_database;user_personal_database;course_folder;plugin_ent_installer|institution_id;plugin_ent_installer|enable_sync;plugin_ent_installer|real_used_auth
11 https://template.chamilo.atrium-paca.fr;0;template.chamilo.atrium-paca.fr;Lycée Modèle;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_template;;;courses-template;;1;cas
12 https://lgt-jean-cocteau-13141.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Jean Cocteau;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_jean_cocteau_13141;;;courses-lgt-jean-cocteau-13141;0133195C;1;cas
13 https://lp-lyc-metier-frederic-mistral-13417.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Métiers Frédéric Mistral;Atrium Paca;ene-prod-sgbd.realyce.fr;chamiloadm;%DBPASS%;;;0;1;vchm19_lp_lyc_metier_frederic_mistral_13417;;;courses-lp-lyc-metier-frederic-mistral-13417;0130062X;1;cas
14 https://lgt-saint-charles-13232.chamilo.atrium-paca.fr;1;template.chamilo.atrium-paca.fr;Lycée Saint Charles;Atrium Paca;%DBHOST%;chamiloadm;%DBPASS%;;;0;1;vchm19_lgt_saint_charles_13232;;;courses-lgt-saint-charles-13232;0130039X;1;cas

@ -8,7 +8,7 @@ require_once dirname(__FILE__).'/lib/vchamilo_plugin.class.php';
api_protect_admin_script();
global $VCHAMILO;
global $virtualChamilo;
$plugininstance = VChamiloPlugin::create();
@ -28,7 +28,7 @@ $sql = "
visible = 1
";
if ($VCHAMILO == '%'){
if ($virtualChamilo == '%'){
$result = Database::query($sql);
$_template['hosts'] = array();
if ($result){

@ -2,12 +2,12 @@
use Cocur\Slugify\Slugify;
use Symfony\Component\Finder\Finder;
require_once 'lib/bootlib.php';
require_once 'lib/vchamilo_plugin.class.php';
function vchamilo_hook_configuration(&$_configuration)
{
global $VCHAMILO;
global $virtualChamilo;
if (defined('CLI_SCRIPT') && !defined('CLI_VCHAMILO_OVERRIDE')) {
return;
@ -20,7 +20,7 @@ function vchamilo_hook_configuration(&$_configuration)
$virtualChamiloWebRoot = $_configuration['vchamilo_web_root'].'/';
if ($_configuration['root_web'] == $virtualChamiloWebRoot) {
$VCHAMILO = [];
$virtualChamilo = [];
return;
}
@ -78,11 +78,10 @@ function vchamilo_hook_configuration(&$_configuration)
$data['SYS_HOME_PATH'] = $homePath.'/'.$data['slug'];
$data['SYS_COURSE_PATH'] = $coursePath.'/'.$data['slug'];
$VCHAMILO = $data;
$virtualChamilo = $data;
}
} else {
//die ("VChamilo : No configuration for this host. May be faked.");
die ("VChamilo : Could not fetch virtual chamilo configuration");
die("VChamilo : Could not fetch virtual chamilo configuration");
}
}
@ -146,7 +145,12 @@ function vchamilo_boot_connection(&$_configuration)
);
try {
$database = new \Database();
$connection = $database->connect($dbParams, $_configuration['root_sys'], $_configuration['root_sys'], true);
$connection = $database->connect(
$dbParams,
$_configuration['root_sys'],
$_configuration['root_sys'],
true
);
} catch (Exception $e) {
echo('Side connection failure with '.$_configuration['db_host'].', '.$_configuration['db_user'].', ******** ');
die();
@ -164,6 +168,10 @@ function vchamilo_redirect($url) {
exit;
}
/**
* @param string $course_folder
* @return string
*/
function vchamilo_get_htaccess_fragment($course_folder)
{
$str = "
@ -194,9 +202,15 @@ function vchamilo_get_htaccess_fragment($course_folder)
RewriteRule ([^/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 [QSA,L]
</IfModule>
";
return $str;
}
function vchamilo_get_default_course_index_fragment() {
/**
* @return string
*/
function vchamilo_get_default_course_index_fragment()
{
return "<html><head></head><body></body></html>";
}
@ -223,7 +237,9 @@ function vchamilo_drop_databases(&$vchamilo)
{
global $plugininstance;
if (is_array($vchamilo)) $vchamilo = (object)$vchamilo;
if (is_array($vchamilo)) {
$vchamilo = (object)$vchamilo;
}
if (empty($vchamilo->main_database)) {
Display::addFlash(Display::return_message('No database found'));
@ -263,12 +279,8 @@ function vchamilo_create_databases($vchamilo)
Display::addFlash(Display::return_message("Creating DB $adb"));
$sql = str_replace('%DATABASE%', $adb, $createstatement);
Database::query($sql);
/*if(!$DB->execute_sql($sql)){
print_error('noexecutionfor','block_vmoodle', $sql);
return false;
}*/
}
return true;
}
@ -349,89 +361,6 @@ function vchamilo_load_db_template($vchamilo, $template)
return true;
}
/**
* load a bulk sql in database that is given through a vchamilo configuration record.
* @param object $vchamilo
* @param string $bulfile a bulk file of queries to process on the database
* @param handle $cnx
* @param array $vars an array of vars to inject in the bulk file before processing
*/
function vchamilo_execute_db_sql(&$vchamilo, $bulkfile, $cnx = null, $vars = null, $filter = null)
{
if (file_exists($bulkfile)) {
$erroritem = new stdClass();
$erroritem->message = "vchamilo_load_db_template : Bulk file $bulkfile not found";
$erroritems[] = $erroritem;
return $erroritem;
}
$local_cnx = 0;
if (is_null($cnx)){
$cnx = vchamilo_make_connection($vchamilo, true);
$local_cnx = 1;
}
/// get dump file
$sql = file($bulkfile);
// converts into an array of text lines
$dumpfile = implode('', $sql);
if ($filter){
foreach($filter as $from => $to){
$dumpfile = mb_ereg_replace(preg_quote($from), $to, $dumpfile);
}
}
// insert any external vars
if (!empty($vars)){
foreach($vars as $key => $value){
// for debug : echo "$key => $value";
$dumpfile = str_replace("<%%$key%%>", $value, $dumpfile);
}
}
$sql = explode ("\n", $dumpfile);
// cleanup unuseful things
$sql = preg_replace("/^--.*/", "", $sql);
$sql = preg_replace("/^\/\*.*/", "", $sql);
$dumpfile = implode("\n", $sql);
/// split into single queries
$dumpfile = str_replace("\r\n", "\n", $dumpfile); // translates to Unix LF
$queries = preg_split("/;\n/", $dumpfile);
/// feed queries in database
$i = 0;
$j = 0;
$l = 0;
if (!empty($queries)){
foreach($queries as $query){
$query = trim($query); // get rid of trailing spaces and returns
if ($query == '') continue; // avoid empty queries
$query = mb_convert_encoding($query, 'iso-8859-1', 'auto');
if (!$res = vchamilo_execute_query($vchamilo, $query, $cnx)){
$erroritem = new stdClass();
$erroritem->message = "vchamilo_load_db_template : Load error on query $l";
$erroritem->content = $query;
$erroritems[] = $erroritem;
$j++;
} else {
$i++;
}
$l++;
}
}
echo "loaded : $i queries succeeded, $j queries failed<br/>";
if ($local_cnx){
vchamilo_close_connection($vchamilo, $cnx);
}
if (!empty($erroritems)){
return $erroritems;
}
return false;
}
/**
* Dumps a SQL database for having a snapshot.
* @param $vchamilo object The Vchamilo object.
@ -526,7 +455,7 @@ function vchamilo_get_vmanifest($version)
$file = api_get_path(SYS_PATH).'/plugin/vchamilo/templates/'.$version.'/manifest.php';
if (file_exists($file)) {
include($file);
include $file;
$manifest = new stdClass();
$manifest->templatewwwroot = $templatewwwroot;
@ -606,24 +535,6 @@ function vchamilo_get_available_templates()
return $templates;
}
function vchamilo_print_error($errortrace, $return = false)
{
$str = '';
if (!empty($errortrace)){
$str .= '<div class="vchamilo-errors" style="border:1px solid #a0a0a0;background-color:#ffa0a0;padding:5px;font-size:10px">';
$str .= '<pre>';
foreach($errortrace as $error){
$str .= $error->message.'<br/>';
$str .= @$error->content;
}
$str .= '</pre>';
$str .= '</div>';
}
if ($return) return $str;
Display::addFlash(Display::return_message($str));
}
/**
* this function set will map standard moodle API calls to chamilo
* internal primitives. This avoids too many changes to do in imported
@ -645,6 +556,10 @@ function vchamilo_get_config($module, $key, $isplugin = true)
return false;
}
/**
* @param $vchamilo
* @param string $template
*/
function vchamilo_load_files_from_template($vchamilo, $template)
{
global $_configuration;
@ -822,7 +737,6 @@ function get_string($key, $component = 'local_ent_installer', $a = '') {
if (is_object($a)) {
return replace_string_vars($a, $fallbackstrings[$key]);
}
debugging('String insertion not supported', 1);
die;
}
@ -862,13 +776,6 @@ function print_error($key, $component = '', $passthru = false, $extrainfo = ''){
$str = get_string($string, $component);
}
ctrace('ERROR: '. $str);
if (!empty($extrainfo)){
ctrace('Extra: '. $extrainfo);
}
if ($debugdisplay >= 3){
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
}
if (!$passthru) die;
}
function debugging($message, $level) {
@ -883,14 +790,6 @@ function debugging($message, $level) {
}
}
/**
* Wrap moodle to chamilo side
*
*/
function mtrace($message){
ctrace($message);
}
function ctrace($str) {
if (!defined('CLI_SCRIPT')) echo "<pre>";
Display::addFlash(Display::return_message($str));

@ -1,60 +0,0 @@
<?php
require_once('HTML/QuickForm/submit.php');
/**
* HTML class for a submit type element
*
* @author Valery Fremaux
* @access public
*/
class HTML_QuickForm_cancel extends HTML_QuickForm_button
{
// {{{ constructor
/**
* Class constructor
*
* @since 1.0
* @access public
* @return void
*/
function HTML_QuickForm_cancel($elementName=null, $value=null, $escapeurl=null, $attributes = null)
{
if ($elementName==null){
$elementName = 'cancel';
}
if ($value == null){
$value = get_lang('cancel');
}
parent::HTML_QuickForm_button($elementName, $value, $attributes);
if ($escapeurl!=null){
$this->updateAttributes(array('onclick'=>'window.location.href = "'.$escapeurl.'"; return true;'));
}
} //end constructor
function onQuickFormEvent($event, $arg, &$caller){
$value = $arg[0];
$escapeurl = $arg[1];
if ($value != null){
$this->updateAttributes(array('value'=> $value));
}
if ($escapeurl != null){
$this->updateAttributes(array('onclick'=>'window.location.href = "'.$escapeurl.'"; return true;'));
}
return true;
}
function getFrozenHtml(){
return HTML_QuickForm_submit::getFrozenHtml();
}
function freeze(){
return HTML_QuickForm_submit::freeze();
}
// }}}
} //end class MoodleQuickForm_cancel

@ -1,5 +0,0 @@
<?php
function vchamilo_boot_api_get_path(&$_configuration) {
return $_configuration['root_sys'].'main/inc/lib/';
}

@ -1,16 +1,12 @@
<?php
global $_configuration;
require_once 'bootlib.php';
require_once vchamilo_boot_api_get_path($_configuration) . 'plugin.class.php';
/**
* Description of VChamilo
*
* @copyright (c) 2014 VF Consulting
* @license GNU General Public License - http://www.gnu.org/copyleft/gpl.html
* @author Valery Fremaux <valery.fremaux@gmail.com>
* @author Julio Montoya
*/
class VChamiloPlugin extends Plugin
{
@ -32,6 +28,9 @@ class VChamiloPlugin extends Plugin
return $result ? $result : $result = new self();
}
/**
* @return string
*/
public function get_name()
{
return 'vchamilo';

@ -70,13 +70,11 @@ if ($data->what == 'addinstance' || $data->what == 'registerinstance') {
ctrace("Creating physical course dir in $coursedir");
mkdir($coursedir, 0777, true);
// initiate default index
$INDEX = fopen($coursedir.'/index.html', 'w');
fputs($INDEX, vchamilo_get_default_course_index_fragment());
fclose($INDEX);
$indexFile = fopen($coursedir.'/index.html', 'w');
file_put_contents($indexFile, vchamilo_get_default_course_index_fragment());
$HTACCESS = fopen($coursedir.'/.htaccess', 'w');
fputs($HTACCESS, vchamilo_get_htaccess_fragment($slug));
fclose($HTACCESS);
$htaccessFile = fopen($coursedir.'/.htaccess', 'w');
file_put_contents($htaccessFile, vchamilo_get_htaccess_fragment($slug));
}
// if real coursedir IS NOT under chamilo install, link to it

Loading…
Cancel
Save