fork download
  1. <?php
  2. //-----------------------------------------------------------------------------------------------------------
  3. // E-Lyco CAS Connector
  4. //-----------------------------------------------------------------------------------------------------------
  5. // Copyright (c) 2011 SIREC Pays de la Loire
  6. //-----------------------------------------------------------------------------------------------------------
  7. // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
  8. // To view a copy of this license, visit http://c...content-available-to-author-only...s.org/licenses/by-nc-sa/3.0/ or send a letter to
  9. // Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
  10. //-----------------------------------------------------------------------------------------------------------
  11. // Authors: Alexandre GAUVRIT - gauvrit.alexandre@gmail.com
  12. //-----------------------------------------------------------------------------------------------------------
  13. // Description : install.php - Creation de la table de correspondance.
  14. // Version : 0.2
  15.  
  16. require('../..//main/inc/global.inc.php');
  17. require_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php');
  18. require_once('../..//main/auth/cas/authcas.php');
  19. global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
  20.  
  21. phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);
  22. phpCAS::setNoCasServerValidation();
  23.  
  24. Display::display_header('', 'dokeos');
  25.  
  26. echo '<p> - La connexion CAS est opérationelle</p>';
  27.  
  28. mysql_connect($_configuration['db_host'],$_configuration['db_user'],$_configuration['db_password']) or die(mysql_error());
  29.  
  30. echo '<p> - La connexion SQL est opérationelle</p>';
  31.  
  32. mysql_select_db("dokeos_main") or die(mysql_error());
  33. $result = mysql_query("CREATE TABLE IF NOT EXISTS `user_ent_corresp` (
  34. `id_user_dokeos` varchar(30) NOT NULL,
  35. `id_user_cas` varchar(30) NOT NULL
  36. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;") or die(mysql_error()); // Création de la table..
  37.  
  38. if($result)
  39. {
  40. echo '<p><b> - La table user_ent_corresp a bien été crée</b></p>'; // Confirmation de la création de la table..
  41. }
  42.  
  43. echo '<p><a href="index.php">Acceuil</a></p>'
  44.  
  45. ?>
  46.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty