cleanup of database queries for merge - highly risky merge (dating from months ago) - to be watched closely - requires re-install of the database

skala
Yannick Warnier 14 years ago
commit c8dd10708e
  1. 0
      .hgignore
  2. 13
      404/index.php
  3. 13
      custompages/README
  4. 91
      custompages/first_login.php
  5. BIN
      custompages/images/footer.png
  6. BIN
      custompages/images/header.png
  7. BIN
      custompages/images/login-form-submit-bg.jpg
  8. BIN
      custompages/images/page-background.png
  9. 6
      custompages/index-logged.php
  10. 88
      custompages/index-unlogged.php
  11. 16
      custompages/jquery-1.5.1.min.js
  12. 73
      custompages/language.inc.php
  13. 45
      custompages/language.php
  14. 57
      custompages/lostpassword.php
  15. 3
      custompages/registration-feedback.php
  16. 61
      custompages/registration.php
  17. 168
      custompages/style-ie6.css
  18. 143
      custompages/style.css
  19. 5
      custompages/url-images/README
  20. 0
      documentation/changelog.html
  21. 0
      documentation/credits.html
  22. 0
      documentation/dependencies.html
  23. 0
      documentation/index.html
  24. 0
      documentation/installation_guide.html
  25. 0
      documentation/installation_guide_es_ES.html
  26. 9
      index.php
  27. 0
      license.txt
  28. 0
      main/admin/access_url_add_courses_to_url.php
  29. 0
      main/admin/access_url_add_sessions_to_url.php
  30. 0
      main/admin/access_url_add_users_to_url.php
  31. 33
      main/admin/access_url_edit.php
  32. 0
      main/admin/access_url_edit_courses_to_url.php
  33. 0
      main/admin/access_url_edit_sessions_to_url.php
  34. 0
      main/admin/access_url_edit_users_to_url.php
  35. 0
      main/admin/access_urls.php
  36. 0
      main/admin/add_courses_to_session.php
  37. 0
      main/admin/add_many_session_to_category.php
  38. 7
      main/admin/add_users_to_group.php
  39. 0
      main/admin/add_users_to_session.php
  40. 0
      main/admin/calendar.lib.php
  41. 0
      main/admin/calendar.php
  42. 0
      main/admin/class_add.php
  43. 0
      main/admin/class_edit.php
  44. 0
      main/admin/class_import.php
  45. 0
      main/admin/class_information.php
  46. 0
      main/admin/class_list.php
  47. 0
      main/admin/class_user_import.php
  48. 0
      main/admin/configure_homepage.php
  49. 0
      main/admin/course_add.php
  50. 0
      main/admin/course_category.php
  51. 0
      main/admin/course_create_content.php
  52. 0
      main/admin/course_edit.php
  53. 0
      main/admin/course_export.php
  54. 0
      main/admin/course_information.php
  55. 0
      main/admin/course_list.php
  56. 0
      main/admin/course_user_import.php
  57. 0
      main/admin/course_virtual.php
  58. 246
      main/admin/event_type.php
  59. 10
      main/admin/group_add.php
  60. 11
      main/admin/group_edit.php
  61. 2
      main/admin/index.php
  62. 0
      main/admin/languages.php
  63. 0
      main/admin/ldap_synchro.php
  64. 0
      main/admin/ldap_users_list.php
  65. 0
      main/admin/ldap_users_synchro.php
  66. 0
      main/admin/resume_session.php
  67. 0
      main/admin/session_add.php
  68. 0
      main/admin/session_category_list.php
  69. 0
      main/admin/session_course_user_list.php
  70. 0
      main/admin/session_edit.php
  71. 0
      main/admin/session_import.php
  72. 0
      main/admin/session_list.php
  73. 0
      main/admin/settings.lib.php
  74. 1
      main/admin/settings.php
  75. 0
      main/admin/special_exports.php
  76. 0
      main/admin/statistics/index.php
  77. 0
      main/admin/statistics/statistics.lib.php
  78. 0
      main/admin/sub_language.php
  79. 0
      main/admin/sub_language_add.php
  80. 0
      main/admin/subscribe_class2course.php
  81. 0
      main/admin/subscribe_user2class.php
  82. 16
      main/admin/system_announcements.php
  83. 0
      main/admin/system_status.php
  84. 0
      main/admin/user_add.php
  85. 0
      main/admin/user_edit.php
  86. 0
      main/admin/user_export.php
  87. 0
      main/admin/user_fields.php
  88. 0
      main/admin/user_import.php
  89. 0
      main/admin/user_information.php
  90. 0
      main/admin/user_list.php
  91. 0
      main/announcements/announcements.inc.php
  92. 0
      main/announcements/announcements.php
  93. 0
      main/attendance/attendance_calendar.php
  94. 0
      main/attendance/attendance_controller.php
  95. 0
      main/attendance/attendance_list.php
  96. 0
      main/attendance/attendance_sheet.php
  97. 0
      main/attendance/index.php
  98. 105
      main/auth/cas/authcas.php
  99. 20
      main/auth/cas/cas_var.inc.php
  100. 1610
      main/auth/cas/lib/CAS.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,13 @@
<?php
// HTTP404 page with neat styling
// 2011, Jean-Karim Bockstael <jeankarim@cblue.be>
// ErrorDocument 404 /404/
$language_file = array('document', 'index');
require_once('../main/inc/global.inc.php');
$msg = get_lang('FileNotFound');
Display::display_header($msg);
Display::display_error_message($msg);
Display::display_footer();
?>

