cleanup of database queries for merge - highly risky merge (dating from months ago) - to be watched closely - requires re-install of the database
commit
c8dd10708e
@ -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> |
||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 862 B |
|
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. |
||||
@ -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%"> |
||||
|
||||
</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(); |
||||
|
||||
?> |
||||
@ -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…
Reference in new issue