@ -0,0 +1,13 @@
CustomPages looks for alternatives in this directory, and displays them if present. The user-provided custom pages must exactly be named as such :
- index-logged.php for the general landing page before login
- index-unlogged.php for the general landing page when already logged-in
- registration.php for the registration form
- registration-feedback.php for the registration success feedback
- lostpassword.php for the password recovery form
- lostpassword-feedback.php for the password recovery feedback page
Important note :
If you pull this feature from a repo, not through an upgrade or install process, you have to exectute the following SQL statements in the main database or this option won't appear in the admin interface :
INSERT INTO settings_options (variable, value, display_text) VALUES ('use_custom_pages', 'true', 'Yes'), ('use_custom_pages', 'false', 'No');
INSERT INTO settings_current (variable, type, category, selected_value, title, comment, scope) VALUES ('use_custom_pages','radio','Platform','false','UseCustomPages','UseCustomPagesComment', 'platform');

@ -0,0 +1,91 @@
<?php
require_once('language.php');
require_once(dirname(__FILE__).'/../main/inc/global.inc.php');
require_once (api_get_path(LIBRARY_PATH).'conditionallogin.lib.php');
require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php');
if (! isset($_SESSION['conditional_login']['uid']))
die("Not Authorised");
if (isset($_POST['password'])){
$u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);
if ($_POST['password'] != $_POST['password2']) {
header('Location: '. api_get_self().'?invalid=2');
exit();
}
if (empty($_POST['password'])){ //|| !api_check_password($password)) { //Pass must be at least 5 char long with 2 digits and 3 letters
header('Location: '. api_get_self().'?invalid=1');
exit();
}
$password = $_POST['password'];
$updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], null, $u['language'],'');
if ($updated) {
UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true');
ConditionalLogin::login();
}
}
if ($_GET['invalid'] == 1) {
$error_message = get_lang('CurrentPasswordEmptyOrIncorrect');
}
if ($_GET['invalid'] == 2) {
$error_message = get_lang('PassTwo');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Custompage - login</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="/custompages/style.css" />
<!--<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
<![endif]-->
<script type="text/javascript" src="/custompages/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
if (top.location != location)
top.location.href = document.location.href ;
// Handler pour la touche retour
$('input').keyup(function(e) {
if (e.keyCode == 13) {
$('#changepassword-form').submit();
}
});
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="/custompages/images/header.png" alt="Logo" />
</div> <!-- #header -->
<div id="changepassword-form-box" class="form-box">
<?php if (isset($error_message)) {
echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>';
}?>
<form id="changepassword-form" class="form" method="post">
<div>
<label for="password">*<?php echo cblue_get_lang('langPass');?></label>
<input name="password" type="password" /><br />
<label for="password2">*<?php echo cblue_get_lang('langPass');?></label>
<input name="password2" type="password" /><br />
</div>
</form>
<div id="changepassword-form-submit" class="form-submit" onclick="document.forms['changepassword-form'].submit();">
<span><?php echo cblue_get_lang('LoginEnter');?></span>
</div> <!-- #form-submit -->
</div> <!-- #form -->
<div id="footer">
<img src="/custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -0,0 +1,6 @@
<?php
require_once('main/inc/global.inc.php');
//require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
header("Location: /user_portal.php");
?>

@ -0,0 +1,88 @@
<?php
//require_once('main/inc/global.inc.php');
require_once('language.php');
if (isset($_GET['loginFailed'])){
if (isset($_GET['error'])) {
switch ($_GET['error']) {
case 'account_expired':
$error_message = cblue_get_lang('AccountExpired');
break;
case 'account_inactive':
$error_message = cblue_get_lang('AccountInactive');
break;
case 'user_password_incorrect':
$error_message = cblue_get_lang('InvalidId');
break;
case 'access_url_inactive':
$error_message = cblue_get_lang('AccountURLInactive');
break;
default :
$error_message = cblue_get_lang('InvalidId');
}
} else {
$error_message = get_lang('InvalidId');
}
}
?>
<html>
<head>
<title>Custompage - login</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="/custompages/style.css" />
<!--<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
<![endif]-->
<script type="text/javascript" src="/custompages/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
if (top.location != location)
top.location.href = document.location.href ;
// Handler pour la touche retour
$('input').keyup(function(e) {
if (e.keyCode == 13) {
$('#login-form').submit();
}
});
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="/custompages/images/header.png" alt="Logo" />
</div> <!-- #header -->
<div id="login-form-box" class="form-box">
<?php if ($values['reset_password']) {
echo '<div id="login-form-info" class="form-info">'.cblue_get_lang('your_password_has_been_reset').'</div>';
}?>
<?php if (isset($error_message)) {
echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
}?>
<form id="login-form" class="form" action="/index.php" method="post">
<div>
<label for="login">*<?php echo cblue_get_lang('Username');?></label>
<input name="login" type="text" /><br />
<label for="password">*<?php echo cblue_get_lang('langPass');?></label>
<input name="password" type="password" /><br />
</div>
</form>
<div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();">
<span><?php echo cblue_get_lang('LoginEnter');?></span>
</div> <!-- #form-submit -->
<div id="links">
<a href="main/auth/lostPassword.php"><?php echo cblue_get_lang('langLostPassword')?></a>
</div>
</div> <!-- #form -->
<div id="footer">
<img src="/custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,73 @@
<?php
// CustomPages : Browser language detection
// Include this file in your custom page if you want to set the language variable of the Chamilo session to the best pick according to the visitor's browser's options.
// 2011, Jean-Karim Bockstael, CBlue <jeankarim@cblue.be>
// This requires the Chamilo system to be initialized
// (note that it's easier to do the following include in the parent page)
// require_once('path/to/main/inc/global.inc.php');
// Returns the best match between available languages and visitor preferences
// return the best match as 2-chars code, null when none match
function get_preferred_language($available_langs) {
// Parsing the Accept-languages HTTP header
$langs = array();
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) {
$rawlang = explode(';q=', $httplang);
if (strpos($rawlang[0], '-') !== FALSE) {
// We ignore the locale part, as in en-GB vs en-US
$rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-'));
}
if (count($rawlang) == 1) {
$rawlang[1] = 1.0; // The absence of weighting means a weight of 1 (max)
}
$langs[$rawlang[1]][] = $rawlang[0];
}
krsort($langs, SORT_NUMERIC);
// Choosing the best match
foreach($langs as $weight => $codes) {
foreach ($codes as $code) {
if (in_array($code, $available_langs)) {
return $code;
}
}
}
// No match
return null;
}
// Wrapper function for the get_lang function
// use this if you want to avoid translation caching issues
function cp_get_lang($variable) {
return get_lang($variable, null, $_SESSION['user_language_choice']);
}
// Note that Chamilo languages are expressed as full english names, not 2-characters codes
// e.g. 'english' instead of 'en', 'french' instead of 'fr', ...
// We need a matching array. Note the value for the null key, which is the default language.
// Also note that this is an example matchin array, not all languages are present.
$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'es' => 'spanish');
// Which of these can we actually pick from ?
$available_langs = array('en','fr');
// Which language files will we need ?
$language_file = array('courses', 'index', 'registration', 'admin','userInfo');
// Let's find out which language to serve to this particular browser
$lang_match = $chamilo_langs[get_preferred_language($available_langs)];
// Chamilo overrides this parameters at some places, e.g. in the logout link
if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) {
$lang_match = $_REQUEST['language'];
}
// Maybe a language had already been selected, we should honor this
if (isset($_SESSION['user_language_choice']) && in_array($_SESSION['user_language_choice'], $chamilo_langs)) {
$lang_match = $_SESSION['user_language_choice'];
}
// We need to set the relevant session variables to the best match, to use Chamilo's i18n lib.
$_user['language'] = $lang_match;
$_SESSION['user_language_choice'] = $lang_match;
?>

@ -0,0 +1,45 @@
<?php
function get_preferred_language($available_langs) {
$langs = array();
foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) {
$rawlang = explode(';q=', $httplang);
if (strpos($rawlang[0], '-') !== FALSE) {
$rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-'));
}
if (count($rawlang) == 1) {
$rawlang[1] = 1.0;
}
$langs[$rawlang[1]] = $rawlang[0];
}
krsort($langs, SORT_NUMERIC);
foreach($langs as $weight => $code) {
if (in_array($code, $available_langs)) {
return $code;
}
}
return null;
}
function cblue_get_lang($variable) {
return get_lang($variable, null, $_SESSION['user_language_choice']);
}
$language_file = array('courses', 'index', 'registration', 'admin','userInfo');
$available_langs = array('en','fr');
$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'nl' => 'dutch', 'de' => 'german', 'es' => 'spanish');
$lang_match = $chamilo_langs[get_preferred_language($available_langs)];
// recover previous value ...
if (isset($_SESSION['user_language_choice']))
$lang_match = $_SESSION['user_language_choice'];
// Chamilo parameter, on logout
if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) {
$lang_match = $_REQUEST['language'];
}
// Incoming link parameter
if (isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) && in_array($_REQUEST['lang'], $available_langs)) {
$lang_match = $chamilo_langs[$_REQUEST['lang']];
}
$_user['language'] = $lang_match;
$_SESSION['user_language_choice'] = $lang_match;
?>

@ -0,0 +1,57 @@
<?php
require_once('../../main/inc/global.inc.php');
require_once('language.php');
?>
<html>
<head>
<title>Password recovery</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="../../custompages/style.css" />
<!--<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" />
<![endif]-->
<script type="text/javascript" src="../../custompages/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// Handler pour la touche retour
$('input').keyup(function(e) {
if (e.keyCode == 13) {
$('#lostpassword-form').submit();
}
});
});
</script>
</head>
<body>
<div id="backgroundimage">
<img src="/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="../../custompages/images/header.png" alt="Ambassador logo" />
</div> <!-- #header -->
<?php echo '<div id="registration-form-info" class="form-info">'.cblue_get_lang('lang_enter_email_and_well_send_you_password').'</div>'; ?>
<div id="lostpassword-form-box" class="form-box">
<?php if (isset($form_error) && !empty($form_error)) {
echo '<div id="registration-form-error" class="form-error"><ul>'.$form_error.'</ul></div>';
}?>
<form id="lostpassword-form" class="form" action="lostPassword.php" method="post">
<div>
<label for="user">*<?php echo cblue_get_lang('UserName');?></label>
<input name="user" type="text" /><br />
<label for="email">*<?php echo cblue_get_lang('Email');?></label>
<input name="email" type="text" /><br />
</div>
</form>
<div id="lostpassword-form-submit" class="form-submit" onclick="document.forms['lostpassword-form'].submit();">
<span><?php echo cblue_get_lang('langSend'); ?> </span>
</div> <!-- #form-submit -->
</div> <!-- #form -->
<div id="footer">
<img src="../../custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>

@ -0,0 +1,3 @@
<?php require_once('../inc/global.inc.php');
header("Location: /user_portal.php");
exit();

@ -0,0 +1,61 @@
<?php
require_once('../inc/global.inc.php');
require_once('../inc/lib/group_portal_manager.lib.php');
require_once('language.php');
?>
<html>
<head>
<title>Registration</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!--[if !IE 6]><!-->
<link rel="stylesheet" type="text/css" href="../../custompages/style.css" />
<!--<![endif]-->
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" />
<![endif]-->
<script type="text/javascript" src="../../custompages/jquery-1.5.1.min.js"></script>
</head>
<body>
<div id="backgroundimage">
<img src="/custompages/images/page-background.png" class="backgroundimage" />
</div>
<div id="wrapper">
<div id="header">
<img src="../../custompages/images/header.png" alt="Ambassador logo" />
</div> <!-- #header -->
<div id="registration-form-box" class="form-box">
<?php if (isset($form_error) && !empty($form_error)) {
echo '<div id="registration-form-error" class="form-error"><ul>'.$form_error.'</ul></div>';
}?>
<form id="registration-form" class="form" action="inscription.php" method="post">
<div>
<label for="email"><?php echo cblue_get_lang('langEmail');?>*</label>
<input name="email" type="text" value="<?php echo $values['email']?>" /><br />
<label for="username"><?php echo cblue_get_lang('Username');?>*</label>
<input name="username" type="text" value="<?php echo $values['username']?>" /><br />
<p class="forminfo"><?php echo cblue_get_lang('UsernameWrong')?></p>
<label for="pass1"><?php echo cblue_get_lang('Pass');?>*</label>
<input name="pass1" type="password" value="<?php echo $values['pass1']?>" /><br />
<label for="pass2"><?php echo cblue_get_lang('Confirmation');?>*</label>
<input name="pass2" type="password" value="<?php echo $values['pass2']?>" /><br />
<!--
<label for="phone">*Phone number</label>
<input name="phone" type="text" /><br />
-->
<input name="language" type="hidden" value="<?php echo $_SESSION['user_language_choice']?>" />
<input name="status" type="hidden" value="5" /> <!-- learner -->
</div>
</form>
<div id="registration-form-submit" class="form-submit" onclick="document.forms['registration-form'].submit();">
<span><?php echo cblue_get_lang('Subscribe');?></span>
</div> <!-- #form-submit -->
<div id="links">
<!--<a href="mailto: support@cblue.be"><?php echo cblue_get_lang('NeedContactAdmin')?></a><br />-->
</div>
</div> <!-- #form -->
<div id="footer">
<img src="../../custompages/images/footer.png" />
</div> <!-- #footer -->
</div> <!-- #wrapper -->
</body>
</html>

@ -0,0 +1,168 @@
html, body {
margin: 0;
padding: 0;
}
body {
font-family: "Arial Black",sans-serif;
font-size: 10pt;
width: 100%;
text-align: center;
/*
background-image: url(images/page-background.png);
background-repeat: no-repeat;
background-size: 100%;
*/
}
#backgroundimage {
background-attachment:fixed;
width: 100%
height: 100%
position: absolute;
left: 0;
top: 30px;
z-index:-1;
}
.backgroundimage {
width: 100%;
height: auto;
}
#wrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1;
text-align: center;
}
#header {
width: 520px;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
}
#footer {
position: relative;
/*margin-top: 50px;*/
text-align: center;
}
.form-box {
width: 310px;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
border: solid 1px #CCCCCC;
text-align: left;
/*background-color: white;*/
}
.form {
margin-left: 15px;
margin-right: 15px;
margin-top: 30px;
color: #1F3660;
/*position: relative;*/
text-align: left;
}
.form-submit {
margin: 0;
padding: 0;
width: 310px;
height: 27px;
background-color: #1F3660;
background-image: url(/custompages/images/login-form-submit-bg.jpg);
color: white;
cursor: pointer;
cursor: hand;
}
label {
width: 100px;
float: left;
margin-right: 1em;
display: block;
text-align: right;
line-height: 2ex;
}
input {
text-align: left;
vertical-align: baseline;
margin-bottom: 2em;
width: 150px;
color: white;
background-color: #1F3660;
border: none;
}
.radiobutton {
width: 20px;
background-color: white;
margin: 0;
}
.radiogroup {
margin-bottom: 2em;
}
select {
margin-bottom: 2em;
width: 150px;
}
label {
clear: both;
}
input, select, .radiogroup {
float: right;
clear: both;
}
.radiogroup input, .radiogroup label {
float: none;
}
#links {
margin-left: 15px;
margin-right: 15px;
margin-top: 10px;
margin-bottom: 50px;
color: #1F3660;
}
#links a, #links a:hover, #links a:active, #links a:visited {
color: #1F3660;
}
#links a {
text-decoration: none;
}
#links a:hover {
text-decoration: underline;
}
span {
margin-right: 30px;
margin-top: 3px;
float: right;
}
.form-info {
color: #1F3660;
font-size: 9pt;
}
.form-error {
color: red;
font-size: 9pt;
}

@ -0,0 +1,143 @@
html, body {
margin: 0;
padding: 0;
}
body {
font-family: "Arial Black",sans-serif;
font-size: 10pt;
width: 100%;
text-align: center;
/*background-image: url(images/page-background.png);
background-repeat: no-repeat;
background-size: 100%;
*/
}
#backgroundimage {
background-attachment:fixed;
width: 100%
height: 100%
position: absolute;
left: 0;
top: 30px;
z-index:-1;
}
.backgroundimage {
width: 100%;
height: auto;
}
#wrapper {
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 1;
}
#header {
width: 520px;
margin-left: auto;
margin-right: auto;
margin-top: 30px;
}
#footer {
position: relative;
margin-top: 50px;
text-align: center;
}
.form-box {
width: 310px;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
border: solid 1px #CCCCCC;
text-align: left;
background-color: white;
}
.form {
margin-left: 15px;
margin-right: 15px;
margin-top: 30px;
color: #1F3660;
position: relative;
text-align: left;
}
.form-submit {
margin: 0;
padding: 0;
width: 310px;
height: 27px;
background-color: #1F3660;
background-image: url(/custompages/images/login-form-submit-bg.jpg);
color: white;
cursor: pointer;
cursor: hand;
}
label {
width: 100px;
float: left;
margin-right: 1em;
display: block;
text-align: right;
line-height: 2ex;
}
input {
text-align: left;
vertical-align: baseline;
margin-bottom: 2em;
width: 150px;
color: white;
background-color: #1F3660;
border: none;
}
select {
width: 150px;
color: white;
background-color: #1F3660;
border: none;
margin-bottom: 2em;
}
#links {
margin-left: 15px;
margin-right: 15px;
margin-top: 10px;
margin-bottom: 50px;
color: #1F3660;
}
#links a, #links a:hover, #links a:active, #links a:visited {
color: #1F3660;
}
#links a {
text-decoration: none;
}
#links a:hover {
text-decoration: underline;
}
span {
margin-right: 30px;
margin-top: 3px;
float: right;
}
.form-info {
color: #1F3660;
font-size: 9pt;
}
.form-error {
color: red;
font-size: 9pt;
}

@ -0,0 +1,5 @@
Custom Pages : URL Images
This features allows each access URL to have a number of images (currently three) specific to this URL. This allows easier customization of landing pages by access URL.
You can access a URL's images by calling the static function CustomPages::getURLImages() in your custom page.

@ -17,6 +17,7 @@ require_once 'main/inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'userportal.lib.php';
require_once 'main/chat/chat_functions.lib.php';
// The section (for the tabs).
$this_section = SECTION_CAMPUS;
@ -104,6 +105,12 @@ if (api_get_setting('allow_terms_conditions') == 'true') {
unset($_SESSION['update_term_and_condition']);
unset($_SESSION['info_current_user']);
}
//If we are not logged in and customapages activated
if (!api_get_user_id() && api_get_setting('use_custom_pages') == 'true' ){
require_once api_get_path(LIBRARY_PATH).'custompages.lib.php';
CustomPages::displayPage('index-unlogged');
}
/**
* @todo This piece of code should probably move to local.inc.php where the actual login procedure is handled.
@ -177,4 +184,4 @@ $controller->tpl->assign('home_page_block', $controller->return_home_page());
$controller->tpl->assign('notice_block', $controller->return_notice());
$controller->tpl->assign('plugin_campushomepage', $controller->return_plugin_campushomepage());
$controller->tpl->display($tpl);
$controller->tpl->display($tpl);

@ -43,6 +43,19 @@ if( $form->validate()) {
} else {
UrlManager::udpate($url_id, $url.'/', $description, $active);
}
// URL Images
$url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
$image_fields = array("url_image_1", "url_image_2", "url_image_3");
foreach ($image_fields as $image_field) {
if ($_FILES[$image_field]['error'] == 0) {
// Hardcoded: only PNG files allowed
if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') {
move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png');
}
// else fail silently
}
// else fail silently
}
$url_to_go='access_urls.php';
$message=get_lang('URLEdited');
} else {
@ -61,6 +74,21 @@ if( $form->validate()) {
$url_to_go='access_url_edit.php';
$message = get_lang('URLAlreadyAdded');
}
// URL Images
$url .= (substr($url,strlen($url)-1, strlen($url))=='/') ? '' : '/';
$url_id = UrlManager::get_url_id($url);
$url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
$image_fields = array("url_image_1", "url_image_2", "url_image_3");
foreach ($image_fields as $image_field) {
if ($_FILES[$image_field]['error'] == 0) {
// Hardcoded: only PNG files allowed
if (end(explode('.', $_FILES[$image_field]['name'])) == 'png') {
move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png');
}
// else fail silently
}
// else fail silently
}
}
Security::clear_token();
$tok = Security::get_token();
@ -122,6 +150,11 @@ if (isset ($_GET['action'])) {
}
}
// URL Images
$form->addElement('file','url_image_1','URL Image 1 (PNG)');
$form->addElement('file','url_image_2','URL Image 2 (PNG)');
$form->addElement('file','url_image_3','URL Image 3 (PNG)');
// Submit button
$form->addElement('style_submit_button', 'submit', $submit_name, 'class="add"');
$form->display();

@ -5,7 +5,7 @@
*/
// name of the language file that needs to be included
$language_file=array('admin','registration');
$language_file=array('admin','registration','userInfo');
// resetting the course id
$cidReset=true;
@ -57,7 +57,7 @@ function search_users($needle,$type,$relation_type) {
// get user_id from relation type and group id
$sql = "SELECT user_id FROM $tbl_group_rel_user
WHERE group_id = '$group_id'
AND relation_type IN (".GROUP_USER_PERMISSION_ADMIN.",".GROUP_USER_PERMISSION_READER.",".GROUP_USER_PERMISSION_PENDING_INVITATION.",".GROUP_USER_PERMISSION_MODERATOR.") ";
AND relation_type IN (".GROUP_USER_PERMISSION_ADMIN.",".GROUP_USER_PERMISSION_READER.",".GROUP_USER_PERMISSION_PENDING_INVITATION.",".GROUP_USER_PERMISSION_MODERATOR.", ".GROUP_USER_PERMISSION_HRM.") ";
$res = Database::query($sql);
$user_ids = array();
if (Database::num_rows($res) > 0) {
@ -322,7 +322,7 @@ if ($ajax_search) {
// get user_id from relation type and group id
$sql = "SELECT user_id FROM $tbl_group_rel_user
WHERE group_id = $id
AND relation_type IN (".GROUP_USER_PERMISSION_ADMIN.",".GROUP_USER_PERMISSION_READER.",".GROUP_USER_PERMISSION_PENDING_INVITATION.",".GROUP_USER_PERMISSION_MODERATOR.") ";
AND relation_type IN (".GROUP_USER_PERMISSION_ADMIN.",".GROUP_USER_PERMISSION_READER.",".GROUP_USER_PERMISSION_PENDING_INVITATION.",".GROUP_USER_PERMISSION_MODERATOR.", ".GROUP_USER_PERMISSION_HRM.") ";
$res = Database::query($sql);
$user_ids = array();
if (Database::num_rows($res) > 0) {
@ -401,6 +401,7 @@ if ($add_type == 'multiple') {
<option value="<?php echo GROUP_USER_PERMISSION_ADMIN ?>" <?php echo ((isset($_POST['relation']) && $_POST['relation']==GROUP_USER_PERMISSION_ADMIN)?'selected=selected':'') ?> > <?php echo get_lang('Admin') ?></option>
<option value="<?php echo GROUP_USER_PERMISSION_PENDING_INVITATION ?>" <?php echo ((isset($_POST['relation']) && $_POST['relation']==GROUP_USER_PERMISSION_PENDING_INVITATION)?'selected=selected':'') ?> > <?php echo get_lang('Reader') ?></option>
<option value="<?php echo GROUP_USER_PERMISSION_MODERATOR ?>" <?php echo ((isset($_POST['relation']) && $_POST['relation']==GROUP_USER_PERMISSION_MODERATOR)?'selected=selected':'') ?> > <?php echo get_lang('Moderator') ?></option>
<option value="<?php echo GROUP_USER_PERMISSION_HRM ?>" <?php echo ((isset($_POST['relation']) && $_POST['relation']==GROUP_USER_PERMISSION_HRM)?'selected=selected':'') ?> > <?php echo get_lang('HumanResourcesManager') ?></option>
</select>
<?php

@ -0,0 +1,246 @@
<?php
// name of the language file that needs to be included
$language_file = array('admin','events');
$cidReset = true;
require_once '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$tool_name = get_lang('events_title');
$action = isset($_POST['action'])?$_POST['action']:null;
$eventId = isset($_POST['eventId'])?$_POST['eventId']:null;
$eventUsers = isset($_POST['eventUsers'])?$_POST['eventUsers']:null;
$eventMessage = isset($_POST['eventMessage'])?$_POST['eventMessage']:null;
$eventSubject = isset($_POST['eventSubject'])?$_POST['eventSubject']:null;
if($action == 'modEventType') {
if($eventUsers) {
$users = explode(';',$eventUsers);
}
else {
$users = array();
}
eventType_mod($eventId,$users,$eventMessage,$eventSubject);
// echo mysql_error();
header('location: event_type.php');
exit;
}
$ets = eventType_getAll();
$ajaxPath = api_get_path(WEB_CODE_PATH).'inc/ajax/events.ajax.php';
$htmlHeadXtra[] = '<script src="../inc/lib/javascript/jquery.js" type="text/javascript" language="javascript"></script>';
Display::display_header($tool_name);
?>
<script language="javascript">
var usersList;
var eventTypes = <?php print json_encode($ets) ?>;
$(document).ready(function(){
ajax({action:"getUsers"},function(data) {
usersList = data;
}
);
// ajax({action:"getEventTypes"},function(data) {
// eventTypes = data;
// showEventTypes(data);
// }
// );
});
function ajax(params,func) {
$.ajax({
url: "<?php echo $ajaxPath ?>",
type: "POST",
data: params,
success: func
}
);
}
function refreshUsersList() {
removeAllOption($('#usersList'));
$.each(usersList,function(ind,item) {
addOption($('#usersList'),item.user_id,item.firstname + ' '+item.lastname);
}
);
}
// function showEventTypes(data) {
// $.each(data,function(ind,item) {
// addOption($('#eventList'),item.id,item.name);
// }
// );
// }
function getCurrentEventTypeInd() {
var ind=false;
$.each(eventTypes,function(i,item)
{
if(item.id == $('#eventList option:selected').first().attr('value')) {
ind=i;
return false;
}
}
)
return ind;
}
function showEventType() {
eInd = getCurrentEventTypeInd();
$('#eventId').attr('value',eventTypes[eInd].id);
$('#eventName').attr('value',eventTypes[eInd].name);
$('#eventNameTitle').text(eventTypes[eInd].nameLangVar);
$('#eventMessage').text(eventTypes[eInd].message);
$('#eventSubject').attr('value',eventTypes[eInd].subject);
$('#descLangVar').text(eventTypes[eInd].descLangVar);
ajax({action:"getEventTypeUsers","id":eventTypes[eInd].id},function(data) {
removeAllOption($('#usersSubList'));
refreshUsersList();
usersIds = new Array();
$.each(data,function(ind,item) {
addOption($('#usersSubList'),item.user_id,item.firstname + ' '+item.lastname);
usersIds[ind] = item.value;
removeOption($('#usersList'),item.user_id);
});
$('#eventUsers').attr('value',usersIds.join(';'));
}
);
}
function submitForm() {
if($('#eventId')) {
usersIds = new Array();
$('#usersSubList option').each(function(ind,item)
{
usersIds[ind] = item.value;
}
);
$('#eventUsers').attr('value',usersIds.join(';'));
return true;
}
return false;
}
function addOption(select,value,text) {
select.append('<option value="'+value+'">'+text+'</option>');
}
function removeOption(select,value) {
select.find('option[value='+value+']').remove();
}
function removeAllOption(select) {
select.find('option').remove();
}
function moveUsers(src,dest) {
src.find('option:selected').each(function(index,opt) {
text = opt.text;
val = opt.value;
addOption(dest,val,text);
removeOption(src,val);
});
}
</script>
<h3><?php print get_lang('events_title') ?></h3>
<table id="" width="90%">
<tr>
<td width="5%">
<h4><?php print get_lang('events_listTitle'); ?></h4>
</td>
<td width="5%">
<h4><?php print get_lang('events_userListTile'); ?></h4>
</td>
<td width="5%">
&nbsp;
</td>
<td width="5%">
<h4><?php print get_lang('events_userSubListTile'); ?></h4>
</td>
</tr>
<tr>
<td>
<select multiple="1" id="eventList" onChange="showEventType()">
<?php
foreach($ets as $et) {
print '<option value="'.$et['id'].'">'.$et['nameLangVar'].'</option>';
}
?>
</select>
</td>
<td>
<select multiple="1" id="usersList"></select>
</td>
<td valign="middle">
<button class="arrowr" onclick='moveUsers($("#usersList"),$("#usersSubList")); return false;'></button>
<br />
<button class="arrowl" onclick='moveUsers($("#usersSubList"),$("#usersList")); return false;'></button>
</td>
<td>
<select multiple="1" id="usersSubList"></select>
</td>
</tr>
</table>
<br />
<h2 id="eventNameTitle"></h2>
<form method="POST" onSubmit="return submitForm(); ">
<input type="hidden" name="action" value="modEventType" />
<input type="hidden" name="eventId" id="eventId" />
<input type="hidden" name="eventUsers" id="eventUsers" />
<input type="hidden" id="eventName" />
<br />
<div id="descLangVar">
</div>
<br />
<label for="eventSubject"><h4><?php print get_lang('events_labelSubject'); ?></h4></label>
<input type="text" id="eventSubject" name="eventSubject" />
<br /><br />
<label for="eventMessage"><h4><?php print get_lang('events_labelMessage'); ?></h4></label>
<textarea cols="100" rows="10" name="eventMessage" id="eventMessage">
</textarea>
<br /><br />
<input type="submit" value="<?php print get_lang('events_btnMod'); ?>" />
</form>
<?php
Display :: display_footer();
?>

@ -73,6 +73,13 @@ $form->addElement('file', 'picture', get_lang('AddPicture'));
$allowed_picture_types = array ('jpg', 'jpeg', 'png', 'gif');
$form->addRule('picture', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types);
//Group Parentship
$groups = array();
$groups[0] = get_lang('NoParentship');
$groups = $groups + GroupPortalManager::get_groups_list($group_id);
$group_data['parent_group'] = GroupPortalManager::get_parent_group($group_id);
$form->addElement('select', 'parent_group', get_lang('GroupParentship'), $groups, array());
// Status
$status = array();
$status[GROUP_PERMISSION_OPEN] = get_lang('Open');
@ -102,8 +109,11 @@ if( $form->validate()) {
$url = $values['url'];
$status = intval($values['visibility']);
$picture = $_FILES['picture'];
$parent_group_id = intval($values['parent_group']);
$group_id = GroupPortalManager::add($name, $description, $url, $status);
GroupPortalManager::set_parent_group($group_id,$parent_group_id);
if (!empty($picture['name'])) {
$picture_uri = GroupPortalManager::update_group_picture($group_id, $_FILES['picture']['name'], $_FILES['picture']['tmp_name']);

@ -76,12 +76,18 @@ if (strlen($group_data['picture_uri']) > 0) {
$form->addElement('checkbox', 'delete_picture', '', get_lang('DelImage'));
}
//Group Parentship
$groups = array();
$groups = GroupPortalManager::get_groups_list($group_id);
$groups[0] = get_lang('NoParentship');
$group_data['parent_group'] = GroupPortalManager::get_parent_group($group_id);
$form->addElement('select', 'parent_group', get_lang('GroupParentship'), $groups, array());
// Status
$status = array();
$status[GROUP_PERMISSION_OPEN] = get_lang('Open');
$status[GROUP_PERMISSION_CLOSED] = get_lang('Closed');
$form->addElement('select', 'visibility', get_lang('GroupPermissions'), $status, array());
// Submit button
@ -109,8 +115,11 @@ if ( $form->validate()) {
$description = $group['description'];
$url = $group['url'];
$status = intval($group['visibility']);
$parent_group_id = intval($group['parent_group']);
GroupPortalManager::update($group_id, $name, $description, $url, $status, $picture_uri);
GroupPortalManager::set_parent_group($group_id,$parent_group_id);
$tok = Security::get_token();
header('Location: group_list.php?action=show_message&message='.urlencode(get_lang('GroupUpdated')).'&sec_token='.$tok);
exit();

@ -155,6 +155,8 @@ if (api_get_setting('use_session_mode') == 'true') {
$blocks['sessions']['icon'] = Display::return_icon('session.png', get_lang('Sessions'), array(), 22);
$blocks['sessions']['label'] = api_ucfirst(get_lang('Sessions'));
<li><a href="event_type.php"><?php print get_lang('events_title'); ?></a></li>
<?php endif ?>
$search_form = ' <form method="POST" action="session_list.php">
<input type="text" name="keyword" value="">

@ -494,6 +494,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
Display :: display_header($tool_name);
$action_images['cas'] = 'loginmanager.gif';
// The action images.
$action_images['platform'] = 'platform.png';

@ -22,6 +22,7 @@ require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'system_announcements.lib.php';
require_once api_get_path(LIBRARY_PATH).'WCAG/WCAG_rendering.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
// Setting the section (for the tabs).
$this_section=SECTION_PLATFORM_ADMIN;
@ -122,6 +123,8 @@ if (isset ($_GET['action']) && $_GET['action'] == 'edit') {
$values['visible_guest'] = $announcement->visible_guest ;
$values['lang'] = $announcement->lang;
$values['action'] = 'edit';
$groups = SystemAnnouncementManager :: get_announcement_groups($announcement->id);
$values['group'] = isset($groups[0]['group_id']) ? $groups[0]['group_id'] : 0;
$action_todo = true;
}
@ -154,6 +157,12 @@ if ($action_todo) {
$form->addElement('checkbox', 'visible_guest', null, get_lang('Guest'));
$form->addElement('hidden', 'id');
$group_list = GroupPortalManager::get_groups_list();
$group_list[0] = get_lang('AllGroups');
$form->addElement('select', 'group',get_lang('AnnouncementForGroup'),$group_list);
$values['group'] = isset($values['group']) ? $values['group'] : '0';
$form->addElement('checkbox', 'send_mail', get_lang('SendMail'));
if (isset($_REQUEST['action']) && $_REQUEST['action']=='add') {
@ -192,7 +201,9 @@ if ($action_todo) {
}
switch ($values['action']) {
case 'add':
if (SystemAnnouncementManager::add_announcement($values['title'], $values['content'], $values['start'], $values['end'], $values['visible_teacher'], $values['visible_student'], $values['visible_guest'], $values['lang'], $values['send_mail'], $values['add_to_calendar'])) {
$announcement_id = SystemAnnouncementManager::add_announcement($values['title'],$values['content'],$values['start'],$values['end'],$values['visible_teacher'],$values['visible_student'],$values['visible_guest'], $values['lang'],$values['send_mail'], $values['add_to_calendar']);
if ($announcement_id !== false ) {
SystemAnnouncementManager::announcement_for_groups($announcement_id, array($values['group']));
Display :: display_confirmation_message(get_lang('AnnouncementAdded'));
} else {
$show_announcement_list = false;
@ -201,6 +212,7 @@ if ($action_todo) {
break;
case 'edit':
if (SystemAnnouncementManager::update_announcement($values['id'], $values['title'], $values['content'], $values['start'], $values['end'], $values['visible_teacher'], $values['visible_student'], $values['visible_guest'], $values['lang'], $values['send_mail'])) {
SystemAnnouncementManager::announcement_for_groups($values['id'], array($values['group']));
Display :: display_confirmation_message(get_lang('AnnouncementUpdated'));
} else {
$show_announcement_list = false;
@ -259,4 +271,4 @@ if ($show_announcement_list) {
$table->display();
}
/* FOOTER */
Display :: display_footer();
Display :: display_footer();

@ -0,0 +1,105 @@
<?php
/*Written by Noel Dieschburg <noel@cblue.be> for the paris5 university
* Checks if the user is already logged in via the cas system
* Gets all the info via the ldap module (ldap has to work)
*/
require_once(api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php');
require_once(api_get_path(SYS_PATH).'main/auth/ldap/authldap.php');
/**
* checks if the user already get a session
* @return the user login if the user already has a session ,false otherwise
**/
function cas_is_authenticated()
{
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
global $PHPCAS_CLIENT;
global $logout;
if (!is_object($PHPCAS_CLIENT) )
{
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);
// die("phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);");
phpCAS::setNoCasServerValidation();
}
$auth = phpCAS::checkAuthentication();
if ($auth) {
$login= trim(phpCAS::getUser());
/*
Get user attributes. Here are the attributes for crdp platform
sn => name
ENTPersonMailInterne => mail
ENTPersonAlias => login
ENTPersonProfils => profil
givenName => first name
*/
/*$user=phpCAS::getAttributes();
$firstName = trim($user['givenName']);
$lastName = trim($user['sn']);
$login = trim($user['ENTPersonAlias']);
$profil = trim($user['ENTPersonProfils']);
$email = trim($user['ENTPersonMailInterne']);
$satus=5;
switch ($profil){
case 'admin_etab':
$status=3; //Session admin
break;
case 'admin_sie':
$status=3; //Session admin
break;
case 'National_3':
$status=1; // Teacher
break;
case 'National_1':
$status=5; // Student
break;
default:
$status=5; // Student
}*/
//If the user is in the dokeos database and we are ,not in a logout request, we upgrade his infomration by ldap
if (! $logout){
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql = "SELECT user_id, username, password, auth_source, active, expiration_date ".
"FROM $user_table ".
"WHERE username = '$login' ";
$result = api_sql_query($sql,__FILE__,__LINE__);
if(mysql_num_rows($result) == 0) {
require_once(api_get_path(SYS_PATH).'main/inc/lib/usermanager.lib.php');
$rnumber=rand(0,256000);
UserManager::create_user($firstName, $lastName, $status, $email, $login, md5('casplaceholder'.$rnumber), $official_code='',$language='',$phone='',$picture_uri='',$auth_source = PLATFORM_AUTH_SOURCE);
}
else {
$user = mysql_fetch_assoc($result);
$user_id = intval($user['user_id']);
//echo "deb : $status";
UserManager::update_user ($user_id, $firstname, $lastname, $login, null, null, $email, $status, '', '', '', '', 1, null, 0, null,'') ;
}
}
return($login);
}
else
{
return(false);
}
}
/**
* Logs out the user of the cas
* The user MUST be logged in with cas to use this function
**/
function cas_logout()
{
//phpCAS::logoutWithRedirectService("fmc.univ-paris5.fr");
phpCAS::logoutWithRedirectService(api_get_path(WEB_PATH));
}
?>

@ -0,0 +1,20 @@
<?
/* This file contains all the configuration variable for the cas module
* In the future, these will be in the database
*/
require_once('lib/CAS.php');
define("CAS_VERSION_2_0",'2.0');
define("SAML_VERSION_1_1", 'S1');
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
$cas_auth_server = api_get_setting('cas_server');
$cas_auth_uri = api_get_setting('cas_server_uri');
$cas_auth_port = intval(api_get_setting('cas_port'));
$cas_auth_uri = api_get_setting('cas_server_uri');
if ( ! is_string($cas_auth_uri)) $cas_auth_uri = '';
$cas_auth_ver = '2.0';
//$cas_auth_ver = SAML_VERSION_1_1;
?>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save